Comment by onlyrealcuzzo

2 months ago

I'm building a memory safe programming language that's like Rust, with a declarative concurrency model, which makes it much safer, simpler, and easier and nearly as fast & efficient

https://github.com/cuzzo/clear

The goal is to make Rust code nearly as easy to write as Ruby, but it almost always does the absolute best strategy.

You can write somewhat slow untyped code, and the internal tooling can guide you to adding all the types and optimizations and concurrency strategies that will make your code as fast as possible.

Sounds a lot like Crystal, which is also similar to Ruby and features a green fiber runtime: https://crystal-lang.org/#concurrency

  • Yes, in a lot of ways.

    Crystal wanted to be Ruby/Go - essentially a faster Ruby, that sort of scales, too.

    CLEAR aims to be a substantially safer Rust - no Garbage Collector - no manual synchronization hazards, and safer than even Pony - but also with far less complexity than Rust.

    Crystal's fibers did not do well multi-threaded until somewhat recently, and AFAIK, it's still very far behind Rust/Tokio and Go in a lot of important benchmarks. Crucially, afaik, p99 in adversarial workloads can still blowup easily.

    Like Tokio, CLEAR lowers fibers into Finite State Machines instead of stacks, which perform better than stacks in wait heavy (i.e. Go's primary market - web servers) and idle-heavy scenarios (i.e. chat servers, telecom, etc), and it has Go's work stealing algorithm + forced yielding to ensure p99 doesn't blow out.

    Also, CLEAR transpiles to Zig, so it has native access to the entire C library. Crystal has a bootstrapping / ecosystem problem that's unlikely to ever be solved.

    CLEAR doesn't need a single person to contribute to it to have access to basically everything.

    Also, transpiling to Zig means you get Zig's other killer feature - you can compile to any target (i.e. Linux) from any target (i.e. MacOS).