14 ms·
I like Odin
- t-writescode 4y agoWow. The comments in a lot of these threads look to be full of a lot of snark and anger towards other programming languages and people. I wonder if we're approaching another one of those periods again where people need to be at [not their computer] again.
- torginus 4y ago> As someone who is interested in systems programming, and has experience working with Go I wonder how Go got it's reputation as a systems language. Imo, it occupies the same abstraction level as Java or C#.
- noisy_boy 4y agoMaybe Go compiling to native binary with excellent performance and being somewhat "simple" (say, compared to Java 8 streams conveniences etc), has given rise to that impression. Though I wasn't under that impression myself (I think Go having a GC compared to usually more manual memory management by systems languages is a pretty significant difference).
- copx 4y agoAFAIK Go was and is primarily used to write back-end server software and this is commonly called "systems programming" (as opposed to application programming) too. It is kinda confusing that the term is used for that and for low-level embedded/firmware/kernel programming, despite both areas having little in common with each other.
- doliveira 4y ago> and this is commonly called "systems programming" Is it, though? My impression it only started with Go calling it that way
- undecidabot 4y agoSystem programming languages also used to refer to non-scripting languages. See this paper by John Ousterhout (creator of Tcl) written in 1997: https://users.ece.utexas.edu/~adnan/top/ousterhout-scripting.pdf https://users.ece.utexas.edu/~adnan/top/ousterhout-scripting...
- ObscureScience 4y agoI don't think so. I think it's just the way Rob et al. used the term from their previous experience. It's not meant to mean operating systems language, nor embedded systems language. Rather for writing parts of a systems, such as servers. I would say that the definition is not that far away for Java or C#, but the expectation is simply that it would be "lower level" components of a system, including unix like utilities.
- wizofaus 4y agoNot unreasonable to argue that something like Docker or k8s is more "system software" than an application.
- agumonkey 4y agoI always interpreted go "system" as networked async systems and not electronic chip systems.
- rgoulter 4y agoI think this makes sense considering that most of the cloud-native software is written with Go. (Docker / Podman, Kubernetes, Helm, Istio, Terraform, etc.)
- agumonkey 4y agoI don't know if I'm crazy but it matches the definition of a system. Coupling different parts together. These are just high level systems, and unsurprisingly when people see 'system programming language' they want to see high level assembly like C; but it's misplaced reflex in this case.
- hsn915 4y agoWhen Go was first announced ~2009, Rob Pike explicitly framed it as a systems language https://www.youtube.com/watch?v=rKnDgT73v8s https://www.youtube.com/watch?v=rKnDgT73v8s I would not say it's the same as Java or C#. The crucial difference is that it compiles to a native executable binary file, not something that needs a virtual machine.
- deleted 4y ago[deleted]
- bhedgeoser 4y agoC programs are executed inside the C virtual machine.
- wizofaus 4y agoCan't tell if serious...
- never_inline 4y agoEither a reference to Abstract Machine from the standards, or something suggesting the processor is a C virtual machine.
- PopGreene 4y agoInteresting article: "C Is Not a Low-level Language" (https://queue.acm.org/detail.cfm?id=3212479 https://queue.acm.org/detail.cfm?id=3212479)
- never_inline 4y agoI have read that. While I feel that article is being too harsh on C, it would be interesting to have cache intrinsics just like we have SIMD intrinsics. I would imagine that would be more complex to implement, however.
- 4y ago
- Shorel 4y agoI agree with the others. Go is its own abstraction level. Not powerful enough to be compared to Java. Probably closer to Node.js, that's to say, it is like JavaScript in the server. Judging by the developers who use it. Except it is compiled.
- pjmlp 4y agoBecause languages like Oberon exist, used to write graphical workstations operating systems, and Go has the same set of features as Oberon. Unless one doesn't consider writing compilers, linkers, GPU debuggers, container management, syscall emulators, unikernels systems programming.
- coldtea 4y ago>Unless one doesn't consider writing compilers, linkers, GPU debuggers, container management, syscall emulators, unikernels [to be] systems programming. Since you can write the above with any language, perhaps even Python or Lua if you wanted to, it's not exactly the ability to write the above or the fact of having written the above in a language, that makes a language to be considered a "systems programming language". In some way, what is called a systems languge it's not a technical capacity thing ("can do X, Y and Z, so it's a systems language"). It's a term applied deliberately, that also includes other aspects.
- pjmlp 4y agoSure one can play word games all day long if that is your point.
- coldtea 4y agoCivilization is all about word games, is my larger point, and those games are important business and what drive characterization - they're not something incosequential that we can "set aside and get to the real work". Doubly so if what we're concerned about is labelling itself, like "what is and what isn't considered a systems language". Then we're in the word domain, not in the measurement domain.
- pjmlp 4y agoActions matter more than words, and in that field Go has already proven itself, regardless of what the priests of the holy church of system programming might preach at the pulpit. In fact their holy C can only be used for the daily activities, when going outside the ISO C Bible, tainting itself with unholy compiler extensions.
- kevinmgranger 4y agoI think the definition of "systems" changed over time. It used to mean building the foundations of operating systems, e.g. kernel and basic userland utilities. Now it means building higher-level userland tools and internet oriented tools. I think the implicit consensus is the lower level stuff is a "solved problem".
- randomdata 4y agoThe simple answer is that it was announced as one. The more complicated answer is that, traditionally, systems programming languages were those which are not scripting or assembler languages. If you listen to Pike for more than a few seconds you'll soon notice that he's a bit of a language purist, so whatever modern interpretation you might have for a term is unlikely to match what he is communicating. More specifically, it was announced as a systems programming language designed for things like web servers and systems of that nature, with more control than Java in some areas. Even with conflicting definitions of systems, there should have been no illusions about it being designed to be in roughly the same space as Java with that context. It was very much suggested from the onset that it was meant to compete with Java. But, ultimately the game of telephone truncated the context that would have helped with finding the right definition of systems and, I expect exacerbate things, there was Rust coming onto the scene juicing the situation with its fans often claiming that "Go isn't a systems language, Rust is!" leaving some revisionism about people believing that Go was a systems language (in the modern sense).
- copx 4y agoIt is not hard to design a language which is a "better C than C" because C has obvious warts, the article mentions a few. But the warts just aren't big enough to justify switching to a different language. That's why no "better C than C" has ever become really popular.
- hsn915 4y agoSimple is not easy. The devil is in the details. Many people can try. It's not easy to do a good job at it.
- Comevius 4y agoThe solution is a language that seamlessly interoperates with C, like Zig does (no FFI, high impedance match with C, cross-compiles C, exports to C ABI, transpiles C, compiles to C).
- deleted 4y ago[deleted]
- rawoke083600 4y agoi had to stop reading cause of all the ads ! Bloody hell !
- jdrek1 4y agoJust use uBO like everyone else, there's not a single ad on that page visible for me.
- rawoke083600 4y agoWas reading on mobile, probably need to use some adblocker for mobile as well.
- hsn915 4y agoI hadn't realized all the ads until I tried to read it from my mobile. Here's an alternative link (substack): https://hasen.substack.com/p/odin-praise https://hasen.substack.com/p/odin-praise
- hutzlibu 4y agoFirefox mobile works with adblockers ..
- fake-name 4y agoOdin Homepage: https://odin-lang.org/ https://odin-lang.org/ (I was curious) I can't see this being generally successful unless it can interoperate with existing C code without much effort. Update: It appears it can: https://odin-lang.org/docs/overview/#foreign-system https://odin-lang.org/docs/overview/#foreign-system It apparently targets LLVM.
- flohofwoe 4y agoI recently wrote a bindings generator to Odin for my C libraries, and the FFI is very well thought out, down to defining things like linker dependencies in the code. For instance see here: https://github.com/floooh/sokol-odin/blob/main/sokol/gfx/gfx.odin https://github.com/floooh/sokol-odin/blob/main/sokol/gfx/gfx... The only minor downside (compared to Zig) is that Odin still requires a separate C/C++ toolchain to actually build the C dependencies. But I guess that's a typical 1st-world-problem ;) (however AFAIK Odin's FFI system isn't in any way related or depending on LLVM).
- Tozen 4y agoI think the reason why he is liking Odin, as a person who used Go, is because it's arguably an offshoot language of Go. Odin (https://odin-lang.org/docs/overview/ https://odin-lang.org/docs/overview/) has borrowed a lot from Go, which can be easily detected in various syntax and concepts. Another language which is in both the C and Go alternative language category, is Vlang (https://github.com/vlang/v/blob/master/doc/docs.md https://github.com/vlang/v/blob/master/doc/docs.md). For anybody that has used Go, these are definitely languages to check out and would be easier to learn.
- cyber_kinetist 4y agoIn terms of actual features though (ignoring trivial syntax), Odin resembles more of Jai. In fact, when I first found about it a few years earlier I though it was an open source clone of Jai. Today many features have diverged since then, and Odin is ahead by many aspects (mainly that the compiler is open source, but also that it’s already being used in production via EmberGen). I still really want the full metaprogramming capabilities that Jai has though (which is lacking in Odin currently).
- hsn915 4y ago> which is lacking in Odin currently gingerBill (the creator/designer of Odin) has been quite clear that Odin is done (in terms of language features) and that he does not intend to ever include support for "macros" or other advanced metaprogramming features.
- Tozen 4y agoI see it more as Odin has a very strong Go-like foundation, and then borrowed heavily from Jai too, in terms of syntax and various features. So that superficially, it looks like Jai. To the point, people could think it was a clone or fork. Also, Jai is a lot more Go-like than many people realize. When Jai diverges from various C/C++ concepts and traditions, it can do so in Go-like ways. > ...Odin is ahead by many aspects (mainly that the compiler is open source, but also that it’s already being used in production... Totally agree with you here. It could be argued that Jai has fumbled its advantage or at least the window of opportunity to claim its more innovative or more game program friendly than other languages. Odin has pretty much covered that gap, so that most of what people liked about Jai, is in Odin and can be used today.
- torginus 4y agoI have high hopes for Odin. There has been a recent trend of C/C++ replacement languages like Zig,Rust,V, etc. with each one trying to find its niche and triumph over its competitors. Odin's niche is the kind of high performance programming that's done in games and other real time visualization applications. Other than fixing C's known issues, like having proper tagged unions, fixing macros, and the crazy compilation model among others, it has a bunch of features, that make it appeal to game programmers. Features, such a structure of arrays support for data oriented design, builtin support for matrices, vectors, and shader-like syntax for 3D math, allocators and the like. And it certainly doesn't hurt that unlike many of these upstart languages, Odin has a real, successful, commercial product built in it, EmberGen, which is used for CG smoke and flame simulations: https://jangafx.com/software/embergen/ https://jangafx.com/software/embergen/
- nyanpasu64 4y agoWhat happens when you mutate the target of a pointer to the same memory as the target of an "immutable" reference (eg. function parameters and union switches)?
- hsn915 4y agoIf I understand correctly, procedure parameters are only immutable in the scope of the procedure because the compiler will decide wether to pass them by value or reference. At the calling scope, the parameter passed is not immutable. You can pass a pointer too, if you want. There's also this pattern: name := name which redeclares name in the current scope and shadows the name that exists in the outer scope call :: proc(b: int) { fmt.println(b) // c := &b // illegal! // b = 10 // illegal! b := b b = 10; fmt.println(b) }
- flohofwoe 4y agoA small but (IMHO) very neat detail is the Pascal-style syntax for defining variables (without requiring a separate 'var' or 'let' keyword): // inferred type: a := 23 // explicitly typed, the type is squeezed between the : and = a : u32 = 23 OTH constants now require special syntax: a :: 23 ...but at least this is consistent with other places in the language, like functions: my_func :: proc(...) ...and 'squeezing in the type' also works as expected for constants (which admittedly looks a bit weird, but is also hardly needed): a : u32 : 23
- brabel 4y agoSo, the pattern is: <const_name> : [type] : <value> <var_name> : [type] = <value> where the type is always optional as it can be inferred? That's why `a :: 32` declares a constant, but `a := 32` declares a variable... This is pretty neat, actually.
- mananaysiempre 4y agoThis pun originates from Limbo, I think. Go inherits the colon-equals for the inferred-type definition, but not the colon for type ascription, yet another way in which it could have been beautiful but isn’t.
- gingerBill 4y agoIt's slightly older than Limbo, and comes from Newsqueak. The difference is that Newsqueak used keywords for the other non-variable declarations. `x: int = 123`, `const X: int = 123`, `type My_Int: int`, etc.
- hsn915 4y agoSubstack link if you are reading from mobile or otherwise don't have an adblocker: https://hasen.substack.com/p/odin-praise https://hasen.substack.com/p/odin-praise
- avgcorrection 4y agoMemory unsafety (by default without opt-in) is being treated like a feature in these newer languages.
- hsn915 4y agoWhat other language takes this stance? (other than jai, which is not released)
- renox 4y agoZig
- renox 4y agoThat's because memory safety has a price: either a GC (which creates interoperability issues if you have two languages with GCs..) or a complexity price like in Rust.. So these languages stay memory unsafe but tries to minimise the issues caused by the lack of safety.
- avgcorrection 4y agoMaking an effort in language design also has a price.
- still_grokking 4y agoThat's not true. Memory safety could be free. Actually it would even outperform any memory unsafe language, when done right™. The key would be hardware supported automatic memory management. This tech exists since many years but nobody uses it (likely because our "good old friend": patents, which is a death sentence to any good idea). https://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon12AndThen.pdf https://researcher.watson.ibm.com/researcher/files/us-bacon/... https://people.eecs.berkeley.edu/~kubitron/papers/holistic_runtime/maas-asbd16-hwgc.pdf https://people.eecs.berkeley.edu/~kubitron/papers/holistic_r... https://adept.eecs.berkeley.edu/wp-content/uploads/2018/06/A-Hardware-Accellerator-for-tracing-garbage-Collection-Maas-6-2018.pdf https://adept.eecs.berkeley.edu/wp-content/uploads/2018/06/A...
- eterps 4y agoNice, it also supports distinct types (Similar to Nim): https://odin-lang.org/docs/overview/#distinct-type https://odin-lang.org/docs/overview/#distinct-type
- ceronman 4y agoOdin sounds like a nice improvement over C, however this caught my attention: > If your “dread” of C comes from fear of memory management, then Odin is probably not for you, and dare I say, maybe systems programming is not for you. I have to say that my dread of C definitely comes manual memory management. The awkward syntax and compilation model I can tolerate. But having your program expose critical security vulnerabilities because you forgot a weird edge case while managing a pointer is really worrying. For simple programs is not that complicated, but for complex multi threaded ones it becomes really hard. And the fact that event the most expert programmers make these mistakes, leaves me not much hope. So perhaps systems programming is not for me? But what exactly is systems programming? Is it developing OS kernels, writing drivers and embedded microcontroller systems? Or is it more. I'm not very interested in writing any of those. But I do want to write programs that are fast and run as fast as C or C++, and I want a language which allows good control of resources and has minimal overhead. Sometimes these programs are multi-threaded and quite complex, so I want memory and type safety and I want tools to crate abstractions to tame complexity a little bit. Is all this out of the systems programming definition?
- kretaceous 4y agoSeems like you need Go then? You mention you want memory management, type safety and proper abstractions, hence the suggestion. Of course, you also mentioned C's syntax as awkward for you, so you might feel the same with Go's syntax.
- xyzzy4747 4y agoGo is not a fast language compared to C/C++/Rust. It’s more in line with Java as it’s also garbage collected.
- kretaceous 4y agoThat's fair. Go is not as fast and cannot manage resources as well as the languages you mentioned.
- Tozen 4y ago
- xyzzy4747 4y agoI’d much rather use a safe language such as Rust that has the same speed without all the worries. Probably a harder learning curve than Odin or Go but more likely to work and also run faster (than Go at least). It also has zero cost functional programming paradigms.
- eterps 4y agoI like how newer languages with a C style syntax have more readable type declaration mechanisms than C (some even Pascal-like to an extent). But I am not sure what I would prefer in some cases when looking at these new languages. For example doing some alloc/pointer stuff in Odin is like: ptr := new(int) ptr^ = 123 x: int = ptr^ free(ptr) And in Hare: let ptr: *int = alloc(123); let x: int = *ptr; free(ptr); Which approach do you prefer, and why?
- shadowofneptune 4y agohttps://www.bell-labs.com/usr/dmr/www/chist.html https://www.bell-labs.com/usr/dmr/www/chist.html From Dennis Richie: > Declarations in C must be read in an `inside-out' style that many find difficult to grasp [Anderson 80]. Sethi [Sethi 81] observed that many of the nested declarations and expressions would become simpler if the indirection operator had been taken as a postfix operator instead of prefix, but by then it was too late to change. Apart from that choice of syntax, both examples seen equivalent.
- xigoi 4y agoI prefer `^` for pointers because it's pointy, and having it after the value because it's less ambiguous when combined with subscripts and field accesses.
- greaterthan3 4y agoWhen I'm evaluating an open-source project, I always check the quality of its commit messages. I don't care about following a specific format or something, all that matters is whether they are informative or not. Sadly, Odin doesn't seem to pass the test. It's full of commits labeled with just "fix <thing>": https://github.com/odin-lang/Odin/commits/master https://github.com/odin-lang/Odin/commits/master A few examples of projects with better commit messages: Linux kernel: https://github.com/torvalds/linux/commits/master https://github.com/torvalds/linux/commits/master gcc: https://github.com/gcc-mirror/gcc/commits/master https://github.com/gcc-mirror/gcc/commits/master Perl: https://github.com/Perl/perl5/commits/blead https://github.com/Perl/perl5/commits/blead Wayland: https://github.com/wayland-project/wayland/commits/main https://github.com/wayland-project/wayland/commits/main
- vitiral 4y agoHow many developers are there? For single developer projects, commit messages have very little value compared to documentation and an extensive passing test suite. As the project grows in contributors, the commit log gains value
- greaterthan3 4y ago>How many developers are there? According to GitHub, there are 132 contributors. Probably most of them were one-off drive-by PRs, but nonetheless, it's definitely not a one person project anymore.
- deleted 4y ago[deleted]
- TaupeRanger 4y agoHow is telling you exactly what was fixed not informative? I don't understand what you want.
- greaterthan3 4y agoWhat was broken? How it was broken? Why it was fixed this way? That information is vital during "git blame". Take a look at the commit histories of the other projects I've linked. Their commit messages are much more elaborate.
- gnuvince 4y agoOdin is currently at the top of my Rust exit-ramp strategy (for personal work). As I grow older, I find myself wanting to use languages that are more conservative in their designs. Back in my 20s, I was all about expressivity and meta-programming: Scheme, Smalltalk, OCaml, and Haskell were my drugs of choice. I looked down upon those simple peons who used pedestrian languages like Java or PHP and I definitely looked down on those neckbeards who hadn't left their C caverns and didn't know the greatness of closures, higher-kinded types, hygienic macros and all those features that real languages had. That's how I came to learn about Rust: in the early 2010s, there was a post on Reddit about a new programming language implemented in OCaml. Even before Rust 0.1 was released I was a Rust enthusiast. And what a ride it's been! Rust transformed and evolved a lot since its first days, but what a language it ended up becoming! In a just a few years, Rust went from being a hobbyist toy to an industrial-strength tool used by large projects and corporations like Mozilla, Dropbox, Discord, Amazon, Facebook, and more. I've been using it professionally myself for the past 5 years and it's been (mostly) a great experience. But as Rust and I continue to change, it seems that the paths of our lives are diverging. As I gather more gray hair, I don't have the energy, the time, or even the passion for learning and master exotic language features anymore. I now avoid a lot of the "cool toys" that I was so enamoured with in my 20s. My programming style is now much closer to what it was when I first learned to program in Turbo Pascal in the mid-90s: mostly functions, arrays, and structs. Rust on the other hand continues its quest to be an industrial language that has ivory tower creds: the community and the core team enthusiastically look forward to having more ways to abstract code, more ways to express constraints at the language level. I feel that before long, my values and Rust's will have grown so far apart that we'll have no choice by to break up our long relationship. So I've been looking for what else I could use for personal projects. (I think and hope that I continue to use Rust for my professional career.) Odin is at the moment my clear favorite, with Zig slightly behind, and Nim after that. I find that Odin's design represents my own values about what software and a programming language ought to be like better than anything else out there at the moment. It's high-level, has out-of-the-box support for dynamic arrays and dictionaries (I think, the two most useful data structures), and the whole language is simple enough that I learned most of it in a weekend. It does feel like a step back from Rust in certain areas -- null pointers, using product types for returning errors, no ownership checking -- but I think that I'm at a point where I'm ready to forgive and deal with these issues in order to have a tool that is simpler and doesn't evolve at the speed of 20 year olds.
- jeberle 4y agoI'm happy to see Odin chose snake_case instead of camelCase. At one time Zig debated switching to snake case, but that ship has sailed [0], sadly. It seems like a small bike-shed level comment, but when I consider the code I have left in me, I'd like it to look as nice as possible. 0 https://github.com/ziglang/zig/issues/1097 https://github.com/ziglang/zig/issues/1097
- ithrow 4y agocurious, why do you prefer snake_case to kebab-case?
- IshKebab 4y agoNever use kebab-case. Not even where you can (e.g. filenames). Sooner or later you're going to want that name as an identifier in a programming language that doesn't support it (approximately all of them), and then you're going to have to come up with annoying rules to convert between them, and make all the code that uses it harder to follow and to grep. Obvious example is CSS.
- MH15 4y agokebab-case conflicts with binary expressions, specifically subtraction? Some parser jujitsu would be required to fix this.
- zozbot234 4y agoGenerally, kebab-case means that operators must be separated by spaces. Languages like FORTH or LISP might not even treat operators as separate from ordinary functions.
- samatman 4y agoNot with a parsing expression grammar! They make it easy to say that operators must be separated by spaces only when the alternative would be a valid identifier, and if you disallow trailing hyphens this matches most cases: a-variable; a-1, a-(expr()), 1-a-variable (don't do this) I think the last one illustrates why this will never be popular.
- hestefisk 4y agoFWIW, the Odin compiler seems to be written in C++. Are there any plans to make it self hosted?
- MH15 4y agoThe creator is explicitly against a self-hosted compiler, for better or worse.
- gingerBill 4y agoI'm not against self-hosting. To quote the FAQ (https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-hosted https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-ho...): > Odin is not currently self hosted nor will be until after version 1.0 when the main implementation of the Odin compiler adheres to a specification and is heavily tested. In general, self hosting before a stable language and compiler exists is masturbatory pleasure.
- Jtsummers 4y agoJust a heads up: Be careful posting two nearly identical comments so close together. They both ended up marked "[dead]". HN's filters catch things like that and may auto-kill them.
- gingerBill 4y agoThank you for that. I rarely use HackerNews and I was just trying to clarify my own position.
- gingerBill 4y agoTo quote the FAQ (https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-hosted https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-ho...): > Odin is not currently self hosted nor will be until after version 1.0 when the main implementation of the Odin compiler adheres to a specification and is heavily tested. In general, self hosting before a stable language and compiler exists is masturbatory pleasure.
- dxuh 4y agoI think Odin just doesn't do enough. The improvements over C are there, but imho too small to justify/motivate a large-scale change. And personally I think (!) there is no reason to introduce a new programming language without RAII these days. If you don't solve memory management any more than C did (not), then you are ignoring the biggest problem that needs solving and every replacement that does address this problem looks more attractive.
- gingerBill 4y agoAnd for you, you clearly don't need manual memory management nor high control over memory, memory layout, and memory access. And that's absolutely fine, but don't criticize something which other people REQUIRE and DESIRE. You cannot "solve memory management" because there isn't just "one problem". As for RAII, the article itself showcases some of the alternatives Odin has with the `defer` statement and `deferred_*` attributes. So Odin can have many of the aspects of RAII without tying it directly to a data-type/struct/class, which itself as many costs and trade-offs. RAII has loads of problems to it and many other things which are required to solve those problems. This language is just not for you, and that is absolutely fine! But don't proclaim that it's "ignoring the biggest problem that needs solving" when you are assuming everyone has the same needs, requires, and desires as yourself. n.b. I am the creator of the Odin programming language; go use a language that will help you solve your problems with your requirements.
- mplewis 4y agoBut safe memory management is the biggest problem that needs solving. It’s empirically impossible for humans to write secure, complex programs while managing memory by hand. I agree with OP, that Odin doesn’t go far enough toward safety in this regard. We do all require and desire security.
- gingerBill 4y agoWhat it is interesting is that the comment never mentions memory safety, only memory management; you just added memory safety into the discuss. Memory safety and memory management are not equivalent concepts. As I state in another reply (https://news.ycombinator.com/item?id=32629951 https://news.ycombinator.com/item?id=32629951), you have memory safety and manual memory management. And Odin offers numerous memory safety features as well as being designed around the power of custom allocators.
- B1FF_PSUVM 4y agoDrats, not the Norse deity. In case you're also disappointed, I recommend Votan by John James https://books.google.com/books/about/Votan.html?id=y-OlAwAAQBAJ&redir_esc=y https://books.google.com/books/about/Votan.html?id=y-OlAwAAQ... """ In the second century AD, a Greek nobleman is travelling and living abroad in Germany while carrying on an affair with a military man's wife. When discovered, he takes an emergency business trip to save his life and packs amongst his belongings certain items that lead the people he encounters to think him a Norse God, a fortuitous point of view which he does little to dispel. Forced to keep up the pretence of being a god while staying one step ahead of his lover's jealous husband, Photinus must juggle the severity of his situation with the enjoyment of being a God. """
- gautamcgoel 4y agoSounds like The Road to El Dorado :)
- B1FF_PSUVM 4y agoIt's that sort of tale, the picaresque adventures of a likeable scoundrel (or two). The John James tale checks most features of the Odin story with explainable real-world incidents. He wrote a couple of sequels that go on to Irish mythos, etc.
- stephc_int13 4y agoThe most important aspect of a system programming language, besides performance, is the readability of the code. It will always be more difficult to read (and understand) a program than to write it, so, unless this is some throw away code, ease of reading should be the priority. Unfortunately, the speed/ease of writing is often used instead. Ease of reading means linear, boring, plain English with minimal use of arcane symbols or regex-like expressions. In this regard, meta-programming is very often counter-productive, as it can introduce new idioms and constructs in the language that have to be understood before reading the program itself. Overuse of C macros or C++ templates comes to mind, but I think that lack of readability was also a huge problem for LISP and Forth.
- zamadatix 4y agoReading through Odin (very neat overall!) I am a bit confused on the additional boolean types. "bool" seems to be your standard boolean but then there are b8, b16, b32, and b64. Bitfields seem to be their own thing still so are these just boolean types with a wider backing for something like a data format that stores them that way?
- gingerBill 4y agoThere are a few reasons as to why there are different sized booleans in Odin. One is dealing with foreign code. A lot of old C code used their own boolean type before it was standardized. And many people defaulted to typedeffing `int`. A good example of this is Win32's `BOOL` which is `int` sized, which would be backed by `b32` in Odin. Another reason is that file formats may use different width booleans to a single byte. Another reason is that things that are closer to the register-width are faster than byte-wide operations. So `b32` or `b64` even though it takes more memory up can be faster to deal with than `bool`/`b8`. As for `bit_set`s in Odin, they are backed by integers and a brilliant solution to the problem of flags. They usually become a lot of people's favourite (but small) feature because of their ease of use and clarify of what they express.
- zamadatix 4y agoThanks, appreciate the detailed answer!
- renox 4y agoI read some time ago Odin's documentation, I was quite impressed. But I wonder if it shouldn't copy some Zig features: for example unsigned not wrapping by default are a good idea IMHO: this may detect errors in debug mode and may create more efficient code in release mode. I've been programming in C or C++ since 1993 and I can count on one of my hand the number of time I've used unsigned wrapping voluntary (for clock management)..
- otabdeveloper4 4y ago> learning C++ is too hard, so we'll just write our own new programming language instead Many such cases.
- 4v0v 4y agoI tried it for some basic 3d opengl stuff. I like it but the documentation is lacking and the standard library is all over the place. Also there is only one real big project using it afaik (EmberGen), not enough to bother switching from C/C++. But i'm interested to see how the project will continue. :)
- debug-desperado 4y ago"I like Odin" - me too, just discovered Odin last week. The syntax is just about as perfect as a procedural language can get. I don't do C professionally and really only used for standard uni classes for algos, data structures, system programming, OS, etc. But seeing Bill's streams highlighting the clarity of the Pascal pointer syntax has been eye opening. A C spiral seems so utterly unnecessary compared to how simple it is to read Odin left-to-right. It's good to have a physicist take on a programming language. Thanks for the hard work!
- cshenton 4y agoOdin is probably the most productive I’ve been in a language. I went from reading the docs to having a working interactive PBD particle sim in VR via OpenXR in around 48 hours wall clock time. I am currently writing a rigid body engine in it. It is perfect for graphics/games programming.