Cloud-init + Configuration Management written in Lua/Fennel?

This is admittedly a bit out there but let me float it…

I kinda want to write a next-gen Configuration Management system (a la Puppet, Chef, Ansible) with a Lisp-y DSL. “Um, Guix?” Oh, yes, I’m very much aware of Guix and that’s sort of the inspiration for the idea. Except I would like for this CM system to be able to reach into other areas not typically addressed (or at least not well) by CM tooling. Meaning ability to configure network devices, resource-constrained IoT devices, and even bootable asset build (VM images, container images, etc)

I know this sounds ambitious and crazy but I have decades of experience working in these areas and so the idea is not at all lightly considered.

What I love about Guix is that the CM-like tasks are first-class citizens in that ecosystem by having Lisp and the supporting tooling right out front and not as some (poor) weld-on like cloud-init, Puppet, Chef. But I don’t think Scheme/Guile are probably light enough for net and IoT.




A couple of add-on considerations…

  • the Lua runtime is very very small and Fennel comes for almost zero addtl cost
  • the Lua/Fennel TDD ecosystem appears to be quite good
  • Lua/Fennel gives folks like me who want to the ability to work in a Lisp but Lua might be more approachable to scripters/non-programmers and so I don’t lock anyone out via “obscure” programming language choices. Assuming we don’t consider Lua exotic and obscure. :wink:

Yes, I think something like this would be extremely valuable. I’ve been thinking about doing something for personal config/dotfiles management with Fennel, possibly even light system configuration.

Not necessarily on the level of Ansible or even Guix, though, just enough to make it easy to deploy a consistent configuration across machines on a particular Linux distribution like Alpine.

I really dig Guix but, man, think about having a single language + framework with Lisp-tendencies all the way from network devices to servers to workstations to user apps (ex: OBS, AwesomeWM)?

1 Like

So now that I have not had anyone shoot down my idea of fennel, I’ll take this over to the General forum but drop this one last idea before doing so…

As I sit here moving large files from workstation to my shiny new OSS NAS, Linux has dbus for “hooking” things like a file copy finishing. It’s just that it has little in the way of docs as to how to use it and no real automation framework which treats hooking dbus as a first-class concern. But if it did… And it was LISP-y…

I really like this idea!

I found myself wanting a more lightweight solution to Ansible, GNU Stow, etc. for personal system setup/configuration, so I wrote a quick and dirty tool in Python to handle the symlinking of my dotfiles and directory creation. I’d love to continue on with the idea but more in the scope of a fully-fledged tooled that will handle this and more.

Plus, an excuses to write more Lisp? What’s not to like?

Worth pointing out:
guix: dbus service

guix home: dotfile service

Take a crack at it. I have no patent on the idea. :wink:

I’ll go off in my corner and play for a bit and report back when I have something worth sharing. Hint: right now I’m digging into NATS.

They aren’t?

Post must be at least 20 characters @daviwil Should we turn off that requirement? It seems to just end up forcing the user to write nonsense to hit the magic number, which seems antithetical to the purpose.

I would say it accomplished the goal perfectly in this case because a short message like “They aren’t?” doesn’t really help to move the discussion forward.

It’s a useful indicator to remind us to expand upon what we’re trying to add to the conversation so that it’s not just reply ping-pong.

I personally find the requirement a little annoying at times, but the point of the forum is to be a place for discussions, not short messages like a chatroom.

Doesn’t it? :stuck_out_tongue: Seriously, AFAIK Scheme and Guile are relatively lightweight, so I was challenging the claim that they aren’t and asking for more details–without having to write all that out.

Well, it’s all relative. I’d like to be able to target really small systems as well without having to resort to a brokered model for the tiny stuff. I think I mentioned elsewhere certainly smaller than a Pi Zero (for which an LLM told me that the dominant dev tooling is Python).

I’ll admit that I’m new to Scheme/Guile. For comparison, the runtime requirements of Lua/Fennel or Janet. Let’s set that as an approx baseline. I don’t know where Guile slides in by comparison. I’m basing my opinion off of looking at the disk footprint of Guile on my Debian 12 workstation.

My understanding of Lua is that it’s a lightweight way of providing an application a scripting language when embedded in another application so people could extend the application. Guile was similarly designed, see the foreign function interface.

A lot of the language comparison stuff is beyond me, but this study informs my idea of which languages are light, take it with a grain of salt.

I’m no expert, and my knowledge about Guile specifically is limited, but I’d guess that Debian pulls in a lot of optional parts. Scheme itself is a very simple language.

If Guile were too heavy, there are many other Lisps and Schemes, e.g. PicoLisp comes to mind. And Chicken Scheme compiles to C so it should be lightweight on the target system.

That study is interesting. Both Python and Lua score very poorly on it, surprisingly poorly IMO.

I really like what I see of Janet so far – the std lib is indeed a bit better then fennel – but it’s such a small community of folks. Even smaller than fennel which is already small.

I like that fennel can leverage the long history and relatively large community of Lua while being amongst the smallest footprint Lisps.

I’m going to do a shoot-out between the two – actually I already am – and then coming out of that I may dig into how the winner compares to more mainline Lisps/Schemes like Guile et al.

As to the performance comparisons up-thread a bit…I’m not sure I care about the areas where Lua/fennel didn’t perform well. For what I’m working on its not going to be calculating FFTs and doing eigenvectors. It’s going to be doing a lot of network I/O and waiting on OS commands to complete. It’s a long way from scientific workloads. :wink:

There’s also the Computer Language Benchmarks Game

1 Like