A JavaScript Runtime in ~100 lines of code
github.com
github.com
You are basically using deno's runtime. So it's not totally yours.
This is just a wrapper.
I have to admit that before opening this link i thought that it could be a kind of wrapper or using the V8 engine or something else.
To be fair to the author, this project shows how to do IO with the wrapper. It binds filesystem and web request APIs, so they work. This doesn't just evaluate pure JavaScript functions using Deno.
But yes, from the title, I was hoping for some insanely succinct lexer, parser, and eval loop.
function piython { python "$@" }Node is a distribution of v8. Deno is a distribution of v8. Bun is a distribution of JSC. And so on.
Deno relies on V8, which I'd wager is on the order of a million or more lines..
It appears Js runtime is the new Hello world!.
Anyway, like the sibling comment mentioned. It is not really a full runtime. You're using deno. The title made it seem like you had a Js runtime independent of an existing.
Here's my Lisp interpreter in a couple of lines of Rust: https://github.com/rpasta42/LambdaOxide
And here's the accompanying graphics environment for my Lisp dialect (with a couple of mini-games as an example): https://github.com/rpasta42/skomakare
This is what I call "writing your own runtime"
Here you go:
#!/bin/sh
deno $@