Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I work on Pascal code 8 hours a day, and it is not more readable then conventional C syntax ; I'd argue it's much less.

I'd disagree with that. I've worked on several Free Pascal projects, C projects, C++ projects and some other stuff and i find it easier to follow Free Pascal code in big projects written by other people than C/C++/Java/etc. At least, i'd say that outside extreme cases (like esoteric languages - or trying to write OOP code in an XML-based language with only imperative functionality :-P), readability is up to the reader.

Go is the only other language i found easy to follow, despite not really knowing much about the language itself, but Go is also a much simpler language, more limited in its feature set - Free Pascal on the other hand is a "kitchen sink" language where everything and anything goes and yet it still remains easy to read.

That said, IMO the #1 reason to use Free Pascal isn't so much the language itself (most of the stuff mentioned are also available in, e.g., D - and i'd say that D does a much better job at doing compile-time stuff to the point where you can probably implement yourself any missing features from Free Pascal) but the Lazarus IDE and the FCL and LCL frameworks. Well, that and that it has a very fast compiler with a decent optimizer (and there is the new LLVM backend if you need more oomph, though with a big hit to compile time) and a large number of supported platforms.

Also great backwards compatibility. That is very important, if my X years old code that used to work stops working without externally imposed reasons (e.g. uses OS-specific code and i switched to another OS or the universe replaced x86 with RISC-V) i don't care how clean, consistent, elegant or whatever else a language might be that give theoretical language designers warm feelings, i care that my code that worked doesn't work anymore.



Can you expand on Pascal vs Go? What is Go missing?

I do not know much about either language, but the first thing I thought when people compared Pascal to Go (another comment, not yours) was what about concurrency? Go does have strong concurrency story.

AFAIK there is a lack of mobile support, so the use case for Free Pascal is strongest for cross platform desktop apps?

Is it something you think is still worth learning? Using for a new project rather than legacy code?


> Can you expand on Pascal vs Go? What is Go missing?

Proper type creation (create a new type for integers less than or equal to 12, and greater than or equal to 1, for example)

Proper enum/ordinal types (Even C is more strongly typed than Go in this instance, because C enums are not just ints, and you can't supply an invalid value to a function expecting a specific enum).

Both these together demonstrate the much stronger typing in Pascal.


> Can you expand on Pascal vs Go? What is Go missing?

On the context of classical 1970's Pascal, enumerations instead of the const/iota dance.

On the context of Pascal dialects derived from UCSD Pascal and Object Pascal, by non specific order, exceptions, package naming that isn't tied to source control repos, binary distribution of packages, powerfull generics, metaclasses, GUI RAD tooling, more investments into optimizing compilers (gccgo seems stuck in pre-generics Go).

Personally, I came to peace with Go, still hoping to const/iota dance to come to an end, some day.


> Can you expand on Pascal vs Go? What is Go missing?

Pjmlp mentioned a few, though i wouldn't say so much they are things "Go is missing" but more "Go does not provide them" - at least in my mind it is more of a FPC has "more stuff you could use" than Go lacking stuff.

> what about concurrency?

It is pretty much the same as you'd find in most other languages: done via threads with some language support for thread level storage. There are some helpers in the library and Lazarus also comes with a package that allows you to run stuff in parallel like a "parallel for", but nothing higher level than that.

> Is it something you think is still worth learning? Using for a new project rather than legacy code?

I think if you want to make a desktop application that runs in multiple desktop OSes, it is worth to learn it so you can use Lazarus. For other stuff, i dont think it provides that much of a benefit compared to other languages. I think the weakest aspect might be server-side apps - there is some support (even out of the box and Lazarus even has some RAD support for it so you can do things like routing URLs to different parts visually) and a framework or two, but i get the impression that most effort is in desktop stuff.


> AFAIK there is a lack of mobile support, so the use case for Free Pascal is strongest for cross platform desktop apps?

Both iOS and Android are supported by FreePascal as well as Delphi.


Thanks. Good to know.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: