Those who like this might also like my language project, Runa:
A Python-like systems programming language. This means that the design borrows as much from Python as makes sense in the context of a statically-typed, compiled language, and tries to apply the Zen of Python to everything else. The most important design goals for Runa are developer ergonomics and performance. The compiler is written in Python and targets LLVM IR; there's no run-time. More information can be found on the project website.
Have you tried Nim? The syntax is Python-inspired rather than Python-like, but it seems to combine a lot of the nice features of dynamic languages with the rigour of a static language.
Have you looked at cython? It's (optionally) typed, fast (with only a little bit of effort extra effort over writing normal python), makes the GIL optional (for a reasonable subset of cases) and, most importantly, stable and ready to use today (so no waiting).
+1 for cython. The only criticism I could make is that the real speedups come when you can avoid using PyObjects which means the easiest way to employ it is in the inner loops of numeric code where it truly is phenomenal. Complex data structures have to be boiled into C-style structs to get any significant speedup with them although there is still a base level performance boost from having everything compiled into cpython API calls.
Complex data structures have to be boiled into C-style structs to get any significant speedup
I've never really played with it, but cython does have mappings between python builtin types and STL containers, as well as letting you create C++ classes using cython syntax that you can inherit from and access in python.
Yes, that's correct, but if you are using semi-complex objects, then you have to invoke the python interpreter and lose most of the advantage of going to Cython in the first place.
Even for things like ints, floats, etc - if you want to see a significant speed up, you have to convert them into c ints and floats.
There have been other typed Python variants. RPython, in which PyPy was written, is sort of one. Shed Skin tried to do it entirely via type inference, which is really hard across functions.
It's clear now that you want at least enough type inference in a language that LHS types of assignments and variable creations are inferred when possible. When you have that, as in Go, Rust, and even C++ to some extent, most of the declarations are in function definitions. There, you want them for documentation purposes anyway.
The value-add here is that it compiles to C and therefore the type enforcement is done at compile time. If you are OK with interpreted Python and runtime checking you can use https://github.com/prechelt/typecheck-decorator/
That looks cool! It's pretty different though, it's more like a "design by contract" tool.
I have a similar one, more Python2 style dsl (it supports also function overloading through a kind of pattern matching) https://github.com/alehander42/py-matchete
Well yeah, but I wanted to experiment with the language type system(it started from HM, but it can go anywhere).
Classes/records are not implemented yet, but I can imagine that we have two cases:
<object_with_known_exact_class>.<method>
then we'll just convert that to a normal function invocation in c(because we'll be able to detect the exact ancestor which defines the method and the method)
<an_instance_of_some_class>.<method>
if we only know that an object is an instance of a class, we can wrap the invocation in an inline switch on the type field of the object.(instances would map to C structs).
Nice. I wanted to find out how well it performs (with a simple summing task) but I gave up before I had managed to loop over a range. I'll check back in a week or two ;)
It does support `for ... in range(start, end)` and `while` now. You can check out two summing examples in the examples dir too. It typically gives ~ 6-7x speedup on my machine.
Well considering the amount of courses now in python, who knows what will be asked to and done by students. Maybe it will land before guile-emacs is stable.
A Python-like systems programming language. This means that the design borrows as much from Python as makes sense in the context of a statically-typed, compiled language, and tries to apply the Zen of Python to everything else. The most important design goals for Runa are developer ergonomics and performance. The compiler is written in Python and targets LLVM IR; there's no run-time. More information can be found on the project website.
https://github.com/djc/runa/