3 ms·
I wonder if a version of Python with types with some way to force programs to be total would be a 'good enough' substitute. JavaScript has `"use strict";`, `# u
by jonathanyc 4y ago
I wonder if a version of Python with types with some way to force programs to be total would be a 'good enough' substitute. JavaScript has `"use strict";`, `# use total` could ban recursion and loops over non-constants. You'd have to work hard to ensure things were really total, e.g. ban assigning functions to variables, but maybe you could make it hard enough to pay off.
- eru 4y agoAssigning functions to variables doesn't have to ruin your totality. But yeah, you'd need to carefully select your subset of the language that is both useful and total, and practical to implement.
- rtpg 4y agoStarlark is a version of this, and it's used by Bazel in particular. It's very cool tech, and sidesteps the difficulties of ensuring Python works without shipping a specific Python interpreter.
- jonathanyc 4y agoDidn't know about Starlark, that is awesome.