1. 21

  2. 9

    I hope some openbsd folks give myrddin a serious try. It basically has the same model as C, except you get bounds checking and pattern matching. I think it is a great lightweight language with good security characteristics.

    It will work well with pledge for example. One issue I can see is it doesn’t use the system memory allocator, or have proper ASLR support (yet). But there is lots of potential.

    1. 11

      I’ll get behind that statement. I’ve given myrddin a try and like what I’ve seen. Once a stable version has been released I’d like to get it added to our ports tree.

    2. 6

      Great work. The HN thread a while back had me confused on whose doing what with what. Your post may have cleared it up: you’re doing Myrddin language; Quentin is mpu doing QBE backend; Andrew Chambers is only doing a front end to QBE for C that’s written in Myrddin; all three contributing code (i.e. libraries) to Myrrdin. Correct me if I’m wrong about any of it.

      I’m glad that QBE has made this much progress. I was eyeballing it for my verifiable builds concept since it’s so small, clean, and doing 80/20 rule for optimizations. It could become a nice candidate for verification or even reproducible builds once it can compile a whole, C compiler. I still find Myrrdin interesting with the article showing you’ve done a great job on how concise and readable the code is. Plus all the libraries you’ve made to make it useful in the real world vs so many academic attempts at new languages.

      Great stuff.

      1. 6

        The C compiler isn’t really an official part of myrddin, it was just that qbe needed a frontend for testing and i was learning myrddin at the time. It was a fun project to try things like pattern matching against a C AST.

        The performance of QBE is really quite amazing. I am expecting qc to have performance between -O1 and -O2 with compile times perhaps 4-5 times less than gcc -O2. So far qc is compiling around 5k lines of C code.

        1. 2

          That was my understanding of their relationship. Appreciate the clarification. Those performance results are already amazing given size of compiler and one person being behind it.

          1. 3

            Oh and you made one minor mistake, QBE is in C, so mpu isn’t directly contributing so much code to Myrddin, but he does help Ori with the design. One example of this is discussions for coming up with a design for myrddin’s answer to C++ destructors and rust’s borrow checker.

            My contributions are relatively minor, partially because I am focusing on my own projects, but I’m a happy user of myrddin. And Ori is extremely good at maintaining and fixing issues I have run into rapidly.

            New contributors would be able to have large levels of input into things like the design of the stdlib and language, So its a good time to get started.

      2. 5

        Impressive progress! This has convinced me to try Myrddin soon.