1. 3
  1.  

  2. 2

    A system that I operate has a parse loop that does a bunch of IndexOf operations in order to determine what kind of record we’re dealing with. I looked, in the past, at generating a switch based trie, as it seems like a really good fit. The problem was not the generated code size, but the maintainability of it all.

    I think defining a flex like code generator for this type of thing would be really neat. Or, maybe it’s the case that ragel is usable in this way… already. That’d be pretty neat.

    1. 1

      What you’re describing is one of the main advantages of languages with strong support for metaprogramming (ie DSL’s). It’s also one of ths reasons I push for people to build more C-compatible, C-outputing languages with meta features. You can get readability and performance.

      1. 2

        What you’re describing is one of the main advantages of languages with strong support for metaprogramming

        This is one of the reasons I like Racket so much. Unfortunately for me, I don’t get to program in Racket at work, and I’ve yet to find time to build a system analogous to linj for Racket/Go.

        edit: Forgot to mention, I’ve got a great name for this, too: rago. As in the most obvious name, that also happens to not be completely offensive, and apparently means (according to ud , “Fuck it! I don’t care what your opinion of me is!”)

        1. 1

          Oh that’s good. Im going to say it in future as I exit flipping someone off who started something with me.