dk logo

dk Diskuv, Inc.

Use this command to install dk:
winget install --id=Diskuv.dk -e

A script runner and cross-compiler, written in OCaml. Designed to produce CLIs and installers, to embed scripts in applications, and to configure software environments.

dk is a script runner and cross-compiler designed to simplify scripting across platforms. It enables developers to produce command-line interfaces (CLIs), installers, embed scripts within applications, and configure software environments efficiently.

Key Features:

  • Cross-platform Compatibility: Runs on Windows PowerShell, macOS, Linux, and other Unix-like systems.
  • Script Portability: Scripts can be executed without prior installation of dependencies.
  • Static Typing from Day One: Ensures type safety and scalability for large projects.
  • Package Management: Acts as a package manager to download and run required packages.
  • Quick Start Capability: Executes scripts immediately via the ./dk tool, reducing setup time.

Audience & Benefits:

Ideal for developers seeking to build and deploy scripts quickly without complex configurations. dk enables seamless creation of scalable applications, embedding scripts into existing software, and automating environment setups, all while maintaining compatibility across multiple platforms.

README

dk - A script runner and cross-compiler

The main documentation site is .

Quick Start

Install on Windows:

winget install -e --id Diskuv.dk

or Apple/Silicon:

sudo curl -o /usr/local/bin/dk https://diskuv.com/a/dk-exe/2.4.202506160116-signed/dk-darwin_arm64
sudo chmod +x /usr/local/bin/dk

or Apple/Intel:

sudo curl -o /usr/local/bin/dk https://diskuv.com/a/dk-exe/2.4.202506160116-signed/dk-darwin_x86_64
sudo chmod +x /usr/local/bin/dk

or Linux with glibc and libstdc++ (Debian, Ubuntu, etc. but not Alpine):

sudo curl -o /usr/local/bin/dk https://diskuv.com/a/dk-exe/2.4.202506160116-signed/dk-linux_x86_64
sudo chmod +x /usr/local/bin/dk
[ -x /usr/bin/dnf ] && sudo dnf install -y libstdc++

Then cross-compile a script to standalone Windows, Linux, Android executables (and to a macOS executable if you are on a macOS machine):

dk -g dune -S "
    module Http = DkNet_Std.Http
    module Uri = Tr1Uri_Std.Uri
    let print_endline = Tr1Stdlib_V414Io.StdIo.print_endline
 " -U "
    print_endline @@
    Lwt_main.run @@
    Http.fetch_url ~max_sz:4096 @@
    Uri.of_string {|https://jigsaw.w3.org/HTTP/h-content-md5.html|}
 " -O ReleaseSmall Exe

The executables will be available in the target/ folder:

file target/ZzZz_Zz.Adhoc-* | cut -c1-69 | awk '{print $0 "..."}'

target/ZzZz_Zz.Adhoc-android_arm32v7a:   ELF 32-bit LSB pie executabl...
target/ZzZz_Zz.Adhoc-android_arm64v8a:   ELF 64-bit LSB pie executabl...
target/ZzZz_Zz.Adhoc-android_x86_64:     ELF 64-bit LSB pie executabl...
target/ZzZz_Zz.Adhoc-darwin_arm64:       Mach-O 64-bit executable arm...
target/ZzZz_Zz.Adhoc-darwin_x86_64:      Mach-O 64-bit executable x86...
target/ZzZz_Zz.Adhoc-linux_x86:          ELF 32-bit LSB pie executabl...
target/ZzZz_Zz.Adhoc-linux_x86_64:       ELF 64-bit LSB pie executabl...
target/ZzZz_Zz.Adhoc-windows_x86_64.exe: PE32+ executable (console) x...
target/ZzZz_Zz.Adhoc-windows_x86_64.pdb: MSVC program database ver 7....
target/ZzZz_Zz.Adhoc-windows_x86.exe:    PE32 executable (console) In...
target/ZzZz_Zz.Adhoc-windows_x86.pdb:    MSVC program database ver 7....

32-bit targets are not ready yet. has the full list of issues.

Licenses

Copyright 2023 Diskuv, Inc.

The ./dk and ./dk.cmd build scripts ("dk") are available under the Open Software License version 3.0, . A guide to the Open Software License version 3.0 is available at .

dk.cmd downloads parts of the 7-Zip program. 7-Zip is licensed under the GNU LGPL license. The source code for 7-Zip can be found at . Attribute requirements are available at .

"dk" downloads OCaml, codept and other binaries at first run and on each version upgrade. OCaml has a LPGL2.1 license with Static Linking Exceptions. codept has a LPGL2.1 license with Static Linking Exceptions. The other binaries are DkSDK Coder Runtime Binaries © 2023 by Diskuv, Inc. These DkSDK Coder Runtime Binaries are licensed under Attribution-NoDerivatives 4.0 International. To view a copy of this license, visit .

"dk" acts as a package manager; you run ./dk and tell it what packages you want to download and run. These packages have independent licenses and you may be prompted to accept a license. Those licenses include but are not limited to:

Open-Source

The significant parts of dk that are open-source and downloaded:

  • DkML compiler: and
  • MlFront:
  • Tr1 libraries: to be published
Versions
2.4.25164.1
2.3.202505282324
Website