
Things That Turbo Pascal Is Smaller Than (2011) - Tomte
https://prog21.dadgum.com/116.html
======
geophile
Turbo Pascal was an IDE and a blazingly fast compiler. In 1986, I ran it on my
64k IBM PC (8088 4MHz). It was like nothing else I had experienced previously.
Prior to that, I had developed software in grad school on punch cards. I
occasionally had access to a PDP-11. I don't remember what editor I used, but
it certainly wasn't an IDE. It may have been line-oriented. At work, we had a
VMS system, and I had access to a C compiler and my first emacs. Not too bad,
but nothing as immediate and responsive as Turbo Pascal.

Viewed another way, Turbo Pascal recaptured the incredibly rapid edit/run
cycle that I first experienced with a PDP-8M running BASIC. Only now, I had
64k instead of my shared of 12k shared among a maximum of four users, an IDE
instead of a line editor, and a far better language.

Turbo Pascal also blew away anything else available on the PC. I had a C
compiler from Microsoft that was far more expensive and far slower.

Turbo Pascal was a truly magical piece of software. I remember that I had some
initial skepticism about it. As I recall, it took some liberties with the
language. But once I finally used it, I was instantly converted.

IMHO, nothing has quite captured that experience of development until
IntelliJ, starting with 4.x or 5.x.

~~~
petilon
> _Turbo Pascal was an IDE_

Pretty sure it was the world's _first_ IDE, not just _an_ IDE. In a single
.exe file it had a WordStar compatible text editor, compiler, linker and
libraries.

~~~
badsectoracula
AFAIK the first "IDE" was the one in the original BASIC, or at least the first
one to called that. It was command-line based (no fancy GUIs back then) but it
allowed editing, debugging and compiling (despite BASIC dialects being
commonly interpreted, the original BASIC was a compiler) from the same
environment.

