[HN Gopher] Let's compile like it's 1992 (2014)
       ___________________________________________________________________
        
       Let's compile like it's 1992 (2014)
        
       Author : sysoleg
       Score  : 249 points
       Date   : 2024-02-26 11:18 UTC (11 hours ago)
        
 (HTM) web link (fabiensanglard.net)
 (TXT) w3m dump (fabiensanglard.net)
        
       | aidos wrote:
       | After seeing it mentioned on here a bunch of times over the
       | years, I finally read Master of Doom a couple of months back.
       | Great book!
       | 
       | The games they were producing were incredibly exciting to play at
       | the time, but it's even more inspiring looking back at the
       | history to see what a handful of scrappy kids could create.
        
       | Borg3 wrote:
       | Yeah, thats great in retro systems. If you gather the tools, you
       | can rebuild them. I recently recompiled good old Uplink game for
       | fun. All I needed is Visual Studio 6.0. The devel archive
       | contained all necessary deps to build game. It was a bit tricky
       | to do it right but after an hour of fixing deps (I got rusty) I
       | made it and game works fine :) I even fixed some minor glitches
       | and added little improvements here and there.
       | 
       | Now imagine touching todays stuff.. Madness :)
        
         | ido wrote:
         | These days a lot of what you need is simply the right version
         | of Unity or Unreal installed. You're definitely correct for
         | pre-unity times tho.
        
         | saidinesh5 wrote:
         | I think that's only with Linux's package management mess?
         | 
         | Most commercial embedded/windows stuff I have seen usually
         | vendored their dependencies in a thirdparty/ folder AND fixed
         | the toolchains they use. So the setup is always reproducible.
        
           | Borg3 wrote:
           | Dunno, but for example I tried to compile Stalker SoC and it
           | was very messy adventure. It took me whole day to build it
           | (deps problems, compile errors) and it was such an
           | disappointment because game just crashed. Maybe I will try
           | again one day.
        
           | bombcar wrote:
           | A ton of work has to be done to build old minecraft mods from
           | source.
           | 
           | Doable, but often tricky.
        
           | dormento wrote:
           | I do it that way with toolchains for exotic architectures.
           | Its easier.
           | 
           | (I'm from the "Hey as long as it works" school of thought).
        
         | sillywalk wrote:
         | > I recently recompiled good old Uplink game for fun.
         | 
         | Cool. Cool game. I didn't know the source code was available.
        
           | gattilorenz wrote:
           | It's available on the Internet Archive, and iirc there's also
           | a source-available multiplatform port/new engine on github
        
       | pjmlp wrote:
       | Sweet memories of Borland's MS-DOS IDEs.
        
         | xyzelement wrote:
         | If you have nostalgia for this, check out Free Pascal. It's an
         | open-source Pascal/Delphi clone, and includes a clone of the
         | blue DOS Turbo Pascal editor that will give you the vibe you
         | crave.
         | 
         | I used it for a few of the Advent of Code days this year, but
         | man the nostalgia wore off. Both the limitations of the IDE and
         | the verbosity of Pascal weren't "fun" to operate in daily
         | coming from the modern world. But definitely sweet memories.
        
       | yaky wrote:
       | I highly recommend his book on Wolfenstein 3D (mentioned at the
       | end of the article). Even though it's technical, it is not dry or
       | boring. And there are lots of old-school tricks and
       | optimizations, like 64 unwrapped functions for scaling wall
       | textures, storing the sprites "sideways", managing the wacky
       | graphics card, and hacking the graphics modes to even be able to
       | display something like a game in the first place.
        
         | Pesthuf wrote:
         | This one
         | https://fabiensanglard.net/Game_Engine_Black_Book/index.php ?
         | Looks like it's not out yet, is it?
        
           | fredrikholm wrote:
           | That post is from 2014. He released it in 2017:
           | 
           | https://fabiensanglard.net/gebb/
           | https://fabiensanglard.net/about/index.html
        
           | estebank wrote:
           | It came out in 2017 https://www.amazon.com/Game-Engine-Black-
           | Book-Wolfenstein/dp... as per the bottom of
           | https://fabiensanglard.net/about/index.html
        
           | bombcar wrote:
           | https://fabiensanglard.net/about/ has all of them at the
           | bottom - there is one for Wolf3D and one for Doom - highly
           | recommended.
           | 
           | The CP-System is also interesting, even for someone like me
           | who never used one. But not quite as interesting (to me) as
           | the other two.
        
         | raid2000 wrote:
         | Thanks for the recommendation. I just downloaded the 431 page
         | pdf on the game engine. It's even got a foreward by John
         | Carmack.
        
       | sfc32 wrote:
       | Had some problems opening the archive
       | 
       | Archive: wolfsrc.zip End-of-central-directory signature not
       | found. Either this file is not a zipfile, or it constitutes one
       | disk of a multi-part archive. In the latter case the central
       | directory and zipfile comment will be found on the last disk(s)
       | of this archive. unzip: cannot find zipfile directory in one of
       | wolfsrc.zip or wolfsrc.zip.zip, and cannot find wolfsrc.zip.ZIP,
       | period.
        
         | anta40 wrote:
         | I'm on macOS.
         | 
         | curl -O
         | http://fabiensanglard.net/Compile_Like_Its_1992/tools/wolfsr...
         | gave a HTML file.
         | 
         | $ file wolfsrc.zip
         | 
         | wolfsrc.zip: HTML document text, ASCII text
         | 
         | wget downloaded the file correctly, though. can be unzipped
         | without problem.
        
           | giantrobot wrote:
           | With curl you'll likely need to give the '-L' flag to follow
           | a redirect automatically.
           | 
           | Yup. The link gives a 301 redirect to the HTTPS site. With
           | wget it follows redirects automatically.
        
             | ozymandias1337 wrote:
             | wget FTW.
        
               | giantrobot wrote:
               | I don't dislike wget at all but I appreciate the explicit
               | behavior of curl.
        
               | ozymandias1337 wrote:
               | Fair 'nuff.
        
       | pjc50 wrote:
       | Borland C++ was extremely good: a C++ compiler, standard library,
       | and IDE with debugger that fit in about five megabytes. With the
       | cozy yellow-on-blue Borland colour scheme.
        
         | jahnu wrote:
         | OWL was pretty good too.
        
           | pjmlp wrote:
           | I was quite surprised how bad MFC was by comparison, then OWL
           | got replaced by VCL, still quite good, while MFC continued
           | bad as always.
           | 
           | While Borland had an approach that we could get nice high
           | level frameworks in C++ (a sentiment that Qt also shares),
           | Microsoft C++ folks seemed keen in keeping their beloved MFC
           | as low level as possible.
           | 
           | I read somewhere that MFC originally was similar in concept,
           | but faced too much resistance internally, thus the outcome
           | and was rewriten.
           | 
           | And to this day Microsoft hasn't been able to deliver a C++
           | framework that is as nice to use as those from Borland.
        
             | mschaef wrote:
             | > I read somewhere that MFC originally was similar in
             | concept,
             | 
             | This is what AFX was. They reused some of the core pieces,
             | so the AFX name persisted into MFC.
             | 
             | > but faced too much resistance internally, thus the
             | outcome and was rewriten.
             | 
             | The concern was that developers who had just ascended the
             | Win16 API learning curve would now have to ascend another
             | totally different learning curve to understand the
             | framework. MFC developed from a (supposedly) nice object
             | oriented framework into a way to avoid explicitly passing
             | handles to API calls. (It also replaced message cracking
             | and a few other things.)
             | 
             | By the time Visual C++ rolled around, Microsoft started
             | adding higher level abstractions to MFC and building it
             | back out a bit, but the underlying damage was done.
             | 
             | > And to this day Microsoft hasn't been able to deliver a
             | C++ framework that is as nice to use as those from Borland.
             | 
             | ATL was supposedly quite nice, as was the mostly
             | unsupported WTL derivative (that supported complete app
             | development).
        
         | rurban wrote:
         | Zortech was much better
        
       | Isamu wrote:
       | Installing to the C drive! Luxury! We swapped those floppies back
       | and forth out of the A and B drives because we had no hard drive
       | and it kept prompting for the part of the compiler swapped out!
       | And we enjoyed it! Kids these days don't believe you when you
       | rant about it!
        
         | devoutsalsa wrote:
         | In 1992, I had a 5.25 inch, double height hard drive with 8.9
         | MB of storage. I also had two 5.25 inch, 360 KB floppy drives.
         | 
         | I was jealous of my friend's Mac w/ a 720 KB disk drive and 30
         | MB hard drive (although his system cost probably cost 6x what
         | my PC cost).
        
           | michaelcampbell wrote:
           | > although his system cost probably cost 6x what my PC cost
           | 
           | How times have (not) changed, eh?
        
           | toast0 wrote:
           | Likely just full height, not double height. What has become
           | the normal height for a 5.25" drive is half height. I've seen
           | plenty of full height 5.25" hard drives, but I don't think
           | I've seen double height (would take 4 bays in a modern
           | computer case, if modern computer cases had 4 bays)
        
             | devoutsalsa wrote:
             | It's been a while. It was twice the size of two 5.25 floppy
             | drives. Whatever size that is.
        
           | xorcist wrote:
           | The full height drives were the 8" floppies. They hardly
           | existed anymore in the 90s, not on PC systems.
           | 
           | Wikipedia has a nice article with pictures:
           | https://en.wikipedia.org/wiki/Floppy_disk
           | 
           | Even if you didn't have that 3.5" drive for your computer,
           | perhaps you can take solace in the fact that you understand
           | intuitively why the disks were called "floppy"!
        
         | mixmastamyk wrote:
         | '92, not '82.
        
       | ecshafer wrote:
       | I learned to program in Borland Turbo C++. One thing from back
       | then that I really miss is how easy it was to do some complex
       | things. I was able to draw to the screen by just calling
       | geometric shape functions, and it made pictures! I found out that
       | if I drew a shape, then called the xor function on the shape a
       | new but sligtly different shape, I could make animations. So
       | making little sprites that looked like they were running made out
       | of only 1000 lines of C++ code was awesome. Some friends and I we
       | got together and made a final fantasy like game using these
       | tricks, hand crafted sprites and a game world that you could walk
       | across, every map was a whole screen, and you would go to an
       | adjacent map when you hit the sides, and every step if you had a
       | natural 1 you would go into a fight with some enemies.
       | 
       | This was all pretty tedious and everything, but it was a lot of
       | fun to high schoolers. And if we knew more computer science and
       | software engineering we would have done more probably, and it
       | would have worked better. But unlike today we didn't have to
       | learn SFML or or activex or opengl to just start playing and get
       | stuff working, we could just call circle.
        
         | xyzelement wrote:
         | I _suspect_ that if we wanted to find an environment for kids
         | to do simple shape programming, we can find something like
         | that.
         | 
         | The difference seems to be that there's been a greater
         | divergence between "professional" tools and "kids/intro tools"
         | whereas Turbo C++ (or Turbo Pascal in my days) were kinda both.
        
           | mikepurvis wrote:
           | I've been struggling with getting my ten-year-old across this
           | gap. He's outgrown Scratch/Roblox and I don't think PICO-8 is
           | quite the right set of abstractions (no built in entity
           | system, seriously?); we're working with Godot right now and
           | he's making progress, but it's definitely a lot more of a
           | learning curve figuring out how to do stuff in a tool that
           | has everything.
        
             | xyzelement wrote:
             | I have a 3 and 1 year olds but starting to think about
             | this.
             | 
             | If we really think basic / turbo pascal has this right. Why
             | don't we just teach our kids those things. We can get the
             | environments running I am sure.
        
               | ecshafer wrote:
               | I think something like basic or pascal is right. The
               | "hard" part I think that Borland did so well was make it
               | so easy to just get things right. A Neo Turbo Pascal that
               | you could could type draw(x,y,z,r,"red") and see a red
               | circle on the screen is the ideal, without having to mess
               | with a very complicated workflow like in unity or unreal.
        
               | mikepurvis wrote:
               | I mean, PICO-8 is basically that:
               | 
               | https://pico-8.fandom.com/wiki/Circ
               | 
               | But I'm just not sure if pixel-by-pixel drawing is the
               | right abstraction layer at this point in time.
        
               | xyzelement wrote:
               | that looks cool to me, thanks for sharing. I think
               | something that works well for kids is instant feedback on
               | their code/tweaks, looks like this has it.
        
               | mikepurvis wrote:
               | PICO-8 sits in an interesting spot where it's not exactly
               | a "toy" language/environment the way Scratch is, nor is
               | it especially geared at learning, but on the other side
               | of things it _is_ based on a real programming language
               | (lua) and there 's an interesting scene for it where
               | people flex pushing it to its limits making demos,
               | demakes, etc, many of which are far beyond the NES-level
               | capabilities it's meant to have.
        
               | fuzztester wrote:
               | Python's turtle graphics or Logo is good for this.
               | 
               | Free Logos are available even today.
        
             | khrbrt wrote:
             | Would processing[0] be a good fit? It's designed to be easy
             | to use and learn but powerful enough for professional use.
             | Very quick to get cool stuff moving on a screen and the
             | syntax is Java with a streamlined editing environment.
             | 
             | [0] https://processing.org/
        
             | bombcar wrote:
             | Throw him off the deep end into Minecraft modding ;)
             | 
             | If you search around there are some pretty decent "download
             | InteliJ and go" things.
        
             | philiplu wrote:
             | I've got a 15 yo who decided to start programming in Python
             | using Pythonista on his iPhone. He refuses to take any
             | input from me; just wants to learn on his own. Pythonista
             | comes with some nice game-programming modules. So far he's
             | shown me a Pong game, 2048 clone, air hockey, and more.
        
           | ecshafer wrote:
           | There has been a lot of effort put into making kids versions
           | of technology, which I think is probably the right move for
           | elementary school aged kids. But once you get into middle and
           | highschool, I think as a kid there is a "coolness" factor to
           | using the same stuff that the pros use. Since at that point
           | you are trying to be an adult, you are trying to do stuff the
           | right way, and hey you might be getting a real job in the
           | field just a couple years anyways. So there is some value I
           | think in making just more friendly of an environment and on
           | boarding process to a tool.
        
           | phendrenad2 wrote:
           | At the very least, you can always run Borland Turbo C++ on
           | Windows 2000 in a VM.
        
           | Solvency wrote:
           | It's called Processing.
        
           | mschaef wrote:
           | The other divergence is in expectations.
           | 
           | A kid in the early to mid-80's could get enough working that
           | they could imagine it possible to match a store bought game.
           | 
           | Once hardware capabilities went up, so did the need for more
           | specialized skills and longer development cycles. Even though
           | it might have still been possible to draw a box on the screen
           | with a single command, the relationship of that box to a
           | valuable outcome was a lot less obvious.
        
             | ncruces wrote:
             | Only if people loose the ability to appreciate simple
             | things. 2048 is a lot of fun. So is wordle. Or the xor game
             | that made HN a week ago.
        
               | mschaef wrote:
               | Flappy Bird too, for that matter.
        
           | josephg wrote:
           | When I was teaching programming my go-to was the JavaScript
           | canvas api. It's 2d only, and very simple. And being on the
           | web once a student has made something we can host it for them
           | and they can show their friends.
           | 
           | I have a ~20 line html harness which sets up a page with a
           | full screen canvas element and gives you global window width
           | & height variables. That's all you need to get started. And
           | it's real JavaScript - so students learn a useful programming
           | language as a result, and the advanced students can go nuts
           | and add sprites, sound and networking if they really want to.
        
         | m000 wrote:
         | I kind of envy you for having access to Borland Turbo C++ _and_
         | learning resources for it as a kid. The closest I could get to
         | it was reading a review on my local computing press. Even
         | assuming I could magically get a copy, I still wouldn 't know
         | what to do with it without reading material. And even if I had
         | the reading material, I'm not sure how much I would make out of
         | it with my fledgling knowledge of English at the time.
        
           | elzbardico wrote:
           | I wouldn't have access too if it were not for the local
           | pirate scene. Even owners of local software houses doing
           | professional accounting systems didn't mind copying a few
           | disks of software they paid for to a kid who knew how to ask.
           | If you got something new, you'd immediately share with your
           | colleagues.
           | 
           | And everybody kept in mind that if we ever started making
           | money from our hobby, one of our first investments would be
           | into buying properly licensed copies of the tools we used.
        
           | jerry_tk wrote:
           | Borland Turbo C++ (and Pascal as well) had great help
           | documentation. Every function was thoroughly explained and
           | there was a lot of examples. I learned C just by reading
           | Turbo C++ help docs. I miss that time.
        
         | zozbot234 wrote:
         | Modern 2D graphics are not based on plotting pixels to a
         | framebuffer, they have "textures" or "surfaces" as a native
         | part of the system and any compositing is done as a separate
         | step. So if anything making "simple sprites" has become a bit
         | easier since you can just think of any composited surface as a
         | more generic version of a hardware sprite.
        
           | ecshafer wrote:
           | I think this is more simple from the pov of making a game
           | engine from scratch or a game with complex effects and
           | graphics. But is it more simple from the pov of a high
           | schooler that just wants to get some flat colored shapes on
           | the screen?
        
             | zozbot234 wrote:
             | Even rendering "flat colored shapes" efficiently can be a
             | bit non-trivial if you expect pixel-perfect results, like
             | you'd get by plotting to an ordinary framebuffer - the
             | GPU's fixed rendering pipeline is not generally built for
             | that. The emerging approach is to use compute shaders, and
             | these are not yet fully integrated with existing
             | programming languages - you can't just edit ordinary
             | C++/Rust code and have it seamlessly compile for CPU and
             | GPU rendering. But we're getting closer to that.
        
         | JohnFen wrote:
         | > I learned to program in Borland Turbo C++.
         | 
         | That still reigns as my favorite IDE of all time by a country
         | mile.
        
           | qingcharles wrote:
           | My first real IDE and still my favorite IDE.
        
           | pjmlp wrote:
           | Same here, going into UNIX back in the early 1990's, after
           | using the Borland IDEs across MS-DOS and Windows 3.x (and
           | being aware of their OS/2 versions), felt like time travel to
           | the genesis of programming, CP/M style.
           | 
           | Thankfully a professor pointed us to XEmacs, which I managed
           | to get my Borland experience back, which became my UNIX
           | companion until KDevelop, Eclipse, Netbeans came to rescue.
        
         | zackmorris wrote:
         | _One thing from back then that I really miss is how easy it was
         | to do some complex things._
         | 
         | This might be my biggest disappointment with "modern"
         | programming. I want direct access to the hardware with stuff
         | like $100 1GHz 100+ core CPUs with local memories and true
         | multithreaded languages that use immutability and copy-on-write
         | to implement higher-order methods and scatter-gather arrays.
         | Instead we got proprietary DSP/SIMD GPUs with esoteric types
         | like tensors that require the use of display lists and shaders
         | to achieve high performance.
         | 
         | It comes down to the easy vs simple debate.
         | 
         | Most paradigms today go the "easy" route, providing syntactic
         | sugar and similar shortcuts to work within artificial
         | constraints created by market inefficiencies like monopoly. So
         | we're told that the latency between CPU and GPU is too long for
         | old-fashioned C-style programming. Then we have to manage pixel
         | buffers ourselves. We're limited in the number of layers we can
         | draw or the number of memory locations we can read/right
         | simultaneously (like how old arcade boxes only had so many
         | sprites). The graphics driver we're using may not provide such
         | basic types as GL_LINES. Etc etc etc. This path inevitably
         | leads to cookie cutter programming and copypasta, causing
         | software to have a canned feel like the old CGI-BIN and Flash
         | Player days.
         | 
         | Whereas the "simple" route would solve actual problems within
         | the runtime so that we can work at a level of abstraction of
         | our choosing. For example, intrinsics and manual management of
         | memory layout under SSE/Altivec would be substituted for
         | generalized (size-independent) vector operations on any type
         | with the offsets of variables within classes/structs decided
         | internally. GPUs, FPUs and even hyperthreading would go away in
         | favor of microcode-defined types and operations on arbitrary
         | bitfields, more akin to something like VHDL/Verilog running on
         | reprogrammable hardware.
         | 
         | The idea being that computers should do whatever it takes to
         | execute users' instructions, rather than forcing users to adapt
         | their mental models to the hardware/software. Cross-platform
         | compilation, emulation, forced hardware upgrades that ignore
         | Turing completeness, vendor/platform lock-in and planned
         | obsolescence are all symptoms of today's "easy" status quo.
         | Whereas we could have the "simple" MIMD transputer I've
         | discussed endlessly in previous comments that just reconfigures
         | itself to run anything we want at the maximum possible speed.
         | More like how a Star Trek computer might run.
         | 
         | In practice that would mean that a naive for-loop on individual
         | bytes written in C would run the same speed as a highly
         | accelerated shader, because the compiler would optimize the
         | intermediate code (i-code) into its dependent operations and
         | distribute computation across a potentially unlimited number of
         | cores, integrating the results to exactly match a single-
         | threaded runtime.
         | 
         | The hoops we have to jump through between conception and
         | implementation represents how far we've diverged from what
         | computing could be. Modern web development, enterprise
         | software, a la carte microservice hoards like AWS that
         | eventually require nearly every service just to work, etc etc
         | etc, often create workloads which are 90% friction and 10%
         | results.
         | 
         | Just give me the good old days where the runtime gave us
         | everything, no include paths or even compiler flags to worry
         | about, and the compiler stripped out everything we did't use.
         | Think C for the Macintosh mostly worked that way, and even
         | Metrowerks CodeWarrior tried to have sane defaults. Before
         | that, the first fast language I used, called Visual Interactive
         | Programming (VIP), gave the programmer everything and the
         | kitchen sink. And HyperCard practically made it its mission in
         | life to free the user of as much programming jargon as
         | possible.
         | 
         | I feel like I got more done between the ages of 12 and 18 than
         | all the years since. And it's not a fleeting feeling.. it's
         | every single day. And forgetting how good things were in order
         | to focus on the task at hand now takes up so much of my psyche
         | that I'm probably less than 10% as productive as I once was.
        
           | zozbot234 wrote:
           | Microcode? I don't think that's how modern march works. You
           | can definitely make modern compute accelerators more like a
           | plain CPU and less bespoke, and this is what folks like
           | Tenstorrent and Esperanto Technology are working on (building
           | on RISC-V, an outstanding example of "simple" yet effective
           | tech) but a _lot_ of the distinctive featuresets of existing
           | CPUs, GPUs, FPUs, NPUs etc. are directly wired into the
           | hardware, in a way that can 't really be changed.
        
         | Keyframe wrote:
         | good old conio.h and Borland's BGI graphics.h :) SDL is kinda
         | there for that today, albeit not as simple.
        
           | cmpxchg8b wrote:
           | xlib > bgi. That thing was so "powerful" it destroyed my
           | monitor using a mode with suspect timings :D
        
         | Arnavion wrote:
         | Computer Science classes in Indian schools (fifth to eighth
         | grades in my case) taught programming using Borland Turbo C++.
         | That was back in the 2000s, but I wouldn't be surprised if they
         | still use it today.
        
       | sebastianconcpt wrote:
       | Oh the memories..
       | 
       | One thing that we need to rescue/reinvent from that are the TUIs
       | which will look amazing in higher resolution screens.
        
         | bombcar wrote:
         | The _speed_ you could get on those  "box character TUIs with
         | light up Alt-key shortcuts" was _insane_ - I can remember going
         | to Fry 's Electronics, where everything was managed by some
         | (probably mainframe) computer that was interacted with via
         | terminals (later a terminal emulator on windows) and the
         | employees who knew it could get you a printed out quote for the
         | cage before the thing had even finished drawing the first
         | screen.
        
           | sebastianconcpt wrote:
           | _dot matrix printer background noises_
           | 
           | Sorry I didn't get the last part of what you said, come
           | again?
        
       | dang wrote:
       | Related:
       | 
       |  _Let 's compile like it's 1992 (2014)_ -
       | https://news.ycombinator.com/item?id=13750097 - Feb 2017 (80
       | comments)
        
       | jpm_sd wrote:
       | Gosh, I really miss that DOS text-based UI. Reminds me of my old
       | reliable PS/2, which I kept using up until about 1997!
        
         | einpoklum wrote:
         | You can use midnight commander on your terminal, at least...
        
       ___________________________________________________________________
       (page generated 2024-02-26 23:00 UTC)