I think the reason it really works so good is that most people follow the already established conventions when writing their own macros.
Binding constructs look like let (ITER, rackets for loops, BB, my looping construct: https://git.sr.ht/~bjoli/goof-loop which pushes the limits of what can be comfortably done without breaking hygiene). Derived conditional constructs look like cond (trivia, match, case).
After some time you get a taste for how things are supposed to work to integrate (and to some extent compose) with the rest of the system. The discussions in the SRFI mailing lists can sometimes obsess over small details that, when finished, always seems to come together in a nice way.
It's elegant, conceptually simple, and it's just fun to hack. It has a regular syntax, which means that once you learn the syntax you never have to worry about it again. There's no operator precedence, so you don't have to worry about messing that up. It's relatively easy to read (although I've created my share of monstrosities, so it's possible to do so), and you also get the power of macros, which can help to repeat yourself less, and give you a lot of power, should you ever need it (I have hardly ever written a macro, and it's not the main draw, but it's there). It has the ability to add your own syntax, to an extent: You need raw strings, string interpolation, external representations of data, or a more concise syntax for functions? You're covered.
It's super easy to learn for people with programming experience limited excel macros and the like, not to mention the huge number of tutorials, books etc.
It's used in a rule engine for cases where the user needs an escape hatch to express super context specific rules we do not provide matchers for out of the box.
I just started using this (using integration with (spac)emacs), and it does indeed spark joy. I have been performing some refactoring today and it made my life much, much easier.
I'm still working out how to configure it to avoid false positives on some custom macros, but so far I'm all smiles
I found it very useful and delightful when I was doing something so obscure as writing a Zig binding for FreeType and HarfBuzz. It didn’t always generate correct Zig code but it was still really good and I was so impressed by how it picked up the FFI conventions and reused its knowledge of those libraries in this new language context.
Yep. Would bet on it again. It's proven itself to me and my employer, and has increased developer productivity and joy dramatically. Bad code looks bad, good design emerges organically, and macros let you hide the plumbing where needed, and optimize things away at compile time. Not even mentioning the wonderful world of OTP.
It’s also kind of a crazy library (eg letting you magically shell out to commands—one step away from a 90s-style IFS security hole). I think it’s more of a fun exercise in crazy things you can do with C preprocessor macros.
Yeah, I can see that. There are a few things that make it nice, like the `@` sign in place of `this, and implicit returns (which remove a bunch of boilerplate and brackets).
It's by far the best FFI implementation in the industry across all languages. You can even setup a GCC workflow to automate the bindings by stripping information from headers.
I'm disappointed by the FFI experience everywhere else, it makes you feel like you're doing software development in the stone ages.
I think I like it because of how weirdly constrained it is. Especially when you're writing something that will overwrite the handler itself, it's easy to get yourself stuck in a loop or a strange dead end.
Because the syntax alone is already so different it was a great way for me to "re-learn" programming. Even for the very short while I played with it, it really thought me to look further than the default go-to patterns I used to use.
This is how I use it. I ignore anything specific to the logic of what I am writing, but it's great for filling out shit like structs and gets those right. I start typing `type ResponseHandler....` and it immediately knows what I want
Binding constructs look like let (ITER, rackets for loops, BB, my looping construct: https://git.sr.ht/~bjoli/goof-loop which pushes the limits of what can be comfortably done without breaking hygiene). Derived conditional constructs look like cond (trivia, match, case).
After some time you get a taste for how things are supposed to work to integrate (and to some extent compose) with the rest of the system. The discussions in the SRFI mailing lists can sometimes obsess over small details that, when finished, always seems to come together in a nice way.
reply