Hacker News new | ask | show | jobs
by faho 1327 days ago
The idea behind this series of posts is to see how much of python, concretely, is syntactic sugar and how much is necessary. How much could you do with e.g. doing macro transformation on top of a minimal core?

The last post before this was titled: "MVPy: Minimum Viable Python".

So, since python doesn't have goto, you can't replace while with an if with two gotos (without adding a goto to the language).

You can replace an `if` with a while tho, easily.

2 comments

Tbf python isn't exactly a language that's high in sugar to start with, it doesn't even have switch statements. Not sure why you'd want to take away even more until there's nothing usable left. People have the weirdest hobbies hah
No, but it has the `match` statement which is even better: https://docs.python.org/3/whatsnew/3.10.html#pep-634-structu...
I wouldn't exactly call something only available in 3.10 as something python "has". Most of us haven't moved past like 3.8 at best, some still using 2.7 for legacy stuff even.
Waiting for the solution that involves transforming Python code into an encoded Turing machine and implements a minimal UTM in some tiny subset of Python.