I got the Subleq+ compiler and interpreter working. They're posted on GitHub. This is a huge advance over hand jamming the physical addresses. Many thanks to Chris Lloyd for the basis of the system. The parser is still mostly his code.
Subleq is a single instruction computer. That instruction consists of three words, A B C. The function is [B] = [B] - [A]; if [B] <= 0, jump to C. "[x]" means the contents of memory at location x. As limited as it seems, you can theoretically do anything with a computer like this. It just takes longer.
Why am I interested in this?
- I'm a geek. If that wasn't obvious by now, you haven't been paying attention.
- Subleq reminds me of a programming project I found in a magazine for the Commodore-64 back when I was a kid. There was some toy language that only had two instructions: Increment an address by one, and decrement an address by one and jump if it was zero. I played around with that for weeks. Good times. Happy memories.
- This has gotten me back into programming for the first time in almost 30 years. I actually went to college for programming back in the early 90's. I dropped out (the second time) when I noticed that I, as a Junior, was helping the grad students with their projects. I also saw that my friends were having trouble finding local jobs in the field, as the industry was leaving Ohio and moving to California at the time. I just lost interest and motivation.
- Being partially disabled and mostly stuck at home, I have a lot of time on my hands and I get bored. This is a nice challenge.
Is a stack too much power for an esolang like this? If course it is! Could it take some of the challenge of using a language like this away? Of course it can! But that's not really the point, is it? It's not to use the language so much as to create a usable language. And it still doesn't have an explicit instruction. It's all just data and memory locations. But then, that's all computers really are.
No comments:
Post a Comment
I reserve the right to remove egregiously profane or abusive comments, spam, and anything else that really annoys me. Feel free to agree or disagree, but let's keep this reasonably civil.