Live data from Hacker News

Lazarus IDE 3.0

forum.lazarus.freepascal.org

11–20 of 78 posts

Re: Lazarus IDE 3.0

#11
I keep hearing about Pascal and Delphi, especially on HN, what is it and why is it special or talked about so much? I understand it's an older programming language but not why it's so loved. Any recommendations on how to learn it and is Lazarus a good option for the IDE or does VSCode suffice?

Re: Lazarus IDE 3.0

#12

I keep hearing about Pascal and Delphi, especially on HN, what is it and why is it special or talked about so much? I understand it's an older programming language but not why it's so loved. Any recommendations on how to learn it and is Lazarus a good option for the IDE or does VSCode suffice?

It's not hard to learn. It was often taught as a "first language" the place that I guess Python occupies today. Essentially a more sophisticated BASIC

Re: Lazarus IDE 3.0

#13
This wont be part of a Lazarus release any time soon (ok, it might be in 4.0 but i don't know when 4.0 will happen) as it is only on trunk, but recently i was fixing bugs for the Gtk1 backend. The neat bit is that Gtk1 is very small and while it isn't preinstalled anywhere nowadays (except Slackware) you can carry the .so as they are around 5-6MB or so. However it also supports static linking and after some quick hacking i made Lazarus to statically link against Gtk1 but dynamically link against X11, etc, thus making binaries that can run in pretty much every distro (assuming of course what Gtk1 provides is enough). The neat bit is that the static binary is only around 1.5MB larger than the equivalent binary linked dynamically with Gtk2.

Here is a little mesh viewer test for some docview-like API i wrote recently (not part of Lazarus itself, this is part of a package i use with common code across my Lazarus apps) that was statically compiled with Gtk1 on Slackware running on a Debian which has no Gtk1 libraries at all[0]. Also a bonus screenshot[1] with another mesh viewer (this is a different project[2]) compiled twice, once with the Gtk1 backend and once with the Qt6 backend with the exact same code (just changed the target "widgetset" from the project settings).

[0] https://i.imgur.com/Y4jvQMk.png

[1] https://i.imgur.com/NE2LB3U.png

[2] http://runtimeterror.com/tech/jtf/

Re: Lazarus IDE 3.0

#15

I keep hearing about Pascal and Delphi, especially on HN, what is it and why is it special or talked about so much? I understand it's an older programming language but not why it's so loved. Any recommendations on how to learn it and is Lazarus a good option for the IDE or does VSCode suffice?

I've written a lot of Object Pascal (meaning the Delphi dialect of Pascal, not the older Apple dialect) over the years and... i don't think there is anything special about it :-P. It has a bunch of neat features (and a bunch of not so neat pitfalls) but really IMO the three main reasons to use it is that:

1. It has decent backwards compatibility (code i wrote even 20 years ago compiles either out of the box or with very minimal change - e.g. if you used strings as byte buffers or if you relied on some esoteric RTTI implementation details you may need to change some things but the changes are quick and trivial).

2. Lazarus is a fast and responsive IDE with RAD functionality for making GUIs (and other stuff, e.g. i haven't used it myself much but you can do things like configure visually via the IDE how a webapp will respond to various URLs) and FCL and LCL provide a rich frameworks for desktop applications.

3. The compiler is relatively fast. Delphi's compiler (at least the classic one) is much faster but compared to -e.g.- current C++ compilers, FPC is much faster (it takes less than a minute to compile Lazarus itself and AFAIK the codebase is more than a million lines of code - there is 2 million lines of code in the repo but you don't compile everything).

Re: Lazarus IDE 3.0

#16

I keep hearing about Pascal and Delphi, especially on HN, what is it and why is it special or talked about so much? I understand it's an older programming language but not why it's so loved. Any recommendations on how to learn it and is Lazarus a good option for the IDE or does VSCode suffice?

Delphi and Lazarus are a continuation of the beloved gui-first idiom where you are greeted by an IDE capable of running code at design-time. That means you can add an sql connection component, create a query, connect it to a data source, connect the data source to a grid and fill it right there while designing your form to see how the result will look like when you run it.

The second reason to use it is: it builds for many targets and runs without garbage collection.

Lazarus needs to recompile and restart itself in order to use packages, but other than that, it's pretty stable and fast. VSCode can be used to edit Pascal code, but it is pretty irrelevant.

Re: Lazarus IDE 3.0

#17

I keep hearing about Pascal and Delphi, especially on HN, what is it and why is it special or talked about so much? I understand it's an older programming language but not why it's so loved. Any recommendations on how to learn it and is Lazarus a good option for the IDE or does VSCode suffice?

It's not hard to learn. It was often taught as a "first language" the place that I guess Python occupies today. Essentially a more sophisticated BASIC

Yes, it was the programming language I was taught in school. So there is some nostalgia at play, for me at least.

Re: Lazarus IDE 3.0

#19

I keep hearing about Pascal and Delphi, especially on HN, what is it and why is it special or talked about so much? I understand it's an older programming language but not why it's so loved. Any recommendations on how to learn it and is Lazarus a good option for the IDE or does VSCode suffice?

It's not hard to learn. It was often taught as a "first language" the place that I guess Python occupies today. Essentially a more sophisticated BASIC

Essentially a more sophisticated BASIC

Absolutely wrong.

PASCAL was invented by Professor Niklaus Wirth at ETH Zurich specifically for teaching structured programming, circa 1970 (year of first release). It's a descendant of ALGOL (1960), which was pretty much the first structured programming language and introduced functions that could be recursively invoked -- ALGOL is the ancestor of C and PL/I as well as Pascal and relatives (Modula-2, Oberon, etc) and is hugely important.

BASIC came out of Dartmouth College in the US in the mid-sixties and the emphasis was on interactive invocation: early BASIC was almost completely non-structured (GOTO for flow of control, minimal subroutines, IF statements with no ELSE).

While both Pascal and BASIC were intended as teaching languages, they took radically different views of what to teach. And Python is different again: Python has the virtue of a simple and consistent core syntax, but wasn't designed for teaching -- it was designed for scripting, and was developed in the early 1990s for computers with 2-3 orders of magnitude more resources than early BASIC and Pascal.

Object Pascal/Delphi (Delphi was Borland's proprietary implementation with RAD for Windows) is an outgrowth of Borland's Turbo Pascal from the early 1980s, which in turn took Wirth's Pascal and added some essentials that had been missing -- notably dynamically allocated strings, modules, and finally object encapsulation -- that made it much more suitable for writing serious code: for a while Turbo Pascal was a viable competitor for C on MS-DOS.

But Pascal is in no way related to BASIC.

Re: Lazarus IDE 3.0

#20

I keep hearing about Pascal and Delphi, especially on HN, what is it and why is it special or talked about so much? I understand it's an older programming language but not why it's so loved. Any recommendations on how to learn it and is Lazarus a good option for the IDE or does VSCode suffice?

The nicest thing is the IDE, so using VSCode you're missing the point.

https://www.youtube.com/watch?v=MvFCgc_YvAs

(watch at 2x speed for an idea how fast I worked at the time :=))

I won't describe features that are no longer unique. Most other IDEs have catched up, but twenty years ago, Delphi was much better than anything else. VB had a similar style, but the Object Pascal language was more powerful. Also you were able to program IDE plugins.

The work that FPC and Lazarus teams have done is incredible. Borland was a big SV company. These are voluntary programmers and have outdone Delphi.

Edit, with one more thing: you could program Delphi components (and you can program Lazarus components) using the same Object Pascal language used for the applications. Components can be graphical UI controls (special buttons, edit boxes, calendar pickers, etc.) or non-visible database, communication, processes, really any kind of objects, that can also interact with the IDE.

Post reply on HN