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

> A few clicks from your web browser and four (4) minutes > later you and your Windows and macOS users can start > scripting with DkCoder. And all users, > including glibc-based Linux desktop users, can use their > Unix shells or Windows PowerShell. Nothing needs to be > pre-installed on Windows and macOS. Just copy and paste > two lines (you'll see examples soon) and your script is > running and your project is editable with an LSP-capable > IDE like Visual Studio Code. > > Unlike most scripting frameworks, DkCoder solves the problem of scale: you start with small scripts that do immediately useful things for you and your team, and when inevitably you need to expand, distribute or embed those scripts to make full-featured applications, you don't need to throw out what you have already written. DkCoder is a re-imagining of the scripting experience that re-uses the best historical ideas: > > 1. You don't write build files. If that sounds like Unix /bin/sh or the Windows Command Prompt, that is intentional. > 1. Most files you write can be immediately run. If that sounds like how Python scripts are almost indistinguishable from Python modules, or like JavaScript modules, that is intentional. > 1. Most files you write can be referenced with a fully-qualified name. If that sounds like Java packages and how that has been proven to scale to large code bases, that is intentional. > 1. Your scripts play well together and don't bit rot. It is conventional to add static typing (Typescript, mypy) when scripting projects get large. DkCoder has type-safety from Day One that is safer and easier to use.

That quote was from the main documentation site . You are highly encouraged to visit that site!

Quick Start

The recommended way to execute DkCoder scripts is with the help of the ./dk tool. The ./dk tool runs the build script you specify, downloading support files beforehand if necessary. As a result, you can get up and running quickly without having to follow manual installation steps. Gradle users: If that sounds like the easy-to-use Gradle Wrapper, that is intentional.

The ./dk tool is compatible with Windows PowerShell, macOS and glibc-based desktop Linux. It can also run on Windows Command Prompt if you invoke it with .\dk rather than ./dk.

Example 1. The game of Snoke as a set of scripts:

git clone --branch V2_3 https://gitlab.com/diskuv/samples/dkcoder/SanetteBogue.git
./SanetteBogue/dk StdStd_V2_3.Run SanetteBogue_Snoke.Snoke

Example 2. The documentation site as a set of scripts (on Windows there is an alpha bug; rerun the --serve command if it fails the first time):

git clone --branch V2_3 https://gitlab.com/diskuv/samples/dkcoder/DkHelloScript.git
./DkHelloScript/dk StdStd_V2_3.Run DkHelloScript_Std.Y33Article --serve

Example 3. A production webhook microservice as a set of scripts:

git clone --branch V2_3 https://gitlab.com/diskuv/samples/devops/DkSubscribeWebhook.git
./DkSubscribeWebhook/dk StdStd_V2_3.Run DkSubscribeWebhook_Std.Subscriptions subscriptions-serve --help

Installing

In Windows PowerShell, macOS and desktop Linux:

git clone https://github.com/diskuv/dk.git
dk/dk user.dkml.wrapper.upgrade HERE
./dk dkml.wrapper.upgrade DONE

In Windows Command Prompt:

git clone https://github.com/diskuv/dk.git
dk\dk user.dkml.wrapper.upgrade HERE
.\dk dkml.wrapper.upgrade DONE

Known Issues

The dk executable on Windows requires Visual C++ redistributables. They are typically already present on PCs, except brand-new PCs. You may need to download and install the Visual C++ redistributables from Microsoft.

Quiet Mode

Any command that ends in Quiet, like ./dk RunQuiet, will not print messages while dk initializes itself. However, if sudo is required for elevation, then commands will be echoed to the terminal.

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:

Versions
2.3.202505282324
Website