Turbo Pascal Compiler (2013)
teamten.com
teamten.com
Early 8 & 16-bit architecture BASICs and Pascals worked on by several people all strived for p-code compatibility [0][1] and this guy wrote this by himself. I thought that was most remarkable when I found this a couple years ago.
Turbo Pascal (the original) was amazing, I used it for many years - both Z80 and PC.
[0] https://en.wikipedia.org/wiki/Turbo_Pascal#CP.2FM_and_DOS_ve...
Later on, I wrote a front end menu system (which simply gave a customisable easy to select option of applications to run in DOS) that ended up being used on thousands of PC's throughout businesses and almost every government department in my town.
Good Days. I downloaded the original Turbo Pascal v 1.x a couple of years back, and intended to try re-writing that point of sale system again to see how much I still remembered > 30 years later. Never got around to it, but I will make a concerted effort this year to try it out. I may just try it on this web emulator, seeing as I am now on a Mac!
Thank you Anders Heljsberg! And to these guys for building a web emulator of the original compiler.
I also wrote a ton of stuff for fun in Turbo Pascal, but I doubt I still have any of that code.
Embarcadero is the company that now owns all of Borland's IP (I believe), and they have released the older version of TP 1.x, 3.x and 5.x in their 'museum'.
For $50. I was 15. Knew nothing of business. Good 'ol days :)
(Not so) Interesting side story: The menu system I talk about in my post above - I actually wrote a full screen editor for it, because I was sick of using EDLIN to edit batch files etc. all the time. My editor was I believe one of the first ones I had seen which let you use cursor keys to move around the screen, and it let you edit a mammoth 255 lines of DOS batch code(!) :)
But it had ONE crucial bug that I never fixed - if you edited a line, you had to cursor off it or press [Enter] at the end of the line for it to commit your changes from the change buffer to the in memory copy of the file, so if you saved the batch file without doing this, your last changes would not get saved.
To this day, more than 3 decades later. No matter what editor I am using (Sublime/Atom/VS Code etc.), that behaviour is ingrained in my psyche, and even if I make a single line change in my source code, I reflexively cursor OFF that line or press [Enter] before I hit 'save'...
In 1985 I wrote a simple programmers text editor in it (I really had no idea what I was doing - I learned as I went along), and released it as shareware.
Folks started sending me checks, and by 1988 I had to hire staff to help me process and ship orders, do tech support, and so on.
We peaked at 15 employees in the mid-90's. While I eventually converted everything to C, I still have very fond memories of Turbo Pascal. Those were the days!
I fired up Turbo Pascal in a DOS box on Windows 10 and got the code to compile. Sadly, I don't have the game any more and the 'Rockford' available online is actually a remake / emulation using a different game engine and the maps are in a different format.
Code here for anyone who wants to laugh at my skills as a non-programmer:
https://github.com/linker3000/Historic-code-PC-Pascal-and-AS...
PS: Does anyone here have a copy of the original Rockford game!!??
At one point, Stag came down and checked over the code with a view to making it their stock program but I think things became too complex when legal got in the loop.
Also, Shareware! Lol!
http://edn.embarcadero.com/museum/
IIRC someone has posted the complete source code online but I cant find it right now...
As https://news.ycombinator.com/item?id=10202563 said, it is not THE turbo pascal compiler.
Also there is http://www.freepascal.org/
Are you sure you don't mean NES/SNES style games?
Love that.
When I turned it on for the first time, it booted off of what must have been some kind of rom and dropped straight into UCSD Pascal. I was programming at home at the time via Basic & 6502 assembly, and when I saw the Pascal prompt, I was like, awesome! (I had a class at school using Turob Pascal)
I spent a lot of weekends in our cold garage (over the winter) hacking on that machine. I wish I would have saved some pictures. I made a star trek type game and (my fav at the time) a database ala dBase.
Good times..
(Mobile typo edits)
We had to write our own bindings for DirectDraw and DirectSound, since there were no C header files we could use directly. (This was before 3D acceleration, so no Direct3D, which wouldn't really have been feasible.) We were all Pascal programmers at the time, and didn't even consider using C or C++.
Turbo Pascal was really ideal for writing games in. Short develop-compile-debug cycle, great native performance, support for inline assembly (our image code had lots of this), and easy calling into C libs.
I was using Borland's Pascal tools as late as 1999-2000, the last iteration being Delphi 4.0. While I did plenty of GUI stuff, my biggest project was a non-GUI teleconferencing solution that consisted of a web application that orchestrated calls using several distributed backends (or microservices as we would call them today), with RPC using Microsoft DCOM; Delphi had very good COM support. As part of this app, I had to talk to several low-level telecomms boards by Dialogic, which of course only had C headers. I wrote an AST-based C-to-Pascal translator so I didn't have to do all the headers manually, and I was able to use it to translate things like Microsoft's MAPI headers, which were COM.
Still... It's amazing to think today that I was so fond of/productive in Pascal that I shoehorned everything into it, even those headless server apps, when obviously C or C++ would have provided much less friction.
The answer is of course that TP/BP/Delphi all provided an amazingly productive experience. These days I use Go a lot, which of course is heavily influenced by the Wirth family of languages. Go today feels a lot like Borland Pascal with garbage collection.
</nostalgia>
Got to agree on the productivity part. I did just part of one product in Turbo Pascal (just at the start of my career), which was a freelance project, interestingly, without any previous job experience, like some others here have said they did, but also a lot of personal / fun stuff with it, and also taught it for a while in a training institute. Most of my other product and project work was / is done in C, Java, Ruby, Python etc. But as I too have said here a few times before, never come across a more productive environment than TP and Delphi - though Python is close, for the language part alone (leaving aside libs, GUI, building, etc.).
function DirectDrawCreate(...): HRESULT; stdcall; external 'ddraw.dll';It was a hand-coded C parser with support for a minimal subset of C++ concepts, needed to successfully translate COM interfaces. It had a bunch of kludges specifically to recognize COM. Handling macros was without doubt the most painful part of it, because I couldn't just run the .h file through a preprocessor; I had to also preserve the macros and try to convert them into declarations, so that "#define FOO 1" would result in "const FOO: Integer = 1;" or whatever. Not too bad with simple things, but sometimes people will abuse macros to declare functions...
htrans worked well enough that I could run it on a bunch of stuff and not need to edit the resulting .pas files at all. Unfortunately, I suspect I've lost the source code.
I'm not sure whether I have nostalgia for that time or Stockholm syndrome
How many languages can you identify for web development that match the following features:
- Fast
- Compiled
- Small, single file executables
- Low-memory consumption
- Readable syntax that isn't afraid of being a bit verbose
- A small language vocabulary you can actually learn rather than the labyrinthine language definitions of today
I always liked Niklaus Wirth's philosophy on programming language design. I wish more programming language designers would follow it.
You should have a read of "In Search of Stupidity"[0] and revel in the eye-watering commercial mistakes and foot shooting these companies indulged in during the late 80's to mid 90's.
From the mid 80's until around 1995-96 I used many of the tools written about in that book - WordStar, dBase, Clipper, then one day they were gone, largely because of incompetence and entrenched complacency.
It makes me sad to think of what FoxPro could have become. Microsoft didn't just kill the product, they pretty much killed the category.
In fact ever since I call it the lovechild (or offspring anyway) between C and Pascal, but one's that ready to party like it's the 2010s (with regards to networking, parallelism, graphics etc)
Certainly it meets your bullet points, indeed I was looking for the same back when I got into it
Well, you said that, he didn't. Just something some are looking for.
> It sounds like it could be an unnecessary proxy for what you actually value.
"Could", huh? Or it "could" be a "necessary proxy".. or it "could" be no proxy at all! I like having a tool that translates source code into machine instructions. Silly ole me huh? How on earth did I ever come up with such an unfounded preference?! Now you tell me what in the heck that could possibly be a proxy for, because I have no idea myself.. sometimes a cigar is just a cigar.
Given how Facebook eventually wrote a PHP-to-C compiler, how many Python code-bases end up trying to go CPython or some such, how much JS is transpiled from other languages.. the notion of "liking compilers" isn't entirely exotic
Er, what?
> "Could", huh? Or it "could" be a "necessary proxy".. or it "could" be no proxy at all! I like having a tool that translates source code into machine instructions. Silly ole me huh? How on earth did I ever come up with such an unfounded preference?! Now you tell me what in the heck that could possibly be a proxy for, because I have no idea myself.. sometimes a cigar is just a cigar.
I have no idea what you're saying here, or if you're even saying anything at all (it doesn't sound like it), but it doesn't seem like you understood what I said, either.
> Given how Facebook eventually wrote a PHP-to-C compiler, how many Python code-bases end up trying to go CPython or some such, how much JS is transpiled from other languages.. the notion of "liking compilers" isn't entirely exotic
To be clear: no one has pursued those things just because people "like compilers". People created those compilers because they like the side effects they bring. They're producing desirable results—things like better performance at runtime, better memory use, et cetera. So I return to my original point: if those things are desirable, then mention those things. That something is compiled is not an attractive pursuit in and of itself, to anybody. After all, you could write a terrible compiler that takes forever to build and generates slow code for an obscure machine that nobody is interested in owning. The mere fact that it compiles does not add anything in its favor, and the same is true for the "good" compilers. "Compiled" is a null proposition.
Secondly, please maintain an overall better sense of decorum. The way you responded above is not how we have discussions here.
My original, admittedly obscured "point" --- why? All these are obvious to anyone here and we store them under the compressed moniker/variable name "compiler" so every HN reader automagically decompresses this moniker upon encounter into the entire range of benefits. People talking about programming languages naturally see no obstacle in this, in fact usage of umbrella terms (esp. when the usual motivation for usage is "whatever benefits are implied by term X, I want them all anyway") makes for more fluid and rapid conversation in all manner of fields.
He could have said "I want better performance at runtime, better memory use". How insanely generic, every programmer wants this from any language. Then some clever guy comes and asks "better than?", OP answers "than interpreted languages", then flamewar ensues. Not productive either.
Ah well. A curious discussion for sure. =)
I spent the summer saving up for my own 286 machine just so I could use it.
Dabbled in Modula-2 (stonybrook) and Turbo C. However I never really got into Delphi as I wasn't that interested in OOP or Windows. Worse Borland did their best to break my interest with the near constant upgrades that required buying the product all over again and worse in bundles that exaggerated the price.
Turbo Pascal or similar would be a cool way to write web pages if it could be extended that way without getting silly complex
I'd be content if the major browsers could move wasm out of Preview (or worse) Status for starters.. ;)
"Things That Turbo Pascal is Smaller Than"
That didn't however stop Pascal from starting my career though as I started programming for real a few years later with Delphi 2 which was running a slightly improved version of Pascal with object oriented additions.
How I loved that programming environment: As quick and easy to use as VB, but able to produce real native binaries that run without any (external) runtime environment.
Plus you got all the windows SDK C headers pre-translated to Pascal so the whole windows API was ready at your fingertips (what could possibly go wrong when a self-thought teenager gets to write native code with complete unprotected access to memory and threading?).
Delphi is what I've used for my first commercial project too and Delphi is what I still use these days when I have to do some very, very rare Windows work).
The language is phantastic. Even after years of not looking at my code, it is very readable to me and I get back into productive mode very quickly.
Of course this might all just be nostalgia talking.
I agree that Delphi is quite nice. I use both Delphi and (much more) C++Builder for work, but I wish more of it was Delphi.
so the 5 were running 11 month ago !
I don't know what you were hoping for? Someone maintaining a Turbo Pascal compiler on their free time for no obvious purpose?
Language in itself is very clean, and the way how static it is and how precise you need to be with declaring of variables is great for preparing you for C down the road. Then again you can do many things with it.
I remember writing my first serious apps in Pascal, (few hundreds LOC), it was basically CRUD app, but it talked to .txt and .bin files. I learned a lot about memory management, and it made me implement and really understand deeply many concepts like linked lists, sorting algorithms and work with strings (writing small parsers). I am very grateful for Pascal, and I think it changed me forever, in a way where I got in love with it and I got hang of lower level programming pretty early. After that when I went to C, I had to learn a lot but it felt so natural. It's funny that I find myself struggling with Python and JS (with JS I got better, Lisp and functional programming came in handy there), cause I just can't get used to the language giving you pretty much everything just by calling one simple method/function. Numbers of times I found myself writing function for something trivial that already exists in language by itself. Anyway, it felt great to think about old times and Pascal. I think it is very underrated as a learning language.
The affordability of all the Turbo branded language products (and the excellent printed documentation that came with them) that were made available to me as child by my parents are on the primary reasons I have such a love for technology and why I am in software development today.
It's really a shame that modern programming platforms don't capture some of that same ease of use for experimentation. :(
Maybe the author was in a similar situation, whether conscious or not.
This is Hacker News after all :)
While I don't really use TP much anymore albeit the occasional pet project using FPC's cross build ability to produce DOS binaries, Pascal has a special place in my heart :)
I wish I could find a project that made me feel like that.
It was also my first compiler when I started doing Windows 3.1 development. TPW with OWL was quite ahead of how MFC ended up.
W to load file
R to run
It was also a vanity thing - from memory it showed you how long it took to compile, and I used to love seeing a several thousand line project compiling in < 1 second.