samsara
mpl
samsara | mpl | |
---|---|---|
6 | 7 | |
64 | 288 | |
- | 15.3% | |
10.0 | 8.4 | |
over 1 year ago | 2 months ago | |
Rust | Standard ML | |
- | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
samsara
-
Garbage Collection for Systems Programmers
> IME it's the other way around, per-object individual lifetimes is a rare special case
It depends on your application domain. But in most cases where objects have "individual lifetimes" you can still use reference counting, which has lower latency and memory overhead than tracing GC and interacts well with manual memory management. Tracing GC can then be "plugged in" for very specific cases, preferably using a high performance concurrent implementation much like https://github.com/chc4/samsara (for Rust) or https://github.com/pebal/sgcl (for C++).
-
Why choose async/await over threads?
> Just for example: "it needs a GC" could be the heart of such an argument
Rust can actually support high-performance concurrent GC, see https://github.com/chc4/samsara for an experimental implementation. But unlike other languages it gives you the option of not using it.
-
Boehm Garbage Collector
The compiler support you need is quite limited. Here's an implementation of cycle collection in Rust: https://github.com/chc4/samsara It's made possible because Rust can tell apart read-only and read-write references (except for interior mutable objects, but these are known to the compiler and references to them can be treated as read-write). This avoids a global stop-the-world for the entire program.
Cascading deletes are rare in practice, and if anything they are inherent to deterministic deletion, which is often a desirable property. When they're possible, one can often use arena allocation to avoid the issue altogether, since arenas are managed as a single object.
-
Steel – An embedded scheme interpreter in Rust
There are concurrent GC implementations for Rust, e.g. Samsara https://redvice.org/2023/samsara-garbage-collector/ https://github.com/chc4/samsara that avoid blocking, except to a minimal extent in rare cases of contention. That fits pretty well with the pattern of "doing a bit of GC every frame".
-
Removing Garbage Collection from the Rust Language (2013)
There are a number of efforts along these lines, the most interesting is probably Samsara https://github.com/chc4/samsara https://redvice.org/2023/samsara-garbage-collector/ which implements a concurrent, thread-safe GC with no global "stop the world" phase.
-
I built a garbage collector for a language that doesn't need one
Nice blog post! I also wrote a concurrent reference counted cycle collector in Rust (https://github.com/chc4/samsara) though never published it to crates.io. It's neat to see the different choices that people made implementing similar goals, and dumpster works pretty differently from how I did it. I hit the same problems wrt concurrent mutation of the graph when trying to count in-degree of nodes, or adding references during a collection - I didn't even think of doing generational references and just have a RwLock...
mpl
-
Garbage Collection for Systems Programmers
I'm one of the authors of this work -- I can explain a little.
"Provably efficient" means that the language provides worst-case performance guarantees.
For example in the "Automatic Parallelism Management" paper (https://dl.acm.org/doi/10.1145/3632880), we develop a compiler and run-time system that can execute extremely fine-grained parallel code without losing performance. (Concretely, imagine tiny tasks of around only 10-100 instructions each.)
The key idea is to make sure that any task which is *too tiny* is executed sequentially instead of in parallel. To make this happen, we use a scheduler that runs in the background during execution. It is the scheduler's job to decide on-the-fly which tasks should be sequentialized and which tasks should be "promoted" into actual threads that can run in parallel. Intuitively, each promotion incurs a cost, but also exposes parallelism.
In the paper, we present our scheduler and prove a worst-case performance bound. We specifically show that the total overhead of promotion will be at most a small constant factor (e.g., 1% overhead), and also that the theoretical amount of parallelism is unaffected, asymptotically.
All of this is implemented in MaPLe (https://github.com/mpllang/mpl) and you can go play with it now!
- MPL: Automatic Management of Parallelism
-
Good languages for writing compilers in?
Maple is a fork of MLton: https://github.com/MPLLang/mpl
-
Comparing Objective Caml and Standard ML
Some of us are still using SML for research and teaching, e.g. https://github.com/mpllang/mpl
- MaPLe Compiler for Parallel ML v0.3 Release Notes
- MPL-v0.3 Release Notes
What are some alternatives?
sundial-gc - WIP: my Tweag open source fellowship project
cakeml - CakeML: A Verified Implementation of ML
nitro - Experimental OOP language that compiled to native code with non-fragile and stable ABI
LunarML - The Standard ML compiler that produces Lua/JavaScript
gara
HPCInfo - Information about many aspects of high-performance computing. Wiki content moved to ~/docs.
patty - A pattern matching library for Nim
mlton - The MLton repository
node-libnmap - API to access nmap from node.js
1ml - 1ML prototype interpreter
qcell - Statically-checked alternatives to RefCell and RwLock
ppci - A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python