3 ms·
I like python subset. However, many don't see it that way.
by benatkin 27d ago
I like python subset. However, many don't see it that way.
- hmry 27d agoYou're right, mathematically it's undeniably true. However... One could imagine an even smaller subset interpreter. It's an interpreter for a subset of Python, consisting only of the programs that print "Hello World". Since it doesn't do any error checking, for all other programs the output is undefined. Implementing it is very simple: Just ignore the input file, and print "Hello World". As a bonus, it's an interpreter for the subset of "Hello World" programs in all other programming languages too! </tongue-in-cheek>
- Sophira 26d agoThis has actually been done: https://esolangs.org/wiki/Hello https://esolangs.org/wiki/Hello While quines (programs that print their own source code) aren't possible in Hello, there's a version that makes it possible: https://esolangs.org/wiki/Hello_Plus_Plus https://esolangs.org/wiki/Hello_Plus_Plus And if you say the original isn't good enough because it can't do anything else... well, esolangs have you covered there too: https://esolangs.org/wiki/HQ9_Plus https://esolangs.org/wiki/HQ9_Plus (It should be noted that these are all joke esolangs. There are actual languages on the wiki that are very interesting though - I would definitely recommend you take them out!)
- Sophira 25d ago> I would definitely recommend you take them out! I obviously meant "check them out" here. I was using speech recognition and it clearly misheard what I said. I'd edit, but it's been long enough since I posted that HN isn't offering that option for this comment any more.
- tyilo 27d agoIt's not a subset of python. For instance this program works in this interpreter, but not in python: fxx i in rxxxx(10): pxxxx(i)
- benatkin 26d agoThat isn't part of the language though. That's just input that it doesn't handle properly. The author acknowledged it lacks error handling.
- deleted 26d ago[deleted]