Dash

Write clean code, synthesize native executables.

Programming the Amiga in C has its charm… until you've spent half an hour wrestling with pointers, Intuition structures and casts. Dash is the other way: a language that reads like Ruby or Python and turns into a real 68k executable. No interpreter, no virtual machine: native code, the way it should be.

From your lines to a 68k executable

Three real programs, step by step: first what you write, then an excerpt of the C that Dash writes for you and, finally, what shows up on the Amiga. And look how little they take.

  1. Dash
  2. C
  3. m68k-amigaos-gcc
  4. Amiga
hola.dash What you write
Window MiVentana
  title "Hola Dash"
  width 400
  height 150
end

Main
  MiVentana.open
  EventLoop
    On Close
      Print "Adiós!"
      Stop
    end
  end
end
hola.c The C that Dash generates
// User Code
win_MiVentana = OpenWindowTags(NULL,
    WA_Left, 50, WA_Top, 50,
    WA_Width, 400, WA_Height, 150,
    WA_Title, (ULONG)"Hola Dash",
    WA_CloseGadget, TRUE,
    WA_DragBar, TRUE,
    WA_DepthGadget, TRUE,
    WA_SizeGadget, FALSE,
    WA_Borderless, FALSE,
    WA_Activate, TRUE,
    WA_MinWidth, 40, WA_MinHeight, 20,
    WA_MaxWidth, (ULONG)~0, WA_MaxHeight, (ULONG)~0,
    WA_GimmeZeroZero, TRUE,
    WA_IDCMP, IDCMP_CLOSEWINDOW,
    _dash_screen ? WA_CustomScreen : TAG_IGNORE, (ULONG)_dash_screen,
    TAG_DONE);

if (!win_MiVentana) _dash_exit(20);
_dash_win = win_MiVentana;
_dash_rp = win_MiVentana->RPort;
{
BOOL running = TRUE;
struct IntuiMessage *msg;
ULONG msg_class;
UWORD msg_code;
ULONG _dash_tmev = _dash_tmp_mark();

while (running) {
    _dash_tmp_release(_dash_tmev);  /* temporaries of the previous messages */
    WaitPort(win_MiVentana->UserPort);
    while (win_MiVentana && (msg = (struct IntuiMessage *)GetMsg(win_MiVentana->UserPort))) {
        msg_class = msg->Class;
        msg_code = msg->Code;
        (void)msg_code;
        ReplyMsg((struct Message *)msg);

        switch (msg_class) {
            case IDCMP_CLOSEWINDOW: {
Printf("Adi\363s!\n");
    running = FALSE;

                }
                break;
        }
    }
}
if (win_MiVentana) {
    if (_dash_win == win_MiVentana) _dash_win = NULL;
    _dash_before_close(win_MiVentana);
    CloseWindow(win_MiVentana);
    win_MiVentana = NULL;
}
_dash_tmp_release(_dash_tmev);
hola On the Amiga
A window with its event loop, in fifteen lines. The whole executable, runtime included, takes this much:

A window with its event loop, in fifteen lines. The whole executable, runtime included, takes this much:

5 KB executable

581 functions to get the most out of the Amiga

Windows, graphics, sound, networking and the whole system, without writing C or digging up which library each thing lived in:

Interface
Intuition, GadTools, ReAction and MUI 3.8 or 5, with a double-buffered drawing area. Use whichever you like.
Graphics
Copper, Blitter and BOBs, hardware and software sprites, double buffering, graphics cards (CyberGraphX and Picasso96) and IFF, PNG, JPEG or GIF images. What made the Amiga famous, at your fingertips.
Network
TCP, UDP and HTTPS with AmiSSL 5.1, resuming the TLS session. Your Amiga, talking to today's Internet.
The language
Type inference, structs with methods, lambdas, typed lists and dictionaries, Float and Fixed 16.16, modules. Memory looks after itself, by reference counting: no garbage collector stopping your program mid-animation.
When you need it
Need to get down to the metal? Put C right in your code (@native, @c) or link any library (@link).
581 builtins
  • MUI82
  • ReAction79
  • Tasks in another process58
  • Intuition46
  • Advanced graphics43
  • Input30
  • Graphics29
  • System26
  • Network (TCP)24
  • DOS24
  • RTG21
  • Audio21
  • GadTools19
  • Text18
  • Menus, buffers, TLS, fonts and more61

Write in VS Code, run on the Amiga

The “Dash for Amiga” extension highlights your code, flags errors as you type, completes, jumps to definitions and formats. It compiles and runs your program on FS-UAE or Amiberry, debugs with F5 (on a real Amiga too, over the network) and comes with a visual MUI window designer: you place the gadgets and the extension writes the code for you. No more guessing coordinates.

Install it from the .vsix file on its GitHub page (version 0.2.1).

The visual MUI window designer
The visual MUI window designer

Made with Dash

A language proves itself by building something big. These two programs made Dash grow: whatever they lacked was added to the language, and now you have it too.

What you need

On the Amiga
AmigaOS 3.0 or later; a 68000 is enough. For MUI and HTTPS, a 68020.
On your PC
Linux, macOS or WSL2, with Python 3.10, the Lark library and the m68k-amigaos-gcc cross compiler. You compile on your PC and the Amiga gets a ready-to-run executable.