Danny Yoo

hashcollision.org · Personal blog · on HN since 2011

Danny Yoo writes about Racket and Scheme, including compilers to JavaScript, parser generators, and language-oriented programming.

What HN saysHN links it in Racket threads as a reference for building languages with macros, such as the Brainfuck example and Whalesong compiler.
24HN people shared it
15linked it in comments
17stories submitted
340story points
10 months agolast shared
2011people per year2026

Most-shared posts

  1. 1
    F*dging up a Racket
    12 people · 161 points · first shared 2011 · 7 comments on HN
  2. 2
    Whalesong: a Racket to JavaScript compiler
    10 people · 158 points · first shared 2011 · 10 comments on HN
  3. 3
    Ragg: A Racket AST Generator
    1 people · 21 points · first shared 2015 · discussion on HN
  4. 4
    Simply scheme
    1 people · first shared 2015
  5. 5
    Boid
    1 people · first shared 2012
  6. 6
    Raphael demo
    1 people · first shared 2012
  7. 7
    Index
    1 people · first shared 2021
  8. 8
    Index
    1 people · first shared 2014

What HN people wrote when they linked it

skrishnamurthi · 2025-09-07
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.
rscho · 2021-02-14
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
soegaard · 2016-06-23
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/
Turing_Machine · 2015-06-17
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!
neilv · 2026-01-21
Jens Axel Søgaard is cool and involved in many things. We collaborated on SICP support. Original developer of Whalesong was Danny Yoo. https://www.hashcollision.org/whalesong/ There was also this: https://docs.racket-lang.org/racketscript/ Dave Herman worked on various JS-related libraries for Racket (or PLT Scheme) before he was involved with Rust.
moron4hire · 2017-09-21
https://www.hashcollision.org/whalesong/ it's a little stale, though. This is the latest repo: https://github.com/soegaard/whalesong
ketralnis · 2017-09-04
I'd probably start by using Racket (Racket is a scheme is a lisp) which has a whole toolkit for language building. Arc is written this way, for instance. Often these are lispy languages but there is no reason they have to be. A starting point: http://beautifulracket.com/stacker/ or https://www.hashcollision.org/brainfudge/ That will get you started rediculously quickly and give you things like GC and JIT for free. You can always implement it outside of racket once it starts to take further shape
pmelendez · 2015-08-03
>"Scheme doesn't run in the browser and lacks tooling for readily manipulating the DOM" Meh... [1][2][3][4] [1] http://www.biwascheme.org/ [2] https://github.com/jcoglan/fargo [3] https://www.hashcollision.org/whalesong/ [4] http://wiki.call-cc.org/eggref/4/spock
shriramkmurthi · 2015-03-25
This is a criticism of Lisp-based DSLs but not of Racket-based DSLs. Racket actively enables you to impose different, non-parenthetical surface syntaxes on the DSL. It is not a "this sort of works if you arrange it carefully _and nobody screws anything up_" thing like in Ruby, it really is an explicit language definition. The easiest way to understand this in action is to read about Danny Yoo's Brainfuck embedding in Racket: https://www.hashcollision.org/brainfudge/
klibertp · 2015-02-01
You're probably not, but you sound as if you're just jealous... You could phrase your comment better. On topic: I too don't think "another brainfuck interpreter" is very interesting, but I enjoyed sort-of-a-compiler for brainfuck implemented here: https://www.hashcollision.org/brainfudge/ by Danny Yoo. You can get something out of even the most useless of examples sometimes :)
jarcane · 2014-08-25
It is possible to cross-compile Racket for Android. There's notes on how to do this in the src tree here: https://github.com/plt/racket/tree/master/racket/src There's also Whalesong, which compiles Racket to JS, which could potentially be useful for either platform: http://www.hashcollision.org/whalesong/index.html
gcr · 2013-08-11
Just as an aside, are you aware of Whalesong? http://hashcollision.org/whalesong/ It's a Javascript VM that interprets Racket bytecode. It's complete enough to run, eg. World/Universe games or render HTDP2e pictures. Might be useful for some of what you're doing.
ynniv · 2012-09-22
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.… 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.
dyoo · 2011-06-28
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.

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close