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

**URL:** <https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293>\
**Category:** Programming\
**Created:** [February 17, 2024, 9:34pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293 "2024-02-17T21:34:06Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![unruffled\_lumiere](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@unruffled\_lumiere](https://forum.systemcrafters.net/u/unruffled_lumiere)\
**Post date:** [February 17, 2024, 9:34pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/1 "2024-02-17T21:34:06Z")

</div>

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.

Lua/Fennel?

Thoughts?

---

<div class="post-metadata">

**Author:** ![unruffled\_lumiere](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@unruffled\_lumiere](https://forum.systemcrafters.net/u/unruffled_lumiere)\
**Post date:** [February 17, 2024, 9:38pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/2 "2024-02-17T21:38:00Z")

</div>

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. 😉

---

<div class="post-metadata">

**Author:** ![daviwil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/daviwil/32/1_2.png) [@daviwil](https://forum.systemcrafters.net/u/daviwil)\
**Post date:** [February 18, 2024, 7:31pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/3 "2024-02-18T19:31:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![unruffled\_lumiere](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@unruffled\_lumiere](https://forum.systemcrafters.net/u/unruffled_lumiere)\
**Post date:** [February 18, 2024, 8:04pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/4 "2024-02-18T20:04:27Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![unruffled\_lumiere](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@unruffled\_lumiere](https://forum.systemcrafters.net/u/unruffled_lumiere)\
**Post date:** [February 19, 2024, 4:17pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/5 "2024-02-19T16:17:17Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![tdback](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@tdback](https://forum.systemcrafters.net/u/tdback)\
**Post date:** [February 20, 2024, 1:57am UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/6 "2024-02-20T01:57:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://forum.systemcrafters.net/u/moto)\
**Post date:** [February 20, 2024, 2:07am UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/7 "2024-02-20T02:07:17Z")

</div>

Worth pointing out:  
[guix: dbus service](https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/dbus.scm)

[guix home: dotfile service](https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/home/services/dotfiles.scm)

---

<div class="post-metadata">

**Author:** ![unruffled\_lumiere](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@unruffled\_lumiere](https://forum.systemcrafters.net/u/unruffled_lumiere)\
**Post date:** [February 20, 2024, 2:31am UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/8 "2024-02-20T02:31:20Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![alphapapa](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alphapapa](https://forum.systemcrafters.net/u/alphapapa)\
**Post date:** [February 20, 2024, 8:41am UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/9 "2024-02-20T08:41:01Z")

</div>

> [@unruffled\_lumiere](#):
>
> I don’t think Scheme/Guile are probably light enough for net and IoT.

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.

---

<div class="post-metadata">

**Author:** ![daviwil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/daviwil/32/1_2.png) [@daviwil](https://forum.systemcrafters.net/u/daviwil)\
**Post date:** [February 20, 2024, 8:51am UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/10 "2024-02-20T08:51:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alphapapa](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alphapapa](https://forum.systemcrafters.net/u/alphapapa)\
**Post date:** [February 20, 2024, 9:41am UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/11 "2024-02-20T09:41:02Z")

</div>

> [@daviwil](#):
>
> 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.

Doesn’t it? 😛 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.

---

<div class="post-metadata">

**Author:** ![unruffled\_lumiere](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@unruffled\_lumiere](https://forum.systemcrafters.net/u/unruffled_lumiere)\
**Post date:** [February 20, 2024, 2:22pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/12 "2024-02-20T14:22:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://forum.systemcrafters.net/u/moto)\
**Post date:** [February 20, 2024, 4:39pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/13 "2024-02-20T16:39:33Z")

</div>

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](https://sites.google.com/view/energy-efficiency-languages/results) informs my idea of which languages are light, take it with a grain of salt.

---

<div class="post-metadata">

**Author:** ![alphapapa](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alphapapa](https://forum.systemcrafters.net/u/alphapapa)\
**Post date:** [February 20, 2024, 10:58pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/14 "2024-02-20T22:58:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alphapapa](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alphapapa](https://forum.systemcrafters.net/u/alphapapa)\
**Post date:** [February 20, 2024, 11:04pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/15 "2024-02-20T23:04:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![unruffled\_lumiere](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@unruffled\_lumiere](https://forum.systemcrafters.net/u/unruffled_lumiere)\
**Post date:** [February 20, 2024, 11:15pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/16 "2024-02-20T23:15:01Z")

</div>

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. 😉

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://forum.systemcrafters.net/u/moto)\
**Post date:** [February 20, 2024, 11:44pm UTC](https://forum.systemcrafters.net/t/cloud-init-configuration-management-written-in-lua-fennel/293/17 "2024-02-20T23:44:32Z")

</div>

There’s also the [Computer Language Benchmarks Game](https://benchmarksgame-team.pages.debian.net/benchmarksgame/)
