1. 38
    1. 8

      I’m one of the lead Fennel devs and have a passing familiarity with other compilers that target the runtime; happy to answer any questions folks might have.

      1. 4

        Fennel is great, just want to say thanks for the work in it.

      2. 2

        Is there a sweet spot for Fennel?

        I’ve been looking for a new language to play with on the side and was going to jump into clojure. However the start up times for cli type programs gives me pause. I’d like something that’s fairly useful for scripting (automating all the little things) too.

        1. 2

          I would say the most common thing Fennel gets used for is probably making games, but that’s probably just because https://love2d.org and https://tic.computer just make it so dang easy.

          You can definitely do web apps in it; you won’t find as many libraries as the JVM, but stuff like https://leafo.net/lapis/ works great, and all the basics for stuff like postgres or redis or whatever works fine. (In fact, you can even execute Fennel inside postgres and redis.) But it’s definitely a lot better at CLI scripting than Clojure.

          In the last release we just added support for standalone binaries, so you can compile your code down to a native executable that’s usually under 300kb.

    2. 6

      awesome! There is also this pretty exhaustive list: https://github.com/hengestone/lua-languages

      1. 2

        that is awesome, thanks a lot for sharing.

      2. 1

        And by the way, as mentioned in that repo, I’d love to see more languages compile directly to bytecode using Rochus Keller’s tools so tracebacks and debugging become less convoluted.

        Willing to pony up for beer/coffee/pizza if someone wants to take on a project like that :)

        1. 2

          I’ve considered this, but the idea of being tied to one specific implementation seems like a big bummer when there are so many Lua runtimes out there; PUC, LuaJIT, Fengari, rembulan, moonsharp, go-lua, luerl, and a bunch more I’m forgetting.

          1. 1

            … though … thinking about it, one thing we’re working on for Fennel right now is a plugin API, which will add hooks/extension points for various parts of the compiler cycle.

            Once that’s fleshed out a bit, it may eventually be possible to build a plugin that overrides the special forms in the AST responsible for emitting Lua with ones that emit bytecode instead.

            It would at least make for a nifty experiment! It will be a while before that’s feasible, though; the compiler still has a number of internal functions that are tightly coupled with generating Lua, and it’ll take some time to break those up.

    3. 5

      Urn compiles to Lua but it is written in Common Lisp.

      I don’t think this is true; GitHub mistakenly detects Urn files as CL files, but Urn is mostly written in Urn.

      1. 3

        Yep, it looks like it’s self-hosted and using .gitattributes to apply CL syntax highlighting in the absence of direct support github/linguist.

        Incidentally, because Fennel uses the same approach to get Clojure-esque syntax highlighting in .fnl files, you see the similar side effect of GitHub reporting the repo as containing Clojure code!

        Can be somewhat confusing, but in my opinion worth it for the syntax highlighting until there’s direct linguist support!

        1. 1

          I actually went searching for where Fennel was using Clojure in the source and couldn’t find it…

          1. 1

            Sorry about that!

            The good news is that this thread prompted me to double-check, and there appears to be a way I missed to omit files from the language stats while still getting the highlighting, so assuming there aren’t other side effects, it should be possible to save folks the same inconvenience in both Fennel and Urn moving forward. Your post may end up making both repos more approachable!

      2. 1

        Fixed. I relied on GH to detect languages too much. Sorry for the mistake.

        1. 1

          No problem; cool. Another interesting tidbit is that I think Amulet and Urn are developed by the same people.

          I’m curious about the comments at the bottom; it looks like you are incorporating posts from the fediverse into there; is that accurate? Is the blog itself syndicated over ActivityPub?

          1. 2

            I’m curious about the comments at the bottom; it looks like you are incorporating posts from the fediverse into there; is that accurate? Is the blog itself syndicated over ActivityPub?

            The blog uses WebMentions to populate that content. I’m using a service called bridgy to pick URL mentions and their replies from Twitter and Mastodon and forward them as WebMentions to the blog. It is quite simple to implement since I’m using a SaaS for WebMentions as well.

    4. 5

      Hadn’t heard of Amulet, thanks for sharing! I feel compelled to mention I am, this very minute, working on making my language compile itself to Lua.