Graal (http://www.graalvm.org) also provides a Python implementation on top of the JVM. Its implementation is interesting: Graal uses the Truffle framework which takes a basic interpreter for any language and converts it into an optimised JIT compiler. Interestingly, graal/truffle also has an interpreter for LLVM bytecode - and through this can support c-language python extensions.
Announcement
Collapse
No announcement yet.
RustPython Is Implementing Python 3 Within Rust
Collapse
X
-
Originally posted by jacob View Post
Another thing is that with a more rigorous memory management, this new interpreter might be able to reduce reliance on dynamic garbage collecting (the Python language will always require some form of GC, but the interpreter itself may be able to streamline it), which would theoretically allow it to provide better support for multithreading by avoiding the GIL.
Comment
-
Originally posted by atomsymbol
Btw: I don't understand the meaning of "dynamic GC". What would "static GC" mean: compile-time GC without any GC at runtime (it is achievable for some programs)?
Originally posted by atomsymbolIn my opinion, optimized reference counting isn't necessarily slow because an advanced compiler can sometimes elide refcount updates. In CPython, it is slow because neither the bytecode nor the interpreter have explicit inc/dec refcount instructions, which makes it impossible to elide them, and consequently every object pointer assignment has to update two refcounts.
Escape analysis is able to put objects onto the stack to avoid heap allocations.
Originally posted by atomsymbolAn advantage of reference counting is much lower memory consumption compared to deferred garbage collection strategies, unless the object graph contains cycles.
I know that garbage collection is the bogey man to a lot of long time C or C++ developers and there are definitely environments where memory is tightly constrained and GC flat out can't be used. But GC technology is still improving and it looks like the Java Virtual Machine is leading or close to leading the way. The JVM G1GC garbage collector seems to be best for total throughput on average. For latency, the JVM Shenandoah GC can do sub 10ms pauses on 100GB heaps: http://openjdk.java.net/jeps/189 . There is also the JVM Z Garbage Collector: http://openjdk.java.net/jeps/333 - in a benchmark with a 128GB heap, max pause time was 1.681ms. The ZGC is currently Linux/x64 only, but once it's on other platforms Call of Duty: Black Ops 6 could be written in it.
- Likes 2
Comment
-
Originally posted by atomsymbol
Thanks for the information.
Also Go 1.8+ has sub-millisecond (500µs) pauses on large (18GiB) heaps: https://blog.golang.org/ismmkeynote
- Likes 2
Comment
-
Originally posted by Michael_S View Post
I thought the default Python implementation uses reference counting? That's not really dynamic garbage collecting, but it is very slow.
Originally posted by Michael_S View PostGood point. I should have dropped "dynamic".
- Likes 2
Comment
-
Originally posted by ssokolow View PostOne could argue that what Rust does is static GC. It is basically doing unreachability analysis at compile time.
Comment
-
Originally posted by ksec View PostI wonder how this would turn out. I tried suggesting a Rusted-Ruby, but there aren't that much interest.
- Likes 2
Comment
Comment