Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
QuasiLiterals (erights.org)
3 points by mpweiher on Oct 20, 2021 | hide | past | favorite | 1 comment


An age ago I used to be a huge fan of the Boo programming language, a .NET runtime language that was vaguely python-ic (Unity hired the author & made UnityScript with this work).

One of the great features I loved was Boo's metaprogramming capabilities. Among others, like E, the quasi-parser was easy to reach for & use at runtime. The tests are a good way to see Boo features, here's a quasi-quote test, which uses a Quasi-quote to get some code, then adds to that AST imperatively: https://github.com/boo-lang/boo/blob/master/tests/testcases/...

At the time, having the compiler & AST all defined in .NET, managed, was incredibly cool & exciting. Now .NET does that pretty pervasively, but at the time, being able to build & compile & load code at runtime was sweet.

I wrote something using a mode Clang used to have where Clang could print out some XML about structures it was compiling via an --ast-print-xml flag, then auto-built a .NET wrapper around parts of that library, a long long time ago, specifically so I could auto-generate a .NET interface to Linux's input.h, making extensive use of macros & quasi-quotes, ~ a decade ago. It's probably awful but it's a fun memory to have, & feels like a good use of all that managed compiler services & quasi-quotes & AST. https://github.com/rektide/vimp/blob/master/src/main/boo/Voo... https://github.com/rektide/input-sharp/




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

Search: