News for hackers. Stuff that matters.
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @05:52AM (#35725671)
Seems abandoned. But Lazarus is doing well, although I doubt there are many Pascal users.

There was a time when Pascal was almost as popular as C. In school we learned Pascal after learning Basic and before learning C. I think in US the East coast preferred Pascal and the West coast preferred C.

Re:GNU Pascal Compiler by actionfromafar on Thursday April 27, 2023 @06:05AM (#35725775)
I preferred C and Pascal looked like a toy language, in retrospect I feel a little guilty. Pascal is a bit like the Go of the time.
Re:GNU Pascal Compiler by galangalalgol on Thursday April 27, 2023 @06:14AM (#35725848)
I feel the same. I had learned c and x86 asm before they taught pascal, and I was annoyed that I was abstracted from absolute control of the hardware even a little. There was no internet, and all the bbs were long distance, so I had focused on diving into the low level details of a computer andnit didn't expose them as well. Like you, in retrospect I like a lot of aspects of the language.
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @06:31AM (#35725981)
These are exactly my thoughts. Maybe Pascal should have been given a bit more attention. While I preferred C (it seemed more "pro" and advanced) and then C++, many of my school mates preferred Pascal and then Delphi.
Re:GNU Pascal Compiler by ZoomZoomZoom on Thursday April 27, 2023 @08:05AM (#35726792)
I'm interested what are the roots of this common "toy language" perception?

Is it the association with learning to program and for this reason with kids?

Or is it just the syntax that makes more sense to uninitiated, and thus less like some secret knowledge passed only to the worthy?

Re:GNU Pascal Compiler by Tozen on Thursday April 27, 2023 @08:36AM (#35727101)
A good argument can be made that it comes from the machinations of Bell Labs (AT&T) and their promotion of C (and later C++). Debatably, a concerted effort was made to attack and belittle Pascal in the media, to get it out of the way. Many people seem to refer to Pascal with a very odd hostility or regurgitate talking points originating from Bell Labs, and as if the language froze in time and stayed the same as it was in the 1970s.
Re:GNU Pascal Compiler by rob74 on Thursday April 27, 2023 @08:46AM (#35727211)
Well, a language that's friendly to newbies will also be used by newbies (also leading to some projects or code that are maybe not that good), so more advanced developers (or those who consider themselves more advanced) will have a tendency to turn their nose up. Something similar is currently going on with Rust vs. Go I suspect...
Re:GNU Pascal Compiler by actionfromafar on Thursday April 27, 2023 @09:22AM (#35727697)
To me it was a lot that it was so wordy and had weird syntax. Semicolon as a separator instead of "end of this line or statement" felt just insane to someone who just had understood (not really, even) how an assembler worked.

I think if it had more C like syntax and was sold as "C, but hardly any footguns", I would have liked it much better. I don't even know what was Pascal and what was Borland stuff, but I remember that I was reluctantly very impressed with its "module" system or whatever it had instead of .obj and .h files.

Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @04:22PM (#35734009)
Just that Go has 10x developers and projects that Rust has. And most Go projects are commercially supported while Rust projects are mostly done for free projects in the line of "let's rewrite X in Rust".

If you follow the money, there's where the developers are. And where the developers are, there is the success of a programming language.

If it ever was a Rust vs Go contest, Go already won and by a big margin.

I can't explain it very good, but I feel like a lot of weird people enjoy Rust and Scala for all the wrong reasons. It's like they enjoy the pain and want that pain to be inflicted to others so they push for those languages.

Re:GNU Pascal Compiler by actionfromafar on Friday April 28, 2023 @03:13AM (#35738421)
I agree with your premise, not your conclusion. I have resigned to rust eating the software world. It's not backed by anything, yet it creeps in everywhere.

You can stop it, but it's hard work and if you ever has as much as a hairline crack in the Porcelaine, Rust will get there, eventually.

Re:GNU Pascal Compiler by bluetomcat on Thursday April 27, 2023 @06:16AM (#35725861)
Pascal was the more restrictive and more verbose language, whereas C had more expressivity and terseness. Most of what could be written in C, could be written in Pascal, minus the hacky stuff.
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @06:36AM (#35726020)
I was blown away when a colleague of mine wrote a little Pascal program which rebooted the computer in the lab. He wrote something at some memory address or port and the computer was running DOS.
Re:GNU Pascal Compiler by susam on Thursday April 27, 2023 @06:51AM (#35726135)
Do you mean something like this? https://github.com/susam/reboot
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @07:03AM (#35726230)
Probably.
Re:GNU Pascal Compiler by mickeyp on Thursday April 27, 2023 @06:20AM (#35725899)
Restrictive how? You had full pointer control in pascal and could drop to assembly with the `asm' statement.
Re:GNU Pascal Compiler by bluetomcat on Thursday April 27, 2023 @06:40AM (#35726048)
Pascal pointers are different animals. Since it is a strongly-typed language, juggling between ints and pointers or between pointers of different types is not allowed. Pointer arithmetic on a byte basis is also not straightforward.
Re:GNU Pascal Compiler by mickeyp on Thursday April 27, 2023 @07:54AM (#35726683)
That's... not true? You have `Pointer' for generic pointers and you can use `^' to indicate any type should be pointer based. You can then use Inc() or plain addressing plus arithmetic. And you can use `^' again on the right-hand side to dereference it.

And you can certainly juggle between different types. You can cast things in Pascal.

Re:GNU Pascal Compiler by jhbadger on Thursday April 27, 2023 @08:08AM (#35726824)
Pascal was a lot like BASIC in that every version added their own (often incompatible) stuff because the official standard language was so limited. Certainly you couldn't drop down to assembly in standard Pascal -- that sounds like something Turbo Pascal added and may be present in modern versions because of the popularity of that.
Re:GNU Pascal Compiler by hnlmorg on Thursday April 27, 2023 @08:48AM (#35727222)
It’s less to do with limitations of the language and more to do with variations in compilers (each vendor wanting to add their own flair to sell their compiler) and a lack of standards.

You saw the same with C and C++ before they were standardised.

Re:GNU Pascal Compiler by hnlmorg on Thursday April 27, 2023 @08:45AM (#35727200)
That’s a good thing.

I do like C but there’s no denying that it makes it ridiculously easy to fuck up. Whereas Pascal enforces correctness. Some view that as annoying verbosity but you can’t please all the people all the time.

Re:GNU Pascal Compiler by wiz21c on Thursday April 27, 2023 @06:38AM (#35726029)
dropping assembly was the killer feature for me. It allowed to migrate gradually from a very easy to understand language to more performance code, without having to understand what a linker does.
Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @06:27AM (#35725945)
Only the ISO Pascal first edition, that barely anyone used outside of a teaching context, it initial purpose anyway.

Also why Modula-2 exists since 1978.

Re:GNU Pascal Compiler by rvense on Thursday April 27, 2023 @08:03AM (#35726774)
The next major release of GCC will have a Modula-2 frontend. I look forward to trying that out.

edit - Apparently it was released yesterday?

Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @08:33AM (#35727067)
Yeah, now it only needs a VSCode plugin that does auto-formating (no need to explicitly type keywords in uppercase), and maybe some package management of sorts.
Re:GNU Pascal Compiler by ghaering on Thursday April 27, 2023 @08:27AM (#35727008)
I have very fond memories of Modula-2. I hacked a lot of cool stuff with it (also with inline assembler) as a teenager. When I eventually switched to C and C++ because I was curious about learning, the overall experience was much worse due to the build system and much slower compile times. We were talking orders of magnitude here.
Re:GNU Pascal Compiler by ihatepython on Thursday April 27, 2023 @06:26AM (#35725937)
Pascal was popular in San Diego, and the early days of Apple iirc
Re:GNU Pascal Compiler by jhbadger on Thursday April 27, 2023 @08:01AM (#35726750)
Yes, the UCSD p-system virtual machine -- basically the same idea as the JVM and .NET but decades earlier -- compile to a virtual machine and deploy to anywhere you had the VM deployed. It was the basis of the Apple Pascal system which was basically an operating system onto itself (on the Apple II, it was used most famously for the early dungeon crawler Wizardry)

https://en.wikipedia.org/wiki/UCSD_Pascal

Re:GNU Pascal Compiler by acegopher on Thursday April 27, 2023 @08:07AM (#35726810)
And was what the Apple Lisa OS was programmed in.

https://computerhistory.org/press-releases/chm-makes-apple-l...

Re:GNU Pascal Compiler by TomMasz on Thursday April 27, 2023 @10:28AM (#35728662)
My learning history is similar to yours Basic->Pascal->C. I feel it was a lot easier learning C by already knowing Pascal than it would have been coming directly from Basic.
Re:GNU Pascal Compiler by glonq on Thursday April 27, 2023 @05:21PM (#35734779)
A million years ago I learned pascal in highschool then modula-2 in college. But once I learned C/C++, there was no going back...