To add a little to what Floh said, yeah, some of the python might have been
replaced by node.js today. Still, python is pretty good for writing tests
and commandline tools etc., and its very robust and well-tested. For stuff
where speed doesn't matter (a lot of the tools and the tests), either
node.js or python would be fine.

The parts written in JS are mainly the code that generates the JS glue.
It's very useful to have that in JS, since it can do things like turn a JS
function to a string and other stuff that JS VMs can just do. That lets us
write the JS library in normal JS, and we can modify it as needed based on
options, etc. - would be much more code to do that in another language.

We did also write JS optimizations in JS, which was convenient since JS has
an ecosystem of parsers etc. That's mattered less and less over time. In
wasm, we optimize using Binaryen instead, and that's written in C++.



On Fri, Apr 5, 2019 at 2:22 AM Floh <[email protected]> wrote:

> I don't know what the original idea was, but I guess it was something like
> "javascript for everything that eventually needs to run in the browser" and
> "python for all command line tooling".
>
> Python was always a pretty good cross-platform scripting solution, today
> node.js would provide a similar environment for command line tools, but
> node.js and emscripten both started at around the same time, so node.js
> wasn't an option back then.
>
> I've been a bit in a similar situation with my 'fips' cmake wrapper. This
> is implemented in python, but today I would probably do it with node.js,
> because the great python2 vs 3 schism is growing more and more painful (and
> IMHO python3 is way overengineered for simple shell scripting stuff where
> python2 is great at).
>
> On Friday, 5 April 2019 06:19:16 UTC+2, caiiiycuk wrote:
>>
>> Hi guys. I'm really curious about why emscripten is written both on
>> python and javascript. Tests are written in python but main sources in
>> javascript (not only libraries, but also some optimizers). Why you do
>> in that way? This choice is due to some environment limitions or just
>> because it's easier to write tests on python?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to