Remix.run Logo
valorzard 3 days ago

Ada is something I've always wanted to get into (it interests me that there's a low level programming language that came around at the same time as C but just never took off)

Ada has a bunch of features built into it already, including concurrency support with tasks [0]

I just haven't found the right motivation to figure out what to do with it yet. Maybe I could play around with the Raylib bindings [1] at some point?

There's also the SDL bindings, which a LOT of work has seemingly gone into [2]

[0] https://learn.adacore.com/courses/intro-to-ada/chapters/task...

[1] https://blog.adacore.com/ada-gamedev-part-3-enjoy-video-game...

[2] https://github.com/ada-game-framework/sdlada

jordanb 3 days ago | parent | next [-]

I learned Ada back in the day, and like it a lot. Always want a project to get back into it. It's more C++ than C though. Arguably, it's C++ done right, or rather, a worse-is-better situation with C++.

One take away is that learning Ada would be a good way to learn the proper way to write C++ code, because the patterns that C++ developers eventually adopted for that level of abstraction are prescribed in Ada. For instance, Ada's Controlled Types map pretty much exactly to the C++ "RAII" pattern.

Ada also is better than C as an embedded language because it has features that make mapping to hardware easier. For instance, it has Representation Clauses that describe to the compiler how a data structure needs to be laid out in memory. It also has native support for bit manipulation. This makes mmaped-io extremely easy and reliable.

johnisgood 2 days ago | parent | prev [-]

I have left lots of comments about Ada, but I do not have them at hand right now. People should check out Ada's contracts (pre- and post-conditions), and subranges. They are pretty cool.

... and of course Ada / SPARK. You can do a lot of checks at compile time, so no performance penalty for any checks whatsoever. It is worth looking into.

And yes, you are right. Ada has concurrency constructs builtin the language that help you avoid dead locks, race conditions and all sorts of concurrency-related issues.

If anyone finds my comment with regarding to it, or may help me find it (there may be a website that could help with that), please let me know. IIRC there is a website for finding comments containing particular words from me, for example.

GhosT078 12 hours ago | parent [-]

If you click on your username then there is a link to all of your past comments.