Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Whitespace, the Language (bewatermyfriend.org)
20 points by pabs3 on Oct 13, 2020 | hide | past | favorite | 5 comments


I designed Nebula [0], a LLVM front end for Whitespace, written in Go. It's the first ahead-of-time compiler for Whitespace. It features its own bespoke intermediate representation in static single assignment form for simpler optimization. Whitespace instructions are stack-oriented like Forth, thus most instructions modify the stack. Nebula lowers these stack-oriented instructions to registers in SSA form such that the stack is modified only once per basic block. It was trivial to add support for Brainfuck, lowering to the same IR.

I have record of almost 100 Whitespace interpreters [1], so I am confident that Nebula is the first AOT compiler for Whitespace. Another project is CensoredUsername's Whitespace JIT compiler in Rust that assembles code on the fly and deoptimizes on error.

[0]: https://github.com/andrewarchi/nebula

[1]: https://github.com/andrewarchi/ws-collection


Whitespace was created by Edwin Brady, notably the same creator of the much more practical Idris language: https://www.idris-lang.org/


I and a few other students once cornered him to ask if he's the same Edwin Brady who wrote whitespace. He said no, it must be some other Edwin Brady. We returned later, with better evidence. He said "Ok, yes, it was me. But in my defense, I was drunk at the time." :)


In fact, Edwin Brady wrote a Whitespace interpreter in Idris: https://github.com/edwinb/WS-idr


For really clean programs: https://metacpan.org/pod/Acme::Bleach




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: