AminetAminet
Search:
83905 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/basic/aqb-0.8.1.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:BASIC Compiler+IDE for Amiga Computers
Author:guenter.bartsch at gmail.com (Guenter Bartsch)
Uploader:guenter bartsch gmail com (Guenter Bartsch)
Type:dev/basic
Version:0.8.1
Replaces:dev/basic/aqb-0.8.0.lha
Architecture:m68k-amigaos >= 2.0.4
Date:2021-12-27
Download:http://aminet.net/dev/basic/aqb-0.8.1.lha - View contents
Readme:http://aminet.net/dev/basic/aqb-0.8.1.readme
Downloads:627

== AQB: A BASIC Compiler and IDE for Amiga Computers

=== Project Scope

An experiment in alternate history: what AmigaBASIC could have looked like,
had it been developed further tailored to the Amiga OS.

What AQB is not: AQB does not try to be a clone of any particular BASIC
dialect - neither QuickBASIC, FreeBASIC or VisualBASIC nor any particular Amiga
specific BASIC implementation like AmigaBASIC, ACE, HiSoft, GFA, Blitz or AMOS.
While it strives to be as compatible as possible with the Microsoft BASIC
family of languages (and certainly has many QuickBASIC traits) the primary
focus is on the creation of a modern, clean, Amiga OS-compliant, future-proof
BASIC that is tailored towards modern Amiga application development.

To be more specific, FreeBASIC is the source of many core AQB language
constructs (in many respects AQB can be considered a subset of FreeBASIC) with
inspiration for Amiga specific commands mainly from AmigaBASIC, ACE and HiSoft.
Main target is Amiga OS compliant application development.

Improvements over AmigaBASIC include:

* Advanced type system (including UDTs and Pointers, see below)
* Support for non-static functions and subs (enables recursion)
* Module support (similar to UNITs in TurboPascal, with full type safety and
  dependencies) * Modern syntax inspired by FreeBASIC and VisualBASIC
* True native 68k compiler
* Integrated IDE besides compiler command line interface with
    * syntax highlighting
    * auto-indent
    * folding support
    * source level debugging

=== Requirements

* 3 MB RAM
* OS 2.0 (V36) or newer

=== Installation

