I hope more languages get these features

  • xxce2AAb@feddit.dk
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    It’s an interesting write up. Unfortunately, many of the execution contexts that’d really benefit from the bespoke per-regex code probably wouldn’t appreciate the additional executable size, e.g. embedded applications.

    But it certainly has its place elsewhere.

  • mcmodknower@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    “Wait Evan, did you say heap allocation? Isn’t heap allocation at compile-time impossible?” … Though, I’d bet that some Lisps were doing all this back in the 60s and 70s too, as is usually the case!

    Yes, macros in lisp are just normal functions running at compile time, taking in the compile time arguments and outputting code.