I wanted a way to distribute small pieces of functionality (ie. scripts) to users. Functionality like:
- Downloading and configuring JDKs, Gradle and Android Studio so that users could use my software development kit.
- Launching a complex cross-compile in WSL2.
- Metaprogramming code-translation tools: <a href="https://news.ycombinator.com/item?id=38748249">https://news.ycombinator.com/item?id=38748249</a><p>/Distribution problem/ I needed these scripts to be usable by junior engineers (devs who have had only one programming language course in high school) and work on the major desktops (Windows, macOS and marginally Linux). My initial solution was to distribute a set of POSIX scripts (MSYS2 on Windows). That was highly error-prone even with a good linter, and it was hard to troubleshoot problems (stack traces are really useful!). My second solution was to distribute CMake scripts and that worked for quite a while. The problem was the CMake scripts didn't scale well ... if one CMake script included another CMake script but a function's parameters changed, I'd get no signal until runtime that the software was broken.<p>/Hackable problem/ And over time, I realized I had a new requirement: my users should be able to edit and adapt the scripts to their own needs.<p>So, I created and have been using the "DkCoder" scripting framework for the past two months. It is an early alpha based on OCaml, and I haven't finished porting my CMake based scripts yet. But I surprised myself: I thoroughly enjoyed using DkCoder for scripts that I had no intention of distributing to users. This was a new use case I hadn't anticipated. In a week I was able to create a real production service (a webhook) that interacts with AWS SES, Stripe, GitLab and 1Password to manage subscriptions for my software kit. And much of that week was low-level REST plumbing because I wanted to simulate scripting for SaaS teams that didn't yet have their client libraries ready. That is one of three examples included with DkCoder.<p>I'd like feedback whether or not this scripting framework is something you could see yourself using.