Right now no installation is required. Just download a release LHA archive
(https://github.com/gooofy/aqb/releases) and unpack it wherever you like, but
keep the directory structure intact.

=== Latest Changes (0.8.1):

Improvements:

    * runtime: SPRITE() function added
    * runtime: SPRITE SHOW command added
    * runtime: SPRITE MOVE command added
    * runtime: SPRITE FREE command added
    * runtime: ILBM LOAD SPRITE command added
    * runtime: POINTER SPRITE command added
    * runtime: POINTER CLEAR command added
    * runtime: FONT and FONT FREE commands added
    * runtime: FONT() function added
    * runtime: TEXTWIDTH() function added
    * runtime: FONSTYLE command added
    * runtime: FONSTYLE() function added
    * runtime: ON BREAK CALL command added
    * runtime: BOB() function x/y offset arguments added
    * ide: editor will use the system text font now
    * ide: editor horizontal scrolling implemented

Bug Fixes:

    * ide: editor RTG high/true color rendering fixed
    * ide: write INI file on deinit only (seems to help with AmigaOS 3.2 68000
stability)
    * ide: disable unavailable/unimplemented menu items
    * help: fix function node refs in amigaguide help

=== Type System

==== Basic types:
* Byte, UByte (8 bits)
* Integer, UInteger (16 bits)
* Long, ULong (32 bits)
* Single (32 Bit FFP floats)

==== Advanced types

* Static (C-like, fast) and dynamic (runtime bounds checking) arrays
* UDTs (structs)
* OOP (FreeBASIC like)
* Pointers (C-like, including function/sub pointers)
* Strings (0-terminated pointers to UByte, C-compatible)

=== Module System and Runtime

AQB tries to keep the set of commands that are built into the compiler to a
minimum and relies on its quite powerful module system to provide most of the
commands as part of the runtime system. This means that while the default
runtime strives to implement a modern QuickBASIC like dialect tailored to the
Amiga, it is quite possible to implement alternative runtime modules that could
provide AQB with a different "personality", e.g. one that is closer to
AmigaBASIC or GFA BASIC or even languages like BlitzBasic ot AMOS.

The goal for AQB's default runtime is to provide a rich set of commands
covering typical Amiga OS programming topics like GUI programming,
multitasking, graphics and audio combined with resource tracking and
error/exception handling. Future plans might also include an automated garbage
collector to make memory allocation easier and safer.

AQB is fully link-compatible with the Amiga 68k GCC compiler which means that
AQB modules can be implemented in C as well as BASIC (one could even
mix these languages within one module, i.e. implement some subprograms in
C while others in BASIC).

==== Intuition / Exec event handling

Since the default runtime wants to enable OS friendly programming no busy
waiting is used. Therefore the SLEEP command is used to process pending events,
i.e. you will need to call SLEEP regularly in your program, typically form a
main loop that could look like this:

    WHILE running
        SLEEP
    WEND

For event processing you register subroutines using the ON ... CALL <function>
family of statements, e.g.

    ON WINDOW CALL myWindowHandler

see https://github.com/gooofy/aqb/blob/master/examples/demo/gfx1.bas for a
simple example of this approach.

Interesting detail: since AQB supports C-like function pointers, the ON ...
CALL family of statements is not built into the compiler but part of the _aqb
runtime:

    PUBLIC DECLARE SUB ON WINDOW CALL (BYVAL p AS SUB)

=== Code Generation and Target Systems

At the time of this writing classic 68k Amiga systems is the only compiler
target. The idea is to focus on one target and try to make AQB work really well
on this platform before expanding to other systems. The AQB compiler is
implemented from scratch in C based on Appel's 1997 book "Modern Compiler
Implementation in C" and tries to keep system requirements (RAM and CPU) low
while still producing somewhat sensible machine code. Originally the AQB code
was based on ComMouses's tiger compiler implementation
(https://github.com/ComMouse/tiger-compiler) which provided a very useful
starting point.

For future expansions to other platforms the current plan is to use an LLVM
based backend for all platforms powerful enough to run LLVM which is probably
true for most NG Amiga systems (AROS, AmigaOS 4 and MorphOS) and most likely
also for highly expanded classic Amiga systems (using accelerator cards
such as PiStom or Vampire).

As for the 68k compiler future plans include further reduction of its memory
footprint ideally to a point where it is useful on 1MB or even 512K Amiga
systems. At that point it might even make sense to implement a 6502 backend
targeting modern 8 bit systems like the MEGA65, Commander X16 or C256 Foenix.

=== Amiga OS System Programming in AQB

AQB datatypes are very similar to C (C-like strings, structs and pointers)
which makes usage of Amiga OS libraries and devices pretty seamless.

Data structures generally can be modeled 1:1 from their C counterparts, a
python script semi-automating the task of converting Amiga C library and device
headers to AQB is in the works. Here is a preview of what the resulting AQB
declarations typically look like:

    [...]

    TYPE ViewPort
        AS ViewPort PTR NextViewPort
        AS ColorMap PTR ColorMap
        AS CopList PTR DspIns, SprIns, ClrIns
        AS UCopList PTR UCopIns
        AS INTEGER DWidth, DHeight, DxOffset, DyOffset
        AS UINTEGER Modes
        AS UBYTE SpritePriorities, ExtendedModes
        AS RasInfo PTR RasInfo
    END TYPE

    TYPE Layer_Info
        AS Layer PTR top_layer, check_lp
        AS ClipRect PTR obs, FreeClipRects
        AS LONG PrivateReserve1, PrivateReserve2
        AS SignalSemaphore Lock
        AS MinList gs_Head
        AS INTEGER PrivateReserve3
        AS VOID PTR PrivateReserve4
        AS UINTEGER Flags
        AS BYTE fatten_count, LockLayersCount
        AS INTEGER PrivateReserve5
        AS VOID PTR BlankHook, LayerInfo_extra
    END TYPE

    EXTERN GfxBase AS VOID PTR

    DECLARE SUB Move (rp AS RastPort PTR, x AS INTEGER, y AS INTEGER) LIB -240
GfxBase (a1, d0, d1)
    DECLARE SUB RectFill (rp AS RastPort PTR, xmin AS INTEGER, ymin AS INTEGER,
xmax AS INTEGER, ymax AS INTEGER) LIB -306 GfxBase (a1, d0, d1, d2, d3)
    DECLARE SUB Draw (rp AS RastPort PTR, x AS INTEGER, y AS INTEGER) LIB -246
GfxBase (a1, d0, d1)
    DECLARE SUB SetAPen (rp AS RastPort PTR, pen AS INTEGER) LIB -342 GfxBase
(a1, d0)

    [...]

=== Benchmark Results

Measured on an A500 configuration (PAL 68000, 3MB RAM) in FS-UAE, Kickstart 1.3

|===
| Benchmark            | AmigaBasic    | GFA Basic 3.52 | BlitzBasic 2.15 |
HiSoft Basic 2 | AQB

| ctHLBench integer    | 33.94s        | 7.40s          | 6.96s           |
12.41s         | 1.66s
| ctHLBench real       | 23.90s        | 6.88s          | 4.99s           |
4.46s          | 3.12s
| fibonacci            | no recursion  | 54.60s         | guru            |
28.18          | 4.09s
|===

=== Source Code

https://github.com/gooofy/aqb



Contents of dev/basic/aqb-0.8.1.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/
-rw-rw-r--  1000/1000     2082    5765  36.1% -lh5- 4816 Dec 26 14:21 aqb/CHANGELOG
-rw-r--r--  1000/1000      331    1096  30.2% -lh5- 8778 Dec 26 14:21 aqb/CHANGELOG.info
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/Fonts/
drwxr-xr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/Fonts/aqb/
-rw-r--r--  1000/1000      983    2448  40.2% -lh5- 151c Dec 26 14:21 aqb/Fonts/aqb/6
-rw-r--r--  1000/1000     1414    2888  49.0% -lh5- 61b8 Dec 26 14:21 aqb/Fonts/aqb/8
-rw-r--r--  1000/1000       38     524   7.3% -lh5- a35b Dec 26 14:21 aqb/Fonts/aqb.font
drwxr-xr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/Fonts/future/
-rw-r--r--  1000/1000     1013    2608  38.8% -lh5- 4afe Dec 26 14:21 aqb/Fonts/future/11
-rw-r--r--  1000/1000     1205    3088  39.0% -lh5- 65e8 Dec 26 14:21 aqb/Fonts/future/15
-rw-r--r--  1000/1000     1673    4508  37.1% -lh5- 84c3 Dec 26 14:21 aqb/Fonts/future/22
-rw-r--r--  1000/1000     2258    7004  32.2% -lh5- 807d Dec 26 14:21 aqb/Fonts/future/30
-rw-r--r--  1000/1000       54    1044   5.2% -lh5- 8f07 Dec 26 14:21 aqb/Fonts/future.font
drwxr-xr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/Fonts/manilow1/
-rw-r--r--  1000/1000     2295    4380  52.4% -lh5- e569 Dec 26 14:21 aqb/Fonts/manilow1/26
-rw-r--r--  1000/1000     3602    8308  43.4% -lh5- 763e Dec 26 14:21 aqb/Fonts/manilow1/40
-rw-r--r--  1000/1000       44     524   8.4% -lh5- 15cb Dec 26 14:21 aqb/Fonts/manilow1.font
-rw-rw-r--  1000/1000     4550   11122  40.9% -lh5- caa1 Dec 26 14:21 aqb/README.guide
-rw-r--r--  1000/1000      333    1096  30.4% -lh5- 72b6 Dec 26 14:21 aqb/README.guide.info
-rwxrwxr-x  1000/1000   172290  373944  46.1% -lh5- 5ec7 Dec 26 14:21 aqb/aqb
-rw-r--r--  1000/1000      242     486  49.8% -lh5- b30d Dec 26 14:21 aqb/aqb.info
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/examples/
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/examples/bench/
-rw-rw-r--  1000/1000      232     391  59.3% -lh5- 0956 Dec 26 14:21 aqb/examples/bench/ctHLBenchInt.bas
-rw-r--r--  1000/1000      224     378  59.3% -lh5- 1f12 Dec 26 14:21 aqb/examples/bench/ctHLBenchInt.bas.info
-rw-rw-r--  1000/1000      230     368  62.5% -lh5- 3118 Dec 26 14:21 aqb/examples/bench/ctHLBenchReal.bas
-rw-r--r--  1000/1000      224     378  59.3% -lh5- 6d34 Dec 26 14:21 aqb/examples/bench/ctHLBenchReal.bas.info
-rw-rw-r--  1000/1000      210     376  55.9% -lh5- ccab Dec 26 14:21 aqb/examples/bench/fib.bas
-rw-r--r--  1000/1000      223     378  59.0% -lh5- 7f08 Dec 26 14:21 aqb/examples/bench/fib.bas.info
-rw-rw-r--  1000/1000      558     949  58.8% -lh5- 1650 Dec 26 14:21 aqb/examples/bench/sieve.bas
-rw-r--r--  1000/1000      222     378  58.7% -lh5- dc21 Dec 26 14:21 aqb/examples/bench/sieve.bas.info
-rw-r--r--  1000/1000      245     624  39.3% -lh5- aa92 Dec 26 14:21 aqb/examples/bench.info
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/examples/demo/
-rw-r--r--  1000/1000     2231    7706  29.0% -lh5- 82ec Dec 26 14:21 aqb/examples/demo/3dplot.bas
-rw-r--r--  1000/1000      220     378  58.2% -lh5- e419 Dec 26 14:21 aqb/examples/demo/3dplot.bas.info
-rw-r--r--  1000/1000      938    2939  31.9% -lh5- b1ea Dec 26 14:21 aqb/examples/demo/bezier.bas
-rw-r--r--  1000/1000      221     378  58.5% -lh5- 430e Dec 26 14:21 aqb/examples/demo/bezier.bas.info
-rw-r--r--  1000/1000      575    1354  42.5% -lh5- 9446 Dec 26 14:21 aqb/examples/demo/gfx1.bas
-rw-r--r--  1000/1000      219     378  57.9% -lh5- 3081 Dec 26 14:21 aqb/examples/demo/gfx1.bas.info
-rw-r--r--  1000/1000      625    1610  38.8% -lh5- 7382 Dec 26 14:21 aqb/examples/demo/gfx2.bas
-rw-r--r--  1000/1000      221     378  58.5% -lh5- 3148 Dec 26 14:21 aqb/examples/demo/gfx2.bas.info
-rw-r--r--  1000/1000     1007    3470  29.0% -lh5- 6bbe Dec 26 14:21 aqb/examples/demo/hand.bas
-rw-r--r--  1000/1000      221     378  58.5% -lh5- 5db9 Dec 26 14:21 aqb/examples/demo/hand.bas.info
-rw-r--r--  1000/1000      623    1692  36.8% -lh5- b976 Dec 26 14:21 aqb/examples/demo/mandelbrot.bas
-rw-r--r--  1000/1000      220     378  58.2% -lh5- c458 Dec 26 14:21 aqb/examples/demo/mandelbrot.bas.info
-rw-r--r--  1000/1000     3693   18213  20.3% -lh5- 21e0 Dec 26 14:21 aqb/examples/demo/tetris.bas
-rw-r--r--  1000/1000      221     378  58.5% -lh5- 6579 Dec 26 14:21 aqb/examples/demo/tetris.bas.info
-rw-r--r--  1000/1000      245     624  39.3% -lh5- 8a94 Dec 26 14:21 aqb/examples/demo.info
-rw-r--r--  1000/1000      247     624  39.6% -lh5- ab3e Dec 26 14:21 aqb/examples.info
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/help/
-rw-rw-r--  1000/1000     1519    4968  30.6% -lh5- e510 Dec 26 14:21 aqb/help/AnimSupport.guide
-rw-rw-r--  1000/1000     1117    3254  34.3% -lh5- 5b40 Dec 26 14:21 aqb/help/AnimSupport.md
-rw-rw-r--  1000/1000      983    2489  39.5% -lh5- b065 Dec 26 14:21 aqb/help/IFFSupport.guide
-rw-rw-r--  1000/1000      785    1760  44.6% -lh5- 1b6d Dec 26 14:21 aqb/help/IFFSupport.md
-rw-rw-r--  1000/1000      191     275  69.5% -lh5- e4f7 Dec 26 14:21 aqb/help/Makefile
-rw-rw-r--  1000/1000     4866   14692  33.1% -lh5- 3bf0 Dec 26 14:21 aqb/help/RefAmiga.guide
-rw-rw-r--  1000/1000     3917   10849  36.1% -lh5- 1407 Dec 26 14:21 aqb/help/RefAmiga.md
-rw-rw-r--  1000/1000     5952   19433  30.6% -lh5- 4293 Dec 26 14:21 aqb/help/RefCore.guide
-rw-rw-r--  1000/1000     4335   13162  32.9% -lh5- eb1f Dec 26 14:21 aqb/help/RefCore.md
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/lib/
-rw-rw-r--  1000/1000     2743    5728  47.9% -lh5- d0b6 Dec 26 14:21 aqb/lib/AnimSupport.a
-rw-rw-r--  1000/1000      674    2524  26.7% -lh5- c2aa Dec 26 14:21 aqb/lib/AnimSupport.sym
-rw-rw-r--  1000/1000     1253    1928  65.0% -lh5- 2748 Dec 26 14:21 aqb/lib/IFFSupport.a
-rw-rw-r--  1000/1000      379     967  39.2% -lh5- 8f8e Dec 26 14:21 aqb/lib/IFFSupport.sym
-rw-rw-r--  1000/1000    14834   31072  47.7% -lh5- 2f87 Dec 26 14:21 aqb/lib/_aqb.a
-rw-rw-r--  1000/1000     2746   11016  24.9% -lh5- ddf3 Dec 26 14:21 aqb/lib/_aqb.sym
-rw-rw-r--  1000/1000    10369   27304  38.0% -lh5- 8e17 Dec 26 14:21 aqb/lib/_brt.a
-rw-rw-r--  1000/1000     1701    6321  26.9% -lh5- ec9f Dec 26 14:21 aqb/lib/_brt.sym
-rw-rw-r--  1000/1000      412     644  64.0% -lh5- 4a99 Dec 26 14:21 aqb/lib/startup.o
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/tutorial/
-rw-r--r--  1000/1000      630    1082  58.2% -lh5- 8df4 Dec 26 14:21 aqb/tutorial/BOBDemo1.bas
-rw-r--r--  1000/1000      219     374  58.6% -lh5- 7779 Dec 26 14:21 aqb/tutorial/BOBDemo1.bas.info
-rw-r--r--  1000/1000      758    1510  50.2% -lh5- 4315 Dec 26 14:21 aqb/tutorial/BOBDemo2.bas
-rw-r--r--  1000/1000      219     374  58.6% -lh5- f6c4 Dec 26 14:21 aqb/tutorial/BOBDemo2.bas.info
-rw-r--r--  1000/1000      415     647  64.1% -lh5- 05ee Dec 26 14:21 aqb/tutorial/BitmapDraw.bas
-rw-r--r--  1000/1000      215     374  57.5% -lh5- 2ee6 Dec 26 14:21 aqb/tutorial/BitmapDraw.bas.info
-rw-r--r--  1000/1000      392     749  52.3% -lh5- 465b Dec 26 14:21 aqb/tutorial/CtrlC.bas
-rw-r--r--  1000/1000      218     374  58.3% -lh5- 0b24 Dec 26 14:21 aqb/tutorial/CtrlC.bas.info
-rw-r--r--  1000/1000      388     606  64.0% -lh5- 6556 Dec 26 14:21 aqb/tutorial/CustomPointer.bas
-rw-r--r--  1000/1000      220     374  58.8% -lh5- b055 Dec 26 14:21 aqb/tutorial/CustomPointer.bas.info
-rw-rw-r--  1000/1000      884    1708  51.8% -lh5- 4000 Dec 26 14:21 aqb/tutorial/Debug.bas
-rw-r--r--  1000/1000      217     374  58.0% -lh5- d55d Dec 26 14:21 aqb/tutorial/Debug.bas.info
-rw-r--r--  1000/1000      494     931  53.1% -lh5- 885a Dec 26 14:21 aqb/tutorial/FontTutorial.bas
-rw-r--r--  1000/1000      217     374  58.0% -lh5- 77f9 Dec 26 14:21 aqb/tutorial/FontTutorial.bas.info
-rw-rw-r--  1000/1000      315     498  63.3% -lh5- 1d51 Dec 26 14:21 aqb/tutorial/ILBMBitmap.bas
-rw-r--r--  1000/1000      218     374  58.3% -lh5- ef67 Dec 26 14:21 aqb/tutorial/ILBMBitmap.bas.info
-rw-rw-r--  1000/1000      515     926  55.6% -lh5- 5500 Dec 26 14:21 aqb/tutorial/ILBMShow.bas
-rw-r--r--  1000/1000      219     374  58.6% -lh5- 2550 Dec 26 14:21 aqb/tutorial/ILBMShow.bas.info
-rw-r--r--  1000/1000      572    1004  57.0% -lh5- a650 Dec 26 14:21 aqb/tutorial/SpriteDemo1.bas
-rw-r--r--  1000/1000      216     374  57.8% -lh5- ad14 Dec 26 14:21 aqb/tutorial/SpriteDemo1.bas.info
-rw-r--r--  1000/1000      524     885  59.2% -lh5- 6a26 Dec 26 14:21 aqb/tutorial/SpriteDemo2.bas
-rw-r--r--  1000/1000      221     374  59.1% -lh5- 62fc Dec 26 14:21 aqb/tutorial/SpriteDemo2.bas.info
-rw-r--r--  1000/1000      647    1200  53.9% -lh5- e2b6 Dec 26 14:21 aqb/tutorial/SpriteDemo3.bas
-rw-r--r--  1000/1000      215     374  57.5% -lh5- 65f2 Dec 26 14:21 aqb/tutorial/SpriteDemo3.bas.info
drwxrwxr-x  1000/1000        0       0 ****** -lhd- 0000 Dec 26 14:21 aqb/tutorial/imgs/
-rw-r--r--  1000/1000     1052    2948  35.7% -lh5- b0bb Dec 26 14:21 aqb/tutorial/imgs/banana.iff
-rw-rw-r--  1000/1000     1823    4290  42.5% -lh5- 31b2 Dec 26 14:21 aqb/tutorial/imgs/dragon.iff
-rw-r--r--  1000/1000     1170    2702  43.3% -lh5- 2308 Dec 26 14:21 aqb/tutorial/imgs/gorilla.iff
-rw-r--r--  1000/1000    33239   39074  85.1% -lh5- 0451 Dec 26 14:21 aqb/tutorial/imgs/hope.iff
-rw-r--r--  1000/1000      243     624  38.9% -lh5- 3256 Dec 26 14:21 aqb/tutorial.info
-rw-r--r--  1000/1000      243     624  38.9% -lh5- bdc9 Dec 26 14:21 aqb.info
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total       102 files  314196  700813  44.8%            Dec 27 19:24

Aminet © 1992-2022 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>