Let's learn D game programming development (2021) [video]
Some months ago i started making a new game engine in Free Pascal[0]. D however was the language i considered the most of all alternatives due to its fast build times (at least for DMD) and metaprogramming and compile time function evaluation and code generation abilities that would help a lot to minimize boilerplate and automate things. In fact i chose FPC less for the language and more for other reasons - as a language i think D would fit better.<p>The two main reasons i chose Free Pascal are (both of which are important):<p>1. There is a strong aversion to breaking working code in FPC which to some extent is also part of the overall ecosystem. Code i wrote 20 years ago still compiles because any new features are made so that they don&#x27;t break existing code. Exceptions exist, like when how string are handled changed, but that was a quick fix (in all of my programs i only had to apply a single line fix twice).<p>I don&#x27;t know D&#x27;s story on that but i&#x27;ve heard that there were updates to the D compiler that broke code (but i don&#x27;t know how severe that is - FPC also introduced theoretically breaking code almost every version but in practice it is usually extreme edge cases, compiler bugs or very internal things and these latter only change like per decade or so).<p>In general i want code that i know it worked today to keep working in 10 years from today so i can focus on other things instead of babysitting it (i do copy&#x2F;paste code i know that works from my existing projects all the time - even the engine i linked above contains a lot of code from older projects, the earliest bits being from 2007 or 2008).<p>This is even more important if i decide to switch to a new language because i wouldn&#x27;t be able to use much of my existing code so any new code i write i want it to be valid for years ahead.<p>2. Lazarus and LCL. Think open source Delphi or Visual Basic with a real framework and a strong language. Lazarus is a &quot;real&quot; IDE in that it isn&#x27;t just a glorified text editor attached to a compiler but it knows the language and builds a database of the entire project in memory, which allows for it to manipulate the code for you (this avoids a lot of boilerplate that come out of the verbose syntax Free Pascal has). More importantly it provides a WYSIWYG visual editor for GUIs (very important for tools) and a rich application framework (LCL) that is designed around Lazarus - these aren&#x27;t independent bits someone stuck together with some glue, they are all made with each other in mind, which provides a more coherent experience than if someone stitched things together (if anything most of the issues Lazarus&#x2F;LCL has is from things outside of their control, like the backend GUI toolkits). I have used a lot of other GUI approaches, Lazarus beats them all hands down. And as a cherry on top Lazarus is a native app written in Free Pascal itself and is very responsive - it even runs on older Rasberry Pis with relatively low resource requirements.<p>Sadly D doesn&#x27;t seem to have a decent GUI story, let alone something like Lazarus and LCL. A promising library was dlangui[1], but that is a 3rd party library that looks like the author decided to abandon[2]. Honestly IMO without something that is adopted by the core D developers (and by extension the rest of the D community) i can&#x27;t see anything flourishing there - it&#x27;ll instead be a bunch of independent solo devs making their own half-baked stuff for eternity (btw, yes, Lazarus&#x2F;LCL are technically a separate project but in practice there is strong overlap between the two projects&#x27; developers and they share resources). At best you get bindings to Gtk+ but that has its own share of issues and bindings to other toolkits (e.g. wxWidgets) look abandoned.<p>I occasionally check out D to see what is the status wrt the above but for years things do not seem to change. I do hope that at some point D will have a good GUI application framework and a good native IDE that understands the language itself.<p>[0] <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;1Y5hL26.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;1Y5hL26.png</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;buggins&#x2F;dlangui" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;buggins&#x2F;dlangui</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;buggins&#x2F;dlangui&#x2F;issues&#x2F;608" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;buggins&#x2F;dlangui&#x2F;issues&#x2F;608</a>