Live data from Hacker News

Why I use Object Pascal

dubst3pp4.github.io

101–110 of 235 posts

Re: Why I use Object Pascal

#101
post #87

What caused pascal to lose out to C? Seems like it was a good language that had developer uptake.

Price of Delphi. You could have had Visual Studio for $1000, but Delphi for $10k. That single-handedly killed Pascal. Lazarus/FPC was a response to that pricing insanity.

Ironically gcc only got a major development bump when Sun became the first UNIX vendor to sell the compilers, with others following up.

Re: Why I use Object Pascal

#102
post #14

In my university (in Paris) we used to learn programming that way for the licence degree 1st year -> pascal only 2nd year -> c only 3d year -> java only That was a very nice learning curve for the core course of programming.

I was enrolled at a university that had you progress like this:

1. Imperative programming with Pascal

2. Object-oriented programming with Java

3. Functional and logic programming with Prolog and Scheme

4. Advanced functional programming with ML

All the software engineering & project management courses basically assumed Java-brand OOP and related practices, though.

Before that I was enrolled at a different university that did three things at the same time in no obvious order:

A. HTML/CSS/JavaScript and PHP for web development (yes, like in the 2000 era)

B. Java for linguistics programming and software engineering (but the professor wouldn't shut up about how much he likes Oberon-2)

C. C++ for interactive graphics programming (and maybe other things to)

Basically all the advanced "computer sciencey" stuff was in C++, all the more "software engineeringy" stuff was in Java and everybody pretended web development wasn't really a thing.

Re: Why I use Object Pascal

#103
post #84

Earlier quoted context omitted.

Did you have a look at https://www.freepascal.org/docs.var and especially at the RTL https://www.freepascal.org/docs-html/current/rtl/index.html and FCL https://www.freepascal.org/docs-html/current/fcl/index.html documentation? I think the Free Pascal team has done a good job documenting nearly everything!

Wow, not sure how I missed that. I was just looking at their Wiki and then there was a page where they had the language spec. This changes a lot. Thanks for bringing this to my attention.

The old Borland manuals are on bitkeepers.

They are quite good.

Re: Why I use Object Pascal

#104
Some fun I had with free pascal in college was that you can $DEFINE almost anything to almost anything else:

  {$DEFINE (:=ab}
  {$DEFINE ):=ba}
  ...etc...
Code becomes pretty ridiculous:

  WriteLn ab ab a + b ba * c ba
If you define WriteLn, +, and * as other things too you can get horrific looking code. All keywords like program, if, then, and end can be redefined. I wrote a script that would take a regular source file and output a functionally identical file which looked like:

  {$DEFINE program:=a}
  ... many more defines ...
  {$DEFINE [:=zd}
  {$DEFINE ]:=ze}
  a b c d e f g h (* ... the entire program on one obfuscated line *)

Re: Why I use Object Pascal

#105
post #76

Earlier quoted context omitted.

> Not to say these are not valid reasons, or expectations one may have from a language, but - what exactly is Pascal being compared to? I mean, it's 2017. I have been searching for it for 15 min now, but last month or so on hn there was a article comparing programming languages and compilers. fpc performance was comparable to c. Also a mvp production exe will be 2.5 MB, no stdlib/.net/qt needed.

> 2.5 MB, no stdlib/.net/qt needed. This is a pro of Pascal then :) I was also looking for the pros of Pascal in contrast to what we've come to expect of languages while skimming the article.

Lazarus on ubuntu and windows is usable, i'm still struggling with macOS and there is legends and lore of ios/android support. It even seems to support qt, but I have not went there yet.

Something else to mention about lazarus is you can hot compile the ide too add in components, fix issues; While using lazarus. It takes a couple of minutes to recompile and there a fail safe cli method to restore. But rather amazing if you wonder how long it takes to compile visual studio professional or qt.

http://wiki.freepascal.org/IDE_Window:_Configure_Build_Lazar...

Re: Why I use Object Pascal

#106
post #9

