8 ms·
Odin seems rather similar to Zig: https://ziglang.org/ https://ziglang.org/ It would be interesting to hear from anyone who has spent time in both about the di
by jitl 7y ago
Odin seems rather similar to Zig: https://ziglang.org/ https://ziglang.org/
It would be interesting to hear from anyone who has spent time in both about the differences in experience.
It’s a trend of “Better C than C” languages that don’t go as far as Rust or C++ in terms of either complexity (or safety) but are more opinionated and modern than C. I think Nim can squeeze into this category, too, but maybe not? Nim is confusing to me.
Jon Blow is also working on one of these, but it isn’t released yet: https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md
- wiremine 7y ago> It’s a trend of “Better C than C” languages that don’t go as far as Rust or C++ in terms of either complexity (or safety) but are more opinionated and modern than C. I don't see C going away anytime soon, but it's exciting to see people attempting to replace it over the long term. Fun to see where it goes!
- AndyKelley 7y agoI had the pleasure of meeting gingerBill at Handmade Seattle: https://mobile.twitter.com/odinlang/status/1195762062841937920 https://mobile.twitter.com/odinlang/status/11957620628419379... It was really fun to hang out and talk shop
- gingerBill 7y agoIt was a pleasure meeting you too, Andy.
- abnercoimbre 7y agoI'm making it a point to generally have independent compiler authors at Handmade Seattle. You two were class acts -- thanks for attending!
- gingerBill 7y agoThank you for inviting us! It was a brilliant event, and thank you for all your hard work.
- GavinMcG 7y agoNot to go too far afield, but I agree that Nim is in that category and I'm curious what parts of it are confusing to you.
- gingerBill 7y agoNim is a cool language but it does have a lot of things about it by default where it is not targeting itself as being a C alternative, such as garbage collection (by default). Nim is also a very complex language with numerous features to it making it a lot more complicated compared to C. So for someone who might like C might not like Nim. However, I recommend everyone try out as many languages to see what they like. Being that I am the Odin creator, I do think you should give Odin a go because it is much more focused on being a C alternative and tackling the kinds of problems it solves.
- Touche 7y agoI really like Nim but GC makes it a nonstarter for embedded devices. So to me Nim is in the same category as Go.
- beagle3 7y agoNim could always work without a GC, and it’s getting better at it all the time. Most of the standard library does depend on GC availability, but this is being worked on.
- Touche 7y agoYeah having 2 ecosystems where some stuff depends on GC and some stuff doesn't is always going to be a turnoff to me. Glad that Odin and Zig made the decision to not.
- ezquerra 7y agoThe nim team is currently working on removing the garbage collector by means of a new reference counting based “garbage collector mode” called “arc” (for automatic reference counting). You can get more info in the following link, where it is described as “plain old reference counting with optimizations thanks to move semantics”: https://forum.nim-lang.org/t/5734 https://forum.nim-lang.org/t/5734 The objective is to make nim suitable for embedded programming and other use cases for which garbage collection is a non starter. This new —gc:arc mode is already available in the nightly builds and the benchmarks are already impressive. I believe that the plan is to make arc the default “garbage collector mode” in nim 1.2.
- rehemiau 7y agoJonathan Blow's language is the most interesting from these three for me because it will have nice metaprogramming features. The document you linked to seems slightly outdated. One of the beta testers has published some more up to date videos with his language introduction and initial experience: https://youtube.com/watch?v=i1vbvikDiI8&index=1&list=PLhEuCycbde-vyFoSBJbdKjw-AVTdQRE5g https://youtube.com/watch?v=i1vbvikDiI8&index=1&list=PLhEuCy...
- rishav_sharan 7y agowell Jai is probably the least interesting language for me as the others actually exist. When Jai ever gets released, only then I can see all its warts and glories.
- jjuel 7y agoI mean it obviously exists. He livestreams coding on the language and in the language. Sure very few people can actually use it right now, but existence is not in question.
- siver_john 7y agoBut existing for someone else, and existing where I can use it are two different things. I'm sure there are lots of cool tools and things that exist at big companies like Google (or more interestingly say the NSA) but for all my intents and purposes they don't because I can't interact with them. A reverse corollary to Russell's Teapot? So what if there is a teapot orbiting Jupiter, I can't get it so it allows me no ability to serve tea. Therefore it might as well not exist!
- boardwaalk 7y agoRespectfully speaking, I don't think we need to get anywhere near some weird "reality is relative" argument here. Just say it's not useful to you because you can't use it. No need to say it doesn't exist, even if it just doesn't exist "for you." (As an aside, I think a lot of societal problems in the world today have roots in relativism and such -- so it's a bit of a bugbear.)
- Gene_Parmesan 7y agoYou can add Beef to that list: https://www.beeflang.org/ https://www.beeflang.org/ I've actually enjoyed playing around with Beef, the dev basically took C++ and gave it the syntax and core library design of C#. Here's a page from the guide just to give an example of the look and feel: https://www.beeflang.org/docs/language-guide/memory/ https://www.beeflang.org/docs/language-guide/memory/ Note that despite the appearance, there's no GC, no ref-counting, explicit manual memory management, and so on.
- totalperspectiv 7y agoI hadn't seen Beef before. Is it 'as fast as C'? The docs look nice.
- Gene_Parmesan 7y agoI can't speak to whether it's literally as fast as compiled C code. I imagine that there will be common uses cases where it's very slightly less efficient due to its support for things like dynamic dispatch; but I don't see any reason in my brief experience with it why it couldn't at least be as fast as equivalent C++ code. It uses LLVM for its backend. One of my favorite things about it is the way it handles memory during debug runs. (My #1 favorite thing is that it was all developed by one guy working solo - Brian Fiete, a cofounder of PopCap Games.) First, it's able to trace allocated memory during debug execution and immediately report on memory leaks, along with the location in code where the leaked memory was allocated. Second, it can guard against use-after-frees in debug by marking the memory freed, but not actually reclaiming it. Any subsequent writes/reads to that location will immediately fail with the object's allocation stack trace. Both of these are turned off during normal builds but seem to be excellent debugging tools. The IDE is also cool and was developed in conjunction with the language. It's not the most feature-rich application and there are some bugs as you'd expect, but it's a perfect example of dogfooding as it was written in Beef. Hot code reloading is also supported. Note that I have zero connection with this language, other than that I really enjoy it so far, and that I reported a minor issue that is probably very specific to me and me alone, and Brian replied to me personally and we had a pleasant brief exchange.
- BubRoss 7y agoI don't think anything has beat the designs of Clay or V, but they aren't really usable. Then again zig intentionally breaks on windows text files so I couldn't say it is widely usable either.
- AnIdiotOnTheNet 7y agoEven notepad can do \n-only newlines these days. Zig can't do UTF-16 files either, but no one complains about that.
- earenndil 7y agoCyclone was definitely there. Sadly no longer maintained, and not at all practical to get working on modern systems (I did some work on it, then gave up).
- mottosso 7y ago> Then again zig intentionally breaks on windows text files Too true. I ran into this after about 10 minutes of trying the language. Copy pasting from a GitHub issue? Better hope those invisible newlines are what you expect.
- renox 7y agoI view this as a good idea!
- BubRoss 7y agoYou think alienating 90% of your potential users is a good idea?
- dooglius 7y agoBeing "opinionated" is a step back IMHO, one of the big selling points of C is that it doesn't get in the programmer's way.
- einpoklum 7y agoC doesn't get in your way in the same sense that PDP-7 Assembly doesn't get in your way.
- WalterBright 7y ago> Better C than C The D programming language can be used as a better C: https://dlang.org/spec/betterc.html https://dlang.org/spec/betterc.html and only requires the C runtime library to link to.
- jug 7y agoNim has an advantage in being so mature. Unfortunately with it maturing, my feeling of it sharing Python’s simplicity slowly faded away.
- bvrmn 7y agoZig has a very small "core" idea. Explicit allocator, basic C semantics, clear UB, errors and comptime. All other features implemented in stdlib in zig itself. Odin fills like go with "special" runtime. For example dynamic arrays are implemented as compiler component in C++.
- gingerBill 7y agoOdin's '"special" runtime' as you call it is extremely minimal and is still easy to swap out with your own, and also only gets used if you use those features. Zig has a runtime of its own now since it has added coroutines (async/await) as a core feature, but that is still extremely minimal aw well.
- pankajdoharey 7y agoI wonder the same why is everyone trying to replace C, but hardly anyone beside Rust is trying to replace C++, does everyone think C is an easier target?