Skip to content

AhdCode v1.9.0

Choose a tag to compare

@aliharundaldalli aliharundaldalli released this 19 Sep 15:13
· 16 commits to main since this release

AhdCode v1.9.0 — Desktop Polish + Interactive Plot — makes Plot.show
an interactive first-party preview, adds basic colors and an enabled state to
the GUI, and gives AhdCode's own windows the AhdCode name and icon. The core
grammar, the static type system, and every previously released function keep
their v1.8.0 behaviour.

Interactive Plot viewer

chart.show() and figure.show() now open AhdCode's own viewer, AhdCode
Plot
, instead of the operating system's image viewer:

Control Action
Mouse wheel or trackpad scroll Zoom around the pointer
Drag with the left button Pan
Q / E Turn the view a quarter turn left / right
R Reset: no turn, whole chart fitted, centered
Escape Close
  • These interactions change only the viewer; they do not change the Chart or
    Figure, their data, or exported PNG, SVG, or PDF files. chart.save(...)
    after show() writes exactly the same bytes as without it.
  • Zoom ranges from a quarter of the fitted size to 1600%; a zoomed chart
    always covers the window, so it cannot be lost, and R brings it back.
    Turns are quarter turns only.
  • show() returns as soon as the viewer is open; each call opens its own
    viewer, which stays open until closed, even after the program ends.
  • The preview PNG is read and deleted at once: no temporary files pile up.
  • A missing viewer, no display, or a chart larger than 6144 units on a side
    raises PlotError. AhdCode never falls back to another application.
  • The viewer is the new bundled ahdplotview helper; charts are still
    rendered by ahdplot, and save() is unchanged.

GUI colors and enabled state

  • window.setBackground(color) and container.setBackground(color);
    setForeground(color) and setBackground(color) on a Label, Button,
    TextInput, and Checkbox.
  • Colors use the Graphics spellings: nine lower-case names, #RRGGBB, or
    #RRGGBBAA (blended over what is beneath; windows are never transparent).
    Anything else raises GUIError. Without colors a window looks as in v1.8.
  • setEnabled(enabled) and isEnabled() on a Button, TextInput, and
    Checkbox. A disabled widget ignores clicks, Enter/Space, and typing, is
    skipped by Tab, and is drawn faded; the program can still change it.
  • Text is now measured for every display scale, so a Label's or Button's
    last letter is no longer clipped on high-density displays (some widgets are
    a few points wider than in v1.8).

AhdCode GUI remains a deliberately small toolkit for forms, utilities, and
educational desktop applications: there are still no tables, list boxes,
drop-downs, menus, dialogs, file pickers, themes, or fonts.

AhdCode window identity

GUI, Graphics, and Plot viewer windows show the AhdCode name and the official
AhdCode icon: on macOS AhdCode in the menu bar (instead of ahdgui or
ahdgraphics) and the AhdCode icon in the Dock; on Windows and Linux the
window icon where the system shows one. This names AhdCode's own windows
only; it does not package user programs as applications.

Language and tooling

  • No grammar, type-system, or coercion change, and no Any, dynamic typing,
    or reflection. New members follow the all-positional-or-all-named rule.
  • Compiled programs, ahdcode run, and the REPL share one implementation;
    show() opens the same viewer everywhere.
  • Editors complete, hover, and show signatures for every new member.
  • No new third-party dependency: the viewer uses exactly the GUI helper's
    pinned Ebitengine v2.10.2 and Go libraries.

Examples and documentation

examples/v1.9 holds gui_colors (an order form with colors and a Save
button that is enabled only when the form is complete) and
interactive_plot (a line and scatter chart shown in the viewer and then
saved). The GUI and Plot references, language specification sections 85 and
86, and student guide section 66 are updated in English and Turkish.

Compatibility

A v1.8.0 program compiles and behaves the same, except that show() opens
AhdCode's viewer instead of the system image viewer and some GUI widgets are
a few points wider because their text is no longer clipped.

Known limitations

  • The macOS menu-bar name is set at run time through a LaunchServices
    function that Apple does not document; if a future macOS removes it, the
    helper's file name is shown instead.
  • Window.onKey also receives keys typed into a focused TextInput.
  • GUI windows cannot be resized, and a long callback blocks its window.

Downloads

File Platform
AhdCode-1.9.0-macos-arm64.pkg macOS Apple Silicon — recommended installer
AhdCode-1.9.0-macos-arm64.dmg macOS Apple Silicon — drag-install image
AhdCode-1.9.0-macos-arm64.zip macOS Apple Silicon — archive with install.sh
AhdCode-1.9.0-windows-x64.exe Windows x64 — graphical per-user setup
AhdCode-1.9.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 from the release package in an
    isolated prefix: real GUI windows with colors, a disabled and re-enabled
    Save button, and Tab skipping disabled widgets; the interactive viewer with
    real scrolling, dragging, Q/E turns, R reset, and Escape, for a Chart and a
    3x2 Figure, including several viewers at once; the Turtle example with real
    arrow keys and clicks; and the AhdCode name in the menu bar and the AhdCode
    icon in the Dock for all three. The same checks ran offline and headless
    under ahdcode run and as relocated native programs with identical output,
    and save() after show() was byte-identical to save() before it.
  • Linux x64: structural and package checks only; the artifact, its GUI,
    and its viewer were not run on a Linux machine for this release.
  • Windows x64: structural and package checks only, including the setup's
    embedded payload test; the artifact, its GUI, and its viewer were not run
    on a Windows machine for this release.

SHA256SUMS.txt lists the checksum of every artifact.