Turbo Pascal and Forth were my first languages past Assembly on C64. They were so much better then Basic and Assembly for a young teenagers. Delphi is now $1,200 to $4,400 a user!!! WOW more then the $75 in 1983 https://www.embarcadero.com/app-development-tools-store/delp...

Currently I'm learning Forth and I really like that language! It's a brain twist and that's reason enough to have a look at :-)

I've never done anything serious in Forth, but I was first exposed to it in the late 80s, and keep coming back to it.

Over the past couple of years I've written, and thrown away, several implementations of Forth in C, C++, and Perl. I've even had it running, embedded, on ESP8266 devices.

It continues to be something I enjoy toying with, but equally something I can't find a perfect use for.

Re: Why I use Object Pascal

#107
post #100
post #75

Earlier quoted context omitted.

It was more than just the popularity of Unix. A while back, I ended up following a link on HN and reading a bunch of old computer magazines. I came across an article by Peter Norton (in PC Magazine) from around 1986 or 87. In it, he discussed why C was rapidly displacing Pascal among DOS programmers. Not that Unix didn't have an effect, but as DOS and then windows exploded in popularity in the 80s, C displacing Pasca…

In those days without Internet and expensive dial-up access to BBS limited to 5 simultaneous users, it depended very much where in the globe we are talking about. On my area in Portugal, using C was mostly for university projects. For anything else we were using Turbo Pascal and Assembly, with Clipper for business applications. Actually many MS-DOS systems programming books had code listings in C, Pascal and Assembly…

A BBS with 5 simultaneous users? Sounds amazing. Most of the BBSes here in the Toronto area only had a single phone line. :)

Re: Why I use Object Pascal

#108
post #7
post #2

How do users of languages like Pascal get by without any/many libraries? Do they need to use the FFI to call out to C functions constantly? I mean, I certainly buy that $VINTAGE_LANGUAGE could still be great to develop in, but I'm curious the practicalities of working on modern systems without re-inventing every single wheel.

In my experience (talking FreePascal/Lazarus here, as I'm on Linux most of the time), the library situation is not that bad, actually. The standard lib has most of the mundane stuff, and a little github-searching can often find a working version of more specific stuff (like SSH2 which I needed recently). To the contrary, in some areas (like GUI tooling) it is far far beyond newer alternatives like Go. Also, I think t…

We needed a app for branding. That login to a website. So it needed to do a POST request. I struggled with fp and google for 30 min, and dropped to the `RunCommand('curl',['https://ifconfig.co'],s, opt)` clutch with curl.exe(with licence file) bundled into my innosetup file... magic?!

Re: Why I use Object Pascal

#109
post #25

I feel kind of sheepish to admit that "Why Pascal is not my favorite programming language" had a huge impact on me and caused me to avoid Pascal until I was forced to deal with it because a coworker quit and dropped maintenance of an in-house application in my lap. I was happy to realize that most of the criticism in that essay no longer applies to relatively recent versions of the language/IDE (Delphi 7 in my case).…

My High School programming class was taught in Pascal (Turbo Pascal version 3 IIRC). I remember liking it just fine, but when I went to the university I switched to C because everything interesting was written in C. Also, there were no Pascal compilers in the FreeBSD (2.0) ports tree back then. I had a notion that Pascal was a "toy teaching language" too, but for what I was doing that didn't really matter.

You've described my experience exactly. Once I got to learn C at university, I felt that I was now using a "grown up's programming language". It took a few years to realise that C's manual memory management and explicit pointer handling was making me much less productive as an application programmer.

Re: Why I use Object Pascal

#110
post #91

I know C# borrowed heavily from Pascal. (So much that a lot of its improvements over Java were overlooked.) What's the advantage of using Pascal over C# or Java? Is it that Pascal outputs true compiled programs instead of requiring a VM?

Makes sense since Anders H. architected c#, turbo pascal, and Delphi. As soon as he left Borland, Delphi began to atrophy. Too bad because it was a ground breaking product when it came out.
Post reply on HN