4 ms·
This looks promising. We haven't seen a lot of new languages lately that could turn into viable alternatives to C. Muon binaries don't seem to have a runtime or
by gizmo 8y ago
This looks promising. We haven't seen a lot of new languages lately that could turn into viable alternatives to C. Muon binaries don't seem to have a runtime or other dependencies so it looks like a module written in Muon can be statically linked into an existing C/C++ project. Pretty cool.
- xixixao 8y agoHave you seen Nim?
- gizmo 8y agoI've used it for some hobby projects a year or two ago. Unfortunately the compiler was very unstable back then and linking Nim into existing projects turned out to be pretty painful, in part because of the gc/threading model. There is a lot to like about Nim, but I think it tries to do too much.
- azhenley 8y agoI second taking a look at Nim: https://nim-lang.org/ https://nim-lang.org/ Some people will argue it isn't a contender for C though since it defaults to using garbage collection.
- lasagnaphil 8y agoBut you can turn off the GC and use it as a ‘better C’ (Nim supports raw pointers by the way.) Although you have to ditch most of Nim’s standard library, you can still import C libraries, including libc (I’ve heard you can also do this for the D language.)
- nimmer 8y agoOnly part of the stdlib depends on GC. Also the GC runs independently in each thread and can work with deadlines, making it harmless in most use-cases.
- nickmqb 8y agoYes, one of the goals for Muon is to make it easy to use Muon code from another language. There's a recent wave of new languages in the same spirit as Muon, like Zig, Kit, Jai and V (the last two have not yet been released). But since they all have no/minimal runtime, it should be relatively easy to reuse libraries between them.
- vedantroy 8y agoI noticed Rust was not your list of languages. Is Rust fundamentally different then these languages? If so, why?
- nickmqb 8y agoAh, good question. Rust could definitely be in that list as well! It's a more mature language (so that's why I didn't mention it in the list), but conceptually it very much fits.
- e12e 8y agoSeeing the original list, my guess was that it was no gc, with a small runtime - and the immediate question then was - how is this different/better than "D as a better C"?
- nickmqb 8y agoThe main difference is simplicity. D has a lof of features, like classes, inheritance, exceptions, properties, etc. Muon is a much simpler language that specifically avoids all of those things.
- IshKebab 8y agoRust aims for (mostly) memory safely which none of the others do. As a result it is way more complicated and rather different from them.
- Gibbon1 8y agoI think that is a very good design choice. Failing at that was one of the big catastrophes with C++.