NOTE | Currently, we at AR/ are still implementing the Arcane 9, and by the grace of God, the reasoning behind it is fully fleshed out. But documentation is outdated when not outright missing, and this is indeed our mistake.
library ARPATH '/forge/'
use '.inc' A9M
library.import
; ...
A9M.read filepath
(See also: AR/Imp)
If the argument is omitted, A9M.read will use A9M.FPATH, which can simply be set through define A9M.FPATH 'path/to/file' or A9M.FPATH equ 'path/to/file'. Alternatively, the path can be passed through the commandline, eg fasm -d A9M.FPATH="'path/to/file'".
A commandline util to do this is also provided in this repo, in bin/peso; peso path/to/file is more or less equivalent to the previously mentioned methods.
The Arcane 9 is a theoretical virtual machine and compiler, which right here and now, we have begun implementing with flat assembler macros. In essence: this a framework for code generation from within the assembler itself.
-
Implemented encoder and interpreter for bytecode instructions through
*::opcode. -
Added
*::ismakerperl module for easier generation of instruction sets for*::vmc. We should now move to compiling Arcane 9 programs into binaries than can be opened as virtual segments, rather than writing every program as a macro.
-
Implemented basic memory allocator through
*::valloc. -
Memory effectively 'unified' under a parent block (
*::vmc.NON), of which the first few segments act as system memory, and every segment after that is user memory, which is managed by the allocator. -
Lengthy
*::vmcrework/breakup. We have now taken to using*::vallocto handle the 'user' portion of memory rather than making a new*::vmemfor each and every buffer. -
Many quality of life features around relative pointers and
*::vmc::decode. Because of the allocator, we don't have to rely on symbolic constants so much anymore, which means the old methods are redundant.
-
*::vmemtweaks forcat,alignandresize. Fixed thebstoremistake were resizing would crash the subsequent write! -
Ported
*::vcstringfrompeso: it just gives a quick way to calculate the length of C strings, but that's enough for now. -
Reworked the string buffer used to collect identifiers into a standard
char**; there's no longer a need to encode the length of each token. -
Turns out that the additional metadata that was encoded with each token can also be inferred by the time
L2gets to need that information, so tokens are now 16-bit for keywords and 32-bit for identifiers. We might revisit this later, but good enough for now. -
*::$$buffers are now padded to a 16-bit boundary and their length is stored automatically to final output.
-
Moved first expression logic into
*::FE; this makes it so we don't have to check for it every single time, and in turns simplifies the logic at all three levels. Quite obvious in retrospect ;> -
Added
aheadandtailto*::L0; we use these to look at neighboring bytes while reading tokens. -
Heavily modified
L0logic for operators. -
Added
lseek_sandrseek_sto*::vmem::metafor when you explicitly want to skip ahead or backwards without crossing buffer bounds.
-
Slight modification to
L0which takes token and expression processing out of the main switch. -
L1memory serialization happens before the expression itself is processed; and so now syntactical analysis is performed directly on serialized tokens. -
Added
*::SHARE::OUTBUFfile for defining output buffers, all catted to*::$$via footer. -
Combine, consume and reverse macros for
*::vmc.
-
Generating token tables using
*::vhash. -
Matching
L1tokens against the default token table. -
Subdivided the output buffer into symbols and strings. Useful for storing identifiers that are syntactically valid but don't match against any reserved token.
-
Added commandline utils for running test
A9Mcompilations.
-
Added
writeandpastemacros to*::vmem::bin: these let us quickly commit the contents of a buffer to disk. -
Added
to_diskandfrom_diskmacros to*::vreg, which similarly, provide a simplified interface to freezing and thawing structures between sessions. -
*::vhashde-serialization wrapper in the form ofvhash.from_disk. -
Minor fixes to
*::vhash.
-
Implemented memory levels: file processing is divided into sections for chunk, array of chunk, and trees of arrays of chunks --
*::L0,*::L1and*::L2, respectively. -
Added
*::vmc, which in short bridges the gap between assembler macros and programming a full Arcane 9. -
Added
*::vrecurse, a small util to allow macros to be self-referential, up to a limit determined byA9M.XDEPTH. -
Subdivided
*::vmeminto smaller modules for maintenance reasons. -
Added
*::vmem::xstepmodule to ease generating iterators for unaligned buffers. -
Expanded the scope of the project beyond just lexing ;>
-
Automatic, variable-sized steps for the macros
copy,eqandprichfrom*::vmem; this makes it easier to work with slices of data smaller than the base alignment of a virtual buffer. -
Fixed mistakes in
*::vcryptthat prevented hash collisions from being solved.
-
Largely untested, but working:
vhash.store&&vhash.loadat*::vcrypt; so, we have effectively implemented hash tables on virtual buffers. -
Small fixes to
*::vmemcopying and comparison macros.
-
Initial sketching on
*::vcryptfor implementing hash tables on virtual buffers. -
*::vmem.bopmacro for quick implementation of operations on virtual buffers. Currently used solely for binary operators, but can be easily extended by calling the*::vmem._gen_bopgenerator macro. -
*::vmem.viewmacro for taking a "slice" of a virtual buffer. This handle can then be manipulated as one would a regularvmem ice.
-
Added segments to
*::vmem: essentially, a virtual buffer can be extended to contain another. The parent segment can write to a child, but not the other way around. -
Added
*::vregto provide a struc-like interface to virtual buffers: strucs can be defined, instanced and their fields accessed through wrapper macros such asget,setand the like.
-
Made this document ;>
-
Initial implementation of
*::vmem; methodsnew,clear,write,read,seekandeq. -
Storing of current token inside
vmem *.ctoken.
-
Turned a 'just-for-kicks' into a thing.
-
Initial implementation of the main loop; pattern and check-making macros, basic state and logic.