News for hackers. Stuff that matters.
Re:Myrddin Programming Language by hawski on Sunday June 03, 2018 @04:32PM (#17221681)
I believe that currently https://myrlang.org/ is a more canonical address.

I can't wait when it will be more mature. It uses QBE compiler backend [0] - "a pure C embeddable backend that provides 70% of the performance of advanced compilers in 10% of the code". Which by itself is very interesting. It does however only support x86_64, but it seems that work on arm64 is underway.

I like that it does not depend on GCC or LLVM. I also cheer Toybox, Oil shell and other rewrite-the-world projects - I'm that kind of weird.

It ticks many boxes for me. Rust brings memory safety, but I can't help the feeling that it just looks like C++. I wonder if it would be beneficial to implement a static analyzer for C, that would take into account additional ownership information on pointers. Something like:

  #define OWN
  int func(struct foo OWN*ptr)
So it would just compile to C, but the analyzer would know more.

Lately I'm wondering how good could be a dynamic language with a homegrown compiler backend. It probably does not have to be fully optimized to be faster than Python. Maybe it would not be as fast as Lua-JIT, but JIT brings it's own set of problems. It could be a fun project to make a compiler for Wren language for example. Such a language could target JVM and CLR as well.

Sorry for a brain dump, but I don't have time to make it more coherent. I may be too passionate about the topic, while lacking experience. I hope it is useful to somebody.

[0] https://c9x.me/compile/

Re:Myrddin Programming Language by pjmlp on Monday June 04, 2018 @03:56AM (#17225499)
What you want is being researched as CheckedC.

https://www.microsoft.com/en-us/research/project/checked-c/

Microsoft's SAL introduced with their major security rewrite in XP, provides the annotations you mention.

https://docs.microsoft.com/en-us/previous-versions/visualstu...

https://msdn.microsoft.com/en-us/library/windows/desktop/cc3...

But it all boils down to C developers actually caring about using them.

Re:Myrddin Programming Language by hawski on Monday June 04, 2018 @04:45AM (#17225751)
If I understand it correctly CheckedC woods as an extension to the language, so you need CheckedC compiler to actually use it.

I agree that SAL fits my description. Is it available outside of Windows? I've seen that someone wanted to add SAL support to clang [0], but decided against, because of Microsoft's patent on the thing [1]. Or than that it looks cool. Thanks for the pointer.

[0] http://clang-developers.42468.n3.nabble.com/RFC-Starting-sup...

[1] https://patents.google.com/patent/US20050076331A1/en?q=Sourc...

Re:Myrddin Programming Language by pjmlp on Monday June 04, 2018 @04:50AM (#17225777)
Actually gcc does have something similar to SAL with FORTIFY_SOURCE, but it is not as feature rich.

https://access.redhat.com/blogs/766093/posts/1976213

Re:Myrddin Programming Language by dang on Monday June 04, 2018 @01:40AM (#17224962)
> I believe that currently https://myrlang.org/ is a more canonical address

OK, we changed to that from https://eigenstate.org/myrddin/. Thanks!

Re:Myrddin Programming Language by FractalLP on Monday June 04, 2018 @08:22AM (#17227050)
Check out Red language if you get the chance. It sounds like you might like.