willvarfar 7 hours ago

Jaw droppingly awesome :)

Brings up a strong nostalgia from me. Around that time computers were becoming mainstream and available where I was in the UK, and I grew up acquiring old cast-off computers and tinkering. For me there was an 'assembly language masterclass' book (I was a beginner and this was my first serious tech book and I had to sink or swim) that went into a lot of 32-bit programming for the 386 (which I never had) but got me far enough along. It was that and computer magazines which were really programming magazines, which were a thing and quite popular back then.

Remember fondly how transformative it was to move from Basic to a copy of Turbo Pascal 6 and it's asm keyword that I got passed on a floppy disk in the playground.

Ah that was the time when it was just obvious that you could entertain yourself on a computer by creating things, however small, instead of just consuming them.

By the time I got computer games, I was thinking about them as programs not games and I got my entertainment by getting into the modding scene.

ikari_pl 7 hours ago

Do you also feel like you did projects in your teen years that you wouldn't pull off today?

I coded assembly (Z80) in a disk editor, having no assembler, just a handwritten list of opcodes.

I wrote a chat client app (in Delphi) HAVING NO INTERNET at home, I went to a cafe, recorded a dump with Wireshark, printed it on a dot matrix printer, and used a marker pen to highlight the bytes I understand the meaning of.

I miss it so much.

  • smokel 6 hours ago

    Yup. I wrote a TSR program to extend Deluxe Paint II on PC with animation features. Never heard about APIs, and simply copied data from the VGA memory, overlaying my own user interface on top of DP.

    The thought of doing this with contemporary systems just seems ... wrong :)

    • ddalex 2 hours ago

      I wrote lots of TSR extensions, I remember one that would allow you to switch between DOS programs.... it broke when the next version of DOS came out.

      I was most fond of my image viewer program that worked only on my video card (a cirrus logic) but was 10x faster then others because it used some hw acceleration on the card (not remembering details right now).

      It's basically impossible to replicate this level on todays extra-locked-down machines - the bar to entry and just tinker is so much higher.

    • SmellTheGlove 6 hours ago

      Well back then we didn’t have all of that memory for those fancy abstraction layers. Sticking your finger in the framebuffer probably wasn’t the worst way to do that!

  • yapyap 26 minutes ago

    It’s the power of boredom, imo.

  • pkphilip 2 hours ago

    I wrote a basic bootable 32-bit OS and an editor in x86 assembly :) all without internet and by poring through the Intel manuals and the "Undocumented..." series of books.

  • pjmlp 2 hours ago

    Yes, my teens were the glory days of 16 bit demoscene, learned a lot.

  • anonzzzies 4 hours ago

    I noticed I missed it and so I went back to it a few years ago. I have old systems (mostly from the 70-90s; a few newer because my love for Sun Sparc & pre-Intel SGI) and newer ones like RISC-V boards and low-powered small devices to thinker with. None of this has any commercial value but it feels so much better than the LLM grifting / code slinging for profit. I wish I found a way to combine them, but I feel it's not possible.

nickcw 3 hours ago

I loved reading this write-up. It was a wonderful trip down memory lane. Writing a PASCAL compiler is very impressive. I only got as far as the assembler!

In 1989 I designed and built a board with 3 transputers on it as part of my (physics) degree project. The transputers were T212 I think, so only 16 bit and no floating point with 2k of local RAM. They ran at 20 Mhz and the all important chip to chip network ran at 10 Mhz. Ostensibly it was so I could do Ising spin simulations on it but actually all I wanted to do was calculate Mandelbrot sets having seen a demo of a box with 256 transputers in doing that.

My transputer box was connected to a BBC Micro and to program the transputer I wrote an assembler in BBC Basic. The transputer instruction set was quite funky - everything was variable length. Which meant when calculating the jump instructions, sometimes my assembler would take 7 passes to find the optimium encoding for everything.

