After I've written about 4'000 lines of code of my AEC-to-WebAssembly
compiler, I
think I'm finally able to implement most of the program in AEC and only use
JavaScript for helper functions. So, I'll try to write a program that prints
all the permutations of the digits of a number, with most of the program
written in AEC.
This is more-or-less a port of the permutations.aec from the
x86 dialect of AEC to the WebAssembly dialect of AEC. The original
permutations.aec is available in
this ZIP archive (and you need to produce the
binary to run yourself) and the binary file is available in
this ZIP archive
(but, if my computer is infected with malware, that ZIP archive will
probably be as well).
This only works in very modern browsers. I'm not too interested in
targeting archaic browsers here. This only works in Firefox 62 and newer or
Chrome 69 and newer. After a few years (if not months), all JavaScript
environments will become as capable as they are, rather than like Internet
Explorer.
AEC program output:
You can see the source code of the AEC program
here. When you want to see a similar
but more complicated example, see
the n-Queens-Puzzle.