by ori_b · 10y ago · 0 comments
I'm a little sad that this got posted before I had a chance to write a good tutorial and upgrade the documentation. So, imagine that this project was just about to step into the shower when Hacker News came knocking on the front door. "A package? I like packages but.. damn it. I'm not presentable yet."
All the code in compiled binaries is in Myrddin, other than a few assembly stubs: There is no dependency on any installed library, although you can bind to C if you want -- for example, http://git.eigenstate.org/ori/cbind-example.git/tree/
But everything else is in Myrddin. For example, memory allocations: https://github.com/oridb/mc/blob/master/lib/std/alloc.myr
Or regexes: https://github.com/oridb/mc/tree/master/lib/regex
The various system calls are all here: https://github.com/oridb/mc/tree/master/lib/sys
And so on.
If you want to play with it, there's a playground here: http://eigenstate.org/myrddin/playground
And there's even a neat little regex debugger it ships with that I find useful:
$ redump '[a-z]+'
abc123
Match failed:
abc123
~~~^That was awesome. Either you're delivering a refreshing amount of honesty or like to under-promise then over-deliver like me. ;)
Funny thing about that....
I might have a RISC-V laptop before they finish Hurd. It still won't even run on RISC-V.
If so, does myrddin have any benefits (current or planned)?
The two languages are very different. D feels very much like an attempt to resolve the warts of C++ and extend its strengths, and it does a good job of that. If you like C++, you'll probably like D, although in many ways I feel that it has an immature implementation. (That's a rant for a different time, and it's not like Myrddin is more mature.)
Myrddin is going in a different direction, I think. It's far simpler than D. The best example of this is probably generics, where in D, they're seen as an opportunity to do complex metaprogramming on types, and idiomatic D uses generics. In Myrddin, they mean that your function is not allowed to care at all about types.
If you like both C and the ML family of languages, I think there's a good chance you'll like Myrddin.