I'm gonna have to put a damper on things, here. Most of the reasons listed are things available in any other modern language (safety, cross-platformness, libraries...) but one of the things cited is readability.
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. The fact that you need to use entire words to denote syntax makes it much harder for your brain to parse things : Instead of immediately seeing "this is code structure" and "this is actual code", you need to actually read the words to make that distinction. It is very counter-productive and a bad design solution, imo.
I feel like this page was written 20 years ago. The reasons would have made quite a lot more sense back then, notably about the type safety.
> The fact that you need to use entire words to denote syntax makes it much harder for your brain to parse things : Instead of immediately seeing "this is code structure" and "this is actual code", you need to actually read the words to make that distinction. It is very counter-productive and a bad design solution, imo.
While I agree that it gets slightly tedious to read daily, I have to say that there is no language other than pascal that lets me come back to the language after 3 years and instantly be able to read it with no problems.
I don't know if any other language where this is possible.
> 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.
> Instead of immediately seeing "this is code structure" and "this is actual code", you need to actually read the words to make that distinction.
First of all, there is syntax highlighting.
Furthermore, after the first few times you see a word you don't actually "read" it in the sense you mean here, you are just matching it, as an image, with other words in your vocabulary. So it's not any harder to "read" a word than to read a curly brace, assuming no other very similar words are used in the vocabulary of the language.
Words can be helpful for people who don't like symbols? C is very terse, Pascal verbose. It's like C vs Python. Single-character symbols can be hard to parse for some people in the same way words are for you.
A good IDE / code structure will make the structure and code easy to differentiate anyway.
I don't have a preference over whether C or pascal is more readable. One might seem more readable depending on my mood or time of day just like editor colors. But my main reason to use a pascal game engine for games would be to avoid garbage collection.
Possibly most of these arguments are arguments in opposition to Lua, the dominant scripting solution in video games, as opposed to pure positives for Pascal?
In the 90s a spent many years programing in pascal in Think Pascal... not glamorous but it got the job done. It's not too bad but I program on C++ now so... yeah, maybe my brain has melted.
Is it though. The whole cross Plattform is a leaky abstraction almost anywhere. Just accept it's gonna be limited to windows and reduce the workload for main revenues market.
As someone who has been coding in Delphi for a living for the past 5 years I'd argue the syntax being verbose is only a small part of a larger problem, which is that (object) pascal is a very bad language for pattern recognition.
The syntax highlighting in current IDEs like RAD Studio or Lazarus is very poor (though I'm not as familiar with the later).
I mean I think aside from keywords, strings, numbers and comments everything has the same color. Even if the syntax was less verbose, we'd still be reading each word. It is basically the same as having no syntax highlighting at all.
And even assuming the syntax highlighting would get better and/or the syntax would be less verbose, we'd still be reading each word because of the case-insensitive nature of the language.
The compiler might not care about the case, but at least my eyes do. So unless I'm reading the word I could not really say whether MyMaGiCaLnAmE and mYmAgIcAlNaMe is the same name or not.
Cannot remember the last time I used a programming language in the Pascal family. Our programming course we had to use Delphi. This was college back in 2001. I purchased a copy of Delphi 5 (my college has version 4) so likely tried things for a year or two afterwards. I doubt I touched Delphi after 2005.
In College we had to create a Stock Control program. It was an IT course so most people struggled as programming was not their direction. For me being a "prodigy programmer" had no issues jumping into Delphi.
If anything, knew little about Delphi. Once I started coding and realised I was typing var, begin, end, or := (etc) -- I knew it was some kind of Pascal. Going back to my earlier days in high school, I had a copy of Turbo C and Turbo Pascal so thats why I had a little head start.
I remember the difficult part was storing the stock data in a binary file, using binary search to find data, etc. My tutor was old-school so I wouldn't be suprised if Delphi had more 'out of the box' solutions which we take for granted in modern Go, C#, etc.
Everyone struggled to get their code to build. Brings back fond memories.
Today I place Pascal in the same Category as Basic. Seems like an interesting project but I just dont have interet using Pascal so would be a deal breaker for me.
I would not be surprised, however, if there is still a pretty large base of Pascal defenders out there. More power to them if the case.
We're probably in the same age group. I used to write simple games and graphics apps in Turbo Pascal in high school. Later on I used Delphi to write "business apps". To me, there isn't that much difference between Pascal and C in terms of language design.
I used to translate my Pascal code to C by replacing begin/end with curly braces, moving interface declarations to header files, replacing well named functions to cryptic-sounding strtok calls, etc. It was all so unnecessarily ugly in comparison.
C is my favorite language now, but the cleanliness of Pascal and the user friendliness of Delphi have stuck with me as reminders of how great a developer experience can be.
I've been using Android Studio for 10 years now and the experience doesn't hold a candle to Borland Delphi Architect from 20 years ago. We might have more advanced features these days, but it's a disconnected mess in comparison.
After learning Basic at home, once I went to high school, Pascal was the first "serious" programming language I've learned.
But since I discovered C a year or two later, I never looked back to Pascal. C felt more "pro", more flexible and seemed closer to metal. Pascal seemed more appropriate for developing GUI apps, while C seemed able to tackle anything, from the most intricate guts of the operating system, to drivers, games and GUI apps. Of course, that was silly, because Pascal was able to do everything that C did, but to my younger self it seemed less "serious" and "pro".
Around '96-97 I was playing with writing fire effects in Turbo Pascal, most of the tutorials used the asm with mode 13h, and all I had was Turbo Pascal 5.5, which didn't support the asm keyword. So, I dabbled a bit with it, and then in late 97, I found about C, and when I saw the for loop in C - I never touched Pascal again.
How fancy, hopefully the project is successful - interesting language choice, always have put "Pascal" as an out-of-date language, but clearly I was wrong
I took a look at the code, since I was curious far a large Pascal codebase looked like. I haven’t seen a substantial amount of Pascal code since about 2001.
One thing I noticed was the file names, I can’t say I’m a fan of prefixing every single source file with “castle”, it makes it much harder to see what the file is about and makes them all look the same. I can’t comment on the actual code, since I’ve never written any Pascal. The engine looks cool though!
This is no different from yacc files being prefix by "yy". It makes it easier to spot which files are castle files and avoids collisions with files/units from other libraries.
If you go through the available Delphi/FPC libraries, you will find basically anything. From CAD drawing widgets to frameworks for building SCADA systems. Most are not present on GitHub, and if they are, don't have hundreds of stars.
On the other hand I have an impression that in more popular languages like Rust - which I use for my projects, I admit - most projects fall into "grep for the 1000th time, but this time made right".
Object Pascal is a modern programming language. It supports classes, units, properties, generics, interfaces, reflection, closures… Everything you expect from a modern OOP language.
It's really a pity how badly the Delphi product was managed by Borland/Embarcadero.
Object Pascal is a great language. These days it produces native code for pretty much all platforms out there. The binaries created are tiny, and the speed is high - close to what C will give you - meaning that typically the code will run between 100 to 10000 times faster than comparable Python code.
When it comes to Castle Engine, it's a gigantic project, making it extremely easy to create games and 3D applications in a RAD kind of way. And unlike other huge Pascal frameworks, it's not a legacy product, but very actively developed. I have HUGE respect for the developers.
A comparable gigantic impressive project is Mormot, and ORM/SOA/MVC framework which is based on extremely optimized code.
Building a Server application with Object Pascal and Mormot is easy to do, and where using NodeJS might be able to handle 500 requests per second, with pascal code you will be in the areas of 10000+.
And this means that while with other languages you might need to run dozens of servers to handle the load, your Object Pascal based server code instead would easily run on a single server. So, using that language can give you massive cost savings.
A lot of people only remember Object Pascal as a teaching language. But the language has evolved, and still has features other languages are lacking, most importantly RTTI (aka reflection). There is only one area where the language isn't up to date, and that is having Multithreading/coroutines integrated into the language itself like it's done in Go.
And finally: I can still compile and run code I have written 40 (!) years ago. Within those 40 years tons of languages have come and gone out of fashion. Pascal is still here.
Back to Castle Engine: Even if you are not familiar with the Object Pascal language, I can highly recommend to try out their visual editor. It's just amazing.
Pascal (Turbo/Borland) was the most most fun I had programming back then. The "Unit" of compiliation just worked (and yes it allowed only DAG-like dependency hierarchies). It was super fast to compile and use, but also to edit/debug.
Then something got lost with Delphi, it's not that it was a bad product, but people started looking elsewhere...
I still cherish the day, as Pascal gave me the headstart to C/C++ from Apple Basic, but also allowed me to start using bit of inline assembly and learn it along the way...
I like pascal - learnt it in second year if tertiary and used off and on for a while. In my opinion as a bad developer and less-bad product manager FPC is the embodiment of duct-tape programming [1] is only that and c# in which I have seen that ethos in developers.
I learned to really program in Delphi, before that it was PHP. Pascal and derivatives still hold a special place in my heart. I never imagined nee development would be done with it!
Most comments in this thread reminds me of the discussion we had under a discussion about Fortran recently, here's the comment thread regarding Pascal https://news.ycombinator.com/item?id=38966342
And it is a proof than grotesquely complex c++ oo is more than useless for a 3D engine. Namespaces using the preprocessor should be enough, if you need more, you are the problem.
Ok I’ve got a hacker challenge for the more creatively-inclined: if I wanted to stretch “cross platform” to web (and thus webVR?), how might I wrap/integrate/emulate/polyfill/whatever this?
EDIT: after a quick search the answer is a resounding “you can do it, but yikes.” Multiple people reference custom compilers, which I’m guessing are beyond my reach…
EDIT 2: wow nvm it’s on their roadmap! Their “why pascal” page says it’s already supported, but i think thats more hopeful than contractual.
Coming soon (roadmap):
Oculus (VR) (we have the hardware to test)
WebGL (FPC can compile to WebAssembly)
XBox (we have the hardware to test).
(Love the casual “we own at least one xbox” humble brag. If the authors are reading this, that’s the only part that I find a tiny bit off putting — a tinge of overeagerness to persuade me / sell me.)
> Love the casual “we own at least one xbox” humble brag.
Maybe it's not a humblebrag, but showing they're taking cross-platform seriously. I don't own an Xbox for example, and if I worked on something like this, buying one would be for the specific reason of making sure the project worked. I'd communicate that.
As for our mention of XBox on https://castle-engine.io/features : the point I wanted to say there was that we have "development" version of Xbox, as provided by Microsoft. Though it doesn't matter much nowadays, since retail Xbox versions can also be used for development, from what I read. I edited that statement to say this
"""
XBox (we have the hardware — even devkit, though "developer mode" can also be activated on a retail version of Xbox).
"""
Jean-Papoulos|2 years ago
I'm gonna have to put a damper on things, here. Most of the reasons listed are things available in any other modern language (safety, cross-platformness, libraries...) but one of the things cited is readability.
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. The fact that you need to use entire words to denote syntax makes it much harder for your brain to parse things : Instead of immediately seeing "this is code structure" and "this is actual code", you need to actually read the words to make that distinction. It is very counter-productive and a bad design solution, imo.
I feel like this page was written 20 years ago. The reasons would have made quite a lot more sense back then, notably about the type safety.
lelanthran|2 years ago
While I agree that it gets slightly tedious to read daily, I have to say that there is no language other than pascal that lets me come back to the language after 3 years and instantly be able to read it with no problems.
I don't know if any other language where this is possible.
badsectoracula|2 years ago
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.
erfgh|2 years ago
First of all, there is syntax highlighting.
Furthermore, after the first few times you see a word you don't actually "read" it in the sense you mean here, you are just matching it, as an image, with other words in your vocabulary. So it's not any harder to "read" a word than to read a curly brace, assuming no other very similar words are used in the vocabulary of the language.
vintagedave|2 years ago
A good IDE / code structure will make the structure and code easy to differentiate anyway.
nurettin|2 years ago
sylware|2 years ago
dazzawazza|2 years ago
In the 90s a spent many years programing in pascal in Think Pascal... not glamorous but it got the job done. It's not too bad but I program on C++ now so... yeah, maybe my brain has melted.
musicale|2 years ago
thesz|2 years ago
unknown|2 years ago
[deleted]
Log_out_|2 years ago
dadie|2 years ago
The syntax highlighting in current IDEs like RAD Studio or Lazarus is very poor (though I'm not as familiar with the later).
I mean I think aside from keywords, strings, numbers and comments everything has the same color. Even if the syntax was less verbose, we'd still be reading each word. It is basically the same as having no syntax highlighting at all.
And even assuming the syntax highlighting would get better and/or the syntax would be less verbose, we'd still be reading each word because of the case-insensitive nature of the language.
The compiler might not care about the case, but at least my eyes do. So unless I'm reading the word I could not really say whether MyMaGiCaLnAmE and mYmAgIcAlNaMe is the same name or not.
dang|2 years ago
Why use Pascal? - https://news.ycombinator.com/item?id=36646890 - July 2023 (307 comments)
Modern Object Pascal Introduction for Programmers - https://news.ycombinator.com/item?id=36371434 - June 2023 (3 comments)
Castle Game Engine Roadmap - https://news.ycombinator.com/item?id=36365420 - June 2023 (10 comments)
Modern Object Pascal Introduction for Programmers - https://news.ycombinator.com/item?id=28079093 - Aug 2021 (3 comments)
Castle Game Engine: Cross-platform 3D and 2D game engine - https://news.ycombinator.com/item?id=23741883 - July 2020 (20 comments)
Castle Game Engine 6.4 released – physics, iOS services, shader pipeline upgrade - https://news.ycombinator.com/item?id=16207075 - Jan 2018 (2 comments)
masfoobar|2 years ago
In College we had to create a Stock Control program. It was an IT course so most people struggled as programming was not their direction. For me being a "prodigy programmer" had no issues jumping into Delphi.
If anything, knew little about Delphi. Once I started coding and realised I was typing var, begin, end, or := (etc) -- I knew it was some kind of Pascal. Going back to my earlier days in high school, I had a copy of Turbo C and Turbo Pascal so thats why I had a little head start.
I remember the difficult part was storing the stock data in a binary file, using binary search to find data, etc. My tutor was old-school so I wouldn't be suprised if Delphi had more 'out of the box' solutions which we take for granted in modern Go, C#, etc.
Everyone struggled to get their code to build. Brings back fond memories.
Today I place Pascal in the same Category as Basic. Seems like an interesting project but I just dont have interet using Pascal so would be a deal breaker for me.
I would not be surprised, however, if there is still a pretty large base of Pascal defenders out there. More power to them if the case.
optymizer|2 years ago
I used to translate my Pascal code to C by replacing begin/end with curly braces, moving interface declarations to header files, replacing well named functions to cryptic-sounding strtok calls, etc. It was all so unnecessarily ugly in comparison.
C is my favorite language now, but the cleanliness of Pascal and the user friendliness of Delphi have stuck with me as reminders of how great a developer experience can be.
I've been using Android Studio for 10 years now and the experience doesn't hold a candle to Borland Delphi Architect from 20 years ago. We might have more advanced features these days, but it's a disconnected mess in comparison.
vfclists|2 years ago
What are the languages you would prefer to use now?
DeathArrow|2 years ago
But since I discovered C a year or two later, I never looked back to Pascal. C felt more "pro", more flexible and seemed closer to metal. Pascal seemed more appropriate for developing GUI apps, while C seemed able to tackle anything, from the most intricate guts of the operating system, to drivers, games and GUI apps. Of course, that was silly, because Pascal was able to do everything that C did, but to my younger self it seemed less "serious" and "pro".
SantiagoElf|2 years ago
Around '96-97 I was playing with writing fire effects in Turbo Pascal, most of the tutorials used the asm with mode 13h, and all I had was Turbo Pascal 5.5, which didn't support the asm keyword. So, I dabbled a bit with it, and then in late 97, I found about C, and when I saw the for loop in C - I never touched Pascal again.
tommica|2 years ago
baq|2 years ago
dkersten|2 years ago
One thing I noticed was the file names, I can’t say I’m a fan of prefixing every single source file with “castle”, it makes it much harder to see what the file is about and makes them all look the same. I can’t comment on the actual code, since I’ve never written any Pascal. The engine looks cool though!
vfclists|2 years ago
Meaningless nitpick.
LispSporks22|2 years ago
wolvesechoes|2 years ago
If you go through the available Delphi/FPC libraries, you will find basically anything. From CAD drawing widgets to frameworks for building SCADA systems. Most are not present on GitHub, and if they are, don't have hundreds of stars.
On the other hand I have an impression that in more popular languages like Rust - which I use for my projects, I admit - most projects fall into "grep for the 1000th time, but this time made right".
bbor|2 years ago
Fischgericht|2 years ago
Object Pascal is a great language. These days it produces native code for pretty much all platforms out there. The binaries created are tiny, and the speed is high - close to what C will give you - meaning that typically the code will run between 100 to 10000 times faster than comparable Python code.
When it comes to Castle Engine, it's a gigantic project, making it extremely easy to create games and 3D applications in a RAD kind of way. And unlike other huge Pascal frameworks, it's not a legacy product, but very actively developed. I have HUGE respect for the developers.
A comparable gigantic impressive project is Mormot, and ORM/SOA/MVC framework which is based on extremely optimized code.
Building a Server application with Object Pascal and Mormot is easy to do, and where using NodeJS might be able to handle 500 requests per second, with pascal code you will be in the areas of 10000+.
And this means that while with other languages you might need to run dozens of servers to handle the load, your Object Pascal based server code instead would easily run on a single server. So, using that language can give you massive cost savings.
A lot of people only remember Object Pascal as a teaching language. But the language has evolved, and still has features other languages are lacking, most importantly RTTI (aka reflection). There is only one area where the language isn't up to date, and that is having Multithreading/coroutines integrated into the language itself like it's done in Go.
And finally: I can still compile and run code I have written 40 (!) years ago. Within those 40 years tons of languages have come and gone out of fashion. Pascal is still here.
Back to Castle Engine: Even if you are not familiar with the Object Pascal language, I can highly recommend to try out their visual editor. It's just amazing.
CarRamrod|2 years ago
incanus77|2 years ago
zem|2 years ago
malkia|2 years ago
Then something got lost with Delphi, it's not that it was a bad product, but people started looking elsewhere...
I still cherish the day, as Pascal gave me the headstart to C/C++ from Apple Basic, but also allowed me to start using bit of inline assembly and learn it along the way...
zoom6628|2 years ago
[1] https://www.joelonsoftware.com/2009/09/23/the-duct-tape-prog...
bitwize|2 years ago
spockz|2 years ago
omgmajk|2 years ago
tsukurimashou|2 years ago
thesnide|2 years ago
Without doing much progress skill wise :-D
shoozza|2 years ago
It's still around. The FLOSS version is called OpenSoldat now (I plan to get it back on track eventually as it became unstable with Version 1.8).
Really enjoyed the quick compile times :)
vr46|2 years ago
I don’t know a thing about Pascal, though, why would anyone still be using it? Is it good?
sylware|2 years ago
thesnide|2 years ago
And mostly to see if those fond memories of learning to code with Turbo Pascal survived the test of time...
lelanthran|2 years ago
https://news.ycombinator.com/item?id=39427811
alanlammiman|2 years ago
hansonpeter|2 years ago
[deleted]
bbor|2 years ago
EDIT: after a quick search the answer is a resounding “you can do it, but yikes.” Multiple people reference custom compilers, which I’m guessing are beyond my reach…
https://news.ycombinator.com/item?id=12029566
EDIT 2: wow nvm it’s on their roadmap! Their “why pascal” page says it’s already supported, but i think thats more hopeful than contractual.
(Love the casual “we own at least one xbox” humble brag. If the authors are reading this, that’s the only part that I find a tiny bit off putting — a tinge of overeagerness to persuade me / sell me.)https://castle-engine.io/features#_cross_platform
Highly recommend the “Why pascal” page in general, the most interesting part of the project to a passerby like me:
https://castle-engine.io/why_pascal
vintagedave|2 years ago
Maybe it's not a humblebrag, but showing they're taking cross-platform seriously. I don't own an Xbox for example, and if I worked on something like this, buying one would be for the specific reason of making sure the project worked. I'd communicate that.
michaliskambi|2 years ago
""" XBox (we have the hardware — even devkit, though "developer mode" can also be activated on a retail version of Xbox). """
As for web:
- This is mentioned on https://castle-engine.io/why_pascal as supported nicely by FPC compiler. FPC can compile regular Pascal code to WebAssembly, there's also Pas2Js that can compile regular Pascal code to JS. See samples e.g. here: https://github.com/genericptr/Pas2JS-WebGL?tab=readme-ov-fil...
- In the context of Castle Game Engine, web is part of "Coming Soon" of https://castle-engine.io/features . We want to utilize above to enable to recompile any Castle Game Engine application (as long as it uses cross-platform API) to the web. Details are on https://castle-engine.io/wp/2023/04/08/web-target-progress-a... .