r/ProgrammingLanguages • u/malderson • Jan 09 '26
Blog post Which programming languages are the most token efficient?
https://martinalderson.com/posts/which-programming-languages-are-most-token-efficient/
0
Upvotes
View all comments
Show parent comment
4
u/glasket_ Jan 09 '26
It's pretty crazy to me that Python added so much stuff surrounding typing but didn't add any way to check with the Python interpreter itself. Like it could have just been a
--type-checkflag to run a checker before starting the interpreter. You can always just download a separate checker, but it's weird to not have something in the core tooling.The entire annotation system itself is pretty bizarre too, almost like they were going out of their way to make it into something that they could claim isn't the responsibility of the interpreter itself to work with. Lazily evaluated expressions that you can just plop alongside any variable or function and access using standard library functions. The "types" can even produce side effects. Considering the original proposal (PEP 3107) all the way back in 2006 was just about annotating types for functions and PEP 484 standardized it as type hints, it's insane to think about how it ended up like this.