4 ms·
It's very interesting to see how their benchmarks [1] progress over time. I would love to see a comparison with the alternatives. Perhaps that could show some o
by migueloller 6y ago
It's very interesting to see how their benchmarks [1] progress over time. I would love to see a comparison with the alternatives. Perhaps that could show some of the benefits of writing this in Rust.
For another JavaScript parser, but written in TypeScript, check out Seafox [2]. It's also self-hosted [3], which I always enjoy seeing.
[1] https://boa-dev.github.io/boa/dev/bench/ https://boa-dev.github.io/boa/dev/bench/
[2] https://github.com/KFlash/seafox https://github.com/KFlash/seafox
[3] https://en.wikipedia.org/wiki/Self-hosting_(compilers) https://en.wikipedia.org/wiki/Self-hosting_(compilers)
- brian_herman__ 6y agoHere is another one. Made by the profilic Fabrice Bellard. "QuickJS is a small and embeddable Javascript engine. It supports the ES2020 specification including modules, asynchronous generators, proxies and BigInt." https://bellard.org/quickjs/ https://bellard.org/quickjs/
- gameswithgo 6y agoSelf hosting is interesting, but often times I wish that fundamental tools like compilers were not self hosted when the language in question is a high level one with runtime performance limitations. I'd rather have them be as fast as possible.
- capitol_ 6y agoIt also complicates the bootstrapping process, sometimes significantly. I understand that it's important to eat your own dog food, in order to experience the pain points yourself. But sometimes people think of self hosting as a symbol of something (pride maybe), and that's the wrong way to approach a programming problem in my opinion.
- wtetzner 6y agoIn practice, I suspect it's less about pride, and more about practical issues. Bootstrapping means you only need to deal with one language ecosystem, instead of two. And, presumably, the author of the compiler would prefer to write code in their language over some other one.
- wtetzner 6y agoI think it depends. Writing a compiler in a low-level language won't necessarily result in better performance. It can, if you put in enough performance work, of course. But if you want to keep the code simpler, a higher-level language could potentially give better performance, simply because it's easier to share data structures, avoid copying, etc. Additionally, things like immutable persistent maps are a great fit for environments in a compiler, and they are much easier to implement in a language with garbage collection. That said, obviously some high-level languages are still going to be too slow without also putting in a lot of work. I think there's a sweet spot with languages that compile to reasonably fast machine code but are also garbage collected. Languages like OCaml, Go, Haskell. Though I personally wouldn't use Go, but that's for reasons other than performance.