3 ms·
Two things about Boo that have left a lasting mark: First, it was the first time I'd seen quasi-quotes, where you can write code that them so converted to AST.
by jauntywundrkind 2y ago
Two things about Boo that have left a lasting mark:
First, it was the first time I'd seen quasi-quotes, where you can write code that them so converted to AST. Very very lovely dynamic programming. It was so awesome having a static runtime but being able to do multi-phase programming in it, was so much nicer than anything I'd seen in java. Excellent easy to understand macro writing.
Second, the boo test cases rocked. Test cases start with a string which is the expected output. Then the rest of the testcase is a short bit of code that outputs. It was so easy to debug & see what was happening, such an elegant frameworkless way to run tests.
I used it a couple times commercially at small webdev shops, but had a bunch of personal projects using Boo. Lead author Bamboo got hired by Unity and their (I believe now deprecated?) UnityScript was related/similar I understand, but Boo kept going for a whole. Great docs for the time too. But yeah tapered off.
The two techniques I describe, quasi-quotes & tests-as-executable are both visible in this macro testcase, https://github.com/boo-lang/boo/blob/master/tests/testcases/macros/custom-class-macro-with-properties-and-field.boo https://github.com/boo-lang/boo/blob/master/tests/testcases/...
Thanks Bamboo et al!
- cb321 2y agoThe Nim macro system also has quasi-quotes (whose heritage ultimately goes back to Lisp, I believe, though Quine 1940 probably deserves the ultimate "credit" [1]). E.g.: import std/macros macro check(ex: untyped) = let info = ex.lineInfo let exStr = ex.toStrLit result = quote do: if not `ex`: echo `info` & ": Check failed: " & `exStr` check 1 == 2 and then saved in `/tmp/j.nim` and run via `nim r /tmp/j` gives Hint: mm: arc; opt: none (DEBUG BUILD, `-d:release` generates faster code) 17090 lines; 0.191s; 24.699MiB peakmem; proj: /tmp/j; out: /u/cb/.cache/nim/j_d/j_56B19E2DE1BC31D8D53BA27494BE816EB824A493 [SuccessX] Hint: /u/cb/.cache/nim/j_d/j_56B19E2DE1BC31D8D53BA27494BE816EB824A493 [Exec] /tmp/j.nim(8, 8): Check failed: 1 == 2 [1] https://en.wikipedia.org/wiki/Quasi-quotation https://en.wikipedia.org/wiki/Quasi-quotation