The BBC Micro only had 32k of RAM which wasn't nearly enough RAM to hold the assembler, the symbol table and the code you were assembling. So the assembler would write each pass to disk! To floppy disk! It was very slow as you can imagine but I did end up writing both an Ising spin simulation and a Mandelbrot set plotter. The Ising spin simulator ran slightly faster than a FORTRAN version I wrote for the university mainframe which I was very pleased with.

I got to learn about parallel processing using message passing and managed to make my first concurrency bug where the program would work on 1, 2 but not 3 transputers! I didn't write programs for multi-processor machines again for more than 10 years.

The transputer seems so ahead of its time, even now 36 years later. I sometimes wonder what it would be like if we'd continued down that path. Maybe your laptop would have 10,000 processors in it each with a few MB of RAM and we'd be writing very different programs in languages where message passing was a first class construct.

  • com 3 hours ago

    > I sometimes wonder what it would be like if we'd continued down that path. Maybe your laptop would have 10,000 processors in it each with a few MB of RAM and we'd be writing very different programs in languages where message passing was a first class construct.

    It sounds a bit like the Erlang BEAM VM to be honest, the BEAM processes tend to be small and there are a lot of them in real-world applications, and message passing is a first class construct (along with some others like ETS which are “cheats” that offer other tradeoffs for specific cases)

jll29 2 hours ago

Fantastic, well done! - I remember the Inmos Transputers (T800), and there was Occam, the curious language, from which I remember just two operators, ? and ! to read and write from the four(?) fast serial ports that connected one transputer with its neighbors.

Pascal was beautiful, clean, simple and fast, and computer science has never reached that height again, IMHO - look at how slow Python is, how unstructured many programs are, when python permitted nested functionsa and procedures (C/C++/Rust still cannot do that today). And the fast compilers, TurboPascal, TurboModula, and TurboC that made Borland famous and wealthy are in some sense also unrivalled: on machines 1000x slower than what I have now in my desk, you felt like you had the fastest PC money can buy.

lukaslalinsky 6 hours ago

