Danny Yoo writes about Racket and Scheme, including compilers to JavaScript, parser generators, and language-oriented programming.
HN links it in Racket threads as a reference for building languages with macros, such as the Brainfuck example and Whalesong compiler.
My apologies! I had to rip out js-bidirectional-input out, and didn't update the documentation to reflect that. The documentation linked from the "API" link there is unfortunately stale, and I haven't had the time to update it. (Most of my time right now is dedicated to a new version of the evaluator, discussed at the bottom of this post.)
The Wescheme environment is meant to pair with the curriculum of the Bootstrap project (http://www.bootstrapworld.org/)
Here are some examples that highlight the features in WeScheme. Each includes both a runner and a live editor link to the source code.
A simple game:
http://www.wescheme.org/view?publicId=messy-humor-truck-adopt-outdo
A sierpenski triangle program:
http://www.wescheme.org/view?publicId=pasty-brawl-frank-vomit-would
A more substantial demo of the image libraries:
http://www.wescheme.org/view?publicId=haste-foggy-grief-hatch-gloom
A simple 1-tick-per-section counter that resets when you press the button:
http://www.wescheme.org/view?publicId=queer-decay-slush-speck-stage
I'm in the middle of a rewrite of the underlying evaluator and libraries during this summer (http://hashcollision.org/whalesong), and hope to deliver in the next few weeks so that people can play with it.
The Ragg tutorial uses Brainfuck as an example of how to use "compile a language by macros". The grammar of the input language is specified as BNF and the output is a syntax object representing Racket forms. Syntax objects are normally used in Racket to implement macros - and therefore there is an extremely rich support for manipulating syntax objects builtin. Using this machinery it is relatively simple to implement compilers using this representation of programs.
Since Brainfuck is an artifical language, I thought I'd show how to compile a "real" language using the same approach. My first idea was to look at Basic, but I decided it would be more fun to pick a language with types.
Having read Jensen's book on compiling Pascal years ago (a must read if you are interested in Pascal compilers) the choice fell on Pascal.
The Ragg tutorial:
http://www.hashcollision.org/brainfudge/
These are great questions!
Yes, what you're describing is the "extreme" version of LOP. Of course you don't have to do it that aggressively to get working code.
Two references I like to point to:
https://www.hashcollision.org/brainfudge/
https://beautifulracket.com/
They will give you a sense of how one uses LOP productively.
You do not need to write a "web server language"! To the contrary, the Web server provides several languages to give you a trade-off between ease and power in writing server-side Web applications. So you can just write regular Racket code and serve it through the server. The server also comes with some really neat, powerful primitives (orthogonal to LOP) — like `send/suspend` — that make it much easier to write server-based code.
I would recommend:
1) Install Racket (http://racket-lang.org/)
2) Read Simply Scheme (https://www.cs.berkeley.edu/~bh/ss-toc2.html) by Brian Harvey and Matthew Wright. It's free. Harvey taught the Scheme classes at UC Berkeley for many years, and is an outstanding (and award-winning) teacher (he also has a series of videos that might be helpful).
One of the stated goals of Harvey and Wright's approach is to get the student ready for SICP. It's definitely way above the "add two numbers" level, but is not quite the instant warp factor 10 that you get when you dive into SICP.
If you do this, you should also use the Racket Library (https://www.hashcollision.org/simply-scheme/) that adds all the extra stuff used in the Harvey and Wright text.
Good luck!
I'm not a Kotlin expert, but I expect that it enables easily interpreted DSLs. Racket enables easy compiled DSLs through its macro system. So, no interpretative overhead.
Also you can really, really change both syntax and semantics:
https://docs.racket-lang.org/2d/
Although not similar technically speaking, Graal/Truffle is a better comparison in spirit, IMO. But Graal/Truffle is hugely complex, with many many man-hours in it.
Classic example and discussion:
https://www.reddit.com/r/programming/comments/i1slm/comment/c20a8ov
https://www.hashcollision.org/brainfudge/index.html
Well, it's a 700k interpreter and runtime. It isn't slow for simple things, but only because JS is really fast now. Interpreters are usually 5 to 10 times slower than whatever they are running in.
http://hashcollision.org/whalesong/examples/raphael-demo/raphael-demo.html isn't bad
http://hashcollision.org/whalesong/examples/boid/boid.html is a little slow compared to http://graphics.cs.wisc.edu/Courses/Games12/Tutorial1/Phase13/
Some of the low framerate could be frame timing (whalesong could be using setTimeout poorly), but they seem to use about the same CPU.