4 ms·
I believe that currently https://myrlang.org/ https://myrlang.org/ is a more canonical address. I can't wait when it will be more mature. It uses QBE compiler
by hawski 8y ago
I believe that currently https://myrlang.org/ 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/ https://c9x.me/compile/
- dang 8y ago> I believe that currently https://myrlang.org/ https://myrlang.org/ is a more canonical address OK, we changed to that from https://eigenstate.org/myrddin/ https://eigenstate.org/myrddin/. Thanks!
- pjmlp 8y agoWhat you want is being researched as CheckedC. https://www.microsoft.com/en-us/research/project/checked-c/ 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/visualstudio/visual-studio-2013/ms182032(v=vs.120) https://docs.microsoft.com/en-us/previous-versions/visualstu... https://msdn.microsoft.com/en-us/library/windows/desktop/cc307398.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/cc3... But it all boils down to C developers actually caring about using them.
- hawski 8y agoIf 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-support-for-SAL-td3466171.html http://clang-developers.42468.n3.nabble.com/RFC-Starting-sup... [1] https://patents.google.com/patent/US20050076331A1/en?q=Source+code&q=annotation&oq=Source+code+annotation https://patents.google.com/patent/US20050076331A1/en?q=Sourc...
- pjmlp 8y agoActually 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 https://access.redhat.com/blogs/766093/posts/1976213
- FractalLP 8y agoCheck out Red language if you get the chance. It sounds like you might like.