When I was teen moving into adulthood, I couldn't understand why Pascal is being abandoned and people are moving into C and C++. I often think how would the software world look like if that did not happen. It's such a shame that we lost such a simple, yet productive language, in the commercial settings. And now we have Rust as the next winning choice, language even more complex than C++.

  • cjfd 5 hours ago

    Don't forget that, at least in the pascal that was used in my university programming course, all data structures have a fixed size. If you want variable size, you need to allocate them on the heap and free them manually, so it is not clear that this is going to be that much easier than C or C++ in practice. Actually attending the lecture about this I was a bit shocked that it was necessary to free memory manually and I thought to myself 'isn't this going to lead to a lot of trouble'. Turns out my 19-year-old self was right about that.

  • p0w3n3d 5 hours ago

    Why would you say that Pascal was (is?) a simple and productive? I wrote some software in Turbo Pascal and Delphi at that time, and was usually envying the C++ freedom. All the headers had to be translated to Pascal first. Pointer arithmetic was kludgy. I really wonder how could I do more complicated things, like large byte buffer with variant structures, parsing in Pascal.

    • willvarfar 5 hours ago

      Whereas if K&R had adopted Pascal (and tweaked the language to support whatever limitations they ran into when making the OS) instead of inventing C to make Unix, your experience would have been flipped; should C++ have come along, it would be the one with the header translation costs etc?

      Wirth went on to create Modula2 and Oberon and make operating systems in them. It is fun to imagine a world where that was the way chosen forward instead of C to C++.

      • p0w3n3d 2 hours ago

        I believe C is closer to what happens in the computer, than the Pascal is. I am not advocating for C as I dreadfully fear of this language (though I have experience in it, it always fills me with respect when I'm getting to close). What I'm saying is that for example, LPS String implementation in Pascal is Pascal-specific, not ubiquitous in systems, and handling PChar in Pascal gives a headache. Simple task: call a Windows function with your own string from Pascal. (Maybe my experience is too old and I don't know that this has been solved already, but back when I tried it, it was a nightmare)

    • t43562 4 hours ago

      Headers are the huge achilles heel of the C-based languages. Pascals modules were MUCH better. Pascal always built code faster in my experience, because it wasn't parsing megabytes of headers just to compile a hello world program. This also probably makes a pascal compile much simpler to implement as it's not 2 languages layered together.

      Macros in C are an utter disaster imo. If you want to get an AST for any piece of code you have to know what's defined so you must know exactly what the build system is going to do to the code i.e. the code isn't self-contained. If you use one build system to build for production and another in your IDE for development then you might get totally different results.

      C,C++ have a lot of ways to do one thing and Pascal tends to have one. The more you have to work on other people's code the more attractive Pascals' "one way" seems.

      • p0w3n3d 2 hours ago

        what I mean is that once you want to access some API, the standard is C, so the headers you will get are in C. For example: windows.h. To do anything, either you have translated windows.pas, or you need to manually rewrite the function definitions. Another example: if you would like to access HongKong Exchange, you will receive a .so object and omni_api.h file, which is damn hard to understand, easier to use.

        That's why I said about freedom.

        • t43562 2 hours ago

          Pascal had a different calling convention so you can "just" write all your libraries in pascal.

          As you say, calling out to other libraries would need a translation but ..... it's the same for python or many other languages. It would be a bump in the road but not a disaster.

        • lukaslalinsky 2 hours ago

          That was the point of my wondering, what if the standard was not C, but some modern Pascal. What if the APIs didn't involve any C headers.

    • lukaslalinsky 5 hours ago

      I mostly meant the DOS era, when you accessed hardware directly, there were pretty much no libraries. Further on, if people did not start using C++, Pascal would have to evolve to allow writing the things that were previously done in assembly, and libraries would be done in that language as well. That did not happpen, so C++ won and writing Pascal code was even more complex because you had to brindge the C APIs.

      • ikari_pl 4 hours ago

        What things that were previously done in assembly do you mean?

        I remember Delphi nicely allowed including C++ files and assembly in the project too, so there's that. It is a very wordy language, but apart from the need to separate declarations and implementation, was pretty nice to use, and powerful.

larodi 4 hours ago

If I understand right you were living in Mexico at that time and not going too fancy shmancy school for rich kids?

If so - doubles the magnitude of this achievement.

  • anonzzzies 4 hours ago

    In those days, unless you were very privileged, you had to learn things from a maybe 1 book, maybe a magazine (some matrix printed stapled pages in my province) and, in my case, without having a computer for the first year of learning basic & assembly. I just had a 2nd hand book + those magazines and some old folk telling me I should learn it. When we did get a computer (borrowed), I knew listings by heart which I typed in, changed and explored. It was somehow nicer than instant gratification we have now. I worked out assembly listings in HEX (I did not know what an assembler was or that it existed) on paper in class (school was of course boring af) and typed it in when the borrowed computer was back. Very nice times.

lukeh 5 hours ago

INMOS (morally) lives on as XMOS, with its funky dialect of C (XC), which incidentally I quite enjoy.

  • kitd 4 hours ago

    Moreover, David May at INMOS also created OCCAM for the transputer. Rob Pike credits OCCAM's channels as being the inspiration for those in Golang.

marstall 5 hours ago

what a beautiful story. thanks for sharing, OP. shades of my own youth peeking into 6502land on my AppleIIe in the early 80s.

Also thanks for the Transputer deep dive, TIL!

Love the source code you posted on Github with its Spanish comments.

begueradj 6 hours ago

That was the era where we had to buy compilers to run C, Pascal ... code. That's why even SQL had (and maybe still has) its own C compiler.

agumonkey 4 hours ago

Being exposed to the dragon book at that age. Interesting.

andrewstuart 8 hours ago

The Byte Book of Pascal I think led to the creation of a lot of Pascal implementations.

  • pjbk 7 hours ago

    And us poor C folks had to be grateful for Ron Cain's small C compiler that was published in Dr Dobbs, along all its derivatives.