Skip to content

AhdCode v2.0.0 — Desktop Application Completion

Choose a tag to compare

@aliharundaldalli aliharundaldalli released this 19 Sep 23:12

AhdCode v2.0.0 — Desktop Application Completion — completes AhdCode's
first-party desktop application foundation: the GUI gains the ordinary
controls of a small data application, the Plot viewer gains a toolbar and 3D
surfaces, and ahdcode package turns a program into a desktop application
that runs without AhdCode installed. The core grammar, the static type
system, and every previously released function keep their v1.9.0 behaviour.

GUI

  • New widgets: ListBox, Select (drop-down), TextArea (multi-line,
    scrolling), PasswordInput (masked), and TableView — a read-oriented
    table with a header, row selection, horizontal and vertical scrolling, and
    fast drawing of tens of thousands of rows.
  • onChange for TextInput, PasswordInput, TextArea, and Checkbox;
    onChange(index: Int?, text: String?) for Select and ListBox and
    onSelect(row: Int?) for TableView. Only the user's actions call them;
    select, setItems, setRows, and setText never do.
  • window.setResizable(true): tables, lists, and text areas take a larger
    window's extra space; nothing else stretches.
  • Dialogs: GUI.openFile, openFiles, selectFolder, saveFile,
    message, and confirm — the system's own dialogs on macOS and Windows.
    A cancelled dialog returns null (an empty List for openFiles), never an
    error, and a dialog never reads or creates a file.
  • Tab and Shift+Tab visit every enabled control; every new widget has colors
    and an enabled state.

With v2.0, AhdCode's first-party GUI covers the ordinary controls needed for
small forms, data-entry tools, database front ends, and file-oriented desktop
utilities. There is still no tree view, menu, rich text, web view, theme
engine, custom-widget system, or async/thread API: these are intentional
boundaries, and callbacks still run one at a time.

Plot

  • The viewer shows a toolbar: Save (PNG, SVG, PDF), Zoom Out,
    Zoom In, Rotate Left, Rotate Right, and Fit. Save runs the
    renderer on the chart's own definition, so the file is byte for byte what
    save() writes, whatever the view.
  • Plot.surface(x, y, z: Matrix) draws a 3D surface: an immutable
    Surface with title, xLabel, yLabel, zLabel, size, wireframe,
    save (PNG only, deterministic), and show, which opens the viewer in 3D
    with orbit, pan, zoom, and reset. It is small scientific plotting, not a 3D
    engine.

Application packaging

ahdcode package app.ahd --name Ledger --icon ledger.png makes a macOS
.app, or a Windows or Linux folder and archive, holding the compiled
program and only the helpers it uses. The application finds its helpers only
inside itself — never an AhdCode installation, PATH, or environment
overrides — and shows its own name and icon. Nothing from the project folder
is copied, and a leak check guards every package. macOS applications are
signed ad hoc, not with a Developer ID; see the packaging guide for
Gatekeeper.

Language and tooling

  • No grammar, type-system, or coercion change; no Any, dynamic typing, or
    reflection. Compiled programs, ahdcode run, and the REPL share one
    implementation.
  • Editors now complete, hover, and show signatures for every Chart, Figure,
    and Surface member and every new GUI member, from the compiler's own
    metadata (the Chart and Figure gap of v1.8 and v1.9 is fixed).
  • No new third-party dependency.
  • The macOS Dock icon of AhdCode's windows has the rounded macOS shape.

Examples and documentation

examples/v2.0 holds ledger_app (a SQLite ledger with a TableView,
dialogs, and CSV export), surface_plot, and package_hello. New: the
Packaging guide. Updated: the GUI, Plot, and CLI references, language
specification sections 87–90, and student guide section 67, in English and
Turkish.

Compatibility

A v1.9.0 program compiles and behaves the same. The GUI helper protocol is
version 3, so a v2.0 program needs the v2.0 helpers, which the packages
include.

Known issue found after release

In a program that uses Plot but not GUI, the viewer's Save reports
"Save needs AhdCode's GUI helper (ahdgui), which is not installed": the
compiler recorded the helper's location only for programs that open a window
of their own, so the viewer had no path to the save dialog. It affects 2D
charts and 3D surfaces, under ahdcode run and for a built program outside
the installation. chart.save(path), surface.save(path) and packaged
applications are not affected, and the artifacts below are unchanged.

Until the next release, name the helper when you run the program:

AHDCODE_GUI_RUNTIME=~/Library/AhdCode/current/libexec/ahdcode/ahdgui ahdcode run chart.ahd

The fix is on main (Fix Plot viewer Save runtime discovery) and ships in
the next release.

Known limitations

  • Window.onKey also receives keys typed into a focused text field.
  • A long callback blocks its window.
  • On Linux the dialogs are drawn by AhdCode itself, and the file dialog
    chooses one file at a time, also for openFiles.
  • A packaged macOS application is not notarized; another Mac asks the user
    to allow it once.

Downloads

File Platform
AhdCode-2.0.0-macos-arm64.pkg macOS Apple Silicon — recommended installer
AhdCode-2.0.0-macos-arm64.dmg macOS Apple Silicon — drag-install image
AhdCode-2.0.0-macos-arm64.zip macOS Apple Silicon — archive with install.sh
AhdCode-2.0.0-windows-x64.exe Windows x64 — graphical per-user setup
AhdCode-2.0.0-linux-x64.tar.gz Linux x64
ahdcode-0.2.3.vsix VS Code extension (own version line, unchanged)

The macOS .pkg and .dmg are signed with Developer ID certificates,
notarized by Apple, and stapled. The Windows installer is not Authenticode
code-signed; SmartScreen may show an unknown-publisher warning.

Platform QA

  • macOS (Apple Silicon): live-tested — GUI windows with every new widget,
    a 10,000-row TableView, resizing, dialogs, the Plot toolbar and Save, 3D
    Surface orbit/pan/zoom/reset, and packaged applications launched from the
    Finder and the Terminal outside the repository; the same checks run
    headless under ahdcode run and as native programs with identical output.
  • Linux x64 and Windows x64: compiled and package-tested only
    (structure, executable format, and, for Windows, the application icon
    resource); not run on a Linux or Windows machine for this release.

SHA256SUMS.txt lists the checksum of every artifact.