7 ms·
Small joys of programming in Odin
- pmarreck 3y agoIs it just me or does it look a lot like Go?
- fredrikholm 3y agoThey both lack semi colons and parens around conditionals, but in terms of syntax its near identical to Jai.
- gingerBill 3y agohttps://github.com/odin-lang/Odin/wiki/Odin-vs-Jai https://github.com/odin-lang/Odin/wiki/Odin-vs-Jai
- fredrikholm 3y agoCheers Bill, really enjoy your blogs and videos.
- gingerBill 3y agoThank you for reading my articles and watching my videos!
- zote 3y agoYeah part of it gives the same vibes
- gingerBill 3y agohttps://odin-lang.org/docs/faq/#what-have-been-the-major-influences-in-the-languages-design https://odin-lang.org/docs/faq/#what-have-been-the-major-inf...
- CrampusDestrus 3y agoWarning: this is not a blog post about all the enjoyable activities you can partake in the company of a norse deity
- totetsu 3y agoGota keep an eye out for that kind of thing
- hutzlibu 3y agoAcording to this series, it is a mixed experience. https://de.wikipedia.org/wiki/American_Gods https://de.wikipedia.org/wiki/American_Gods
- sigzero 3y agoSeason 1 was good. Season 2...not so much.
- hutzlibu 3y agoAnd season 3 was better and season 4 will never come ... I do recommend the book.
- chrsig 3y agoI have a hard time recommending the book. The main character had no agency for most of it, and the plot was very unclear. It made for a good unveiling at the end, but given the size of the book...it's a lot to read for that payoff. I won't say don't read it -- it did manage to keep my interest, after all -- I just have a hard time recommending it due to the time-investment:reward ratio.
- hutzlibu 3y agoWell, you have to be into the topic, or not. Mythology has the trait of unclear plots and dealing with mysterious forces quite often .. (Some stories don't even have a reveal at the ending at all)
- crdavidson 3y agoOoh, hadn't seen @disable before, super useful to know! That'll be handy for doing toggleable build options for tracing / debugging. I've been using Odin for about a year now, many of the pain-points I've had have just been knowledge gaps. Odin's docs and debug info have slowly gotten better over time, and little discord-community tips here and there have made a huge difference for my quality of life.
- memco 3y agoI was curious after reading: can the @disable behavior be modified at runtime? For long running programs I find it helpful to be able to set a certain log level up front but have a way to update it without rebuilding or restarting the program. There may be other operations that can’t immediately be shut down and restarted so requiring a rebuild or restart to get debug logs is not an option in those cases.
- zannzen 3y agoIt cannot, it's purely a build-time feature. The disabled proc isn't even in the binary if you disassemble it. Also for the record I just noticed I wrote @disable everywhere instead of @disabled. That's been fixed now
- munificent 3y ago@disabled is neat. C# has long had the same feature: the [Conditional] attribute.
- pphysch 3y agoOdin looks extremely appealing to me, but I am quite sad about the lack of methods, or more specifically, lack of guarantees about "dot-autocomplete" support in mainstream code editors. But I do think methods make code more concise and readable too ( object_verb(obj) vs. obj.verb() ). They are syntactic sugar worth having. In 2023, tooling is at the point where RTFM is secondary for mainstream lang libraries (TFM being embedded into the editor in intelligent ways). I will not go back.
- nrabulinski 3y agoEditor suggestions are good enough when you know what you’re looking for or can guess where the method you’re looking for will be and what it will be called. You very much still need to RTFM if you don’t have neither
- pphysch 3y agoSo let's say I'm using some new SDK. I run a method that returns a Service object. In my current Go/Python world, I can dot-autocomplete to quickly get an idea of what procedures I can perform with this object. 90% of the time, this is sufficient to proceed. 10% of the time I need to RTFM/SO.
- galaxyLogic 3y agoMethod-syntax is more than syntactic sugar. It is not just about getting a function from an object and then executing that function. It is executing that function in the context of the object from which you get it, by utilizing the pseudo-variable "this" (or 'self' in Smalltalk) which refers to that object from which you got that function (a.k.a "method" in this case). But definitely the ability to have editor-support for lookup of argument-types etc. is a great benefit too.
- munificent 3y ago> It is executing that function in the context of the object from which you get it, by utilizing the pseudo-variable "this" (or 'self' in Smalltalk) which refers to that object from which you got that function (a.k.a "method" in this case). Ignoring runtime polymorphism for the moment, there's nothing special about "this" or "self". It's just another function parameter. Consider how in Python it is actually explicitly declared as a parameter in the method declaration.
- WhereIsTheTruth 3y agoI started using Odin just recently, I'm very happy with it so far, it's exactly what I needed, a mix between Go (no garbage collector) and C, context system, bunch of allocators available, a sane module system (folder based) and tagged union.. very good stuff And they have a very polished language server https://github.com/DanielGavin/ols https://github.com/DanielGavin/ols That helped me learn Odin in few hours only Give it a try, you might like it!
- jiehong 3y ago> Go (no garbage collector) Well, that’s incorrect: https://www.sobyte.net/post/2021-12/golang-garbage-collector/ https://www.sobyte.net/post/2021-12/golang-garbage-collector...
- WhereIsTheTruth 3y agoI should have perhaps wrote "without", as an argument why I enjoy odin, my english isn't great, my bad Or maybe I misunderstand your comment?
- sarchertech 3y agoI've been using odin on some side projects (mostly game dev). I narrowed down my choices to Odin and Zig. After building toy projects with both, I settled on Odin. I like that it feels fairly high level, but still gives you so much control over memory layout.
- Fraterkes 3y agoJust out of curiosity, what framework have you been using inside Oding for gamedev? Raylib?
- sarchertech 3y agoYeah I’ve been using raylib essentially just as a pixel buffer because I’m working on a pixel sim.
- matthewfcarlson 3y agoI'd love to read a write-up once you're done :)
- sarchertech 3y agoThis one is going to take a while, but I'll definitely put something out when it's done.
- dang 3y agoRelated: A Review of the Odin Programming Language - https://news.ycombinator.com/item?id=32799499 https://news.ycombinator.com/item?id=32799499 - Sept 2022 (140 comments) I like Odin - https://news.ycombinator.com/item?id=32626543 https://news.ycombinator.com/item?id=32626543 - Aug 2022 (204 comments) Odin Programming Language - https://news.ycombinator.com/item?id=30394000 https://news.ycombinator.com/item?id=30394000 - Feb 2022 (42 comments) Looking into Odin and Zig - https://news.ycombinator.com/item?id=28440579 https://news.ycombinator.com/item?id=28440579 - Sept 2021 (27 comments) The Odin Programming Language - https://news.ycombinator.com/item?id=22199942 https://news.ycombinator.com/item?id=22199942 - Jan 2020 (141 comments) The Odin Programming Language - https://news.ycombinator.com/item?id=20075638 https://news.ycombinator.com/item?id=20075638 - June 2019 (3 comments)
- rwbt 3y agoOf all the "Better C" programming languages I've tried so far, Odin is my favorite. Somehow it feels very ergonomic and familiar to a C programmer. Zig has many cool things, but I'm always second guessing myself and trying to figure out the "right" way to do things. But writing Odin is really nice and feels fun. I have high expectations from Odin going forward, but there are some pain points hopefully will get resolved in the future. - The toolchain is alright at best (I know this is being worked on right now). - Discord only communication with the community. They're all very nice but sometimes I wish a lot of these discussions should be indexed by a search engine.
- TheAceOfHearts 3y agoShaving the yak: I find `$FNAME.test.odin` to be a bit nicer than `$FNAME_test.odin`. I'm confused about this caller_location thing in tests. It looks like you're just passing `loc = loc` a bunch of times for no good reason. Why can't the language automatically or implicitly implement that functionality? Having to write `loc = loc` at the end of every assertion just seems silly.
- skribanto 3y agoWithout it, it would pass the current location, that is the location inside that test function, rather than the original parent call.
- TheAceOfHearts 3y agoSure, I'm saying the language could aspire to implement full stack traces automatically for tests, rather than requiring passing it for all assertions. Having to keep writing the same thing over and over is just boilerplate and a distraction. There's no reason the language itself couldn't implement some built-in support for such functionality along with the testing module, given that they control the full ecosystem.
- eikenberry 3y agoInteresting language... Any word on what they plan for concurrency?
- fuzztester 3y agoHow many names (or substrings of names) of programming languages (other than Odin) can people see in the title of this current HN post? :)
- gcoakes 3y agoI can't imagine someone named their language "of", "programming", or "in". So, I guess 3. Joy and Odin are obvious since they have shown up here recently. Totally tangential, but am I the only one that was taught to put punctuation inside of quotes and now despises that rule?
- fuzztester 3y agoIf you're referring to the period at the end of the sentence, I don't like that rule either. Seems more natural to have the period after the closing quote, at least in cases like this sentence of yours from above: >I can't imagine someone named their language "of", "programming", or "in". But I think there may be cases where period inside and before closing quote may seem better, e.g. if quoting what someone said, like a quoted sentence inside another sentence. But I'm not an English grammar expert.
- fuzztester 3y agoIt was kind of a trick question. 4: Small(talk), Joy, Pro(log) and D (from Odin).
- fuzztester 3y ago>and D The D language, that is. https://dlang.org https://dlang.org
- fuzztester 3y ago>Joy and Odin are obvious I had explicitly excluded Odin above. :)
- fuzztester 3y agoI'll wait another 12 or so hours to see if anyone else than gcoakes replies, before replying myself.
- hollowturtle 3y agoTried it and enjoyed the simplicity and productivity. I wish I would have been able to do more with it but the lack of docs stopped me somewhere along the path. To me the overview page is not enough, it doesn’t go much into details. The packages documentation page is hard to navigate, you either know what you’re looking for or just get lost. Same for code examples. The only way to have a better grasp of some stuff is by asking on Discord, which I don’t like doing. It would be great if something like “The Odin book”(like rust has) goes live
- cshenton 3y agoOdin is lovely and a great fit for graphics and games programming. I’ve been doing my real time graphics research in it (the CPU parts at least).
- devmunchies 3y agoHow does one compile a language to other architectures which are not “officially” supported? It should be doable since it uses LLVM? Example, ESP32 SoC.