14 points carteragecat 4 hours ago 4 comments

jqpabc123 3 hours ago | parent

Pascal is all about minimizing compile time. This was not an accident --- Niklaus Wirth designed it this way.

In other words, Pascal is more focused on compilation speed rather than on runtime speed. This may have made sense in a bygone era where PCs where slow and single core.

This is not to say that the runtime speed of today's Pascal code is "bad" --- it is "good enough" for a lot of uses but it typically lags somewhat behind the best available.

This is enough to exclude it from consideration for things like OS development or network/web services where speed (or the lack thereof) tends to get carried forward and inflict additional, cumulative costs.

And this is not to say that it must remain this way --- but it's history and momentum has worked to exclude much effort to change it. To the point where today, not many developers focused on performance would reach for a Pascal compiler. This has a carry on effect and will need to change in order for the language to grasp more development mindshare.

vintagedave 1 hour ago | parent

Talk author here, hi! Yes, the original compilers were single-pass and very fast. And that does limit optimisations.

In the talk I discuss things other languages are doing, including inbuilt SIMD types, where I think runtime speed can be a language design goal. And the Pascal compiler I work on, Oxygene, has had a bunch of runtime performance recently - some via a third party math library, but some via LLVM including even custom passes we built. At the same conference I gave the above talk at, I also gave a talk on optimisation techniques using a Delphi app (a raytracer), ie, very practical, let's spend an hour optimising this code, and at the end I recompile the Delphi VCL app in Oxygene and it's about 2.5x faster. That's on ARM. Other tests have seen much bigger on x64 or x32.

I figure performance is like any other industry problem: you can choose which you focus on, not all languages solve everything, but ultimately your language has to have a solution.

jdswain 21 minutes ago | parent

I've got a long-term project of building an Oberon compiler. Oberon is a language in the Pascal family, the newest language from Wirth, and an attempt to remove any unnecessary features from his languages, indeed he went a little too far in some early versions of Oberon and restored a feature or two in successive versions.

Mostly I've learnt a lot from building a compiler, in particular the back-end which I didn't have much experience with. But also I've started using Oberon more and more. My compiler targets the 65C816 processor, but I ended up porting the front-end to LLVM so that I had native oberon, and used it to build a number of tools, an emulator, and actually the compiler (there was a C intermediate step).

In the end I've started to really like Oberon, and I don't miss much from more modern languages. I did add some extensions so I have a very simple form of object-orientation, and used it to implement a UI toolkit similar to AppKit, but much simpler. Some of the modern language features add more complexity than they give in benefits. And sometimes it's just better to write code than learn a new language feature or library.

Plus it's a very readable language.