8 ms·
Modern Pascal is still in the race (2022)
- zwnow 3y agoHaving to write C/AL to make a living, which is based on Pascal, I can safely say it shouldnt be in the race anymore...
- elteto 3y agoInteresting take. Pascal is definitely a niche language but most of the community around FPC and Lazarus seems very positive and welcoming. Would you mind expanding on why you feel this way? What Pascal do you use? Do you use Delphi or FPC/Lazarus? What don’t you like about the language (or your particular vendor implementation)?
- zwnow 3y agoI have to say I wrote this as more of a joke as I do have no actual experience with Pascal. Looking at the syntax I just assumed it to be extremely similar to the language I have to work with on a daily basis. And with that, just as limited. C/AL is a product of Microsoft and is only used in their ERP Software Navision. It's a horrible experience to work with as you don't have a lot of modern languages features just for the sake of readability. At some point in the article the author wrote that Rust code isn't readable for example. I'd argue code shouldn't have to be readable by non-programmers. And especially not if the language sacrifices features like creating objects or dynamic arrays... But as I wrote, I don't have actual experience with Pascal so maybe it's actually better.
- bitwize 3y agoFree Pascal is a lot more robust and featureful than whatever God-awful ERP language you have to work in. It's a spiritual descendant of Turbo Pascal and Delphi, which were used to develop diverse applications from line-of-business to games for decades. Dynamic memory allocation and objects are built-in. It is definitely NOT the Pascal of Kernighan's "Why Pascal Is Not My Favorite Programming Language".
- tabtab 3y agoWhat are the top 2 pain points you encountered?
- b800h 3y agoI hope this isn't hosted on Pascal. Got a 502.
- doublerabbit 3y agoProbably got a 502 for it not being hosted on Pascal. But iirc, HN is Lisp?
- jacquesm 3y agoNot quite, Arc, a LISP inspired language that is essentially a one-off. http://www.paulgraham.com/hundred.html http://www.paulgraham.com/hundred.html
- dbsmith83 3y agoI used Delphi in the 90's and early 00's, and really loved how simple it was to create desktop applications. I tried to get back into Pascal via Lazarus a few years ago, but was just very turned off by Pascal itself. The conventions just differ so much from other more popular languages that I use for work now, and there just isn't the same level of stack overflow questions/answers to make it easy to pick up. I guess with ChatGPT, it should be a lot easier to pick up now, so maybe I should give it another go.
- Svip 3y agoThis article reads more like an ad for mORMot 2 than Pascal. I've been out of the Pascal game for a few years, so I had to look up mORMot 2.[0] Apparently Synopse are the maintainers of it. The article basically compare their CSV/JSON serialising library to Go's standard CSV/JSON libraries. Looking at the Go code, it's pretty clear why it has memory issues, it reads all the lines into a single object (well, `[][]string`) immediately, rather than reading line for line (which takes advantage of the stream). I am not sure how this is remarkable and impressive for Pascal. They talk about how you don't need to use the `try..finally..Free` routine all the time, but that's only if the object in question is an interface. Interfaces are somehow handled by a reference counter in Object Pascal, so you need to know how to operate on objects vs interfaces, because they act very different. Pascal is full of these quirks. [0] https://github.com/synopse/mORMot2 https://github.com/synopse/mORMot2
- davidw 3y agoIf you have to loudly proclaim you're still important...
- jchw 3y agoHmm meh. I have a soft spot for Delphi/Object Pascal but I think the case here is not great. What it looks like at a glance is they wrote a better Pascal program than the Go one it was competing against, rather than just idiomatically port it. A fine approach, but it doesn't tell us that much. Specifically, it doesn't tell us very much about programming languages. Go has plenty of weaknesses versus Pascal, but two commonalities of the languages are lightning fast compile times and a pretty good experience for modelling data structures. Pascal is undoubtedly lower level and does not guarantee memory safety, whereas Go does but its GC is often less efficient and more memory-heavy than manual allocation. Blow for blow, though, I'd say the largest weak point for Pascal is a somewhat archaic syntax and for Go, honestly, the concurrency model. (Channels are nice, until they are not. I feel as though it's easier, though not necessarily easy, to write correct programs using mutexes than Go channels in many cases. This is weird, because nothing has changed about the old shared memory with locks model since it was the source of so many problems. Yet, programmers, computers and toolchains have changed a lot. Rust with locks is a great example.) But the biggest problem for Pascal is the lack of a strong killer app. Back in the day, libraries like VCL made Delphi amazingly productive for desktop apps. But VCL/LCL doesn't really hold up as well these days, where desktop apps are less important and the important features of GUIs has shifted a lot. That leaves Delphi and Object Pascal as a sort-of also-ran: It's not that Go is especially good, in fact I'd argue its claim to fame and namesake (the concurrency model) just wound up being kind of ... bad. But, now that it's here and popular, there's little reason for e.g. Go developers to switch to Object Pascal, a less supported language with less of a job market, less library support, etc. And that really is a shame, because it isn't really a reflection of Object Pascal being unfit for modern software development.
- astrodust 3y agoDelphi was really a "Concorde moment" in that it was actually rapid, both in terms of development speed, and performance, which was somehow forgotten as the web emerged. Forgotten to the point that people thought Visual Basic was a good idea.
- misja111 3y agoDelphi was great but a major deal breaker was that is was not free to use.
- soliton4 3y agopascal was the 2nd language i learned after basic and it was the best time of my learning life. the fact that you could add inline assembler code and the early attempts of object oriented programming were amazing. it was turbo pascal 6.0 btw.
- wiz21c 3y agoInline assembler was a killer feature: you could optimize bits of your code without having to understand how an assembler works and without having to deal with a linker as Pascal compiler did everything itself. Great time indeed !
- foobarian 3y agoNot to mention you had a running program milliseconds after Ctrl-F9. I get modern apps require so much more stuff to run but I still miss that zippy experience.
- wiz21c 3y ago+1 for the fast compile time. TurboPascal was not a marketing name, it was that fast, including my old 386 machine. But TBH, nowaday's compilers do so much more, I'll happily trade compile time for that !
- falker 3y agoPS4 emulator/compat layer in FP: https://github.com/red-prig/fpPS4 https://github.com/red-prig/fpPS4
- cdelsolar 3y agoNice mormot.
- lproven 3y ago"Thanks. I just had it stuffed."
- anta40 3y ago>> And... Pascal is still in the race for sure! And what about.. umm... Modula 2/3 or Oberon? They don't gain as much industry attractions as Pascal does, eh?
- mikewarot 3y agoWirth went too far with Modula, case sensitivity is a bug, not a feature. He became obsessed with purity, instead of usability. Anders Hejlsberg was the author of the best Pascal implementation, greatly enhancing Pascal until he was seduced by Microsoft and helped start the evil that is .NET and C#. Delphi was great until Borland decided to abandon most of their user base and pursue the corporate market. Lazarus/Free pascal is really good, except for the abysmal documentation. The very lumpy approach to creating help actively prevents incremental improvements. There's no way to just fix one page of the help.
- Rochus 3y ago> case sensitivity is a bug, not a feature. Agree; that was the first thing I changed in https://oberon-lang.github.io/ https://oberon-lang.github.io/; besides the few academic oddities, original Oberon is a much better language than Pascal or Modula. > He became obsessed with purity, instead of usability There was definitely an academic bubble; for example, the claim that Oberon is a system language and can only be specified with 16 pages is demonstrably false, especially since there is a lot of code in the Oberon system that can only be implemented at all by means of (partially undocumented) backdoors to the language; unfortunately, these backdoors bypass the compiler's type checking. > Lazarus/Free pascal is really good, except for the abysmal documentation Unfortunately, the language is a huge, partly unspecified patchwork, where apparently all sorts of current fashionable constructs have been built in, partly even redundantly. The resulting complexity is hardly manageable with the present development approach.
- mikewarot 3y agoI never thought of Pascal as a systems programming language. I always considered the inline assembler as the hack to get around that limitation. (Just as it is in C) I am curious, what's the problem with redundancy? Having more than one way to do something doesn't seem particularly ominous to me. I'm sure you've got solid reasons.
- runlaszlorun 3y agoI def have a soft spot for Pascal. And I think Niklaus Wirth deserves more recognition in broader circles for his foundational work with pcode, compilers, Oberon, etc. I learned Pascal like many of us growing up in the early PC era and never could look at BASIC the same way again (or respect Gates for his love of it, lol). I think having such a highly structured language at a young age did wonders. But these days folks are mostly used to the C style syntax. And I'm not even arguing that it is a better language than C or others. But the whole industry has gone overall into believing that anything newly 'invented' is good and anything that's been around a while is passé. Ironically, at the same time as the core technologies we use are based on decades old tech like Unix, relational databases, TCP/IP, etc. And many others like Lisp and Smalltalk fell by the wayside at least partly due to performance issues that were made irrelevant by Moore's law long ago. Oh humans... :) Btw, Logo is another one that's under appreciated. Seymour Papert was brilliant in making programming more visual and intuitive for kids. And I didn't actually know until recently it's actually a Lisp based language with a lot of power. Who knew? In some parallel universe, I'd love to see folks like those, along with many others from that era, as the ones we heap recognition on instead of our worship of current tech billionaires. Those guys generally understood the hardware, software, and core theory. Given the mess that is computing and the internet, it's a shame that we'll be losing them over the next few decades.
- wolfi1 3y agoWirth's disdain for C++ leads sometimes to chuckles in the audience at public lectures("C with 2 plusses")
- squarefoot 3y agoAs an old Delphi user when it was strong back in the day I still like Pascal, although my dream is to see one day Lazarus swallow other more modern languages too, say Zig, Crystal or Nim.
- kagakuninja 3y agoI have lingering distain for Pascal, unlike other people here... In 1980 I was a freshman at UCSC, and the professors did not like C. So most classes used UCSD Pascal. While it apparently pioneered some cool ideas, it was not at all ready for industry use. The free function was just a suggestion, it didn't deallocate anything. Arrays were fixed size, and an array of size 80 was a different type than size 255 (and 255 was the maximum). I remember the compiler class where we built a compiler-compiler using Pascal. It was pretty cool that the professor came up with a design that worked, but also quite dumb as we had to pass around a bunch of 255 char arrays. And also insane that we couldn't use the industrial strength tools like C and yacc available on the VAX / UNIX computers... But what about Modulo-2? Well one professor would torture the class, making them use various not-C languages. One year it was PLZ (A PL/I based language created by Zilog Corporation). When I took the class, it was Modulo-2, using a compiler developed at CMU I think. It also implemented free() as a suggestion that did nothing, and had other warts. I was not impressed... I realize that it is unfair complaining about shitty academic implementations, but that's what I lived through.
- Simplicitas 3y agoIs it just me or does hearing "Zilog Corporation" not sound like it's straight out of the movie "Blade Runner"?
- kagakuninja 3y agoLol, I added corporation because I assumed the youngsters didn't know about it. After googling, I see they called themselves Zilog, Inc.
- ggm 3y agothe T(wo)LA of UC in UCSD/UCSC can't be entirely ignored. the p-system was very innovative, but ultimately got sidelined I think UC decided to self-host its teaching paradigm, well and good. If you'd gone to any other university without UC in its name you might not have had the p-System thrown at you so much. Obviously if you'd gone to UCB, things would have been radically different. The interesting thing to me is that San Diego hosts the supercomputer centre and so there was a sense the engineers there really live in Fortan, did, and do. (I was in the UK system at the same time as you, and my uni had Wirth on sabbatical for a year, during the ada/modula specification days. We all learned on Pascal on a Dec-10, unless you chose the other door and went LISP. I regret not going in the LISP door now, but hindsight is like that)
- swatcoder 3y ago“In the race” What a terrible habit we have of speaking about our tools like they’re in competition with each other! I don’t think I’ll ever meet a carpenter who talks about their hammer or even their manual crank drill being “still in yhe race”. Tools have contexts where they might be used. Sometimes one tool will supersede another for all the day’s tasks, but tomorrow’s tasks will be different in unknown ways and whatever distinguishes one tool from another may be just the right thing there. In programming languages, that might look like somebody setting aside a paradigm for a while because projects and architectures went a certain way, but then reviving that paradigm again when they go some other way. Pascal has some cool stuff to it. We should be curious about that stuff and keep it in mind as new contexts emerge; but it’s never been in a race and we really don’t do ourselves much good in talking about it that way.
- zem 3y agoprogramming languages (and some other categories of software used to create things) depend strongly on having an active user and developer base, because the range of things that people want to do with them keeps changing and growing. so in that sense there is a competition for mindshare, and languages that don't "keep up" get an increasingly large list of things that you can't use them for because no one has written the libraries, or the compiler backend, or the bindings, or whatever that you need to get your task done.
- swatcoder 3y agoSort of, but that’s less true than ever in an age of .net, java, and js/wasm runtimes that let you easily bridge between your project’s language and libraries written in other languages. Standing up an established language in one of these runtimes is an upper division college level project. If you strongly felt that Algol was the clearest or most inspiring way to express your project, it’s not nearly so out of reach as it was a few decades ago. That’s exactly why we’ve had this cambrian explosion of new and revived languages lately.
- bluGill 3y ago
- supportengineer 3y ago“Usually, at our age, we should be managers, not developers.” There’s a lot of assumptions and bias in here.
- bluGill 3y agoI'd prefer to be a senior staff engineer, or whatever they call the technical leaders. The pay isn't quite as good as upper management, but it is equal to regular management and I get to do technical things. I just have to be careful not to direct others to make a big unmaintainable mess.
- galangalalgol 3y agoYeah ageism wasn't always part of our profession. It was probably a side effect of rapid progress combined with the desire for wage suppression. It has let us move faster as old bad ideas lose their champions faster, but we then lose all the old good ideas too. Not every developer should turn into a manager. We don't need that many managers, and good managers are more rare than good developers in my experience. Having a stereotype that old developers that aren't rich yet must be bad developers comes and goes as the bubbles form and burst. If you develop in a domain where developers need lots of on the job expertise before being productive, or in embedded or game development where a big part of TC is job enjoyment, then that stereotype is already stale and career staff developers can regularly be geniuses.
- bluGill 3y agoOn the other hand people smart enough to be engineers are smart enough to be in management so if that is your interest the world has a lot of people who for whatever reason can't won't do management. While managing other engineers is a way in, once you are in management you can do run a factory or a construction site and those often are places where workers cannot break into management.
- galangalalgol 3y ago
- sinuhe69 3y agoI programmed in Delphi since version 1 (before that of course Turbo Pascal) and I loved the system, a lot. The entire system is snappy, easy to use and beautifully designed. It was ways ahead of its time. Recently, I came back to a pet project: genetic algorithms. I wrote a library for it with polymorphism, generics and some other (actually not so complicated) stuffs in FPC/Lazarus and then I must notice that my productivity suffered quite significantly compared to other languages like Python and F#. The thing is, on the first glance, everything is fine but going into the details, many small issues turnout to be big blockers. For example, FPC introduced constref modifier for parameters. But if you declared as const instead, the compiler will still gives green light. But when running, the result is different in an inexplicable manner. Then there is a very subtle difference between a local procedure/function and a global one using as a comparer. Program compiled just fine without any hint or warning but the result is inexplicably wrong and causes a great deal of debugging effort. That was the case with generic objects list and sorting. Then there is obviously the problem with documentation and the excessive use of overloading and type alias in many libraries. For examples, TFixedPoint and TPoint in the Graphics32 library are totally different, but unfortunately assignment compatible. Thus without good documentation, one can mistakenly pass the parameters for one function for the other and the compiler can not detect it, ultimately defies the purpose of a strong static typing system. Not to mention the (not so small) quality issues with the tooling like the internal debugger crash or (sometimes) missing of declaration informations inside the editor. All in all, I feel the Delphi/FP language is getting old and freight with many technical debts. Trying to introduce new concepts while keeping backward compatibility can make a programming language/system so bloat and hulking that maintain quality can hardly be achieved. It still serves the purpose but it requires IMO an urgent revamp.
- lproven 3y ago> freight with many technical debts "Freight" is a noun, not a verb. I can't guess the word you meant. "Freighted"? (Weighed down.) "Fraught"? (Troubled by.) The sad thing is that Pascal continued to evolve, but TP codified and fossilised it and that seems to be becoming a problem now. Pascal evolved into Modula, which fairly soon became Modula-2 which is still around and enjoyed a moment in the sun. (Modula-3 was someone else.) Modula-2 evolved into Oberon, which is also still around. Oberon evolved into Oberon 2, then was rebooted with Oberon 07, but which also led on to Active Oberon and Zennon. Oberon+ is an attempt to re-unify them. https://oberon-lang.github.io/ https://oberon-lang.github.io/
- ursuscamp 3y agoEvery time I've tried to use Pascal (with Lazarus/FPC) I find myself incredibly confused as to the proper way to download and version packages. Separate project? Using Lazarus package manager? Git submodule?
- Tommstein 3y agoIt's really not, unless we define "in the race" as "still technically exists." It will be displacing absolutely nothing.
- ibobev 3y agoI miss the ease with which you put some graphics on the screen via the Borland Graphics Interface library for Turbo Pascal. :)
- livrem 3y agoI think that is what Free Pascal's backwards compatible graph unit is implementing? Sad to see it is deprecated, but maybe it still works? I could not use it for porting my ancient Turbo Pascal 2.0 game since it was relying on an older, CGA-only, graphics library that had a different API. https://www.freepascal.org/docs-html/rtl/graph/index.html https://www.freepascal.org/docs-html/rtl/graph/index.html
- nilslindemann 3y agoAs someone who has never seen Pascal, I have to say, the code example is not very readable. But that is not because of the syntax, which is nice, but because of the terrible variable names.
- kazinator 3y agoPascal is an abandoned prototype for Modula-2 and Oberon.
- rurban 3y agoModula-2 and Oberon are abandoned dialects of Pascal. I just wish Concurrent Pascal would have survived. As the only properly safe system language.
- pjmlp 3y agoGCC just integrated Modula-2 into their compilers in the box offering. A bit of Oberon survives in Go, which is probably the only reason I somehow like the language, despite their design decisions, which I must admit are still less draconian than Oberon-07.
- kazinator 3y agoMy point is more that Pascal was abandoned by its author, which happened while it was still widely used. (Or that was the external perception. In the Oberon project, sure, they may have had a Pascal front end for all their own old code to work.) Wirth made a mistake by fragmenting his language development over similar, but incompatible languages under different names. When we look at C, the story is different. ANSI C was carefully designed to be backward compatible with K&R C. C99 didn't break too much in C90: test cases to demonstrate incompatibility have to be contrived. The name of the language didn't change. Simply not changing the name is a powerful social tactic. People overlook differences when the name has not changed. (Look at how Lisp outsiders think that Lisp is all the same.) Modern Fortran is very different from Fortran 66 or 77. Because the name is the same, the "Frankenfortran" is accepted in the same circles (e.g. scientific computing). Had the name changed, that would be unlikely. I can't escape the suspicion that Wirth should have continued to use the Pascal name for that entire succession of languages.
- oaiey 3y agoC# using config files? If you want (and use the default template). Otherwise (and minimal apis) the code looks closer to the go model. Argh, I am to trigger happy.
- rurban 3y agoAs anecdote, my new older co-worker started his new embedded camera project also with Lazarus. A fast safe language, much easier and safer than C. Even SIMD tricks and OpenCV are possible for higher frame rates.
- lproven 3y agoLazarus is the IDE for FPC, the FreePascal Compiler, as I understand it. Lazarus itself isn't a language.
- livrem 3y agoWhat Free Pascal seems to do amazingly well is platform-support and backwards compatibility. I think it may be worth considering for some of my future hobby projects for that reason alone, assuming that there will remain some critical mass of developers around to keep the compiler working and that they do not start rolling out new incompatible versions all the time like what has become the norm for popular programming languages. Official list of supported platforms from freepascal.org: "Intel x86 (16 and 32 bit), AMD64/x86-64, PowerPC, PowerPC64, SPARC, SPARC64, ARM, AArch64, MIPS, Motorola 68k, AVR, and the JVM. Supported operating systems include Windows (16/32/64 bit, CE, and native NT), Linux, Mac OS X/iOS/iPhoneSimulator/Darwin, FreeBSD and other BSD flavors, DOS (16 bit, or 32 bit DPMI), OS/2, AIX, Android, Haiku, Nintendo GBA/DS/Wii, AmigaOS, MorphOS, AROS, Atari TOS, and various embedded platforms. Additionally, support for RISC-V (32/64), Xtensa, and Z80 architectures, and for the LLVM compiler infrastructure is available in the development version. Additionally, the Free Pascal team maintains a transpiler for pascal to Javascript called pas2js."
- zubairq 3y agoAlways loved pascal and always will. It was one of my first introductions to "Structured Programming"
- timbit42 3y agoHave you tried Modula-2, which fixed most of Pascal's problems although created a few other problems? How about Ada or Oberon, both much better than Pascal or Modula-2?