~~~
dhosek
I remember wondering how on earth you could write Pascal programs without line
numbers since that was the difference between running a command and
entering/editing a program in the Apple ][ environment. I don't remember if
Apple Pascal had what would qualify as an IDE now, although it had its own OS
which made it less attractive to me.

~~~
zozbot234
> I remember wondering how on earth you could write Pascal programs without
> line numbers

You use a program called EDLIN that writes the line numbers for you, and even
renumbers your lines automatically whenever you have to insert something in
the middle of your program. It's really neat!

~~~
pjmlp
I did my first text processing exam using edlin, "It's really neat!" isn't
something I would use to describe it.

------
wuwuno
Wrote a program to manage the sale and rental of video tapes for an small
business. I wrote it in 1984, using Turbo Pascal. The last time I checked the
store was still running the same software in 2005.

The application was table driven, all important configuration items were
stored in a text file as a key-value pair. It had a bar-code scanner and was
tied into a cash drawer. Receipts were printed on small dot matrix printer.

It took about 4 weeks to write.

The best programming environment ever.

~~~
roel_v
Didn't the software need to distinguish between vhs and dvd by the mid 90's?

~~~
watertom
It did. Like I said everything was table driven, with key value pairs. The
owner opened up the text file, and added a new rental type, DVD. They also
started renting VHS players, and DVD players, just added as new categories.

If the sales tax ever changed, the owner could easily make that change as
well. It had a built in rewards program, specials, sales, all editable in the
text file.

Once the software was delivered I never touched it again.

~~~
coolgeek
You just doxxed your throwaway acccount.

There was no contact in either profile, so my choice was to post as a comment,
or leave you unknowingly exposed

------
esnible3
Turbo Pascal is 3.7x smaller than the Wikipedia page describing it.
Wikipedia's prose description of Turbo Pascal is 148k.

~~~
eyelidlessness
I'm curious how large the actual components delivering that page are. I
suspect they're significantly larger. HTML output (in this case) is a product
of a program, not the program itself.

------
0xcde4c3db
> And the whole thing was lightning fast, orders of magnitude faster at
> building projects than Microsoft's compilers.

This particular comparison is interesting when you consider that the primary
author of Turbo Pascal, Anders Hejlsberg, has been at Microsoft working on C#
and TypeScript for quite a while.

~~~
kragen
Philippe Kahn is not Anders Hejlsberg!

~~~
0xcde4c3db
I suppose we could call Kahn the primary author of Turbo Pascal v1 if we
exclude the actual compiler from the definition of "Turbo Pascal", but I'm not
sure why we'd do that, especially in the context of this article. He
definitely deserves credit for establishing the product category of "credible
off-the-shelf IDE for commodity microcomputers", though.

~~~
kragen
I didn't realize Anders Hejlsberg wrote the compiler in the original Turbo
Pascal! Thank you for the correction.

------
userbinator
It's even more interesting when you consider that it ran under MS-DOS, which
had no dynamic linking --- it's a statically linked binary.

 _The touch command under OS X Lion (44,016 bytes)._

...and I bet that one is dynamically linked.

I believe the reason why it's so fast is because it has no optimiser, and
generates code as it parses. Pascal is also one of the easier languages to
compile.

~~~
ken
Here is touch.c [1] from macOS. The only change since Lion is the addition of
the __used attribute on a couple of consts at the beginning. It's very similar
to the FreeBSD one, though they've diverged slightly in the past 2 decades.

It supports 8 different flags (plus an undocumented -? flag), with support for
using absolute or relative times, setting various timestamps on a file, and
options for dealing with symlinks and permissions and such. More features than
I'll ever need, but not outrageously so.

On Mojave, this file is only 23392 bytes, so it's no longer bigger than Turbo
Pascal. Plus, automatic filesystem compression shrinks this down to only 7340
bytes on disk. Since blocks are 4096 bytes, this is actually the second-
smallest (non-empty) file!

[1]:
[https://opensource.apple.com/source/file_cmds/file_cmds-287....](https://opensource.apple.com/source/file_cmds/file_cmds-287.40.2/touch/touch.c.auto.html)

~~~
ksherlock
'?' isn't an undocumented flag; that's the getopt() return value to indicate a
bad option or a missing argument.

------
DeathArrow
Since many of the problems we have today to solve were solved in the '80s and
'90s with tiny tools such as Turbo Pascal, we can conclude that faster
hardware and lots of memory are allowing us to bloat the software by using
layers upon layers of abstraction, SOLID and DDD principles, virtualizations
inside virtualizations inside virtualizations, emulators running on emulators,
totally inefficient interpreters.

Using Python with its Global Interpreter Lock seems like a total antipattern
when it comes to use resources wisely.

~~~
gmueckl
Well, some things are enabled by more involved software architectures that
would not have been realistically achievable back then. Turbo Pascal was
limited to only showing the first error it encountered when compiling your
program. It did move the cursor to the location of the suspected error. It
wouldn't have been able to generate error markers in th e background while you
type. Autocompletion would not have been realistically achievable either.

That doesn't mean that lots of programs aren't bloated by overly complicated
internal designs. Sometimes this is a concession to the development team
structure. Sometimes this is incompetence. It is hard for me to tell from the
outside.

~~~
badsectoracula
TBH in practice i never found showing more than one error useful since way
more often than not these errors are either related or the first error also
causes the other errors. I only find it useful when the compilation process is
very slow, but i try to avoid slow compilers whenever possible and always just
recompile whenever i fix the first error. Most IDEs move your cursor to the
error position so the build key also acts as a "move to next error" key :-P.

~~~
gmueckl
It depends on the language you are using. Sometimes it can be useful to see
more than the first error message to understand the problem.

I find all the squiggly lines and annotations that Resharper adds to the code
quite helpful. These are a kind of low key way of indicating minor issues with
the code. I find that appropriate for things like coding style violations
because they often aren't an immediate concern because I want to get things
working first. But they are a good reminder of the open cleanup work once that
is done.

~~~
badsectoracula
I think it depends on more than just the language... i find the squiggly lines
very distracting and brings me a bit of anxiety, like someone being over my
shoulder looking at my code and going "hey, you forgot a semicolon over there"
and i'm like "YES I KNOW, i just noticed something else that i want to edit a
few lines above, i'll fix it, leave me alone" :-P.

~~~
gmueckl
I don't have any problems with that at all. I confess that I have a kind of a
disconnect with people like you who seem to be easily distracted by this. I
don't understand it. I am not thinking that you are wrong or anything like
that - it's on me. This is mostly my confusion talking right now.

Sometimes I wonder whether this is somehow related to a quest for
clean/simplified (or, as some might say, dumbed down) user experiences in
other situations. Also, is this in general more of a thing in America compared
to the rest of the world?

------
bdcravens
Turbo Pascal is a language I've never used professionally but always has a
special place in my heart. I grew up poor without any kind of a computer but
always considered computers "fun". As a high school senior (1995) I took what
I thought was just another computer class; they were teaching Turbo Pascal,
and I immediately knew I discovered my life's passion.

~~~
pkaye
Same for me. I learned most of my programming in high school in our computing
classes using Turbo Pascal. I would finish the classwork in a manner of
minutes and spend the rest of the time writing games and other software. Our
teacher didn't mind us playing games as long as we wrote it ourselves.

------
greenyoda
I've never used Turbo Pascal, but I've used UCSD Pascal, which was also pretty
small. In a college computer graphics course in around 1980, we ran UCSD
Pascal on Terak 8510/a machines, which had a total of 28K 16-bit words (56K
bytes) of RAM.

The Terak was an interesting machine:

> _The Terak 8510 /a of 1976 or 1977 was among the first desktop personal
> computers with a bitmap graphics display. It was a desktop workstation with
> an LSI-11 compatible processor, a graphical framebuffer, and a text mode
> with downloadable fonts. Despite the lack of a MMU, it was capable of
> running a stripped version of UNIX version 6. It was the first personal
> machine on which the UCSD p-System was widely used.[1] Various universities
> in the USA used it in the late 1970s and early 1980s to teach Pascal
> programming. It provided immediate graphic feedback from simple programs
> encouraging students to learn._[1]

Also, in those days, we were running Version 7 Unix on a PDP 11/45, which
supported several concurrent users in what would now be an unimaginably tiny
256K of RAM.

[1]
[https://en.wikipedia.org/wiki/Terak_8510/a](https://en.wikipedia.org/wiki/Terak_8510/a)

------
fortran77
While today's code does a lot more, and has to deal with everything from
internationalization to accessibility, I have to believe that we (I was around
programming in those days!) were better at computer programming back when
computers had memory measured in kilobytes than we are today.

I still take on jobs to do embedded programming in assembly language on PIC or
similar processors and my clients are usually amazed at what can be done in
tiny amounts of code.

~~~
dylan604
Severe limits/restrictions can influence some amazing solutions. To me, this
separates the real programmers from the people that just get paid to bang out
code. We went to the moon and back on this kind of severe limitations, yet
today, we can't make a website without a library requiring 100s to 1000s of
dependencies resulting in a total download larger than the amount of data
required by the entire moon missions. That's just for one page of useless
internet. I just shake my head at the silliness.

~~~
throwanem
Real programmers don't use Pascal.
[https://web.mit.edu/humor/Computers/real.programmers](https://web.mit.edu/humor/Computers/real.programmers)

------
counterplex
My Turbo Pascal story is weirder than most I think. When I was much younger,
someone I knew was learning COBOL and the "editor" they were told to use was a
pirated binary on a floppy. That binary was called tp3 and nobody paid any
attention to it until I, wanting to also learn a bit about COBOL, decided to
try it out myself and read the notice that the program output. Something about
Pascal.

Long story short, I ended up looking into Pascal and using that tp3 "editor"
to learn a bit of Pascal, which seemed a lot more fun than COBOL.

~~~
tomcam
You definitely win the prize for weirdest story. That was random and very
cool.

------
codr7
I had so much fun with Turbo Pascal in the early 90's, I used it to create
everything from GUI frameworks to ANSI bulletin board systems and keyloggers.
Definitely the most creative environment I've come across.

Then came C++, and I wasted A LOT of time trying to wrap my head around it
while creating nothing of value before giving it up entirely.

My Pascal experience also landed me my first job after university, which was
to help write/maintain a system developed in Delphi.

~~~
lioeters
I discovered Turbo Pascal in my preteens, after BASIC. Spent a few years with
it and got pretty fluent. Interestingly enough, I remember also working on a
bulletin board system, called something like WWIV. Now that I think about it,
that was a seed planted for my current occupation.

Learned C after that, but drifted away from programming (for a decade or so)
around when C++ came out. I came back around to computers when I wanted to
build myself a static website - and I'm still in the wondrous rabbit hole.

These days, much of my time is spent reading and writing TypeScript. How
strange after all these years, I'm again speaking a language created by Anders
Hejlsberg. It's a joy to work with VS Code editor as an integrated development
environment, and I fondly remember my time with Turbo Pascal.

------
wolfspider
Turbo Pascal was what the cool kids coded in. Although that sounds like an
offhand statement the kids I knew that started out learning it went on to work
at Id Software later on. A little before my time and I was jealous because
QBasic was where I was at back then. Seeing that though gave me the courage to
jump into Borland C++ not long after. It certainly made me realize there was a
world beyond BASIC.

------
fortyrod
I was one of the 12 people who wrote a lot of Apple Pascal in the early 80s.
One a day I got a call from a tech writer who was reviewing Turbo Pascal for
Byte or some other programming mag. He had heard through the grapevine that I
did Pascal and brought over an Osborne luggable and a copy of Turbo pascal for
CPM. I fell in love instantly. Although I was a die-hard Apple guy at the
time, the PC version of TP eventually turned me into a PC programmer
overnight.

One other thing, it was so cheap and fast that people started using it as
their text editor of choice. It would be interesting to know how many copies
of TP were sold that never compiled a line of code.

------
tomaszs
I have written a 3D engine in Turbo Pascal. There was a castle you was able to
walk through. It was fascinating because all calculation has to be done
manually including figuring all the math to figure out where to plot a 3D
point on a screen. Great times. Later i have moved to Visual Basic and OpenGL.
Nice memories from primary school

~~~
smitty1e
Ah, Visceral BaySuck. I've been in places where all one had was MSOffice, and
that VBA IDE was it.

I keep a private github repo called NVBC (NecroVisualBasiCon) with snippets of
the all the madness that was trying to trick VBA into being a useful tool. The
IDE was good, but the language itself was surgically precise in delivering 83%
of what one wanted for a given task.

~~~
tomaszs
It was caused mostly by the way MSOffice access was delivered to VBA at that
time. And maybe also by VBA itself. Cannot remember. Anywho. VB standalone was
pretty decent. Nice you have the library. Its part of the history

------
hcarvalhoalves
I learned TP during college and thought programming professionally would be
simple like that... Ignorance is bliss right?

~~~
knodi123
I remember when we hired an intern straight out of college, and he had to do a
task where one of the steps involved sorting a long list. He got so excited,
and spent half a day implementing quicksort. He got so sad during code review
when I showed him there was already a built in Array.sort method that was
faster than his.

------
throwaway_pdp09
The BBC computers had a pascal compiler that was about 5K if I remember. It
lacked quite a lot though, like records I think, enumerations & more, but had
nestable procs/funcs so wasn't too far off the language in other ways. Never
used it BTW.

One thing I liked about pascal but missed in every language since is the
ability to have arrays start from arbitrary values. It can be fudged in C/C++
pretty easily but still, be nice to have it built into languages like
java/scala/so many more.

~~~
badsectoracula
Another nice feature is sets and ranges, so you can have something like

    
    
        type Day = (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday);
             Days = set of Day;
        const Weekdays = [Monday..Friday];
        ...
           if Today in Weekdays then ...
        ...
    

Sets are essentially bit flags but they look much better than a series of
#define MONDAY 0x0001 #define TUESDAY 0x0002 etc. IMO, of course :-P.

------
bluemooner
Going beyond Turbo Pascal, the author is amazing! I've just discovered this
blog and I'm amazed by how simple and relevant every article is.

Here are some of my favourites:

[1] [https://prog21.dadgum.com/128.html](https://prog21.dadgum.com/128.html)

[2] [https://prog21.dadgum.com/149.html](https://prog21.dadgum.com/149.html)

------
zengargoyle
Oh wow, I think I learned Pascal via Turbo Pascal. When I was 14 in 1984 I
went to a Computer Camp at Virginia Tech and we used Pascal in this monolithic
IDE sort of thing. Maybe it was actually UCSD Pascal.... We made a simple 16
room 4x4 dungeon with keys and doors. Each group writing the code for one room
and them tying them all together. It came out not bad for a bunch of kids.

When I got my Amiga a year later I was happy that there was a Pascal compiler,
then saddened that it only had stdio sort of interface. No way to open windows
and draw things or the like. Luckily I found a FORTH that not only had a 68k
assembler but also all of the constants and things you needed to write
graphics and the bonus of making that single executable file.

Sorta sad I never really got to use Pascal after that. By university time it
was all Assembly, FORTRAN and C for the CS classes.

~~~
knodi123
> I think I learned Pascal via Turbo Pascal. When I was 14 in 1984

Ha, I learned it via TP when I was 14 in 1994! So many dumb hijinks in that
class. If there was somebody you didn't like, one thing you could do was space
out past the end of line 1 of the program and just write END; in the 100th
column or so. That made everything else in the file just a comment. There was
no word wrap, so unless they knew how to page right, there was no way they'd
ever figure it out!

I also wrote a 2-player pong game, but I knew the keyboard handler could only
handle 3 keys at a time, so if you wanted to temporarily disable the other
player at a key moment, you could just hold down three keys and shut him out.

Ah, good times.

------
pkaye
I'd like to see a performance comparison between Turbo Pascal and TCC (tinycc)
which is about 100k is size.

------
DeathArrow
I toyed with Basic on Z80 as a kid but I have fond memories of Turbo Pascal.

When I was 14 and I first got access to a PC at school, Turbo Pascal was the
first proper programming language I got access to. It got a compiler, strong
typing, an IDE and a help page. Help page was invaluable since we didn't have
Internet access nor did I owned Pascal books.

Pascal made me think anything is possible, from games to line of business
apps. It provided low level access and I toyed with rebooting the PC and
entering BIOS and bypassing BIOS password by writing to some hardware
register.

My journey with Pascal didn't last much, as I discovered C and C++ which
seemed even more amazing and flexible.

------
AceJohnny2
Counterpoint: what are some things that Turbo Pascal lacked that we take for
granted in a modern language environment?

~~~
mhd
What version of TP? The linked articles is about TP3, which lacks common prog
lang features that later versions definitely had (like proper modules or
objects).

If you take a look at later versions or even early Delphi, I'd say garbage
collection. Other languages from the Wirthian family had it, like Modula-2/3
or Oberon.

Lambdas/first class functions.

Unicode support.

Syntactic sugar up the wazoo.

Other than that, I think one could be very productive in a TP 5.5-ish language
even today. The rest would be mostly about the infrastructure and community,
like IDEs, package management and Medium posts with lots of memes.

~~~
FpUser
Modern pascal implemented in Delphi / Lazarus IDEs has basically all essential
features modern language can expect. It does not have garbage collector but I
personally consider it an advantage. What it does instead is heaptrace. When
it is on for debugging - upon shutdown of the program it will point you exact
place/s in source code where you leaked memory should such leak ever occur.
Madexcept product does the same thing and more for Delphi

~~~
pjmlp
The latest version drops ARC, which pissed me, but I guess it is better to
have a sound history, instead of a schizophrenic one depending on the target
platform.

~~~
FpUser
Having memory management based on deployment platform I think is one of the
most insane things Delphi's vendor had committed. Luckily they're backtracking
on that. Anyways the decisions like that combined with maturing open source
alternative Lazarus/FreePascal had led me to use Delphi only for maintenance.
All new GUI projects are going to Lazarus/FreePascal combo.

------
ca98am79
Turbo Pascal was pivotal for me growing up. I often think back on the complete
joy of creating, when I was first learning to program as a kid. I have been
trying to arrange my life in a way so that I can get back to that feeling. You
can see some stuff I did long ago here: [https://github.com/ca98am79/my-first-
programs](https://github.com/ca98am79/my-first-programs)

------
wglb
Written by Anders Hejlsberg
[https://en.m.wikipedia.org/wiki/Anders_Hejlsberg](https://en.m.wikipedia.org/wiki/Anders_Hejlsberg),
who is also lead architect of C#. I was writing a pascal compiler at the same
time and was rather blown away by what Turbo Pascal was able to do.

------
downerending
In the 80s, had an internship at a government outfit with very high security.
This was before the days when PC security was really understood. I could
easily have run off with all sorts of very secret stuff. What I _did_ run off
with was a copy of Turbo Pascal.

------
mikewarot
I wrote an application that we sold to clients in TP. I implemented a set of
libraries to do forms based editing, a cooperative form of multi-tasking, and
the ability to pipe text between those tasks. It was a lot of fun, and a bit
mind bending to have a function return from the spawn call twice. 8)

------
icedchai
I used Turbo Pascal back in high school (1992-93, AP computer science.) By
that point, I already knew C and it felt like a step backwards in some
respects. Still, the IDE was impressive and it was a lot of fun!

~~~
Roboprog
I learned Pascal before learning C in college back in the 80s. For me, C felt
like a step backwards towards assembly language.

Things missing in C: Bounds checking; Non-null references; Subranges; Sets;
Nested functions?

------
malkia
And TurboVision - that was years ahead of everything else...

~~~
pjmlp
Turbo Vision was my introduction to OOP after learning it with Turbo Pascal
5.5 and getting old of a 6.0 copy.

Learning C after that experience was probably similar to how Bjarne felt being
forced to leave Simula for BCPL.

------
Shorel
I made a Tetris clone in Turbo Pascal back in the day.

It ran in an amber monochrome screen.

When I got a newer, faster computer, the colors were a bit under designed, and
it ran too fast. =)

Good times.

------
jasonv
I remember coding in Turbo Pascal to hack on PCBoard and its fork, WWIV, which
were BBS programs.

------
yread
I think the only relevant comparisons are the other binaries. Why is the touch
so large?

------
sbussard
node_modules

