I really wonder how Pascal and the Pascal family of languages, including modula/oberon and ada, how they became niche and how java and c++ took over the world?
Easy answer, UNIX mass adoption. Long answer, UNIX spread like fire, because Bell Labs/AT&T initially weren't allowed to sell it. So the code was given to university, and while they needed to pay for a UNIX license to use it, the price was symbolic versus paying for something like VMS. Which naturally made UNIX the number one choice for the startups trying to get into the Workstation market during the 90's. So C star…
Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
41–50 of 118 posts
Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#42I was blown away when Turbo Pascal 7 came with syntax highlighting.
I also spent days trying to fix infamous Runtime Error 200.
Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#43Earlier quoted context omitted.
Easy answer, UNIX mass adoption. Long answer, UNIX spread like fire, because Bell Labs/AT&T initially weren't allowed to sell it. So the code was given to university, and while they needed to pay for a UNIX license to use it, the price was symbolic versus paying for something like VMS. Which naturally made UNIX the number one choice for the startups trying to get into the Workstation market during the 90's. So C star…
Interesting that you would say that. I've taken the opposite approach to prefer languages that have multiple implementations, platform-independent specs, and a focus on portability, like C, JavaScript and very few others. Also Java/JVM, which at least fulfills this criterion on paper (and pays the bills). Guess it's a matter of whether you're working primarily on the server or client side.
All the ones I currently use in some form, Java, .NET languages, C++, JS, SQL, fulfill the above via ISO, ECMA, or official reference docs managed by multiple vendors.
And to be honest, even those that don't I really don't care any longer, because most of the code I write isn't mine to own rather the employer, so as long as it fulfil what the customer is after, I am good, when the project is done I move to the next challenge.
If project requires cross platform capabilities, then usually something along the lines of what is available across all platform SDKs gets chosen.
Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#44Earlier quoted context omitted.
It is discouraged in Pascal as well. Can give really nasty surprises with scoping / debugging. Well to me it is mostly gossip as I refuse to use WITH in my Pascal code so no practical experience.
Heh, thought it was from Lisp. No problem with scoping there.
Oh, you can do it.
his is the TXR Lisp interactive listener of TXR 249.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
Use full-strength TXR for tough tasks, or dilute with shell scripts.
1> (defmacro with (struct obj . body)
(with-gensyms (obj-sym)
^(let ((,obj-sym ,obj))
(symacrolet ,(mapcar (op list @1 ^(qref ,obj-sym ,@1)) (slots struct))
,*body))))
with
2> (with time (time-struct-utc (time))
(list year month day))
(2021 1 30)
Expansion: 3> (macroexpand '(with time (time-struct-utc (time))
(list year month day)))
(let ((#:g0016 (time-struct-utc (time))))
(symacrolet ((time-local
#:g0016.time-local)
(time-utc #:g0016.time-utc)
(time-string
#:g0016.time-string)
(time-parse #:g0016.time-parse)
(year #:g0016.year)
(month #:g0016.month)
(day #:g0016.day)
(hour #:g0016.hour)
(min #:g0016.min)
(sec #:g0016.sec)
(dst #:g0016.dst)
(gmtoff #:g0016.gmtoff)
(zone #:g0016.zone))
(list year month
day)))
Total expansion; symacrolet gone, a.b desugared into (slot a 'b): 4> (expand '(with time (time-struct-utc (time))
(list year month day)))
(let ((#:g0017 (time-struct-utc (time))))
(list (slot #:g0017 'year)
(slot #:g0017 'month)
(slot #:g0017 'day)))Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#45I did a lot of Turbo Pascaling on that one, but it was frustrating watching the compiler go so slooowly while I already noticed a misprint or a missing ; on the screen.
The last thing I did on Turbo Pascal was a program that drew fractals in 320x200 using direct memory access (byte absolute). I tried to get it working in 640x480, but the differences between individual VGA cards were too big. That was 386 already, though.
Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#46Pascal remains my preferred programming environment. Though a bit buggy, and short on documentation, Lazarus/Free Pascal makes quick work of any forms based windows application. I worked through the entire Advent of Code 2020 exclusively in Pascal.
https://github.com/mikewarot/Advent_of_Code_in_Pascal In case others would like to skip the trip through mike's blog ;) I'm surprised at how modern a lot of the code feels.
Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#47This is the environment where my programming really took off from amateur to, well, less amateur. It was so fast to compile and so ergonomic compared to the alternatives. Great stuff.
Me too! I graduated, in a manner of speaking, from FORTRAN, which had no recursion and pointers to Pascal. Looking back I believe Pascal was the perfect language to learn those two fundamental and tricky concepts. It felt aesthetically pleasing and struck just the right balance between the terse (and sometimes quirky) C and verbose COBOL. When I coded up those graph algorithms in Pascal I felt “happy” in a way that c…
Sure you can emulate them with double pointer indirection, which is anyway what the compiler does, but it adds more cognitive overhead.
Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#48That said, i'm afraid that modern Pascal isn't awfully popular, which hurts its practicality a bit (e.g. learning about it, finding tutorials and others' experience with it, getting help). However, it's approach to native GUI development is pretty good, the language itself seems pretty okay and the compilation times are generally pretty good, as is performance ( https://benchmarksgame-team.pages.debian.net/benchmarksgame/... ).
Perhaps the only actual dealbreaker i can think of, is the fact that it doesn't have that many stable or even first party web development frameworks/libraries ( the closest i've found to that being https://wiki.freepascal.org/fpWeb_Tutorial and https://wiki.freepascal.org/fcl-web ), however they don't seem to be as popular as the "de facto" frameworks of the other languages. For example, Java has Spring (and Spring Boot), Node has Express, Python has Django (or even Flask), Ruby has Rails, .NET Core has ASP.NET Core, which are all widely supported and well documented, with plenty of tutorials.
Of course, that has only been my limited experience, since i mostly work with the other alternatives at my workplace and only dabble in Pascal occasionally in my free time. Would anyone care to comment on their experience with modern Pascal as well?
Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#49Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)
#50Earlier quoted context omitted.
It’s different in Pascal l, iirc: in JavaScript with has dynamic scope in and affects every function you call inside the work statement; in Pascal, it has lexical scope. I used it all the time in Delphi and don’t recall any real issues.
The Pascal/Modula-2 WITH statement brings all of the members of a record into the lexical scope, without them being mentioned in the statement (i.e. implicitly). So when you add, remove or rename members of a record, you are potentially influencing the contents of scopes in other files all over the project. You can cause variable shadowing that way. VAR B : INTEGER; WITH ^P DO A := B; (* B is just a local, A is a fie…