Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

true it could result in more performance (except python lol) but afaik these languages don't have similar libs as I'm currently using (babel, isolated-vm, codemod matcher), and implementing them from scratch would be too much effort to be worth it #23

Closed
moongazer07 opened this issue Nov 9, 2023 · 2 comments

Comments

@moongazer07
Copy link

          true it could result in more performance (except python lol) but afaik these languages don't have similar libs as I'm currently using (babel, isolated-vm, codemod matcher), and implementing them from scratch would be too much effort to be worth it

swc is probably the closest thing to babel but still too limited:

Originally posted by @j4k0xb in #22 (comment)
you could also transpile the libs if possible

@j4k0xb
Copy link
Owner

j4k0xb commented Nov 10, 2023

There are some js to c/wasm transpilers but:

  • they only supports a small subset of js
  • https://stackoverflow.com/a/5193132/4011614

    Very, very tricky --- Javascript is a heavily dynamic language where pretty much everything can be changed at run time: object properties, functions, types, etc.
    As such it maps very badly onto C. Any Javascript translator would have to be able to cope with such things, which means it would have to translate the Javascript into machine code at run-time - which makes it a JIT, which we're already using.

So a transpiler that supported every js feature would still be slower overall.

https://www.assemblyscript.org is very similar to js/ts but would also require rewriting or substantially modifying all libs, in which case using another language is most likely a better choice

@j4k0xb j4k0xb closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
@0xdevalias
Copy link

For ease of others following along, this thread started in this issue:

And continues in this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants