[ANN] DkCoder 0.1.0

I wrote an article DkCoder: Intro to Scripting that describes a very early cut of OCaml-ified scripting:

Hello Builder! Scripting is a small, free and important piece of DkSDK. Walk with me as we use the DkSDK tool “DkCoder” to write little scripts that become full-fledged programs. My hope is that within minutes you feel like your dev experience is as productive as in Python, but enhanced so you:

  1. have nothing to install except Git and optionally Visual Studio Code
  2. have safe and understandable code (“static typing”)

DkCoder is a transparently installed OCaml 4.14 environment with one API: run a script. It shouldn’t be confused with conventional OCaml distributions, although underneath DkCoder has the conventional bytecode binaries1, and dune and ocamllsp.

No C compiler, Cygwin/MSYS2, Homebrew or MacPorts are needed. Please skim the article for the exact Windows/macOS/Linux requirements.

It grew out of two things:

  1. My frustrations sharing scripts with others. It was easy for inter-dependencies between scripts to break POSIX shell scripts (the basis of the DkML installer) and CMake scripts (most of my tools).
  2. My need to have a good delivery vehicle for my own software.

Please don’t do anything major with DkCoder yet. In fact, if you think you’ll be using DkCoder for your own scripts or your own software, please send me a message so I can prioritize/deprioritize.

I’d like to thank @octachron for the codept analyzer. It is lightly used now but as hinted in the Security section of the article it will become much more important. And also thanks to the projects that have fixed their newly discovered bytecode-only bugs over the past two months.

1: Actually, I bundle a new binary called ocamlrunx which is a DT_NEEDED/LC_LOAD_DYLIB re-linking of ocamlrun against all the C libraries (ffi, SDL2* and their deps today) to get macOS and Linux bytecode working.

9 Likes