Short: AmigaBasic Compiler Enhanced (ACE) Author: Manfred Bergmann Uploader: manfred bergmann me com Type: dev/basic Version: 3.0.0 Replaces: ace-basic Requires: OS2.0+ Architecture: m68k-amigaos >= 2.0 Distribution: Aminet URL: https://github.com/mdbergmann/ACEBasic CHANGELOG ========= v3.0.0 (2026-03-02) ------------------- New Features: - IEEE 754 Floats: Migrated from Motorola FFP to IEEE 754 single-precision floating-point format throughout compiler and runtime. All float literals, constants, and runtime operations now use IEEE single-precision. - VBCC Toolchain: Switched ACE compiler build from GCC to VBCC cross-compiler. Runtime libraries rebuilt with VBCC. - Object System (#97): CLASS, METHOD, EXTENDS, and GENERIC keywords for object-oriented programming. Single inheritance with runtime type dispatch via parent chain walk. Polymorphic method dispatch across multiple type combinations. TRON/TROFF trace support for METHOD definitions. - TYPECASE (#102): Type-based pattern matching (TYPECASE/CASE/END TYPECASE) with ISA inheritance semantics and variable narrowing, enabling runtime class dispatch where subclass members become accessible within each matched case block. - ATOM Primitive Type (#93): Lightweight symbolic constant type for pattern matching and tagging. Literal syntax: #:name. - TASKPROC Keyword (#114): SUB modifier for Exec Task entry points. Auto-saves/restores registers and calls Wait(0) before return. Zero-parameter SUBs only; cannot be called from ACE code directly. - Struct SUB Parameters (#95): Struct type names as SUB parameter types (e.g. SUB Foo(MyStruct s)), auto-generating pointer setup and eliminating manual DECLARE STRUCT boilerplate. - EXIT WHILE / EXIT REPEAT (#82): New statements to break out of WHILE...WEND and REPEAT...UNTIL loops early, analogous to EXIT FOR. - FREE Statement (#83): Per-block memory deallocation. FREE releases memory allocated by ALLOC for a specific block, complementing the existing CLEAR ALLOC which frees all allocations. - SUB Tracing (#85): New -t compiler flag and TRON/TROFF runtime commands for tracing SUB/FUNCTION entry and exit. OPTION t+/t- for per-file control of tracing. - CyberGfx Screen Support (#86): SCREEN mode 13 now also supports CyberGraphX retargetable graphics (in addition to Picasso96). - Bounded String Operations: Runtime _strncpy/_strncat preventing buffer overflows. Compiler emits destination buffer size for string variable, array, struct member assignments, and LINE INPUT#. - IFF Picture Submodule (#84): IFF ILBM picture support extracted from compiler/runtime into a standalone submodule. New Submodules: - iff.b: IFF ILBM picture loading (extracted from built-in commands). - fad.b (#101): Files And Directories ? 20+ SUBs for file system operations (existence checks, metadata, path manipulation, directory iteration). - hashmap.b (#107): CLASS-based string-keyed hashmap with open addressing, typed value storage, and iteration. - dynarray.b (#111): Growable type-tagged indexed collection with iteration, builder, search, higher-order functions, and sort. - json.b (#113): Complete JSON parser, generator, and pretty-printer using hashmap and dynarray as intermediate representation. - taskutil.b (#114): Exec Task utilities ? TaskLaunch, TaskGetData, TaskTerminate. - testkit.b (#108): Shared test assertion library (TkAssertTrue, TkAssertEq, TkAssertEqStr, etc.) eliminating duplicated test boilerplate across submodules. Changes: - Replace ami.lib with amiga.lib (#90, #87): Replaced the custom ami.lib with the standard amiga.lib plus custom ace_clib.s and ieee_math.s modules for better compatibility. - Runtime Library Optimizations (#62): Lookup tables, O(1) argument access, and dynamic allocation improvements in runtime libraries. - Submod Test Runner (#91): Unified submod test runner (runner.rexx) replacing per-submod test scripts. - parseUsing Rewritten in ACE BASIC: Replaced ARexx parseUsing.rexx with compiled ACE BASIC utility. - AIDE Removed from Distribution: Still available on Aminet. - Eliminated ~170 Runtime Library Build Warnings (#61). - Updated vasm to 2.0e. Bug Fixes: - Fix PRINT Crash for SINGLE Values: Fixed crash caused by K&R float parameter promotion when printing single-precision values. ------------------------------------------------------------------------------ v2.9.0 (2026-02-16) ------------------- New Features: - Struct Enhancements (#81): - Typed array members: any base type can now use SIZE n, not just STRING. Access elements with s->arr(i). - Nested struct access: chain the -> operator through embedded structs (e.g. outer->inner->field). - Typed struct pointers: members can point to a specific struct type, enabling -> chaining through pointers as well. - Self-referential structs: a struct can contain a pointer to its own type (e.g. for linked lists). - Struct arrays as members: embed a fixed-size array of structs inside another struct, accessed via s->items(i)->field. - New String Functions (#73): TRIM$/LTRIM$/RTRIM$, STARTSWITH/ENDSWITH, RINSTR, REPLACE$/REVERSE$/REPEAT$, LPAD$/RPAD$, FMT$ (sprintf-style formatting with up to 8 args), and MID$ statement form for in-place modification. - P96/RTG Screen Support: SCREEN mode 13 for Picasso96 retargetable graphics with 8/15/16/24/32-bit depths. COLOR r,g,b for direct RGB drawing on HiColor/TrueColor screens. - Tail-Call Optimization (#67): Self-recursive SUBs with numeric params are automatically optimized to jumps, eliminating stack growth. - Buffered File I/O (#63): fgetline/fgets/fgetchars now use bulk Read+Seek instead of per-char fgetc. ~12x throughput improvement. - HTTP Client Submodule (#71): Full HTTP/HTTPS client with TCP transport, chunked transfer encoding, streaming, and AmiSSL support. Stateless struct-based API. Extracted into tcpclient, amissl, and httpclient submodules. - DP-Float Submodule: Double-precision math via mathieeedoubbas/trans libraries. 32 functions: arithmetic, trig, hyperbolic, exp/log, string conversion. (by David Benn, reviewed and converted to submod). - SNI Support for AmiSSL: Server Name Indication support in amissl submodule, fixing HTTPS connections to virtual-hosted servers. New Submodules: - httpclient.b / tcpclient.b / amissl.b: HTTP/HTTPS networking stack. - dp-float.b: Double-precision floating-point math. - sagasound.b: Vampire SAGA 16-bit audio (16 channels, up to 56 kHz). - turtle.b: Turtle graphics (moved from built-in commands to submodule). Changes: - Turtle Graphics Moved to Submodule (#72): 13 built-in turtle commands removed from compiler/runtime, replaced by external turtle.b submod. - CubicIDE Plugin: Use regedit for proper preset/filetype registration instead of manual file copying (install.bat by Josef Wegner). Updated autocase, syntax dictionaries, and quickinfo to cover all keywords and functions from quickref.txt. - Codegen Abstraction: Extracted gen_ffp_call, gen_bool_test, gen_stack_cleanup helpers. Enhanced peephole optimizer. Bug Fixes: - Fix #79: Single-line IF THEN now handles SUB/FUNCTION calls correctly (previously misidentified as undimensioned arrays). - Fix #76: CONST SINGLE now generates correct FFP literals (was corrupting bit patterns via implicit int-to-float conversion). ------------------------------------------------------------------------------ v2.8.0 (2026-02-09) ------------------- New Features: - INVOKABLE Keyword: New SUB modifier for closures used as callbacks. SUBs declared with INVOKABLE can be passed via BIND and correctly invoked through function pointers with runtime CLSR detection in both expression and statement contexts. - YAP Preprocessor: New BASIC preprocessor (Yet Another Preprocessor) replacing the legacy APP. Supports #define/#undef macros, #ifdef/ #ifndef/#else/#endif conditionals, #include "file" and #include with nested includes (up to 8 levels), include-once tracking, -D/-U CLI options, and -I include path. Written in ACE BASIC. - List Submodule: Lisp-style linked list library (submods/list/) with typed cons cells supporting INTEGER, SINGLE, STRING, and ADDRESS values. Lists are effectively immutable when only non-destructive functions are used. Includes higher-order functions (LMap, LFilter, LReduce, LForEach) using closures/INVOKABLE. Comprehensive test suite with 190+ assertions. - REM #using Directive (#47): Source files can now declare object file dependencies with REM #using . The bas script automatically parses these and links the specified object files. - Installer (#32): AmigaDOS Installer script (Install-ACE) for end-user installation with Cubic icons. New Submodules: - list.b: Lisp-style linked list with higher-order function support. Changes: - 68000 Runtime Libraries: Separate runtime libraries (db.lib, startup.lib) for 68000 targets, alongside the default 68020 builds. - Removed Legacy APP Preprocessor: The old C-based APP preprocessor source has been removed in favor of YAP. - Deprecated ACPP and NAP: The C-comment preprocessor (ACPP) and NAP preprocessor are deprecated. YAP supersedes both (influenced by NAP's design) and provides a unified preprocessing solution. - CubicIDE Integration: Added CubicIDE ACE plugin and IDE folder. Bug Fixes: - Fix Assembler Label Suffixes (#44): Type qualifier characters (%, &, !, #, $) in SUB/FUNCTION names are now mapped to portable assembler-safe suffixes (_IS, _IL, _FS, _FD, _ST) for vasm compatibility. - Fix INVOKE in Statement Context: INVOKE with runtime CLSR detection now works correctly in statement context (previously only worked in expression context). - Fix REM #using with No Directives (#47): The bas script no longer errors when source files contain no REM #using directives. Compiler Internals: - Major refactoring (#55): Extracted codegen.c module with reusable code generation helpers (gen_rt_call, gen_frame_addr, gen_push, gen_pop, gen_lib_call, gen_var_addr, etc.). Broke up large functions (statement, factor, compile, insymbol, for_statement) into focused handlers. Extracted invoke.c for SUB/FUNCTION call handling. Total reduction of ~1500 lines of duplicated code. Testing: - 60 new test cases across 10 categories (strings, math, logic, fileio, memory, control, syntax, subs, arithmetic, errors). - Recursion test suite (7 tests). - YAP preprocessor test suite (11 tests covering all features). Documentation: - Internal calling conventions document (AmigaGuide). - INVOKABLE keyword documented in ref.txt and ace.txt. - List submodule README and API documentation. ------------------------------------------------------------------------------ v2.7.1 (2026-02-03) ------------------- New Features: - ELSEIF Keyword: Block IF statements now support ELSEIF for cleaner multi-branch conditionals. Syntax: IF condition THEN ... ELSEIF condition THEN ... ELSE ... END IF - LCASE$ Function (#33): New string function that returns the lowercase version of a string. Syntax: result$ = LCASE$(string$) Changes: - MUI Module Improvements: Added HorizSpacing/VertSpacing attributes and fixed boolean handling in MUI submodule. - MUI Constants Fix: Corrected MUI constants to match official mui.h header values. Bug Fixes: - Fix DATA Statement FFP Conversion (#40): Fixed regression where DATA statements with floating-point values were not correctly converted to FFP format. - Fix doublebuffer.h (#39): Corrected issues in the double buffering include file. Testing: - Refactored test-suite to use ASSERT (#38) for cleaner test verification. ------------------------------------------------------------------------------ v2.7 (2026-02-01) ----------------- New Features: - Closures and Function Pointers (#14): Support for first-class function references. Use @ operator to get a SUB address (@SubName), BIND to create closures with pre-bound arguments (BIND(@SubName, arg1, ...)), and INVOKE to call through a function pointer or closure (INVOKE ptr&(args)). BIND behaves a little bit like the Curry pattern in functional programming. See docs/ref.guide for more details. - Callback SUB (#28): New CALLBACK modifier for SUBs that can be invoked via the AmigaOS CallHookPtr() function. Syntax: SUB name(ADDRESS, ADDRESS, ADDRESS) CALLBACK Use @ to get the address for a Hook's h_Entry field (@MyCallback). - MUI Submodule (#23): MUI (Magic User Interface) support via the MUI.b submodule. Provides high-level BASIC wrappers for creating modern Amiga GUIs with windows, buttons, lists, menus, tabs, and more. Documentation: docs/MUI-Submod.guide. Includes 7 example programs, including a FileViewer example that uses a custom class. Note: This is a beta release - usable but more features will come. Report bugs or feature requests on GitHub. - Filled Circle/Ellipse (#15): CIRCLE command now supports trailing F flag for drawing filled circles and ellipses. Syntax: CIRCLE [STEP] (x,y),radius[,color[,start,end[,aspect[,F]]]] Fill uses AreaEllipse() and respects active PATTERN. - GADGET SETATTR Expressions (#20): GADGET SETATTR now accepts variables and expressions for tag values, not just constants. Enables dynamic gadget updates based on runtime values. - Graphics Double Buffering: New include file and example for double-buffered graphics programming. See examples/gfx/dbuf_demo.b. Changes: - 68020 Code Generation Default (#24): The compiler now generates 68020 native instructions by default. Use OPTION 2- in source to disable 68020 code generation for 68000 compatibility. - Module Command Uses vasm: The module compilation command now uses vasm assembler instead of the legacy assembler. - Enhanced bas script. It now accepts a list of submods for linking. And is overall a bit smarter. Bug Fixes: - Fix Library Closing (#25): Fixed issue with LIBRARY CLOSE not properly closing opened Amiga shared libraries. - Fix EXTERNAL Module Bugs (#29): Fixed bugs with uninitialized A4 register when using EXTERNAL modules, which caused crashes and incorrect behavior with shared variables and arrays. - Fixed Typos (#18, #26): Corrected various typos in source and documentation. Testing: - New test categories: closures, callback - Added SUB tests with SHARED variable access ------------------------------------------------------------------------------ v2.6 (2026-01-26) ----------------- New Features: - GadTools Gadget Integration: Full support for GadTools-based gadgets with modern Amiga look and feel. New syntax: GADGET id, status, label$, (x1,y1)-(x2,y2), kind [, TAG=value ...] - Gadget Kinds: Support for BUTTON, CHECKBOX, INTEGER, STRING, LISTVIEW, MX (mutual exclude), CYCLE, PALETTE, SCROLLER, SLIDER, TEXT, and NUMBER gadgets. - GADGET FONT: New syntax to set font for GadTools gadgets: GADGET FONT name$, size - GADGET SETATTR/GETATTR: Runtime modification and querying of gadget attributes via tags. - ASSERT statement: Runtime assertion checking for defensive programming. Syntax: ASSERT expression [, "message"] Prints "ASSERT FAILED: " and exits on failure; passes through silently when the condition is true. Implemented as an assembly-level runtime library function (assert.s in db.lib). - 68020 native code generation: When compiling with the -2 flag or OPTION 2+ in source, the compiler emits native 68020 instructions (muls.l, divs.l, divsl.l) for long multiply, divide, and modulo instead of calling library routines (lmul, ace_ldiv, ace_lrem). Emits "machine 68020" assembler directive for vasm. Documentation: - txt2guide.rb: Ruby script to auto-generate AmigaGuide documentation from text sources (ref.txt, ace.txt). Testing: - GadTools test suite: New 'gtgadgets' test category for GadTools gadgets. - Legacy gadgets tests: Separate 'legacygadgets' category for original BOOPSI gadgets. - Assert test suite: New 'assert' test category with ok and fail cases. - 68020 arithmetic test: opt020 test case validating native 68020 code generation for multiply, divide, and modulo operations. ------------------------------------------------------------------------------ v2.5 (2026-01-22) ----------------- New Features: - AGA Screen Support (modes 7-12): Full support for AGA chipset screens with up to 256 colors (8-bit depth). Toolchain Changes: - vasm/vlink replaces legacy assembler/linker: Uses vasm and vlink as the standard toolchain instead of a68k/blink. Bug Fixes: - FFP/vbcc floating-point compatibility fix: Fixed FFP handling in runtime library (sleep_for_secs and float routines) for vbcc compatibility. Build System: - GNU Makefile build system: New Makefile-ace and Makefile-lib in src/make/ replacing legacy AmigaDOS build scripts. - Rebuilt runtime libraries: Fresh db.lib and startup.lib compiled with the new toolchain. Project Housekeeping: - Directory restructured: prgs/ renamed to examples/, build scripts moved to src/make/, test infrastructure organized under verify/. - Test suite added: 35 test cases covering syntax, arithmetic, floats, and control flow, run via ARexx runner on emulated Amiga. - Documentation consolidated: Single README.md, .doc files renamed to .txt.