Announcement

Collapse
No announcement yet.

id Tech 4 / Doom 3 Is Being Rewritten In Ada

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #41
    Originally posted by Lucretia
    You could do it with overloading.
    you can't do printf with overloading, it requires infinite number of overloads. you will need to pass parameters in heterogeneous container

    Comment


    • #42
      Originally posted by bregma View Post
      Interesting. It's good that some people have such hobbies, it keeps them away from the troubles that come from drinking, gambling, and carousing with morally questionable members of the appropriate sex.
      I fear there was no irony intended.

      Comment


      • #43
        Originally posted by atomsymbol

        Re-living parts of mankind's history has a very high value for some people. It enables a person to learn how our ancestors lived.

        See also: https://archive.org/stream/byte-magazine-1983-08
        Creator of the project here. I feel like I need to clarify some things - there are a lot of people here who assume I am simply translating the Doom 3 Id Tech 4 engine into another language which is not true. It is more of a rewrite in spirit and has already achieved some interesting feats such as having CVars and console commands, a custom Win32 binding that beats many features in Doom 3's system layer and SDL, and threaded input and windowing. This is all done in a fraction of the lines of code as the original (about 75% less conservatively) thanks to Ada's libraries and powerful "package" organization and advanced low-level features. It uses entirely different APIs at every level - even asset loading.

        Here is an example from the code of what can be achieved in Ada compared to the original (given the original had time constraints). I don't think it would be a stretch to say APIs are more readable

        Id-Tech 4 asset loading

        AdaDoom3:
        Id Software's Id-tech-4-BFG in the Ada programming language. - File not found · AdaDoom3/AdaDoom3

        Id Software's Id-tech-4-BFG in the Ada programming language. - File not found · AdaDoom3/AdaDoom3


        DOOM 3 BFG:





        CVars and commands

        AdaDoom3 - Added feature of being task-safe and atomically set



        DOOM 3 BFG:





        Comment


        • #44
          Originally posted by polarathene View Post
          A recruiter contacted me the other day for some role that required Rust, how much years? oh 3. Goodluck finding that in this country when Rust only went stable in mid 2015...
          Hard to tell with HR sometimes, whether they are breathtakingly clueless or just sadistic...

          Comment


          • #45
            Originally posted by exitcode0 View Post
            That's hardly different from any modern language with record like and variant data structures. Take a look at OCaml, SML, Haskell, Idris, Rust, ... in fact this isn't anything new. You could say ML like languages invented these strongly typed abstractions.

            That looks like crap compared to basic higher order functions. Especially the parsing is AWFUL, it's horrible, Please read about parser combinators. Also, instead of assertions consider DbC and property based testing. For animations consider functional reactive programming. Even C++/Qt uses something similar to that.

            Comment


            • #46
              Originally posted by caligula View Post
              That's hardly different from any modern language with record like and variant data structures. Take a look at OCaml, SML, Haskell, Idris, Rust, ... in fact this isn't anything new. You could say ML like languages invented these strongly typed abstractions.

              That looks like crap compared to basic higher order functions. Especially the parsing is AWFUL, it's horrible, Please read about parser combinators. Also, instead of assertions consider DbC and property based testing. For animations consider functional reactive programming. Even C++/Qt uses something similar to that.
              I am sure it may look similar, but there are some benefits in Ada for working at a low-level like being able to specify compatibility with C per data structure and specify the spacing between members with record representation clauses. As for "higher order functions" John had a few things to say about that here:
              (Here begins a comment written by John Carmack in 2014, about an email he sent to a programmers’ mailing list in 2007.)


              ... as you are a senior member caligula, I would expect more in your reply. I don't know what has angered you about my project insult it to such a degree and throw buzzwords at me like I am a 2 year old... it may seem distasteful to you but the parsing in AdaDoom3 follows the model in Doom 3 BFG but achieves less temporary state overhead and a reduction of actual complexity - thus my claim about readability.

              Comment


              • #47
                Originally posted by exitcode0 View Post

                I am sure it may look similar, but there are some benefits in Ada for working at a low-level like being able to specify compatibility with C per data structure and specify the spacing between members with record representation clauses.
                Being able to specify packing, padding, alignment and such is really nice, but it's hardly anything Ada specific. C does it actually quite well, but it doesn't have the type safe sum types and for some reason the standardization of the fine grained control of structs took really long. If a functional languge lets you specify packing, padding, and alignment and provides sum/product types or even GADTs with higher-kind types, it pretty much does everything you can wish for. It can also generate the pretty printers, serialization code etc. for you. Automatically. Property based testing decreases the number of needed test cases like 99.9%.

                As for "higher order functions" John had a few things to say about that here:
                (Here begins a comment written by John Carmack in 2014, about an email he sent to a programmers’ mailing list in 2007.)
                The original comment is around 10 years old. Compilers do evolve - just compare the latest LLVM/GCC -O3 -march=native -ffast-math with a 10 year old GCC. Other thing is, function inlining is a different beast in functional languages and oftentimes the compiler has to do tons of inlining everywhere because otherwise the perf would absolutely suck in any program. If you use short lambdas with no special captured state in the closure, the translation is extremely straightforward. There is no magic involved. For loops, the functional language implementors know tons of tech with deforestation and loop fusion etc. In C/C++, the compiler actually needs to turn the code into a 'functional' form to even prove that it can safely inline and do other aggressive optimizations. The starting point, the code that the user wrote, has too little information.

                ... as you are a senior member caligula, I would expect more in your reply. I don't know what has angered you about my project insult it to such a degree and throw buzzwords at me like I am a 2 year old... it may seem distasteful to you but the parsing in AdaDoom3 follows the model in Doom 3 BFG but achieves less temporary state overhead and a reduction of actual complexity - thus my claim about readability.
                Listen, I tried to be constructive and listed tons of concepts you might be interested in, didn't call people with names like some others here did. They're not buzzwords, they're real stuff. Old stuff, nothing new and fancy. You can probably even implement them in Ada. If you want to understand what I said, go read about the topics. I'm not dismissing Ada per se (it's just a boring programming language for Pete's sake), I'm just annoyed by some bogus claims.

                Comment


                • #48
                  Originally posted by caligula View Post
                  Being able to specify packing, padding, alignment and such is really nice, but it's hardly anything Ada specific. C does it actually quite well, but it doesn't have the type safe sum types and for some reason the standardization of the fine grained control of structs took really long. If a functional languge lets you specify packing, padding, and alignment and provides sum/product types or even GADTs with higher-kind types, it pretty much does everything you can wish for. It can also generate the pretty printers, serialization code etc. for you. Automatically. Property based testing decreases the number of needed test cases like 99.9%.
                  True, C has come a long way, but it doesn't have enforceable discriminate unions or safe enumerated types without making template boilerplates everywhere.

                  Originally posted by caligula View Post
                  The original comment is around 10 years old. Compilers do evolve - just compare the latest LLVM/GCC -O3 -march=native -ffast-math with a 10 year old GCC. Other thing is, function inlining is a different beast in functional languages and oftentimes the compiler has to do tons of inlining everywhere because otherwise the perf would absolutely suck in any program. If you use short lambdas with no special captured state in the closure, the translation is extremely straightforward. There is no magic involved. For loops, the functional language implementors know tons of tech with deforestation and loop fusion etc. In C/C++, the compiler actually needs to turn the code into a 'functional' form to even prove that it can safely inline and do other aggressive optimizations. The starting point, the code that the user wrote, has too little information. I actually do plan on making the "Game" layers of the engine such as enemy behavior and AI in a functional language, but
                  It seems you are advocating for an increase in actual complexity for a decrease in perceived complexity - I don't think that is always a win either in readability or speed as you seem to imply. Functional programming is nice, but at the end of the day C APIs rule the world and writing Win32 or Vulkan code in a functional language seems hellish to me. I actually do plan on making the upper "Game" layers of the engine such as enemy behavior, AI, GUI stuff in a functional language.

                  Originally posted by caligula View Post
                  Listen, I tried to be constructive and listed tons of concepts you might be interested in, didn't call people with names like some others here did. They're not buzzwords, they're real stuff. Old stuff, nothing new and fancy. You can probably even implement them in Ada. If you want to understand what I said, go read about the topics. I'm not dismissing Ada per se (it's just a boring programming language for Pete's sake), I'm just annoyed by some bogus claims.
                  Well, calling my project "awful, terrible crap" without going into more detail was a bit patronizing, but perhaps I read your comment as a continuation of the flame war just as you were annoyed by it as well.

                  Comment


                  • #49
                    Originally posted by Lucretia
                    Michael I apologise to you and anybody reading this but I won't sit idly by while some no mark insults me, this just makes people like that think they can do what they want. I certainly won't put up with that without responding.
                    Man, no offense and no harm intended, but frankly you're a kid. Don't know your real age but you start with a good intention when apologizing to Michael and others, then you screw up again when you say you have to respond, won't sit idly etc. Come on, grow up!
                    People are trolling all over the place on Internet and you take it personally, make it a public affair and you are just drawing shame and ridicule onto you.

                    At least what sets you apart from the others in the ridiculous flame war everybody can see in this article's comments, is that you're trying to apologize.
                    Now finish it - now and next time, just let the trolls write their stupid insults, don't answer, or at least don't go back in the mud, playing with the other pigs. You will have grown up a bit. Let THEM be ridiculous, don't be like them.

                    Oh and by the way... it's just talking about languages, game development etc... how on earth can it come to such lowly trash-talk... how can it become personal... this is just beyond ridiculous.

                    My well-intended 2 cents.

                    Comment


                    • #50
                      Haven't touched ADA in over 30 years (not since it's peak roughly). Amazing! Can we get Doom 3 in LISP? CLIPS? or Prolog? (j/k)

                      Comment

                      Working...
                      X