News for hackers. Stuff that matters.
Re:The Odin Programming Language by _bxg1 on Friday January 31, 2020 @02:08PM (#22204532)
Whenever 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?

Re:The Odin Programming Language by gingerBill on Friday January 31, 2020 @02:16PM (#22204611)
One 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/

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.

Re:The Odin Programming Language by keldaris on Friday January 31, 2020 @03:00PM (#22205036)
Given 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.

Re:The Odin Programming Language by dotbmp on Friday January 31, 2020 @04:02PM (#22205692)
Odin doesn't have CUDA-like GPU interoperability, so the benefits are going to be purely client-side. If you were working in say OpenCL + C the benefits are more obvious, with CUDA you're not going to get an analogous experience.

I would say in my experience that Odin is definitely preferable as a client language for the simple reason that it's a nicer systems programming environment than other languages, but it's not (at least right now, future developments could always change this) equipped to run native GPU code.

Things like SPIR-V and "shader ASM" open up some interesting possibilities once the custom backend is implemented, but the complexity of integrating GPU execution means making it a first-class feature it probably unlikely.

Re:The Odin Programming Language by Vassvik on Friday January 31, 2020 @04:07PM (#22205750)
As most of the heavy lifting in Embergen is done on the GPU via shading languages the main benefit in using Odin isn't necessarily anything to do with memory control compared to the usefulness of its remaining feature set. The simplicity of the language and its ergonomic set of features does a good job at reducing friction and it is a joy to program in. Simply not being bogged down in all the complexities of C++ in all their forms, nor being held back by the arcane annoyances of C is quite refreshing.
Re:The Odin Programming Language by tudelo on Friday January 31, 2020 @03:36PM (#22205401)
is 'orthodox c++' a thing? i feel like there is a joke somewhere there...
Re:The Odin Programming Language by keldaris on Friday January 31, 2020 @04:36PM (#22206049)
It's a reference to [1] and a mindset arguably most common in the gamedev world that emphasizes simplicity, pragmatism and performance (including compile time performance) over many aspects of "modern C++". I've found it useful and productive, YMMV.

[1] https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b

Re:The Odin Programming Language by ttctciyf on Friday January 31, 2020 @08:42PM (#22207922)
That's an interesting (and I think worthwhile) read! Just how much it upset the denizens of r/cpp[1] is a sight to behold:

> This starts ridiculously, then it gets worse

...

> looks like a solid way to produce abysmal quality code

...

> just learn the fucking language like everybody else

...

> The trolls from r/javascript are brigading us again It seems

1: https://www.reddit.com/r/cpp/comments/41b3o3/orthodox_c/

Re:The Odin Programming Language by deadEndDave on Friday January 31, 2020 @02:24PM (#22204688)
> 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?

Re:The Odin Programming Language by Touche on Friday January 31, 2020 @02:26PM (#22204716)
I think you are operating from the bias of big programming departments where hiring for a specific language is a thing. Some companies don't assume that you need to know their specific stack before hiring. And some programmers program outside of a work setting and hirability isn't part of their decision making.
Re:The Odin Programming Language by _bxg1 on Friday January 31, 2020 @02:36PM (#22204805)
I do lots of programming outside of a work setting and I still appreciate good library and tooling support. And even if the programmers at a company are expected to be able to jump around, combining multiple languages makes building and interop more complicated.
Re:The Odin Programming Language by Touche on Friday January 31, 2020 @02:54PM (#22204974)
I can't speak for Odin but Zig (also a niche language) is compatible with all C libraries so the ecosystem side is very good.
Re:The Odin Programming Language by _bxg1 on Friday January 31, 2020 @03:54PM (#22205610)
That makes sense. I guess I assumed the interop story would necessarily be arduous and crufty, but if both languages are native I can see how you might get more of it "for free".
Re:The Odin Programming Language by dotbmp on Friday January 31, 2020 @04:04PM (#22205716)
Odin requires writing bindings (for the moment, this will likely be automated with third-party tooling), Zig actually has full first-class C importation.

In both cases the interoperability is excellent imo.

I can't speak to Zig as much, but Odin's type system makes working with C APIs much more of a pleasure than doing so in C itself.

Re:The Odin Programming Language by lang_throw_away on Friday January 31, 2020 @02:34PM (#22204780)
throwaway because I don't want to DOX myself

I'm working with language development where we're deploying a custom language built with another custom language.

>who's actually using these languages, and in what contexts?

Compare it to using C in 1970 or Ruby in 1995. It's people who have a real problem they're trying to solve for which existing tooling and widely used languages are a poor fit - as well as people who genuinely enjoy developing their own PLs that have their own ways of doing things.

>Where does the build complexity/hiring difficulty/lack of tooling tradeoff make sense

With VC money, anything is possible...

>build complexity

Fairly nil. Contemporary build systems are language agnostic, and the steps to make one that functions good enough are well known and can be thrown together in a week or so. Not to mention it's become increasingly common for "widely used" PLs to fallback on things like python scripts to handle builds.

>hiring difficulty

It's actually a fantastic way to weed people out and find good candidates. In my (limited) experience, people willing and able to learn a new language (or have a few under their belt) are generally the exact kinds of people you want to hire anyway. Code switching between languages on a daily basis is a fantastic skill, and leads to good developers and mindshare, helps create a diverse technical background.

>lack of tooling

This is a legit problem, and one that a lot of folks stumble on. But luckily building tooling is a great way to dogfood your language - and it's never been easier to integrate with various tool frameworks via standard protocols.

But that said - every company just getting off the ground lacks tooling. For language devs it's a language server, debugger, disassembler, and what have you. For your bootstrapped startup it's build systems/procedures and code review, ERPs and CRMs, etc. Building your own tooling is a part of the growth of a business, tech or otherwise, it's just that when you work on a custom language you have to build some different tools than a SaaS might.

I'll throw one more in though that's the biggest hurdle - wheel reinvention. Stuff you take for granted in any language or have great packages for are the biggest blockers to being productive. But you do the ROI math and decide if it makes sense, so hopefully your lang has good FFI.

Also worth mentioning - if you're working in an esoteric language with heavy contribution by your own team, you're probably doing it because you have a lot of work that looks nothing like putting together a CRUD app or developing a backend for your latest API for your SaaS idea.

Re:The Odin Programming Language by gingerBill on Friday January 31, 2020 @02:50PM (#22204937)
Odin's `foreign` system (FFI) is very easy to use and allows for a lot simpler build system in the process too.

I highly recommend you read the overview (https://odin-lang.org/docs/overview/) and many of the Odin wrappers and bindings for more information on this topic https://github.com/odin-lang/odin-libs

Re:The Odin Programming Language by lang_throw_away on Friday January 31, 2020 @03:01PM (#22205043)
I wasn't commenting on Odin, but replying to OP's question about language development.

It's good to see you took FFI seriously and made it low friction, it's absolutely critical for younger languages.

Re:The Odin Programming Language by dotbmp on Friday January 31, 2020 @04:12PM (#22205796)
The most critical point you brought up is in finding good developers. Reminds me of this quote by Eleanor Roosevelt: "Great minds discuss ideas; average minds discuss events; small minds discuss people."

In this case, small minds discuss libraries/frameworks, average minds discuss language details, great minds still discuss ideas.

All of the best, most interesting, and most insightful programmers I have talked to express ideas in language and tool-agnostic terms, with written language, and only use code as an implementation or demonstration detail. This isn't to say that tooling and languages are not important of course, but the best programmers can pick up new tools and languages quickly and express their ideas in any given medium. If a programmer is limited by thinking in terms of the language(s) they know, they're basically a bricklayer. Still respectable, but they're doing tedium rather than manipulating the idea space.

Re:The Odin Programming Language by _bxg1 on Friday January 31, 2020 @04:32PM (#22206020)
Even among "great minds", narrow domain-specific knowledge can matter. The nuances of how to squeeze performance out of the JVM, the exact assembly generated by some C code, etc. There's a difference between being able to use a language and being able to take full advantage of it.

There's also something to be said for language idioms as a means of communication and shared documentation within a team. Someone who speaks French and Italian may have no trouble picking up Spanish, but might say things that lose meaning when translated literally until she's gotten more immersed in the culture surrounding the language. One of your "great minds" may pick up C# and try to use it like Clojure, or vice-versa, and create enormous friction within the codebase.

Not that this is necessarily the dominant factor in these decisions, but it is a factor, no matter how intelligent and experienced your hires are.

Re:The Odin Programming Language by mnemonicsloth on Friday January 31, 2020 @05:11PM (#22206417)
> Even among "great minds", narrow domain-specific knowledge can matter.

Yes, but it never matters at first. The first thing you do, always, is hack a prototype together. Computers are fast. Basic algorithms and data structures are usually good enough. You don't optimize until you've got what you want in principle. And sometimes you don't optimize at all. The internet is full of prototypes that escaped into the wild and then attracted enough users that they became irreplaceable.

Javascript is a good example. The version we have is several versions too early, and it's warty. JS would be a much better language if someone had paid more attention to the low-level details. But I would argue that JS is a huge success in spite of this. An awful lot of work has been done in JS, including work that couldn't have been done in most other languages.

The grandparent of this post is right that ideas are the important thing. JavaScript succeeds because it borrows good ideas from Scheme and Self.

Re:The Odin Programming Language by dotbmp on Friday January 31, 2020 @07:57PM (#22207684)
Yeah, the "Great minds" are still going to have a bigger lead when it comes to understanding language details, which are trivial semantic implementation concerns compared to understanding concepts. Programming itself is the boring part; it's merely transcription of concepts into machine-legible code. The concepts themselves, many of which are not even limited to the domain of computer science, are where all the interesting content is to be found.

When I say boring, I mean relatively; there is some "puzzle solving" merit to programming per se. But this is mere mechanics and minor compared to the experience of manipulating ideas into practicable forms before writing them out in code.

Re:The Odin Programming Language by _bxg1 on Friday January 31, 2020 @03:52PM (#22205586)
> Compare it to using C in 1970 or Ruby in 1995

That's not the category I'm talking about, though. C (and I believe Ruby) was a major shift from what came before. Those two are better compared to Clojure or Go: dramatically different value-propositions that can make it worth the time and effort to take a chance on a new, green technology. What I'm talking about is languages that are "like X but with improvements to Y and Z".

Re:The Odin Programming Language by aidenn0 on Friday January 31, 2020 @08:03PM (#22207727)
I'm not sure about this. Algol 60 was a strong influence on most of the programming languages from around this time.

Algol 60 had a number of obvious deficiencies, which needed to be addressed. Both Algol 68 and CPL were designed to fix these issues, but had a level of complexity that made them impractical to implement.

Pascal, which Predates C slightly, grew out of of Wirth's much simpler (compared to Algol 68) set of changes to Algol 60.

The CPL people were having trouble with implementation, so Richards created a stripped down version (BCPL). Thompson apparently didn't have access to the full specification, but samples of it greatly informed the the design of B, which eventually begat C. Apparently the "killer-feature" of C over B at the beginning was byte-addressing, which is arguably no more or less niche than what any of these new languages claim.

Re:The Odin Programming Language by pjmlp on Saturday February 01, 2020 @02:54PM (#22212809)
C was a major shift in ignoring security, that is all.

Almost memory safe systems programming languages (not fully safe due to use-after-free) were already a thing since 1961.

In fact ESPOL was probably the very first systems programming language with unsafe code blocks.

Re:The Odin Programming Language by brakmic on Friday January 31, 2020 @02:15PM (#22204602)
These days programming languages are going the way of JavaScript frameworks.