News for hackers. Stuff that matters.
Re:JavaScript Macros in Bun by jakelazaroff on Friday June 30, 2023 @02:23PM (#36539784)
Pretty cool! Sounds like it was inspired by comptime in Zig (which shouldn't be too surprising since Bun is written in Zig).
Re:JavaScript Macros in Bun by Jarred on Friday June 30, 2023 @02:49PM (#36540224)
It was mostly inspired by comptime in Zig. Babel macros came to mind too, but those rely on an AST and Babel-specific api. What’s really cool about comptime in Zig is it feels like ordinary code. Macros in Bun aim for that too.
Re:JavaScript Macros in Bun by zigobserver on Friday June 30, 2023 @06:02PM (#36543016)
If Zig drops LLVM, where does that leave Bun development? There is no alternative Zig implementation.
Re:JavaScript Macros in Bun by erichocean on Friday June 30, 2023 @04:41PM (#36541947)
Woah, nice. Zig has a nice sweet spot of providing useful functionality at compile time vs. having "macros can make the text you read mean practically anything" like in, e.g., Lisp.