Statically typed. That's just Java with python syntax again, which the article tries to talk it's way out of but that's what it is.
This assertion is so vague as to be meaningless - say more? You're presumably not asserting that all statically typed languages are fundamentally Java, because that would be saying the patently false "C and Haskell are fundamentally Java". Are you specifically saying the article's hope that it's not "Java with Python syntax" is misplaced; if so, why?
SPy: An interpreter and compiler for a fast statically typed variant of Python
101–110 of 133 posts
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#102As a prospective user the first thing I look for is lists, list comprehension, list slices, string methods, zip, zip*, tuple destructuring, generators, dicts and sets. These data structures, their syntax, and associated methods are what make Python a joy to use. They are what make it possible to solve a puzzle in a one-liner. The examples in the playground are neat but I don’t see any of the Python bread and butter u…
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#103Looks very interesting! I remember chatting with one of the creators of PyPy (not the author of TFA) a number of years ago at HPI. He had just given a talk about how RPython was used in PyPy development, and I was fascinated. To me, it seemed completely obvious that RPython itself seemed like a really interesting standalone language, but he would have none of it. Whenever I suggested that RPython might have advantage…
I have asked about using RPython as a generic standalone language before. I think the official statement is that is was never intended to become one, and it's really a very minimal subset of Python (so basically no existing Python code will run, it would require heavy refactoring or complete rewrite), and it's only specifically those features that they currently need, and it might also be a moving target, and they do…
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#104If in the end we can just have .spy on some files that have performance critical functions in them and the rest is just normal python, this could be down right amazing. We recently swapped out mypyc optimised module for a rust implementation to get a 2-6x speed up, and not having to do that would be great.
Also, when I read about the language features which make Python intrinsically slow, generally I think "I never use that." e.g. operator overloading meaning you need to do all these pointer dereferences just to add two numbers together. Yes, I get that pytorch and numpy rely critically on these. But it makes me wonder...
Could you disable these language features on a module-by-module basis? That is, declare "in this sub-tree of the source code, there shalt be no monkey-patching, and no operator overloading" and therefore the compiler can do a better job. If anybody tries to do the disallowed stuff, then it's a RuntimeError. Would that work?
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#105Earlier quoted context omitted.
> Granted what messes up Python, or better said CPython implemenation, is that C extensions are allowed to mess up with its internals thus making void many possible optimizations that would be otherwise available. I'm doing a Ruby compiler (very, very slowly, though faster again now with Claude Code doing most of the heavy lifting), and the same issue with Ruby has made me seriously toy with the idea of one day embed…
Have you seen how TruffleRuby makes use of LLVM bitcode, to ship C compiler as well?
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#106Earlier quoted context omitted.
One of the standard architectures for complex applications is to put together a scripting language and an systems programming language. You can either look at the scripting language as primary with the systems language used for performance or hardware interfacing or you can look at the systems language being primary and the scripting being used around the edges. The model of having a closely related scripting and sys…
Yes, there are quite many real-world cases of this architecure. But, wouldn't it be better it the same language (more or less) can be used for both? I don't think such a language exists currently, but I think it would be a nice goal.
In general you want a solid engineering language with a focus on correctness, and a second "scripting" language focusing on quick development.
Second if the languages are very similar but not the same it seems like you would see "confusion" errors where people accidently use lang 1 in lang 2's context or vice versa.
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#107This seems to be going for a somewhat similar goal to Mojo [0] - anyone here who used both and is willing to offer a comparison? [0] https://www.modular.com/mojo
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#108The author invents so many terms, I don't want to uncharitably ascribe this to anything, but they should use existing terminology.
Re: SPy: An interpreter and compiler for a fast statically typed variant of Python
#109Earlier quoted context omitted.
all of this is well and good if you completely forget that there are billions of lines of Python in prod right now. so your grand epiphany is basically on the level of "let's rewrite it in Rust". i'll let you hold your breath until that rewrite is done (and in the meantime i'll explore workarounds).
I kind of object to this take. Nobody's talking about porting billions of lines of code, for all we know it's just for personal projects, or a learning experience. This kind of replies is like killing an idea before it's even started, smells like the sunk cost fallacy. OTOH I do understand the weight of a currently existing corpus in production, evidence is the ton of COBOL code still running. But still, your reply k…
am i the only person in the room that can read tone? please tell me what is the force of this statement in what i've responded:
> If you want static compilation, use a language and libraries built with that assumption as a ground rule.
is this an imperative only for hobbyists? not sure.
> This kind of replies is like killing an idea before it's even started, smells like the sunk cost fallacy.
there is no idea - that's exactly my whole point. tear it down and build it again is not an idea.