TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Modern Pascal is still in the race (2022)

181 点作者 open-source-ux超过 1 年前

25 条评论

runlaszlorun超过 1 年前
I 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.<p>But these days folks are mostly used to the C style syntax. And I&#x27;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 &#x27;invented&#x27; is good and anything that&#x27;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&#x2F;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&#x27;s law long ago.<p>Oh humans... :)<p>Btw, Logo is another one that&#x27;s under appreciated. Seymour Papert was brilliant in making programming more visual and intuitive for kids. And I didn&#x27;t actually know until recently it&#x27;s actually a Lisp based language with a lot of power. Who knew?<p>In some parallel universe, I&#x27;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&#x27;s a shame that we&#x27;ll be losing them over the next few decades.
评论 #37846355 未加载
评论 #37846590 未加载
评论 #37846924 未加载
评论 #37846268 未加载
评论 #37851457 未加载
评论 #37847157 未加载
评论 #37851478 未加载
评论 #37848610 未加载
jchw超过 1 年前
Hmm meh. I have a soft spot for Delphi&#x2F;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&#x27;t tell us <i>that</i> much. Specifically, it doesn&#x27;t tell us very much about programming languages.<p>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.<p>Blow for blow, though, I&#x27;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&#x27;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.)<p>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&#x2F;LCL doesn&#x27;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&#x27;s not that Go is especially good, in fact I&#x27;d argue its claim to fame and namesake (the concurrency model) just wound up being kind of ... bad. But, now that it&#x27;s here and popular, there&#x27;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.<p>And that really is a shame, because it isn&#x27;t really a reflection of Object Pascal being unfit for modern software development.
评论 #37846173 未加载
评论 #37846569 未加载
评论 #37845209 未加载
评论 #37845577 未加载
Svip超过 1 年前
This article reads more like an ad for mORMot 2 than Pascal. I&#x27;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.<p>The article basically compare their CSV&#x2F;JSON serialising library to Go&#x27;s standard CSV&#x2F;JSON libraries. Looking at the Go code, it&#x27;s pretty clear why it has memory issues, it reads <i>all</i> the lines into a single object (well, `[][]string`) immediately, rather than reading line for line (which takes advantage of the stream).<p>I am not sure how this is remarkable and impressive for Pascal. They talk about how you don&#x27;t need to use the `try..finally..Free` routine all the time, but that&#x27;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.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;synopse&#x2F;mORMot2">https:&#x2F;&#x2F;github.com&#x2F;synopse&#x2F;mORMot2</a>
kagakuninja超过 1 年前
I have lingering distain for Pascal, unlike other people here...<p>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&#x27;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).<p>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&#x27;t use the industrial strength tools like C and yacc available on the VAX &#x2F; UNIX computers...<p>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&#x2F;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...<p>I realize that it is unfair complaining about shitty academic implementations, but that&#x27;s what I lived through.
评论 #37852332 未加载
评论 #37847120 未加载
评论 #37854716 未加载
评论 #37854817 未加载
dbsmith83超过 1 年前
I used Delphi in the 90&#x27;s and early 00&#x27;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&#x27;t the same level of stack overflow questions&#x2F;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.
swatcoder超过 1 年前
“In the race”<p>What a terrible habit we have of speaking about our tools like they’re in competition with each other!<p>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”.<p>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.<p>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.<p>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.
评论 #37848870 未加载
评论 #37854724 未加载
sinuhe69超过 1 年前
I 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.<p>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&#x2F;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.<p>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&#x2F;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.<p>All in all, I feel the Delphi&#x2F;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&#x2F;system so bloat and hulking that maintain quality can hardly be achieved. It still serves the purpose but it requires IMO an urgent revamp.
评论 #37855721 未加载
supportengineer超过 1 年前
“Usually, at our age, we should be managers, not developers.”<p>There’s a lot of assumptions and bias in here.
评论 #37850261 未加载
soliton4超过 1 年前
pascal 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.
评论 #37845710 未加载
anta40超过 1 年前
&gt;&gt; And... Pascal is still in the race for sure!<p>And what about.. umm... Modula 2&#x2F;3 or Oberon? They don&#x27;t gain as much industry attractions as Pascal does, eh?
评论 #37846637 未加载
ibobev超过 1 年前
I miss the ease with which you put some graphics on the screen via the Borland Graphics Interface library for Turbo Pascal. :)
评论 #37854867 未加载
squarefoot超过 1 年前
As 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.
livrem超过 1 年前
What 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.<p>Official list of supported platforms from freepascal.org: &quot;Intel x86 (16 and 32 bit), AMD64&#x2F;x86-64, PowerPC, PowerPC64, SPARC, SPARC64, ARM, AArch64, MIPS, Motorola 68k, AVR, and the JVM. Supported operating systems include Windows (16&#x2F;32&#x2F;64 bit, CE, and native NT), Linux, Mac OS X&#x2F;iOS&#x2F;iPhoneSimulator&#x2F;Darwin, FreeBSD and other BSD flavors, DOS (16 bit, or 32 bit DPMI), OS&#x2F;2, AIX, Android, Haiku, Nintendo GBA&#x2F;DS&#x2F;Wii, AmigaOS, MorphOS, AROS, Atari TOS, and various embedded platforms. Additionally, support for RISC-V (32&#x2F;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.&quot;
zwnow超过 1 年前
Having to write C&#x2F;AL to make a living, which is based on Pascal, I can safely say it shouldnt be in the race anymore...
评论 #37844716 未加载
评论 #37849223 未加载
rurban超过 1 年前
As 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.
评论 #37855732 未加载
ursuscamp超过 1 年前
Every time I&#x27;ve tried to use Pascal (with Lazarus&#x2F;FPC) I find myself incredibly confused as to the proper way to download and version packages. Separate project? Using Lazarus package manager? Git submodule?
falker超过 1 年前
PS4 emulator&#x2F;compat layer in FP: <a href="https:&#x2F;&#x2F;github.com&#x2F;red-prig&#x2F;fpPS4">https:&#x2F;&#x2F;github.com&#x2F;red-prig&#x2F;fpPS4</a>
zubairq超过 1 年前
Always loved pascal and always will. It was one of my first introductions to &quot;Structured Programming&quot;
评论 #37872382 未加载
nilslindemann超过 1 年前
As 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.
davidw超过 1 年前
If you have to loudly proclaim you&#x27;re still important...
kazinator超过 1 年前
Pascal is an abandoned prototype for Modula-2 and Oberon.
评论 #37854291 未加载
oaiey超过 1 年前
C# using config files? If you want (and use the default template). Otherwise (and minimal apis) the code looks closer to the go model.<p>Argh, I am to trigger happy.
Tommstein超过 1 年前
It&#x27;s really not, unless we define &quot;in the race&quot; as &quot;still technically exists.&quot; It will be displacing absolutely nothing.
cdelsolar超过 1 年前
Nice mormot.
评论 #37855754 未加载
b800h超过 1 年前
I hope this isn&#x27;t hosted on Pascal. Got a 502.
评论 #37845181 未加载