Aesop

Picasso (or ) is a project to fully bootstrap the Free Pascal compiler.

(to be clear: i'm not some weird person who thinks pascal is still a useful, relevant language. the first version of the nim compiler was written in object pascal; we need fpc to build it properly. so picasso could be better described as a project to bootstrap nim...)

= ideas =
 * the obvious idea first: llvm
 * literally create gpc2 by writing it in c with gcc
 * c is an abomination, so i avoid it as much as possible
 * i've heard that gccjit is also an abomination, but i cannot currently comment on that
 * if i went the full way and contributed a new pascal frontend to gcc, i'd have to sign the gnu cla, which i am unwilling to do on principle
 * try compiling to $SOME_LANGUAGE
 * d is probably the best choice here: there's a variety of compilers available, it's got a garbage collector, and it implements some features that c doesn't have but pascal does
 * go would probably also work
 * other ideas: rust, zig, or straight to c?
 * embrace TRUE compiler development and produce machine code directly
 * no
 * interpreter
 * will cause trouble when i try to implement advanced features, see the note about rascal in the timeline
 * unless i jit it
 * which i will not do
 * language for implementation
 * scheme?
 * my deepest darkest secret is that i don't actually like scheme that much
 * (it's nothing about the syntax, i'd pick it over c any day, but i hate dynamic typing)
 * ocaml?
 * not yet fully boostrapped (but really close!)
 * rust?
 * got a good library ecosystem
 * d?
 * just quite pleasant te write code in -.o.-
 * zig?
 * would require a zig-build-system in guix. this would not be hard, since ZIG DOESN'T TRY TO SHOVE A TERRIBLE LANGUAGE-SPECIFIC PACKAGE MANAGER DOWN YOUR THROAT \o/
 * the only reservation i have is that the language is very immature and the compiler is subject to massive changes

if you have an idea, ping unmatched-paren on #bootstrappable; i'm not constantly connecte, but i check the logs every day and will probably reply within 48 hours

= timeline =
 * 1) i decided to try and bootstrap nim. i quickly discovered that this would not be as easy as i thought...
 * 2) the oldest fpc archive i could find could only compile for m68k and REALLY old ia32 variants. it was self hosting even back then, anyway.
 * 3) p2c, an old pascal to c converter, was the first program i tried to use. sadly, i couldn't actually get it to run (the last update was around the early 90s.) either way, it probably wouldn't have actually worked. fpc is more non-standard than rustc, and rustc doesn't even have a standard to adhere to!
 * 4) gpc, the early 00s gcc implementation of extended pascal, wasn't an option, as rekado couldn't get it working with even remotely modern gcc, and it would suffer from the same problem as above
 * 5) i began to write a bootstrap compiler in ocaml, but was told in #bootstrappable that the latest version of ocaml was not yet bootstrapped.
 * 6) i found a basic pascal interpreter called rascal written in rust, a language i am intimately familiar with. naïvely, i started extending it; however, i quickly realized that doing an interpreter was setting myself up for pain when i tried to implement advanced features (such as inline asm, which is used in several places in fpc)