Live data from Hacker News

A guided intro to the Free Pascal language

getlazarus.org

51–60 of 102 posts

Re: A guided intro to the Free Pascal language

#51
Note for people who don't know much about FreePascal. It is a full-featured and very fast compiler. The resulting program is a rival for the best output of C/CPP compilers. It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. It has a great but old-looking IDE, Lazarus. It has been under active development for decades and is used for proper projects like:

https://dadroit.com/ https://peazip.github.io/ https://cudatext.github.io/ https://lazpaint.github.io/

As far as I know, there is no toolkit out there that lets you make fine looking applications for multiple platforms with proper speed.

The old Pascal you may know is not the new Pascal. The development of Pascal is mostly focused on ease of development while maintaining low-level programming and backward compatibility. It looks old on its face, but it is young at heart.

I recommend starting with Lazarus, https://www.lazarus-ide.org, a much lighter IDE compared to so-called light projects like VSCode, with many more features and components to play with.

Friendly word: don't let the comments with outdated information make you miss a great and fun tool.

Re: A guided intro to the Free Pascal language

#52
post #51

Note for people who don't know much about FreePascal. It is a full-featured and very fast compiler. The resulting program is a rival for the best output of C/CPP compilers. It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. It has a great but old-looking IDE, Lazarus. It has been under active development for decades and is used for proper projects like: htt…

You mention that Pascal is almost as safe as Rust. This comes as a great surprise to me, because I was under the impression that Pascal and C are very similar.

(Though I hear the strings, at least, know their own size!)

Re: A guided intro to the Free Pascal language

#53
post #48

Earlier quoted context omitted.

> lack of a standard (Pascal was a learning language, not intended for professional use) The parenthetical is correct, what is outside is not; Pascal had a standard (ISO 7185:1983), but the standard lacks features needed for serious use, so Pascal implementations were either standard and hobbled or useful but not interoperable.

Pascal had a standard (ISO 7185:1983) Doesn't "1983" tell you something? I don't mean to snark. Maybe my comment wasn't clear enough. I've talked of two different periods: the first in the seventies, the second in the eighties and later. The starndar was late. By that time, it wasn't needed because the only Pascal that was widely used was Borland's.

> Doesn't "1983" tell you something?

That it was finalized around the same time Turbo Pascal 1.0, which only ran on DOS and CP/M, was released.

> The starndard was late. By that time, it wasn't needed because the only Pascal that was widely used was Borland's.

The ISO standard closely followed the 1974 language description, which served largely the same purpose and had generally the same shortcomings on utility, so that the “interoperable but not useful because following a very limited common description, or useful but not interoperable because of proprietary extensions on top of the common description” predates the ISO standard; the lack of a common labguage spec was never as much of a problem as the focus of the spec.

And, no, by December 1983, Turbo Pascal (released the month before) was not the only Pascal that mattered. Nor would it be later in the 1980s, as Apple's Object Pascal (which influenced later versions of Turbo Pascal) became important.

Re: A guided intro to the Free Pascal language

#54
post #38

I used to be a hard Delphi/Pascal guy and still think it is much better than C for it's strong typing and overall "squareness". But I'd have a hard time going back to it nowadays. The 'var' section, magic "Result" variable and begin/end pairs are just from another age. Programming languages have advanced _a lot_ since Pascal was created. It's core principles remain valid (safety by default, readability, flexibility).…

nothing magic about Result keyword, it's just an implicit pointer, you can avoid it completely by using explicit pointers.

It's not magic in how it works, it's just magic in it's syntax. It's a variable you don't have to declare. It's ripe for abuse / mistakes and would be one of the things I'd have lints for and watch closely in PRs.

Re: A guided intro to the Free Pascal language

#55
post #42
post #29

Earlier quoted context omitted.

Embarcadero insane pricing of Delphi is the reason I haven't continued beyond my old version Xe2. I guess they are making hay while the sun shines with the locked-in customers.

In these days, Lazarus and FPC are a valid choice instead of Delphi, except when you are doing some heavy component based codes, like organization oriented projects. Plus side is Lazarus can produce a project and UI for almost any OS.

I would jump back to fpc/lazarus after twenty years if devexpress supported it.

Re: A guided intro to the Free Pascal language

#56
post #51

Note for people who don't know much about FreePascal. It is a full-featured and very fast compiler. The resulting program is a rival for the best output of C/CPP compilers. It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. It has a great but old-looking IDE, Lazarus. It has been under active development for decades and is used for proper projects like: htt…

> It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner.

What does this mean, exactly? Usage in the style of Go requires garbage collection and being safe like Rust (without GC) requires a borrow-checker, and as far as I know Free Pascal doesn't have either.

Re: A guided intro to the Free Pascal language

#57
post #52
post #51

Note for people who don't know much about FreePascal. It is a full-featured and very fast compiler. The resulting program is a rival for the best output of C/CPP compilers. It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. It has a great but old-looking IDE, Lazarus. It has been under active development for decades and is used for proper projects like: htt…

You mention that Pascal is almost as safe as Rust. This comes as a great surprise to me, because I was under the impression that Pascal and C are very similar. (Though I hear the strings, at least, know their own size!)

Pascal is type safe and generally catches most errors at compile time, you can still create run-time errors such as indexes outside arrays but these will cause errors not bad return data.

eg I use C a lot and find myself referencing array index [0] a lot, in pascal arrays starts at [1] if not specifically defined so I know this from experience, frustratingly I have a different problem in C which will either return random data or crash if writing.

Re: A guided intro to the Free Pascal language

#58
post #51

Note for people who don't know much about FreePascal. It is a full-featured and very fast compiler. The resulting program is a rival for the best output of C/CPP compilers. It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. It has a great but old-looking IDE, Lazarus. It has been under active development for decades and is used for proper projects like: htt…

Should add the freepascal community is much more forgiving of noobs and generally well behaved (trolls dont like quiche I guess!)

Re: A guided intro to the Free Pascal language

#59
post #56
post #51

Note for people who don't know much about FreePascal. It is a full-featured and very fast compiler. The resulting program is a rival for the best output of C/CPP compilers. It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. It has a great but old-looking IDE, Lazarus. It has been under active development for decades and is used for proper projects like: htt…

> It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. What does this mean, exactly? Usage in the style of Go requires garbage collection and being safe like Rust (without GC) requires a borrow-checker, and as far as I know Free Pascal doesn't have either.

Object Pascal has two magic types, dynamic arrays and AnsiStrings. These are automatically reference counted. Objects and classes have to be managed by hand, yes.

In general, expect a lot more compiler magic out of Pascal, a lot of concepts were hacked into the Borland compilers over time.

Re: A guided intro to the Free Pascal language

#60
post #56

Earlier quoted context omitted.

> It can be used in the style of simpler languages like Go and is almost as safe as Rust in a much faster manner. What does this mean, exactly? Usage in the style of Go requires garbage collection and being safe like Rust (without GC) requires a borrow-checker, and as far as I know Free Pascal doesn't have either.

Object Pascal has two magic types, dynamic arrays and AnsiStrings. These are automatically reference counted. Objects and classes have to be managed by hand, yes. In general, expect a lot more compiler magic out of Pascal, a lot of concepts were hacked into the Borland compilers over time.

So, it's closer to C++ wrt safety, not Go or Rust.
Post reply on HN