How to use Emscripten?

Asked

Viewed 163 times

2

I wanted to convert my codes into C++ for Javascript so I could use them on web pages. How can I do this? From what I’ve researched Emscripten does that, I just don’t know how to use it.

How it works?

How to use it?

What are your resources?

How to integrate the Javascript generated in HTML?

1 answer

1


The question is a little broad, I will answer what gives.

I wanted to convert my codes into C++ for Javascript so I could use them in Web pages.

It’s not that simple. While it is possible to do this, if the code was not prepared to work on *browser, or at least it is a library that is integrated into a code prepared for this, nor waste time.

How can I do it ? So I searched Emscripten does it, only I don’t know how to use it.

Telling how to do is very broad, would be a manual. I suggest studying a little Webassembly, that eliminates the need for Emscripten and resolves in a much better way.

How it works ?

He is a compiler (or transpilator so it looks like what happens with Typescript or Coffescript), where it takes the code in C or C++ and generates a Javascript code that runs in the browser. A script called asm.js to run the generated code. The performance is pretty bad, unlike Webassembly which is even used to improve JS performance.

How to use it?

With a more specific problem you may be able to answer another question. But I don’t know if you still want to learn something obsolete.

What are your resources?

I don’t know what you mean.

How to integrate the Javascript generated in HTML?

Too wide to answer here.

  • emscripten is obsolete ?

  • 1

    Essentially yes :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.