1. 11

Hey Lobsters,

There seems to be this trend (which started with rust) of these zero-cost abstractions, safe languages alternatives to C.

Rust is the most recent trendy one. I’ve been watching Myrddin closely the last months. A story about Zig has been posted recently on Lobste.rs.

My searches showed me that Cyclone was the first Rust. (But has been abandoned since) And I also read that Ada has been forgotten, but is still a good choice.

I think what I’m looking for is Rust, but I don’t like the syntax, I’m looking for a language without any garbage collector, with option types (instead of exception or return codes) and algebraic data-types.

Is there any language that I missed in this space? I’m asking because I’ve never heard of Zig before it was posted on Lobste.rs and I was hopping some crustaceans might know more that I could find.

  1.  

  2. 19

    I think what I’m looking for is Rust, but I don’t like the syntax, I’m looking for a language without any garbage collector, with option types (instead of exception or return codes) and algebraic data-types.

    You’re looking for … Rust. Not to be rude, but since when was syntax a good reason to exclude the exact thing you’re looking for? Particularly a very standard syntax at that.

    1. 1

      If the syntax is an issue then I’d say it’s not the exact thing that they are looking for.

      1. 10

        I guess my meaning is that syntax really should not be an issue when it comes to choosing a programming language. It is literally superficial, compared to everything they are looking for.

      2. 1

        Yes, you’re right, the syntax is the last thing I don’t like about the language.

        What I don’t like the most is the community. (it sometimes reminds me of the Rails community) Of course the community doesn’t do the language, but it does the libraries that I’m gonna use. And the Rust community is composed of a big chunk of inexperienced clueless programmers wrapping everything they can’t figure out in unsafe blocks. I don’t have an example in my hands, but I’ve seen many library written by people not understanding programming 101 (if bool { true } else { false }, …)

        I was hoping for a language like Myrddin (which I’m really following, but it still have manual memory allocation) with community à la suckless.

        I also don’t like how Rust solves some of its design problems with unsafe blocks. Add to this the community and the syntax (ability to do the same thing with 5 different syntax), and you have an okay language with cool concepts, but it doesn’t excite me.

        1. 6

          What I don’t like the most is the community. (it sometimes reminds me of the Rails community) Of course the community doesn’t do the language, but it does the libraries that I’m gonna use. And the Rust community is composed of a big chunk of inexperienced clueless programmers wrapping everything they can’t figure out in unsafe blocks. I don’t have an example in my hands, but I’ve seen many library written by people not understanding programming 101 (if bool { true } else { false }, …)

          I’m sorry. You don’t like a global community, probably because some of the head figures stem from the Ruby community, but you don’t have an example at hand?

          Gosh, It’s a new language, just gaining traction. It’s natural that people tip their toes and it’s great that people that previously didn’t touch systems programming or a functional-like language do it.

          Many core libraries (especially the regex libs and all the stuff in nursery) is top notch, Servo is a huge project and we have reached a level of integration - for example into build and cross-compile toolchains - that only Go can currently match in that space.

          I’m happy we are not like the suckless community - no one would care about us then, because elitists don’t spread a language well.

      3. 9

        Ats? ats-lang.com

        Tries to unify formal specification with the implementation.

        1. 2

          The Documentation link on that webpage doesn’t work …

          Edit: Here is the latest website: http://www.ats-lang.org/

          1. 1

            Yes, I don’t know whether I’m gonna use it. But this is this the kind of language I’ve never heard before, that I was expecting from this thread. It looks pretty cool. Thank you.

            1. 2

              I have some writings on ATS if interested. It’ll give an idea of what it can do.

          2. 7

            Ada, as unsexy as it is, is in this category.

            Edit: Although its option/discriminated union types are less robust and pervasive than Rust et al.

            Honestly Rust is probably your best option, syntactic quirks aside, if it has the semantics you want. Everything else either lacks some of your features or has a precariously small user base.

            1. 2

              Add SPARK to that for more safety than about anything can give you outside dynamic allocation. Ada doesnt have Rust-style protection for that.

              1. 1

                I don’t mind a small user base, as I explained I’m looking for a community. On the other hand this is for a hobby, not for professional development.

              2. 2
                1. 2

                  The various ML-derived languages have option types and algebraic data types, but they’re all garbage collected.

                  The various Pascals can be compiled, are low-level, lack garbage collection, and have wordy syntax. They lack algebraic data types, though they do have first-class enumerations and variant record types, unlike C.

                  1. 2

                    A sensible subset of C++. ie. Don’t use raw pointers, use shared/uniqueptr, use std::string, use lambdas or at least virtual functions/functoids instead of function pointer callbacks, use staticcast etc. instead of C style casts.

                    1. 1

                      Not a fan of Rust’s syntax, but I bear it for the semantics, and I think it’s worth it. It’s not the end word in safe systems programming, but it’s certainly pushes us forwards! Maybe we could make a prettier concrete syntax for it…. that would be cool :)

                      1. 1

                        Question: What about Go Lang?

                        (noob here)

                        1. 2

                          It has return codes, a garbage collector, and lacks fancy features such as algebraic data types.

                        2. [Comment removed by author]

                          1. 14

                            I’m looking for a language without any garbage collector, with option types (instead of exception or return codes) and algebraic data-types.

                            Go satisfies none of these requirements

                            edit: it’s also unsafe (as in, undefined behavior) in the presence of data races, further disassociating it from the safety traits of rust.