Telling someone to write a program for the 6502 with C is a great way to illustrate how C actually is a high-level language.
oh oh, a topic i know a little bit about
i wanted to riff on
llvm-mos, but looks like their
github is somewhat active, i personally thought it was a dead project
theres also good old
cc65, which supports C89 with some extensions like c++ comments, and it still is somewhat active
funnily enough, while looking at cc65's recent commits i found a channel with a fairly recent video explaining the differences between llvm-mos and cc65
but the main thing i wanted to say is that ironically, theres a language higher level than c designed specifically for 6502 called
prog8, the project is being developed by one guy who commits multiple times at least a few days every week, ive tried it out and it works great, in the newest release he has added structs and longs to the language
the optimizer does its job very well
and the standard library itself is also very well optimized (
benchmarked with c)
its mainly designed for cbm computers (specifically 8bitguys commander x16) rather than nes, but there is a custom target for the nes and other computers/consoles
but thanks to this, it recognizes petscii characters like ♠
also a BIG upside that it provides is that there are ifs for every specific cpu flag (like
if_eq to check if the zero flag is set)
you can unroll loops, you can use the zero page, you can set it so it overwrites unneeded entries in the zero page, you can use floats (unlike cc65)
there are namespaces and
defers
in general i love the language
the only downside is that you need to have 64tass installed and that it uses kotlin so you need to have jdk installed as well
EDIT: while writing this post ive stumbled upon
oscar64 and it is
fucking insane (see the prog8 benchmark), not only does it support C99, it also supports a fair bit from C++ like templates and lambdas, all while being fast
as fuck, and still being active