Introduction

dk is a standalone binary that runs scripts and (optionally) cross-compiles those scripts to standalone executables:

  • a "script" is a file containing source code that can be run directly from the command line. Common examples include .sh shell scripts and .py Python modules.
  • a standalone executable is a native executable (ex. a .exe file on Windows) that requires nothing more than standard system libraries

Think of dk as a Python interpreter, but using a different language (OCaml) and having the ability to create executables from your scripts that you can deploy to other machines and operating systems.

It was designed for high school students and for experienced developers to collaborate on large software projects. Students, you should have a teacher or a mentor guide you through the Quick Walkthrough; once to get you familiar with what dk can do, and once more to give you an explanation of what is happening. Experienced developers, please start at the Quick Tour instead.

Developers who are ready to script with dk should explore the dk Runtime to check which versions of Windows Windows Logo, macOS macOS Logo, and Linux Linux Logo are supported for your users.

Developers who are writing scripts should first consult dk Parties for how to organize your scripts in a project, and then keep a copy of the dk Libraries and dk Macros reference manuals open while editing their scripts.

Intermediate and advanced OCaml users will want to read the Coming From OCaml guide.

Examples

  • DkSubscribeWebhook - Clonable formerly-in-production Stripe webhook that uses GitLab, AWS SES and 1Password.
  • Sonic Scout - `dk` powers the student developer experience, and some `dk` scripts are cross-compiled into the data layer (ie. embedded as a shared library) in its Android app.
  • SanetteBogue - A demonstration of existing OCaml code (a game) that runs without modifying the source.
  • Command-Line Tools

  • dk(1)
  • dk-Embed(1)
  • dk-Exe(1)
  • dk-REPL(1)
  • dk-Run(1)
  • dk-SBOM(1)
  • DkAssets_Capture.File(1)
  • DkAssets_Capture.Origin(1)
  • DkAssets_Capture.Spec(1)
  • DkFs_C99.Dir(1)
  • DkFs_C99.File(1)
  • DkFs_C99.Path(1)
  • DkNet_Std.Browser(1)
  • DkNet_Std.Http(1)
  • DkStdRestApis_Gen.StripeDl(1)
  • DkStdRestApis_Gen.StripeGen(1)
  • MlStd_Std.Exec(1)
  • MlStd_Std.Export(1)
  • MlStd_Std.Legal.Record(1)
  • Reference Manuals

  • dkcoder-libraries(7)
  • dkcoder-macros(7)
  • dkcoder-runtime(7)
  • dkcoder-parties(7)
  • dkcoder-design-security(7)
  • dkcoder-design-linking(7)
  • dkcoder-limitations(7)
  • Guides

  • Quick Walkthrough for students
  • Quick Tour for experienced developers
  • Coming From OCaml Guide
  • Release Notes

  • dk Release Notes