7 ms·
Things That Turbo Pascal is Smaller Than (2011)
- abc_lisper 14y agoThats pretty awesome! I have written my first program in Turbo Pascal :)
- runn1ng 14y agoMy first program was in QBasic, but I actually learned how to write code in turbo pascal. :) ...and delphi. and c#. and java. and perl. and scala. But well, you know what I mean. (and I learned how not to write code in C++ and PHP.)
- outside1234 14y agoAnd it had an editor too! Turbo Pascal was what I cut my teeth on and to this day I have fond memories of how productive I was in it.
- 4ad 14y agoPrevious discussion: http://news.ycombinator.com/item?id=3175629 http://news.ycombinator.com/item?id=3175629
- michael_miller 14y agoThe comparisons the article makes are not apples-to-apples. The authors start with a binary file, and compare it to uncompressed text files. For example, zlib.h on Mountain Lion is 80511 bytes, but only 22031 bytes when gzip compressed (around half the size of Turbo Pascal). The article's tone implies that these were the 'good old days' when compilers were small and fast. However, priorities have rightly changed. We now have computers that can execute billions of operations per second without breaking a sweat, I/O devices which can perform tens of thousands of IOPS, and laptop GPUs that can push 3D content to a 5.1 million pixel display. It's likely that Turbo Pascal was highly optimized to deal with the constraint's of that day's computers. A lot of developer man hours were almost certainly allocated to shaving off extra bytes from the executable. It's usually not worth devoting such man hours to tiny performance improvements, considering the beefy hardware most people have.
- klodolph 14y ago> The article's tone implies that these were the 'good old days' when compilers were small and fast. That's reading a lot into two short paragraphs. Tone doesn't come across well in text, and the shorter the text is, the harder it is to figure out tone. I don't hear nostalgia for the 'good old days' in the article, what I hear is, "Wow! What a feat of engineering to fit an IDE and compiler into 40k!" We get the same kick out of watching demo competitions. Have you seen the "Elevated" demo? Including the music, sound effects, textures, everything, it's only 4k... http://www.youtube.com/watch?v=_YWMGuh15nE http://www.youtube.com/watch?v=_YWMGuh15nE
- AurSaraf 14y agoKnowing the author's other writing (which is, by the way, very recommended), I would think he isn't trying to say "look how wrong we went, lets make things smaller again" but instead "look how fun that was, but come on, those days are over. Now that we have comparably infinite resources, lets focus on what can be made with them." tl;dr The Author would probably agree with you more than you think
- MarkSweep 14y agoThe one apple-to-apple comparision is the touch command. You would think that touch would not be that big: http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/touch.c http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/touch.c
- deleted 14y ago[deleted]
- jonsen 14y agoAnd it was learnable. I mean, you could learn every detail of the language with a reasonable effort. Just read through the manuals, which are extremely well written. Not many modern languages you can say that about.
- tomjen3 14y agoI very much disagree with this. Java is much more modern, but you can learn the entire language in some months of work. I will grant you that it will take longer to learn all the libraries you want to use, along with the entire Java standard library, effective design of Java programs, etc. But the languages haven't gotten much bigger over the years.
- tisme 14y agoI have a 2 foot tall stack of Java manuals here that beg to differ :) Java is big, the java ecosystem is huge. Sure, it does more than turbo pascal, but if you're able to go from 0 to learning the entire language in a few months of work then you're a pretty hard worker! Going from 0 to knowing turbo pascal (language, ecosystem, ide) inside out in a few months is no remarkable feat.
- bad_user 14y agoJava is big, the java ecosystem is huge. Sure it is. However you don't have to learn all of it. I never learned much about Swing, AWT, JSP, JSF, EJB, Struts, Spring, Hibernate and all that crap. I tried them out at some point, but eventually I had the common sense to just say no. You're basically comparing a language with the entire ecosystem of another. I remember trying to make MOD files play in Turbo Pascal, which left me with about 200k of memory for whatever else I wanted to do. I remember trying to read BMP files and because I had no available libraries, I had to implement the functionality by my own (and forget about GIFs or Jpegs). I remember trying to create a window with a button in Windows 3.11 and for some reason whatever I did was freezing my computer, so I had to reboot all over again, until finally giving up in agony. I know at least one man that gave up on programming when the transition to Windows happened, because Borland Pascal was so goddamn awful for anything not involving a text interface running in 286 real mode - that it left that man with the impression that programming was not for him. Yes, you can go from 0 to "knowing turbo pascal" in a short time. However that doesn't mean much, when in that same time you can accomplish so much more in a modern environment, even if you end up just scratching the surface.
- mgkimsal 14y ago"The entire Turbo Pascal 3.02 executable--the compiler and IDE--was 39,731 bytes." Many icons are bigger than that these days (and with Retina displays, will continue to grow).
- klodolph 14y agoOS X 10.0.4 was released in 2001 and had 128x128 pixel icons in 24-bit color with 8-bit alpha, at 66k each. It was not typical to compress them.
- EdgarVerona 14y agoI was a big fan of Turbo Pascal. It was a great learning language, and had a robust library that was really fun for beginners to tinker with! I'd almost call it the Python of its time.
- colomon 14y agoI was really impressed by this, until it occurred to me that the source code for the C64 Forth compiler I used back in the day was probably considerably smaller than 39K. :)
- tisme 14y ago39K worth of Forth is a very large program. Most forth code never grows beyond a couple of screens. That doesn't mean there isn't a lot of functionality, it just means that forth is unusually dense.
- nhebb 14y agoAnd it's still available for download: https://downloads.embarcadero.com/free/turbopascal https://downloads.embarcadero.com/free/turbopascal
- eckyptang 14y agoI was thrown at turbo Pascal at university. Horrible language to be honest as it was utterly painful to produce any reasonable data structures in it. The verbosity usually broke the memory constraints of the machine just before you finished what you were doing meaning hours of search and replace on identifiers to shorten them to clean up ram for the editor. Ick. It made me actually long to get back to a m68k based sun 3 with a c compiler which took literally 2 minutes to compile hello world if some asshat wasn't running emacs on the same box which was swapping to disk 100% of the time... However what they managed to cram in was impressive.
- marshray 14y agoAs I recall it, when TP came out on the it meant that you no longer had to choose between Basic and 16 bit segmented mode asm. Not many people had heard of C back then and Pascal was considered a very well-designed language. The PC C compilers of the time were somewhat lousy. Few people doing PC development had access to a proper *NIX machine.
- astrodust 14y agoYou had a choice between several types of C compiler: lousy, expensive, or lousy and expensive! When Linux came out I was kind of stunned you got gcc thrown in like it was no big deal.
- tluyben2 14y agoHmm, I don't have that experience; TP worked well for me and I created quite substantial commercial projects which made me a 'wealthy' student in university. Especially when they introduced overlays we were able to use all those kilobytes :) I have good experiences with it and I still have all the sources of the software I wrote then (a lot of it is still sold and a lot I ported to Delphi after that and is still sold). Do you have concrete examples of what you are referring to? I used structures, but never too complex as I came from assembler (Z80/68k) and didn't (and don't) really see the use of very complex structures. Reasonable worked fine.
- 14y ago
- tome 14y agoIt would be very nice if this was presented in an appropriate graphical format for easier comparison.
- greggman 14y agoI used Turbo Pascal and other environments even smaller environments (anyone remember Action! (editor + compiler in 16k and ran on a 48k machine, http://en.wikipedia.org/wiki/Action!_(programming_language) http://en.wikipedia.org/wiki/Action!_(programming_language)) That said: * the machine I ran Turbo Pascal on had a 115meg hard drive which was large compared to my co-workers 80meg drives. * Turbo Pascal could not edit or display Chinese, Japanese, Korean. * The editor could not search and replace across files with undo like my current editor. Nor do I think it could do a regex IIRC. * It could not tag 40k+ files and bring up help on any function in near realtime. * It could not refactor code. * The machine ran in 80x50 characters. No windows. I could not view both reference material and my code at the some time on the machine, I needed a book. If I didn't have the book I needed I had to either go to a library or find a tech bookstore. (I only new of 3 in all of both Northern and Southern Califorina). * The machine I ran it on had no networking. * I had to manually edit config.sys, autoexec.bat and move DIP switches when ever any new devices were added. There was no USB only serial and parallel. * When my program crashes I often had to reboot the machine. * There were no fonts, everything was text. * There were no images except a few icons in my apps. No way to easily display a company logo or screenshots in docs. * There were few if any libraries. If I needed to read an image or parse a file I had to write it from scratch. If I needed to draw some graphics I had to poke registers. If I wanted to play audio I had to do device specific stuff. I'm sure we could go on listing all the things those machines did not do nor did Turbo Pascal do compared to today's environments with their large libraries and access to all the stuff we've built up today. Sure I miss the time when I could basically own the entire machine but I'm happy that today I can just plug in a USB stick or a digital camera and they just work. That I can participate internationally in multiple languages. That 1-20meg images are trivial to manipulate and display. That mp3s, wavs, and other audio is ubiquitous, etc.... Those simple days were fun but a little reflection will show that today's supposed complexity has made it easy to take a lot of things for granted. In the Turbo pascal days. If you wanted to display a photo it would take hundreds or thousands of lines of code, especially if you wanted it to work for more that just your machine. Today it's step 1: copy file from camera, step 2 <img src="path/to/file.jpg" /> I'm not going back.
- podperson 14y agoA comparison to Lightspeed Pascal (which was not quite so small but well under 400kB) might be more instructive. (Or Mac Pascal -- an interpreted Pascal IDE available on the Mac even earlier.) It had a proper GUI, could (theoretically) have been localized by editing resources, had undo (one level) and find/replace, the Mac was networked from day one, and so on.
- marshray 14y agoGoogle's home page https://www.google.com/ https://www.google.com/ HTML+images is about 42k in my browser.
- kps 14y agoThe stock V6 UNIX kernel is 28,684 bytes, and /bin/sh is 5888.
- mixmastamyk 14y ago39k for the executable? or with libraries? They had some in those days, they were called "overlays" although that might have been in the 90's and dos protected mode, etc. I'm sure the help, etc were in separate files.
- waivej 14y agoThat's a great article! I learned to really program on Turbo Pascal, and if I remember correctly, the small executable made it easier to store programs on the "program disk". Though by the time I built my own computer, it had dual floppies so it wasn't as big of a deal.
- cottonseed 14y agoThere should be a followup, "Things That Turbo Pascal is Faster Than". Sure to be included are "loading the wikipedia C++ page" and "loading the photo of the iPhone 5 on apple.com".