# Making a game in Ada with Raylib

**URL:** https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704
**Category:** General
**Created:** [March 10, 2024, 8:58pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704 "2024-03-10T20:58:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![JeremyGrosser](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jeremygrosser/32/3_2.png) [@JeremyGrosser](https://forum.ada-lang.io/u/JeremyGrosser)
#### Post date: [March 10, 2024, 8:58pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/1 "2024-03-10T20:58:29Z")

</div>

The Twitch streamer [Tsoding](https://www.twitch.tv/tsoding) has been learning Ada over the last week by building a game with the [raylib](https://github.com/raysan5/raylib) graphics library.

It’s been fun to watch, albeit a bit frustrating when he only skims the documentation then claims it doesn’t answer his question.

[Day 1](https://www.twitch.tv/videos/2081075219)  
[Day 2](https://www.twitch.tv/videos/2081992117)  
[Day 3](https://www.twitch.tv/videos/2082962014)  
[Day 4](https://www.twitch.tv/videos/2083846830)  
[Day 5](https://www.twitch.tv/videos/2084786540)  
[Day 6](https://www.twitch.tv/videos/2085892456)  
[Day 7](https://www.twitch.tv/videos/2086878914)

---

<div class="post-metadata">

### Author: ![Micronian2](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@Micronian2](https://forum.ada-lang.io/u/Micronian2)
#### Post date: [March 10, 2024, 9:47pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/2 "2024-03-10T21:47:18Z")

</div>

Wow! It’s a pleasant surprise he is revisiting Ada. I really hope this time around it has been a smoother experience, though your comment already has me a little concerned. Hopefully some who knows Ada and were watching the live streams were able to provide some advice to him. Definitely will start watching the videos.

---

<div class="post-metadata">

### Author: ![Micronian2](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@Micronian2](https://forum.ada-lang.io/u/Micronian2)
#### Post date: [March 11, 2024, 8:18am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/3 "2024-03-11T08:18:16Z")

</div>

I finished watching Day 1 and watched some of Day 2. It’s good to see that he is actually making progress and liking Ada despite the various small issues he experiences.

@JeremyGrosser I agree that it is frustrating to see him missing some details, despite being right in front of him in the documentation. If he were more patient then I think it would go smoother for him. It also doesn’t help when he makes some wild remarks which are not the fault of the language (eg he complained about the highly abbreviated file names that GNAT library files. )

Hopefully he has a good experience in the later episodes.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [March 11, 2024, 3:21pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/4 "2024-03-11T15:21:42Z")

</div>

OMG, the first half an hour is _whining_ about the ONCD report stating that C and C++ are dangerous and should not be used, no shock there.

All he’s really doing is programming in C in Ada in this video.

Just started on the second one, the C\_Pass\_by\_Copy stuff, I should know this, but I didn’t really even though I use it for colours in SDLAda too (been years since I originally wrote that, so cannot remember). I thought Ada could put small records into registers directly too.

---

<div class="post-metadata">

### Author: ![Micronian2](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@Micronian2](https://forum.ada-lang.io/u/Micronian2)
#### Post date: [March 11, 2024, 10:09pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/5 "2024-03-11T22:09:56Z")

</div>

If my memory is correct, the C\_Pass\_By\_Copy came about because the ARG goofed and thought all C structs were passed by reference, but that’s because most C code they came across would passed the address of the object. Ada compilers would implement pragma Import and Export to pass records via C convention by reference. Since it was too late to undo that (eg break existing code) they had to introduce C\_Pass\_By\_Copy.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [March 11, 2024, 10:15pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/6 "2024-03-11T22:15:47Z")

</div>

Who’s the Ada dev (ExitCode0) in the chat on stream 2?

Oh, it’s the Ada Doom 3 guy.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [March 11, 2024, 11:16pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/7 "2024-03-11T23:16:09Z")

</div>

Ok, it’s kind of infuriating watching these videos, but maybe the next revision should have a legacy runtime and a new runtime?

---

<div class="post-metadata">

### Author: ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)
#### Post date: [March 12, 2024, 12:53am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/8 "2024-03-12T00:53:52Z")

</div>

I watched way too much of these.

It’s like he’s doing this as a joke, and he has huge frustrations interspersed with disbelief of cool features every now and then.

---

<div class="post-metadata">

### Author: ![Micronian2](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@Micronian2](https://forum.ada-lang.io/u/Micronian2)
#### Post date: [March 12, 2024, 4:57am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/9 "2024-03-12T04:57:56Z")

</div>

I hope people are smart enough to realize what he is displaying in the link below is not a reflection of the Ada language, but rather of his code organization skills.

[https://twitter.com/tsoding/status/1766571137402646813](https://twitter.com/tsoding/status/1766571137402646813)

While I am not a fan of his approach to learning Ada, my hope is that he actually helps to generate more interest in it.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [March 12, 2024, 10:16am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/10 "2024-03-12T10:16:59Z")

</div>

> [@Micronian2](#):
>
> I hope people are smart enough to realize what he is displaying in the link below is not a reflection of the Ada language, but rather of his code organization skills.
> 
> [https://twitter.com/tsoding/status/1766571137402646813](https://twitter.com/tsoding/status/1766571137402646813)

Are you aware of how ignorant people view Ada??

> [@Micronian2](#):
>
> While I am not a fan of his approach to learning Ada, my hope is that he actually helps to generate more interest in it.

This seems to be a thing now. Books? Nah! Website with the reference manual? Nah. Let’s just guess based on having used C.

---

<div class="post-metadata">

### Author: ![DirkCraeynest](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/dirkcraeynest/32/94_2.png) [@DirkCraeynest](https://forum.ada-lang.io/u/DirkCraeynest)
#### Post date: [March 12, 2024, 11:14am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/11 "2024-03-12T11:14:14Z")

</div>

I’m afraid you’re right. The amount of misinformation and FUD that’s spread about Ada on social media dwarfs the amount of genuine info and experiences.

I’m trying to do what I can to correct or point out the most blatant misinformation and invite everyone knowledgeable to do the same…

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [March 12, 2024, 11:21am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/12 "2024-03-12T11:21:15Z")

</div>

Thing is, I don’t think he’s wrong about the runtime though. Problem is, the runtime is directly linked with the compiler.

Simpler languages, even Fortran, were easier to update to be more modern than Ada has ever been; Ada has always been complex.

By updating the runtime to be more modern, you could get rid of the mess of strings, the old antiquated I/O stuff, the containers with tampering which just seems like a mess.

---

<div class="post-metadata">

### Author: ![Micronian2](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@Micronian2](https://forum.ada-lang.io/u/Micronian2)
#### Post date: [March 12, 2024, 8:34pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/13 "2024-03-12T20:34:20Z")

</div>

In the second half of episode 3, he acknowledges the fact that his approach and the things he says can be polarizing, but it’s just how he is. He goes on to state that viewers should focus on whether he can make progress and what he is able to achieve in the end.

He did make a comment that he thinks better documentation and more examples need to be available. There is room for improvement in both those areas, especially with regard to insufficient examples. There are still some good sources of documentation. However, I think part of the issue is that he often just doesn’t have the patience to read what is there, which is a shame.

Regarding standard library, yeah the whole string standard library can use a revamp.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [March 12, 2024, 9:27pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/14 "2024-03-12T21:27:22Z")

</div>

> [@Micronian2](#):
>
> In the second half of episode 3, he acknowledges the fact that his approach and the things he says can be polarizing, but it’s just how he is. He goes on to state that viewers should focus on whether he can make progress and what he is able to achieve in the end.

I stopped watching that one as it was just too painful.

> [@Micronian2](#):
>
> He did make a comment that he thinks better documentation and more examples need to be available. There is room for improvement in both those areas, especially with regard to insufficient examples. There are still some good sources of documentation. However, I think part of the issue is that he often just doesn’t have the patience to read what is there, which is a shame.

Doesn’t matter what documentation is available if you load it, scroll past what you’re looking for and then whine about it not having what you want.

> [@Micronian2](#):
>
> Regarding standard library, yeah the whole string standard library can use a revamp.

Yeah, and the rest.

---

<div class="post-metadata">

### Author: ![Irvise](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@Irvise](https://forum.ada-lang.io/u/Irvise)
#### Post date: [March 12, 2024, 9:31pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/15 "2024-03-12T21:31:50Z")

</div>

These notes were taken after I had already seen about 6 episodes. I wanted to track this info to organise some of my ideas, open a discussion and use this information for a future talk that I want to give.

### Good parts:

- He is enjoyable to listen to, his main goal is to entertain.

- He is extremely knowledgeable and a quick thinker. He has worked on plenty of projects and languages.

- He is not bothered that Ada is not so well-known and that his viewership may not be that high, but he does not care about it, he wants to use it.

- He had already used Ada in a previous project (game of life), so he already has a good grasp of the nature of the language.

- He clearly states that he likes Ada. Even though he is mad at it several times, he explains he wouldn’t be so angry if he didn’t care about the language itself. The reason he gets mad is because he genuinely likes the language.

- The type system is something he thoroughly enjoys and praises Ada about.

- He is _very_ happy about the ease with which C code can be bound and used

- He is happy that one can define functions/procedures inside the declaration blocks of other functions/procedures and he exploits this to his advantage.

- He is happy he can easily create his own exceptions.

### Negatives parts:

- HE BARELY READS THE DOCUMENTATION, WHICH MAKES HIM MISS QUITE A LOT OF THE ANSWERS HE IS LOOKING FOR.

- He is a very knowledgeable guy, so he relies on intuition quite heavily.

- Regarding the type system:

- Regarding Maps and the issues he had using/deallocating them:

- He hates string management in Ada

- He admits that Jai is clearly better and the only reason he is using Ada is because Jai is not currently widely available. But that he would switch in a heartbeat.

- He barely used the package system to better structure his code. Making the code look a lot worse than what it needs to. Packages are one of Ada’s strengths!

- Slow compile times

- He does not like to learn a new build tool (GPRbuild) and does not like incremental builds

- He thought that the compiler ± enforced a formatting style.

- Debugging

- He pointed out that finding which type attributes are available is very annoying and unclear. I partially agree with him on this, but then again, he failed to RTFM… He did not use them as much as he could have due to this reason, which I think is a shame.

### General comments:

- He had issues getting Ada working in Emacs. The Ada-mode in Emacs needs to be maintained and refactored to become easier to use. Basically, it has to become “plug & play”.

- He knows about contracts, but does not use them (so it is basically Ada, not Ada/SPARK).

- He did not touch the tasking system, which is fine.

- I do not think he used subtypes.

### Closing thoughts

I think his streams are a clear positive to the Ada community in general. They are bringing people’s eyes into the language; and he has a quite large audience, In one video he said that about 600 people were watching (live!). They see that Ada has a lot of nice features and that they are not new, it is just that “modern” programming languages just failed to learn anything in the past 40 years. It was common to see comments such as “Ada is very readable”, “this is a nice language to learn”, “pog” / “poggers” (which a modern way of saying “really cool!”), “Can Rust do that?”, etc.

If I missed something, please, feel free to add it!

Regards,  
Fer

* * *

Edit: some extra points after having seen the 7th, 8th and 9th episodes.

### Good parts

- He noticed that the OOP features in Ada are kinda shoved in and that the original creators didn’t really like it. Tsoding personally agrees with it quite a lot. He likes that OOP is there but it was never heavily integrated with the language.

- He sometimes refactors parts of his code and creates local procedures which makes his code look cleaner.

- He is happy that Ada allows for custom indexing.

- He implemented his own Queue from scratch, including some methods/procedures pretty much in his first try/compilation.

- He did not realise that `'Image` for Integers has a leading space to account for the minus sing. That is why his debugging information for the path finding looked so nice/squared.

- I forgot to say that he was happy with the useful error/warning messages that the compiler emits 🙂

- His content idea is to make a video in his main YouTube channel about his experience using Ada and explain how to build games using it 😃

### Bad parts

- Copying arrays, maps etc, is not obvious an normally requires `access` types, which is not ideal.

- He missed `pragma Debug()` and the family. He wanted something to do conditional/debugging compilation.

- He is extremely disappointed with discriminated records

- Regarding custom indexing

- He states that the language starts great, but as one goes deeper and into more complex/advance features and requirements, the language becomes underwhelming (see the points above).

- A user posted how to do BFS in the chat, from top to bottom. Since the code is unformatted, Tsoding dismissed it saying it was like C++ programmers, where they just throw a large wall of templates and call it a day. Sadly, that was not the case here, the user was just using Priority\_Queues…

- He complains that Ada has no `continue` in order to start the next loop iteration

- He missed on iterator filters (a new addition of Ada 2022) (see the `when` in the example below

```ada
for E of Some_Array when E /= 0 loop
   Put_Line (E'Image);
end loop;

```

- When searching for Queues, he found the Tasking specific constructs and stopped looking for an actual Queue object. And a few seconds before he had actually opened the file with the actual Container specification…

- I missed this one, but he does not like that Ada is cans insensitive and that it uses fairly long names.

### General comments

- As he is getting deeper with the game, the amount of time and comments related to Ada’s features are lower. This is to be expected, as he is becoming more used to Ada and wants to add more complex features to the game.

---

<div class="post-metadata">

### Author: ![Lucretia](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/lucretia/32/17_2.png) [@Lucretia](https://forum.ada-lang.io/u/Lucretia)
#### Post date: [March 12, 2024, 10:16pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/16 "2024-03-12T22:16:18Z")

</div>

Yeah, I saw a few people say they were wanting to try Ada and I saw one say he’d just bought an Ada book.

Other’s said in the chat numerous times that the emacs ada-mode didn’t work and you had to use the older one, I dunno, I gave up on ada-mode and emacs years ago, because I assumed as did he, that once installed, it should just work, which it never did, because you have to compile it yourself, which is a bad move.

---

<div class="post-metadata">

### Author: ![JeremyGrosser](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jeremygrosser/32/3_2.png) [@JeremyGrosser](https://forum.ada-lang.io/u/JeremyGrosser)
#### Post date: [March 13, 2024, 7:19am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/17 "2024-03-13T07:19:09Z")

</div>

4 posts were split to a new topic: [Getting emacs ada-mode working](https://forum.ada-lang.io/t/getting-emacs-ada-mode-working/708)

---

<div class="post-metadata">

### Author: ![Micronian2](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@Micronian2](https://forum.ada-lang.io/u/Micronian2)
#### Post date: [March 13, 2024, 6:13am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/18 "2024-03-13T06:13:13Z")

</div>

@Irvise OMG, what an impressive summary of the videos. Did you actually finish watching all of them?

I have only finished the first three and have to take a short break before I see the next one. It’s frustrating to watch him inadvertently making the experience so much more difficult than it should be. That’s not to say none of his comments are fair (some are), but geez he spews so much misinformation when he complains. I’m glad he at least still manages to make progress.

---

<div class="post-metadata">

### Author: ![pyj](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/pyj/32/5_2.png) [@pyj](https://forum.ada-lang.io/u/pyj)
#### Post date: [March 13, 2024, 11:49am UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/19 "2024-03-13T11:49:50Z")

</div>

Having learned Ada in isolation - I’ve still never talked to another Ada developer in person - I’d have been pretty lost without Barnes’ book. There’s a lot of things that Ada just does differently and you expect it to work with C or C++ and it doesn’t. Compared to how Rust, C#, C++ and every other language I’ve used, the way Ada does generics is wild. On top of a lot of differences in keywords to search for to find what you’re looking for – e.g. I never would have looked for “Controlled types” or “tagged types” or “discriminants.” Some of this is because Ada was using some things before the terms were standardized.

> he failed to find a way to set a breakpoint

I’ve always had to revert to using inline assembly with `int3` to break reliably since I don’t use GNAT studio.

The resources have improved now, [learn.adacore.com](http://learn.adacore.com) is impressive, and Alire makes things 10x easier.

The streams have been great to watch. Has anyone reached out to him, or pointed him at the forum?

---

<div class="post-metadata">

### Author: ![Irvise](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@Irvise](https://forum.ada-lang.io/u/Irvise)
#### Post date: [March 13, 2024, 5:13pm UTC](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704/20 "2024-03-13T17:13:21Z")

</div>

> [@Micronian2](#):
>
> Did you actually finish watching all of them?

I am just going to say that I lost a few hours of sleep these last days 😉

> [@pyj](#):
>
> Compared to how Rust, C#, C++ and every other language I’ve used, the way Ada does generics is wild. On top of a lot of differences in keywords to search for to find what you’re looking for – e.g. I never would have looked for “Controlled types” or “tagged types” or “discriminants.” Some of this is because Ada was using some things before the terms were standardized.

Agreed.

> [@pyj](#):
>
> I’ve always had to revert to using inline assembly with `int3` to break reliably since I don’t use GNAT studio.

I am pretty sure it is just me, but I learnt how to actually use the basics of GDB directly in the terminal. I still remember watching videos and reading blogs and manuals for a couple of hours to correctly set breakpoints, watches, catchers, etc. I will admit that it is pretty complex, but it really just works. A breakpoint in Ada is not really that different from one in C imho 🙂

> [@pyj](#):
>
> The streams have been great to watch. Has anyone reached out to him, or pointed him at the forum?

Not me. I wouldn’t mind “interviewing” him, but he said that he will do an “Ada experience” summary video at the end, so I think this will be a good summary of his journey 🙂

* * *

### Good parts

- In his current stream he just found how to properly use variant records/union types!!!

- He initially thought that `-gnat2022` was an extension, but I think he read that in chat someone said that is was just telling GNAT to use the newly released standard.

[Next page](https://forum.ada-lang.io/t/making-a-game-in-ada-with-raylib/704.md?page=2)
