The code makes me smile, because it's nasty . This isn't like C4, a tiny but complete C compiler which does error checking on its subset. Instead, this is worse than Sector C, which takes every shortcut and just plain assumes everything in the source is right. This "Python" just plain assumes for keywords: Any "f" is a "for [x] in range[y]" (exactly that, no other for's). Any "w" is a "while". Any "i" is an "if". Any…
Making a Python interpreter in 1024 bytes
91–100 of 120 posts
Re: Making a Python interpreter in 1024 bytes
#92But to be honest, I wonder what is the smallest interpretable and practical Turing Complete VM? I would argue that implementing a brainfuck that we lower Python interpreter to, or even say like an interpreter untyped lambda calculus or SKI combinator would be very useful, especially for the hardware bootstrapping. I'm talking about things like SectorLisp https://justine.lol/sectorlisp/
The exception to this is obviously embedded systems with very low amounts of resources where C and assembly are practically unrivaled.
Re: Making a Python interpreter in 1024 bytes
#93Re: Making a Python interpreter in 1024 bytes
#94Re: Making a Python interpreter in 1024 bytes
#95>> I started with the most basic code I could think of: 1 + 2
OK, how did you fit that into 512/1024 bytes??? Did you try print(3 * * 1000)?
Re: Making a Python interpreter in 1024 bytes
#96Like a psychopath.
/s
Re: Making a Python interpreter in 1024 bytes
#97Earlier quoted context omitted.
As they say in TDD, write a test, then write the simplest code that will make it pass. Clearly supporting multiple functions starting with 'p' would be overengineering.
By that standard, this is totally over-engineered. Just hardcode it.
Re: Making a Python interpreter in 1024 bytes
#98Re: Making a Python interpreter in 1024 bytes
#99Re: Making a Python interpreter in 1024 bytes
#100But to be honest, I wonder what is the smallest interpretable and practical Turing Complete VM? I would argue that implementing a brainfuck that we lower Python interpreter to, or even say like an interpreter untyped lambda calculus or SKI combinator would be very useful, especially for the hardware bootstrapping. I'm talking about things like SectorLisp https://justine.lol/sectorlisp/