6 ms·
Boa: an experimental Javascript lexer, parser and compiler written in Rust
- kondu 6y agoCongrats :) the project has made so much progress since I last saw it a couple months ago
- zeandcode 6y agoThis is interesting project made by rust
- forbiddenvoid 6y agoI think that's all it takes to make the front page of HN, right? ----- I'm curious to understand the use cases they're trying to solve for. I recognize this is experimental, but it's hard to visualize what this is supposed to be for.
- black_puppydog 6y ago1. Yeah, I guess... But I'm not complaining really. There are less interesting things on the front page. :P 2. The way I see it, re-implementing JS from scratch in a language that is designed to help avoid very common, often compromising programming mistakes around concurrency and memory management makes perfect sense. Eventually this might make it into browsers and web servers; environments that are executing untrusted code in the former case and are publicly exposed in the latter case. Having them be fast-yet-secure is important, isn't it? Of course, it's early days, but you gotta start somewhere after all...
- azakai 6y ago> Eventually this might make it into browsers and web servers I'm skeptical at least for browsers. Browser JS VMs have integration between their parsers and their interpreter and their JITs, at minimum. You wouldn't really be able to drop in a standalone project like this. But I agree it's not a bad thing to have more JS parsers out there! Many are already written in a safe language, though, so this isn't new, for example several are written in JS and TS, there is Rhino in Java, Otto in Go, Esprima .NET in C#, etc. etc. But it's natural to want one in Rust as well.
- kaoD 6y ago>several are written in JS and TS, there is Rhino in Java, Otto in Go, Esprima .NET in C# All of those have a mandatory GC.
- azakai 6y agoIndeed, and that may matter in some cases. As I said, it's natural to want a JS parser in Rust. Each language has its own benefits, and Rust's are quite unique.
- postalrat 6y agoI figure people equate written in rust to mean free of defects and so finalized.
- kbr2000 6y agoThe older boa: http://www.boa.org/ http://www.boa.org/
- mrweasel 6y agoThat kinda what I was hoping for, that would have been more interesting, to me.
- bryanlarsen 6y agoMy first thought as well. IIRC I believe they accepted some of my patches way back when. Means more in those pre-GitHub times. But Boa the web server was discontinued in 2005 so i guess it's fair to reuse the name.
- dguaraglia 6y agoThere was also a Python/wxWindows development environment called 'Boa constructor'. It was the bee's knees. Shame it died. http://boa-constructor.sourceforge.net/ http://boa-constructor.sourceforge.net/
- tsjq 6y agoPardon my language. That's an utterly useless title and no description shared here either
- SloopJon 6y agoI guess technically, the title should be "Boa release v0.10." Better? Rather than curse the darkness, I'll quote the first sentence from the page: "Boa is an experimental Javascript lexer, parser and compiler written in Rust." What's so great about this particular release? "v0.10 has been the biggest release to date, with 138 issues closed!" Also, there's a test suite: 38,706 tests, of which 6,895 passed and 5,748 were ignored, for a conformance rate of 17.81%.
- tsjq 6y agoThanks. That's really helpful, relevant, informative, useful.
- jayflux 6y agoThe title was originally more than that but i think it was stripped as it didn't match the site title. @dang could you change it to "Boa release v0.10" ?
- dang 6y agoWe've changed the title from "Boa 0.10" to the page's description of the project, since the project doesn't appear to have been discussed on HN before.
- tsjq 6y agoThanks. This is helpful
- quesera 6y ago> Boa is an experimental Javascript lexer, parser and compiler written in Rust. It has support for some of the language, can be embedded in Rust projects fairly easily and also used from the command line.
- migueloller 6y agoIt'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.
- saurik 6y agoDoes anyone know what they mean by "compiler"? The README file on their repository didn't expound on this. (I have a very fast parser and lexer for JavaScript written in C++ that is very compliant in Cycript--the main issues I sometimes see are in my hacky "try to do everything in a single pass"semantic optimizer pass I am doing to generate code, but that is of course optional--though I haven't pushed updates to its repository in a few years despite my doing a lot of work on it... I kind of decided at some point I hated users. But I don't have a "compiler" unless the meaning is "compile from JavaScript to JavaScript", in which case it would be fun to benchmark it against boa and I might start doing that. It is just that it sounds a bit like boa is also executing the JavaScript?)
- nynx 6y agoWhat does compiler mean here in the context of Javascript?
- jdc 6y agoApparently it means interpreter. https://boa-dev.github.io/boa/doc/boa/exec/index.html https://boa-dev.github.io/boa/doc/boa/exec/index.html
- jayflux 6y agoThere’s a talk about it here: https://youtu.be/_uD2pijcSi4 https://youtu.be/_uD2pijcSi4