5 votes

Muon: a modern low-level programming language

5 comments

  1. IanS5
    Link
    I’m not the author, but I saw this language pop up on hacker news and reddit a little while ago. Been messing with it the past couple of days and it seems like a really good alternative to C. I’m...

    I’m not the author, but I saw this language pop up on hacker news and reddit a little while ago. Been messing with it the past couple of days and it seems like a really good alternative to C. I’m a huge fan of rust but it’s a little to heavy to replace C completely. Muon hits the sweet spot for me when it comes to simplify vs ease of use. What do you all think?

    6 votes
  2. [4]
    unknown user
    Link
    I glossed over 10-15 files from the lib and compiler directories, and could spot only one comment in the source code. Almos no comments nowhere, which is not really nice. You'd at least expect...

    I glossed over 10-15 files from the lib and compiler directories, and could spot only one comment in the source code. Almos no comments nowhere, which is not really nice. You'd at least expect public functions to be documented.

    Apart from that, it seems to have some good features, but the biggest problem with it is that it is not C. I don't know or use C all that much, apart from the usual exposure one ends up having when they learn programming and use Unix-like OSes, but I can see thr value the language has: the standardisation and the wide availability of the language makes the trade offs it requires worthwhile. Instead of learning a new language, you can learn some patterns and use what you already know.

    Maybe a better way to improve on C is to build a new stdlib or a wrapper for the POSIX stdlib that can offer some modern features?

    6 votes
    1. [3]
      masochist
      (edited )
      Link Parent
      There are a lot of efforts like this, like GLib (and the C libraries listed in the "similar projects" section, specifically the Apache Portable Runtime and Apple's Core Foundation). The problem,...

      Maybe a better way to improve on C is to build a new stdlib or a wrapper for the POSIX stdlib that can offer some modern features?

      There are a lot of efforts like this, like GLib (and the C libraries listed in the "similar projects" section, specifically the Apache Portable Runtime and Apple's Core Foundation). The problem, as you can probably see at this point, is that there's no std for all of these libs.

      These are all open source (or majority open source) projects, but as is usual in the open source world, there's no agreement. This would need to come from the ISO C standardization committee, but they've typically aimed to keep the language small and simple, both to ease implementation and to keep it suitable for the small environments where the language sees much (most?) of its use, e.g. embedded devices.

      C++, on the other hand, is more open to embracing this kind of thing. Boost serves as something of a proving ground for C++ language and library improvements, and the ISO C++ committee is far more open to accepting these kinds of things. Modern C++ has things like filesystem abstractions, for example.

      5 votes
      1. [2]
        unknown user
        Link Parent
        Wow I did not know what Glib was, albeit seeing its name everywhere all thr time! Thanks for that link! Andbit seems to be an immensely useful library. How hard C++ is to learn? I imagine the new...

        Wow I did not know what Glib was, albeit seeing its name everywhere all thr time! Thanks for that link! Andbit seems to be an immensely useful library.

        How hard C++ is to learn? I imagine the new features are added cumulatively, rather than replacing old, obsolete ones. Does that not make the language too comples and hard to learn?

        I want to learn a language with types that compiles to native binaries (I mostly use Python, Ruby, Shell and Emacs Lisp), and I really like Go's interfaces. Looking around, Swift looks nice, and Vala is interesting, but they are tied to certain frameworks for the most part, and currently are moving targets. Go's interfaces are great, but the situation with generics and error checking, not so much. Also the core community is way too opinionates, and ties to Google is not really a compelling thing. I would also fancy a more expressive type system like Haskell's, and both strong typing and static typing. I am kind of perplexed at the moment. Maybe D or Rust has all or most of these?

        1 vote
        1. LiberHomo
          Link Parent
          Fair warning: I like C++. C++ is the survivor of roughly twenty to forty years of battle in determining which language is the portable extension to C. Swift actually ends up visually looking a...

          Fair warning: I like C++.

          C++ is the survivor of roughly twenty to forty years of battle in determining which language is the portable extension to C. Swift actually ends up visually looking a decent bit like modern C++, but I'm guessing it has less footguns (to be fair, most languages have less footguns). I haven't used them but D and Rust both seem solid. Rust was designed to avoid a lot of the footguns of C++, and I expect to learn it eventually, but I don't see a particularly compelling reason to switch right this second. D has better compile time, better safety than C++, and I'm told stronger abstractions. As for negatives, as far as I can tell Rust's abstractions are actually weaker (but more neatly delineated by syntax, whereas in C++ different abstractions are all class inheritance based); I don't personally like Rust's packaging system, for now it's effectively vendor-lock, per project version-specific dependencies make a lot of sense for enterprise level projects and API-stable libraries, but Rust's ecosystem is still young and API-unstable;

          What C++ really excels at is described by Herb Sutter as, “the programmer can always open the hood and take control.” Thread and memory safety are not impossible in C++, the problem is that because C++ is dangerous by default it means it requires a certain level of intentionality that is simply unrealistic to expect people to hold indefinitely. On the flip side I think that that intentionality is an important factor in learning systems programming.

          4 votes