I wish someone would write a "modern python". Something similar to Python in terms of syntax (but ban spaces for indentation) and expressiveness, but with a sane type system (less like javascript), better performance, and the whole GIL thing fixed.
One feature I would like is a consistent OOP API. Why is it len(foo) instead of foo.length(), yet foo.append(bar) instead of append(foo, bar)? IMO, that's a big annoyance and there's a bunch of cases like that. It's especially weird since the internals use OOP, with foo.__len__() being called.
I wish they had changed those in Python 3.
As an aside, while I like the user of indentation for scope, it has one major downfall and that's lambdas. Python has no multiline lambdas (the only language I know with such a restriction) and this is rather annoying for those well versed with functional programming. We end up having to make tons of named functions, which is unnecessary.
Several variant interpreters have no GIL: for example Jython (Python on the JVM). Most of these intepreters are fully compatibly except in C extension modules (which Jython trades for Java/JVM compatbility).
I do not think you can get similar expressiveness with tighter type controls. Part of the expressiveness comes from these loose controls. The answer to this may well be better static analysis tools.
Yeah, makes recent noise about Python moving to a TCL-style sub-interpreter model kind of irritating. It might be nice to have subinterpreters cleaned up and working anyway, but it's really only CPython, admittedly the current reference impl, with the goddamn problem...
Jython is fine, and can easily be used for server stuff like django.
Haskell is a better Python in a lot of ways. It's high-level, expressive, and offers a sane type system (once you learn a few big words), near-C performance, and an excellent concurrency story. It also uses indentation over curly braces, like Python.
As someone who's either come around or been brainwashed on the tabs/spaces thing (since I can have Vim just treat the four spaces like they're a tab), why is this important?
There's Cobra if you're working on the .Net platform, the language seems pretty nice and very pythonic and has Design-by-Contract built in. There was mention of it being ported to the JVM, but I've not heard of any recent progress. I'd absolutely give it a go on the JVM.
There's Nim, too. I've not played with it much, but it looks nice and is gaining traction.
I've always wondered whether it'd be possible to tweak the OCaml interpreter to allow it to take more pythonic syntax, but follow OCaml's type rules. Jocaml's interpreter could be used to allow concurrency.
There was Boo which basically was static typed python on .net infrastructure.
It's pretty dead now, which is a shame.
Oh, well, at least there is still crystal - ruby with types. And since it compiles to native code, I have no idea if it sorted out GIL.
They use BoehmGC, so even if they have actual threads, they might have problems which old Go's GC had: not freeing memory because floats look like pointers.
7
u/[deleted] Jul 31 '15
I wish someone would write a "modern python". Something similar to Python in terms of syntax (but ban spaces for indentation) and expressiveness, but with a sane type system (less like javascript), better performance, and the whole GIL thing fixed.