So the next post will hopefully be about the compiler itself.
Unless I get distracted again.
Sike!
While I did some work on the compiler, I’m not feeling ready to talk about it yet. I want the post about it to be, well, more in-depth, so for now, let’s go back to immutable data structures.
Tags / lua
Somewhere in 2019 I started a project that aimed to bring some of Clojure features to Lua runtime - fennel-cljlib. It was a library for Fennel that implemented a basic subset of clojure.core namespace functions and macros. My goal was simple - I enjoy working with Clojure, but I don’t use it for hobby projects, so I wanted Fennel to feel more Clojure-like, besides what it already provides for that.
Recently (again, bored on a vacation), I started working on a game I’ve planned for a long time. I wasn’t satisfied with my existing implementations of a player controller1, so I started working on a new one. After a bit of fiddling around, I came to something I’m satisfied with, for now, at least, but while working on it, I wanted to add something I haven’t done in any of my projects yet - I decided to add slopes to my game.
I’m continuing my work on fennel-cljlib, my port of clojure.core and some other core libraries, focusing on porting missing functions and features to it. One such feature, which I sometimes miss in Lua and Fennel, is dynamic binding.
The Lua VM doesn’t provide dynamic scoping as a language feature, and Fennel itself doesn’t introduce any concepts like Clojure’s Var.
If you know Python or do a lot of shell scripting (or even write in Perl), you’re probably familiar with the ability of these languages to reference variables or even expressions from string literals.
In a shell, it is possible to do this:
I just released a new version of the deps.fnl project!
After getting some feedback on the 0.1.0 version and addressing most of it, I’m ready to present a new version with improved dependency and conflict handling.
Major changes The deps.fnl file format The :deps field was changed back to use maps, as it was during the prototyping stage:
I’d like to present a new project, aimed at one of the areas where the Fennel ecosystem can be improved - project dependency management.
Other programming languages have tools to pull in, build, and load external dependencies. Java has Maven, Clojure has Leiningen and other projects like this, Python has Pip and Poetry, and Lua has Luarocks.
Recently I was participating in a conversation about popular programming languages and I brought up Lua. I was met with a response like this:
Lua? Can you even do anything with this language?
The conversation then shifted towards discussing modern dynamic languages, mostly Python, and how it gives you everything Java does without being as complicated as Java.
I spent the previous ten days on vacation. Usually, I try to go off once or twice a year to somewhere where I can just passively relax - usually, it is some sea resort. This year I decided to go to the Republic of Türkiye and spend my time at the beach without any major attractions.
Early on in my career, when I saw a function that returns an anonymous function, I felt a weird mix of emotions. It was just a weird thing to do, especially when you’re coming from C, where there are no anonymous functions. Such concepts as lambdas in C++ were hard to grasp, and I’m thankful that instead of continuing to hit my head against the C++ wall I picked Scheme, and it helped me understand many core concepts, such as higher-order functions that we’ll be mainly talking about in this post.