schism
nearley
schism | nearley | |
---|---|---|
7 | 3 | |
188 | 3,554 | |
0.0% | - | |
10.0 | 0.0 | |
almost 4 years ago | 9 months ago | |
JavaScript | ||
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
schism
-
Scheme in Scheme on WASM in the Browser
I don't know why you've been downvoted, I've given you an upvote for linking to an interesting project (even if it's linked in some way to Google). I'd also like to link to the updated GH link: <https://github.com/schism-lang/schism>.
-
Writing a C compiler in 500 lines of Python
Looks like Schism (https://github.com/schism-lang/schism) got part of the way there, but it unfortunately seems to be dead.
-
Two-tier programming language
It would be interesting to reboot something like Lush but using Wasm and Scheme with https://github.com/schism-lang/schism then you could use code generation internally be emitting wasm from your schism code and then reloading the entire environment.
- Langjam 17-19 Feb
-
Multiple assignment and tuple unpacking improve Python code readability
I love E! Or at least the problems it is trying to solve. As you know Wasm also has a capabilities model. And it is fairly trivial to persist the Wasm heap, it just an array of bytes. I think Wasm aligns nicely.
Chez is a great Scheme, but it doesn't have a Wasm backend. I find https://github.com/schism-lang/schism very interesting.
As for C programs going crazy, well yeah. I did a thing where I would copy of the body of functions around in memory, it worked on some version of Linux and GCC, but only by accident. I would be much less comfortable doing this kind of circuit bending than modifying Python stack frames. If I were to achieve a similar goal in the future, I'd use TCC, generate C code and compile directly into memory.
Framehacks aren't going to do the same thing, and one should have tests for it regardless. Framehacks get you tail calls, stack scope and a bunch of other nice properties.
Happy Hacking!
- Schism: A self-hosting Scheme to WebAssembly compiler
-
Racketscript/Racketscript: Racket to JavaScript Compiler
There is a WIP unofficial project from developers at Google called Schism [1].
[1] https://github.com/schism-lang/schism
nearley
-
Writing a C compiler in 500 lines of Python
While I suspect I would learn more writing a tokenizer and parsing logic myself I find grammars much easier to read and maintain.
ANTLR is pretty good and is supported across several languages and something I had previously used for some quick Elasticsearch query syntax munging in Python. It also means you can often start from an already existing grammar.
The JS version of ANTLR didn't seem to work for me so for the SQL/JSONPath stuff ended up using the Moo lever and Nearly parser which was rather pleasant. https://nearley.js.org
- Parser generators vs. handwritten parsers: surveying major languages in 2021
-
Applicative Parsing
Parsers in nearley.js [1] are written in a very readable EBNF-like DSL; then they get desugared down to a JS file that's a lot like your snippet.
[1] https://github.com/kach/nearley
What are some alternatives?
racketscript - Racket to JavaScript Compiler
PEG.js - PEG.js: Parser generator for JavaScript
biwascheme - Scheme interpreter written in JavaScript
Jison - Bison in JavaScript.
langjam
Chevrotain - Parser Building Toolkit for JavaScript
micrograd - A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API
markdown-it - Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed
gambit - Gambit is an efficient implementation of the Scheme programming language.
xml2js - XML to JavaScript object converter.
cant - A programming argot
parse5 - HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.