13 ms·
The Odin Programming Language
- jitl 7y agoOdin 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?
- Nveterate 7y agoNim, Zig, Jai, Odin, Beef I wonder if a large company will throw into this royal of small and productive system languages. It seems like Nim, Zig/Odin, and presumably Jai all fit into their corners well. Someone with funds to generate tooling and combine the static structure of Zig, the productivity of coding in Nim. I think these language have all shown the potential for a great new language in this space.
- ryuukk_ 7y agoall of them are shit toy languages, they have 0 future since they aren't built with tooling/IDE in mind
- toxik 7y agoI wonder why this type of language is so attractive to bike shed. Just the right balance of complexity and usefulness perhaps?
- galangalalgol 7y agoTo hide any les of the machine you start giving up portability. c- might be a counterexample.
- kbd 7y agoMaybe because it's the layer of the stack most ancient, unsafe, and in need of replacing.
- jessermeyer 7y agoI think it's a mistake to think that in 10,000 years C will remain the golden standard for a language that still is reasonably close to the hardware.
- lang_throw_away 7y agoIt's no longer close to the hardware
- ryuukk_ 7y agono IDE or tooling, what's the point?
- _bxg1 7y agoWhenever I see a language like this (niche and new yet more than a toy, minimal ecosystem/tooling support, and evolutionary - not revolutionary - improvements over a much more widely-used language), I have to wonder, who's actually using these languages, and in what contexts? Where does the build complexity/hiring difficulty/lack of tooling tradeoff make sense for the advantages that one of these languages offers in return? I'm genuinely asking; any anecdotes out there?
- brakmic 7y agoThese days programming languages are going the way of JavaScript frameworks.
- gingerBill 7y agoOne of the big users of Odin at the moment is JangaFX's EmberGen, which does real-time volumetric fluid simulations for games and film. https://jangafx.com/software/embergen/ https://jangafx.com/software/embergen/ Odin has aided them with a huge amount of productivity and sanity of life which other languages such as C or C++ cannot offer, such as a strong and comprehensive type system, parametric polymorphism which is a pleasure to use, the implicit context system, extensive support for custom allocators, the `using` statement, the `defer` statement, and much much more.
- deadEndDave 7y ago> which does real-time volumetric fluid simulations for games and film With all of the advantages you listed, what do you think the possibility of Odin becoming more widely accepted in other fields who could benefit from using it?
- keldaris 7y agoGiven the extent to which real-time fluid simulation consists of GPU computation, is there anything that makes Odin particularly suited to that domain apart from the basic requirement of control over memory allocation and alignment? I'm more on the scientific side of CFD (so CUDA more so than shaders), but always interested in improving upon the kind of orthodox C++ I usually write.
- SiempreViernes 7y agoWith that name I expected a esolang build around the idea of everything being somehow globally accessible, why else name it after the all seeing god?
- gingerBill 7y agoOdin was originally the code name for this project, as names are not something to worry about when developing. However, people liked the name of the language so it has stuck. Most of my internal projects are usually named after a mythological figure before I give it a finalized name. It just makes me stop worrying about it and get on with solving the problems at hand.
- bsldld 7y agoThere is one more programming language that "loves C's efficiency for running code." Not tried it myself, but anyone interested can have a look at: https://github.com/crystal-lang/crystal https://github.com/crystal-lang/crystal
- kornish 7y agoNot to be confused with Oden (http://oden-lang.github.io/ http://oden-lang.github.io/), a functional language which compiled to Go. May it rest in Valhalla!
- jaked89 7y agoWe need less languages, more IDEs.
- grumpy8 7y agoSuch a great landing page, clear examples and documentation. Good job! By the way, there seems to be a css bug in the FAQ/quote section (The text shows dark grey on a dark grey background)
- gingerBill 7y agoThank you. I have fixed the css bug now.
- shdh 7y agoMy problem with most of these new languages (Zig, Odin, V, Nim, etc.) is that they lack an ecosystem. Lots of niceties don't exist yet.
- pasttense01 7y agoAnd that's one of the reasons they are posted about here: to help find developers who will work on the ecosystem.
- azhenley 7y agoAny comment on how Odin would work as a target for a compiler? I have a toy compiler project that I’m exploring different languages to compile to. So far I’ve tested compiling to C, Go, Zig, and Python.
- deleted 7y ago[deleted]
- typ 7y agoLooks promising and I haven't found an obvious pitfall (designs that I don't like) except the coupling with LLVM. I wonder if there is any feature that makes it unable to be translated to efficient C and therefore preventing it from bootstrapping with a C backend like Nim and V. I'll look forward to the self-hosting compiler.
- jug 7y agoPositively surprised by such an early language supporting multiple platforms already, having a clear Getting Started guide and FAQ, language spec and examples. Even aware about the Visual Studio Command Prompt in Windows despite supporting *nix — what is this!
- gingerBill 7y agoI commonly develop on Windows first, and thus support Windows as the main platform. My general philosophy is if it works on Windows, porting to nix is usually pretty simple. One thing that did take some time was getting System V ABI support for the Odin compiler so that nix platforms could support C-ABI 100%. As for VCVARSALL.BAT, there is work currently trying to remove the requirement for it once the compiler is built on Windows. However, Microsoft being what it is, it's quite annoying to get it working on everyone's machine correctly.