Has anybody tried to write a Perl dialect that runs on a 6502 machine?
Because I'm a retro-programmer sometimes, I want a Perl dialect that could have been written in 1982. To be super-particular, a Perl dialect that runs on the X16 (https://github.com/commanderx16) or the MEGA65 (https://github.com/mega65).
TL;DR: Some of you might find this idea stupid. This post has no value for you. Thank you.
To start out, I downloaded and examined Perl 1, Perl 2, and Perl 3, just to see how the language evolved in those first few years. Granted, even Perl 1 is too powerful for 6502-based hardware. I even looked at NQP, which is also far too powerful -- but it was useful for seeing how Perl could be reduced, so to speak.
Aside from the severe constraint of fitting into a laughably minimal 16K block of ROM, it's yet a thought experiment I occasionally wonder about. Some of you might also find the idea diverting.
Even though the end product would be very weak, I still think it could be recognizably Perl.
Here's what I'm pretty sure would disappear.
The shebang (#!)
Packages(!)
Hashtables
Regexes
System, threadlike, and socket-based ops
Here's what I think would maybe still be there.
Arrays and some array ops.
Some file operations.
Sigil-based types.
Labels.
A subset of control structures (looping).
Goto.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |