News for hackers. Stuff that matters.
Re:GNU Pascal Compiler by blindseer on Thursday April 27, 2023 @06:20AM (#35725893)
Having had to work in a large pascal codebase, I don't ever want to use this language again.

No metaprogramming in the language meant we had some parts of the code that were written in pascal to generate pascal code before compilation of the main project.

The code was so verbose, and to get the same thing done in alternative languages would have easily been twice as shorter.

Refactoring always took twice as long as I thought it would. Just moving semicolons around was enough to break my concentration when I was in the flow.

I think the kicker was identifiers being case insensitive. That alone would have been enough to drive me crazy. People complain about Nim's case insensitive features a lot, but Nim's implementation is actually good and orders of magnitude better than Pascal's.

Also hiring a good pascal programmer was next to impossible for us at the time.

I don't know why anyone would pick Pascal today over Nim, Zig, Rust, Julia, Go etc.

Re:GNU Pascal Compiler by stefanos82 on Thursday April 27, 2023 @06:39AM (#35726038)
> No metaprogramming in the language meant we had some parts of the code that were written in pascal to generate pascal code before compilation of the main project.

Weird...if you are talking about Generics, FreePascal has them and work just fine, plus it compiles instantly!

Here's a demo:

    program UseGenerics;

    {$mode objfpc}{$H+}

    type
        generic TFakeClass<_GT> = class
            class function gmax(a,b: _GT): _GT;
        end;

        TFakeClassInt = specialize TFakeClass<integer>;
        TFakeClassDouble = specialize TFakeClass<double>;

        class function TFakeClass.gmax(a,b: _GT): _GT;
        begin
            if a > b then
                result := a
            else
                result := b;
        end;

    begin
        { show max of two integers }
        writeln('Integer GMax: ', TFakeClassInt.gmax(23, 56));
        { show max of two doubles }
        writeln('Double GMax: ', TFakeClassDouble.gmax(23.89, 56.5));
    end.
Re:GNU Pascal Compiler by dannymi on Thursday April 27, 2023 @07:03AM (#35726239)
Yes, but this example of matrix multiplication does weird stuff:

    {$MODE DELPHI}
    {$modeswitch advancedrecords}
    type
      TMatrix<T, R, C> = record
        fCoordinates: array[R, C] of Double;
      end;
    function mul<T, R, X, C>(A: TMatrix<T, R, X>; B: TMatrix<T, X, C>): TMatrix<T, R, C>;
    var
      i: R;
      j: X;
      k: C;
    begin
      Writeln('yep');
      Writeln(High(R)); // 3
      Writeln(High(X)); // 4
      Writeln(High(C)); // 3
      for i := Low(R) to High(R) do
        for k := Low(C) to High(C) do begin
          Result.fCoordinates[i, k] := 0;
          for j := Low(X) to High(X) do
            Result.fCoordinates[i, k] += A.fCoordinates[i, j] * B.fCoordinates[j, k]
        end
    end;
    type
      R1 = 1..3;
      R2 = 1..4;
    var
      A: TMatrix<Double, R1, R2>;
      B: TMatrix<Double, R1, R1>;
      C: TMatrix<Double, R2, R1>;
    begin
      mul<Double, R1, R2, R1>(A,B); // should fail because B would have to have as many rows as A has columns--and it doesn't.
      mul(A,C) // does not work even with a right-size C--even though it should
    end.
Re:GNU Pascal Compiler by badsectoracula on Thursday April 27, 2023 @09:56AM (#35728163)
The second bit is because you lack the explicit specialization - you must always tell the compiler how to specialize a generic. Personally i prefer to use generics in objfpc mode as you are more explicit that way. However FPC trunk can allow implicit function specialization if you request it with {$modeswitch implicitfunctionspecialization}. Your code compiles with that.

The first bit is an interesting case and i wonder why it happens. It seems the root cause is that it considers the two type specializations equivalent as even ignoring the generic functions something like "A:=B" is allowed. I trimmed the code down to this:

    {$MODE DELPHI}
    type
      TMatrix<R, C> = record
        X: array[R, C] of Double;
      end;
    type
      R1 = 1..3;
      R2 = 1..4;
    var
      A: TMatrix<R1, R2>;
      B: TMatrix<R1, R1>;
    begin
      A:=B;
    end.
This is clearly a bug and not intentional behavior as doing the specialization by hand shows an error as expected. Also it seems related to multidimensional arrays as with a single element it also shows an error. Note that the other way (B:=A) doesn't work, so my guess is that at some point the type compatibility comparison only checks if assigning one array would fit memory-wise into the other.

I'll check against latest trunk later and if it happens i'll file a bug report.

Re:GNU Pascal Compiler by dannymi on Thursday April 27, 2023 @03:15PM (#35733173)
Thank you!

I also tried

    {$R+}
    type
      R1 = 1..3;
      R2 = 1..4;
    var
      a: R1;
      b: R2;
    begin
      b := 4;
      a := b;
      Writeln(a)
    end.
... and that only gives me a runtime error. So maybe those types count as equal anyway?
Re:GNU Pascal Compiler by badsectoracula on Thursday April 27, 2023 @03:36PM (#35733437)
The types themselves count as assignable since the values can be compatible and unless the compiler can tell statically a value is out of range it wont complain at compile time (but will at runtime if range checking is enabled).

However using the ranges for arrays is not compatible, if you have a A: array [R1] of Double and a B: array [R2] of Double you can't assign one to the other.

Re:GNU Pascal Compiler by codr7 on Thursday April 27, 2023 @07:31AM (#35726469)
Generics are a very recent addition, though.
Re:GNU Pascal Compiler by badsectoracula on Thursday April 27, 2023 @09:39AM (#35727957)
Free Pascal had support for generics since 2006, predating even Delphi's. While that isn't as long as Wirth's Pascal, it still is almost two decades old which i wouldn't call that recent.
Re:GNU Pascal Compiler by dragonwriter on Thursday April 27, 2023 @01:03PM (#35731169)
> > No metaprogramming in the language meant we had some parts of the code that were written in pascal to generate pascal code before compilation of the main project.

> Weird…if you are talking about Generics

But aren’t they very clearly talking about metaprogramming, which is a completely different thing than generics?

Re:GNU Pascal Compiler by signaru on Thursday April 27, 2023 @06:34AM (#35726003)
Lazarus is a compelling reason to pick Pascal. But I share your pain and had been looking alternatives for machine-code-compiled RAD GUIs. To add, only modern Delphi has var declarations that can be placed elsewhere other than the top of the function.
Re:GNU Pascal Compiler by Tozen on Thursday April 27, 2023 @07:53AM (#35726678)
Actually, the PascalABC dialect[1][2] supports using variables in that way too. However, I've seen arguments that allowing variable declarations anywhere tends to lead to sloppier coding and unnecessary errors, so Free Pascal/Lazarus has not followed that trend. It also appears that Delphi/Embarcadero may have went in that direction to synchronize their C++Builder and Delphi products, to make it easier to jump between them.

1. https://pascalabc.net/en/ (PascalABC) 2. https://github.com/pascalabcnet/pascalabcnet (PascalABC GitHub)

Re:GNU Pascal Compiler by signaru on Thursday April 27, 2023 @08:48AM (#35727224)
PascalABC seems to only target dot NET though.
Re:GNU Pascal Compiler by dom96 on Thursday April 27, 2023 @06:38AM (#35726030)
> People complain about Nim's case insensitive features a lot, but Nim's implementation is actually good and orders of magnitude better than Pascal's.

Can you elaborate on this? In what ways specifically is it better?

Re:GNU Pascal Compiler by freilanzer on Thursday April 27, 2023 @06:32AM (#35725987)
Go also lacks metaprogramming, right?
Re:GNU Pascal Compiler by tgv on Thursday April 27, 2023 @06:37AM (#35726027)
Yes, but there is decent support for code generation. E.g., you can easily get the syntax tree of a go program.
Re:GNU Pascal Compiler by speed_spread on Thursday April 27, 2023 @07:10AM (#35726283)
Maybe the tools aren't there but there's no reason you couldn't parse Pascal the same way. It's not a complicated language.
Re:GNU Pascal Compiler by badsectoracula on Thursday April 27, 2023 @10:15AM (#35728416)
FWIW Free Pascal's FCL has the fcl-passrc package that provides units for scanning FPC code, building syntax trees, resolving identifier references and writing/formatting source code.

Free Pascal comes with pas2js which "transpiles" Free Pascal code to Java Script and is written using fcl-passrc so it should have enough functionality to parse most FPC code.

Re:GNU Pascal Compiler by tgv on Thursday April 27, 2023 @01:40PM (#35731772)
Go neither, but parsing and AST are in the standard library, and code generation is in the standard build process. All it requires is an (ugly) comment line in your source code. So you've got decent and standard tooling. No make magic required.
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @06:33AM (#35725992)
> Having had to work in a large pascal codebase, I don't ever want to use this language again.

Maybe Pascal isn't good for large code bases, but the same is true for Python, too. And nobody hates Python.

Re:GNU Pascal Compiler by pavlov on Thursday April 27, 2023 @06:40AM (#35726049)
I hate Python, and I've met others who feel the same. It's a language which had a reason to exist 25 years ago, but has since been surpassed in every way by other faster, more compatible languages that don't have such quirky syntax. So a lot like Pascal actually.
Re:GNU Pascal Compiler by bluetomcat on Thursday April 27, 2023 @06:59AM (#35726206)
Python has become the lowest common denominator. It's a practical "no-frills" language that can be picked quickly by a sysadmin, a web developer, a scientist doing number-crunching or a kid automating their homework.
Re:GNU Pascal Compiler by pavlov on Thursday April 27, 2023 @07:17AM (#35726351)
The problem with the “no-frills” proposition is that it’s loaded with frills, complexities, and decades of tech debt. Just installing dependencies for a Python project can feel insurmountable.

IMO JavaScript should be the default for any Python use case. It has the same deceptive veneer of beginner-friendly dynamic behavior, same kinds of footguns; but at least JS has a single package manager, much faster optimized engines, and you’d have to learn it for front-end work anyway so it has long-term dividends.

Re:GNU Pascal Compiler by alex_suzuki on Thursday April 27, 2023 @08:48AM (#35727220)
One of things I really like about Python is the huge standard library. Contrary to JavaScript (which I think is a really weird recommendation), where you need to npm install half the world.
Re:GNU Pascal Compiler by nomdep on Thursday April 27, 2023 @09:13AM (#35727559)
It wouldn’t matter if those dependencies where stable, but JS has a culture of abandon libraries or to make backward-breaking changes every week, so upgrading a project after just a few months is a major pain
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:18PM (#35733217)
That's what I learned when I had to do front-end development using Angular: never upgrade packages.
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:17PM (#35733193)
And you never know if package Y required by package X will break the security of your app.
Re:GNU Pascal Compiler by BeetleB on Thursday April 27, 2023 @11:08AM (#35729287)
Having used both Python and JS, the only real benefit the latter has it may be faster.

The language has way too many gotchas. I wish they could shed all the legacy aspects to it. My experience with Python, along with many other folks, is that if we don't know something (API, syntax, etc), we often just guess it and it turns out to be right. Fairly intuitive.

Agree with the other commenter: Using pip + venv tends to solve the majority of packaging problems. In my career I deal with a Python dependency headache once every few years.

> and you’d have to learn it for front-end work anyway so it has long-term dividends.

Except when you don't do front-end work ;-)

Re:GNU Pascal Compiler by nephanth on Thursday April 27, 2023 @12:59PM (#35731100)
Poetry does a good job for package management
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:14PM (#35733167)
I've learned Javascript and a framework or two and I hate it with passion.

I patiently wait for the moment in which we can manipulate DOM from within Weabassembly. Meanwhile I shamelessly push for Blazor for front-end, wherever I can.

Re:GNU Pascal Compiler by nephanth on Thursday April 27, 2023 @12:57PM (#35731079)
Python is absolutely not a "no-frills" language. It is loaded with features, I'd be willing to bet that 99% of python programmers don't know all language features (even relatively old and frequently used ones like metaclasses) and that virtually nobody knows the whole stdlib
Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @02:18PM (#35732383)
Additionally if one cares about performance, knowing C or C++ is also a must.
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:19PM (#35733232)
When was the last decade someone cared about performance?
Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @03:23PM (#35733286)
Apparently everyone that writes native libraries to be called from Python, while calling them Python libraries.
Re:GNU Pascal Compiler by alex_suzuki on Thursday April 27, 2023 @07:00AM (#35726214)
I don’t understand how programming languages can get so much hate. If you don’t like it, don’t use it…
Re:GNU Pascal Compiler by gorjusborg on Thursday April 27, 2023 @07:22AM (#35726387)
I think this sentiment underestimates the amount of work people do on existing codebases.

The most reviled languages are often previously loved languages that made writing code easier at the cost of reading and understanding it.

Team 1 secretes reams of instant legacy code, but get money and promotions for shipping it. Team 42 gets handed a steaming pile of manure that is beyond understanding. They then pick up the pitchforks because it is obviously the language's fault.

So, yeah, it isn't the language so much as the average incentives and behaviors around development.

Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:21PM (#35733259)
> The most reviled languages are often previously loved languages that made writing code easier at the cost of reading and understanding it.

You claim someone actually loved Objective C or Perl? Or even Scala?

Re:GNU Pascal Compiler by musicale on Thursday April 27, 2023 @05:49PM (#35735052)
Hahah. I like Objective-C with ARC (in spite of its complexity and limitations), but Swift is more compact and I'm probably never going back (except maybe for hobby projects like writing something for GNUstep.)

I also like how Objective-C++ can mix in C++ code bases. It's an amazing chimera of a language.

Re:GNU Pascal Compiler by gorjusborg on Thursday April 27, 2023 @09:10PM (#35736432)
That's funny because to me, Perl, is the epitome of a fun write-only language!
Re:GNU Pascal Compiler by ihatepython on Thursday April 27, 2023 @11:19PM (#35737122)
> You claim someone actually loved Objective C

The problem with Objective C is that it requires skill. The average developer really is better off using a more remedial language like Swift.

Re:GNU Pascal Compiler by langfan on Friday April 28, 2023 @05:16AM (#35739127)
I'm sure at least their "parents" did.

$tongue in @cheek

Re:GNU Pascal Compiler by speed_spread on Thursday April 27, 2023 @07:08AM (#35726265)
Most professional programming is done in already existing code and new projects often have to respect existing standards. You rarely get to choose what language to use.
Re:GNU Pascal Compiler by supportlocal4h on Thursday April 27, 2023 @10:12AM (#35728356)
I was recently asked to recommend a language for a new team. My boss (who won't be writing or even reading any of the code) suggested Python. His reasoning: it's what the kids are learning in college these days.

So here I am as the team Senior, looking at current and future team members and deciding on whether to be selfish and choose what's good for me, or trying to figure out what makes something good for the team. Is it better to pick something with a large hiring pool? Is it better to pick something with fewer footguns? Is it better to pick something with higher performance? Is C# really ok if we need Mac support? Is Swift ok for one-off glue apps that run on Linux? Is Zig too young? If a team of five has a Java geek, a Rust zealot, a C# fan, and somebody who only knows Python, can we just agree to all learn and use Go? If I know my replacement will undo whatever I choose, does it really matter?

Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:27PM (#35733325)
The safe bet is C#, followed by Go. Swift, Rust, Zig, Python have their problems.

I love Zig and Nim but constantly pick C# or Go.

If time, money, support and performance are not an issue, you can pick anything but I guess someone of the above will always be an issue.

Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:22PM (#35733272)
Unless you rewrite it in Rust and link an article on HN.
Re:GNU Pascal Compiler by anon35 on Thursday April 27, 2023 @07:07AM (#35726260)
Surely you can appreciate that the language you're using isn't always your choice.
Re:GNU Pascal Compiler by alex_suzuki on Thursday April 27, 2023 @08:51AM (#35727264)
Yes, I do understand that, having programmed in business environments with legacy code for over a decade.

I've hated the poor decisions my predecessors had to make, the corners that were cut. I've hated that it's not maintained or documented. I've hated that it doesn't have tests.

Never have I hated the language.

Re:GNU Pascal Compiler by hughw on Thursday April 27, 2023 @09:31AM (#35727842)
And that sometimes, you make the wrong choice, and grow to hate that language.
Re:GNU Pascal Compiler by DeathArrow on Thursday April 27, 2023 @03:40PM (#35733496)
Not always, but the most languages I have used professionally were my choices.

That means x86, assembly, C, C++, C#, Python and half of Javascript. For Javascript I mean half because I enjoyed doing simple things in JS on front-end long time ago, but these days I kind of dislike JS frameworks and I've learned them because I had to after I signed some contracts. I could have stayed 100% with backend work, but now is too late to complain.

I managed to steer clear of Perl, Objective C, Cobol and other languages I don't enjoy. I managed to learn F# and some Ocaml which I would like to use but never got the chance (personal projects excluded).

Re:GNU Pascal Compiler by andrepd on Thursday April 27, 2023 @07:12AM (#35726300)
> but has since been surpassed in every way by other faster, more robust, more compatible languages that don't have such quirky syntax

Pray tell, which ones are those?

Re:GNU Pascal Compiler by supportlocal4h on Thursday April 27, 2023 @10:15AM (#35728424)
Excelscript
Re:GNU Pascal Compiler by BeetleB on Thursday April 27, 2023 @11:04AM (#35729216)
> It's a language which had a reason to exist 25 years ago, but has since been surpassed in every way by other faster, more robust, more compatible languages that don't have such quirky syntax.

The same could be said about C++, but yet, here we are. Stroustrop's quip comes to mind: "There are languages people complain about, and languages no one uses". Just look at how much people complain about JS.

I don't know how old people here are, but from the early 2000's till probably the mid 2010's, Python really was the great language, with few alternatives - at least when you consider the libraries available for it.

It's not an accident that people began using it heavily for numerical computing. The only viable alternative at the time was MATLAB.

Re:GNU Pascal Compiler by The_Colonel on Thursday April 27, 2023 @07:08AM (#35726266)
I don't hate it, but it's just mediocre. Python is fine for short scripting as long as you don't need dependencies (which still remains rocket science in Python world), at that point it's better to look elsewhere.
Re:GNU Pascal Compiler by rsyring on Thursday April 27, 2023 @07:15AM (#35726338)
Dependencies in Python have been sorted for years. Pip works great for install and pip-tools compile works great for locking. Please stop spreading this untruth.
Re:GNU Pascal Compiler by maleldil on Thursday April 27, 2023 @09:52AM (#35728112)
The existence of poetry, hatch, pdm, etc. (and lately rye) is proof that "just use pip-tools" isn't consensus.
Re:GNU Pascal Compiler by supportlocal4h on Thursday April 27, 2023 @10:22AM (#35728545)
It is a current truth that there are modern apps of interest to me written in Python that I can't install because I need some special dependency manager or environment manager or something and it looks like I will do serious harm to my system environment if I follow the installation instructions.
Re:GNU Pascal Compiler by maleldil on Friday April 28, 2023 @04:32AM (#35738907)
I'm not sure I understand you. If the project uses something "special" like poetry, hatch, pdm, etc., you only need to install those for development. If you simply want to use the project, they all should be installable directly with pip, as they all have pep517-compatible backends.

Even then, how can installing those tools harm your system? You can always use pipx and have each tool be installed in its own virtual environment.

Re:GNU Pascal Compiler by nrclark on Thursday April 27, 2023 @10:48AM (#35728977)
My biggest problem with pip-compile is that it's really slow. Pip-compile runs can take upwards of 20 minutes, depending on how many dependencies your project has.

We use it because we don't have any alternative. I'd really love to have a faster tool though.

Re:GNU Pascal Compiler by ihatepython on Thursday April 27, 2023 @07:09AM (#35726278)
Yeah, nobody hates Python
Re:GNU Pascal Compiler by codr7 on Thursday April 27, 2023 @07:32AM (#35726475)
Except for anyone who has worked in a large Python code base.

I would take almost any other language, including Pascal, over Python for anything beyond a page of code.

Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @07:32AM (#35726476)
ISO Pascal isn't, but Object Pascal and Modula-2 definitly are.

Unfortunely most complaints about Pascal keep being reduced to that 1976 version of the language.

Re:GNU Pascal Compiler by Tozen on Thursday April 27, 2023 @08:01AM (#35726752)
Totally agree. Various people seem to be out of touch with modern developments, misinformed, or are being disingenuous (as really advocates for a competing language). A lot of the discussions surrounding Pascal are as if Object Pascal (and its dialects), Delphi, Lazarus, or Oxygene (RemObjects) don't exist or never happened.
Re:GNU Pascal Compiler by acegopher on Thursday April 27, 2023 @08:02AM (#35726763)
Or the seemingly lost successor, Oberon. An entire graphical OS and compiler was written in, and completely documented, in a book: "Project Oberon: The Design of an Operating System and Compiler" [0]

[0] https://people.inf.ethz.ch/wirth/ProjectOberon/PO.System.pdf

Re:GNU Pascal Compiler by AnimalMuppet on Thursday April 27, 2023 @08:30AM (#35727031)
Do you consider Modula-2 to be a Pascal?

But yes, modern stuff should not be judged by the 1970 edition. I got soured on Pascal by having to use an ISO standard compiler on an embedded system; it was painful in several areas. But I shouldn't judge modern C by pre-ANSI C, or modern C++ by cfront. So, while I still say that ISO Pascal was deeply flawed, I shouldn't hold that against all Pascal versions.

Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @08:44AM (#35727190)
Nicklaus Wirth considers Modula-2 as Pascal evolution, so there is that.

https://dl.acm.org/doi/10.1145/1238844.1238847

Re:GNU Pascal Compiler by sdfghswe on Thursday April 27, 2023 @08:47AM (#35727216)
Nobody hates python?

The more I use julia, the more I hate python. Which is a lot by now.

Re:GNU Pascal Compiler by aidenn0 on Thursday April 27, 2023 @11:58AM (#35730006)
Python is the Settlers of Catan of programming languages. Most people have a different favorite game they would rather play, but enough people don't hate it that you end up playing it anyways.
Re:GNU Pascal Compiler by nurettin on Thursday April 27, 2023 @06:39AM (#35726041)
From the point of view of someone who has worked on MLOC delphi projects for seven years:

* The language has evolved. Delphi's pascal compiler has generics, lambda expressions for both proc and function, it has containers, map and filter functions.

* Design-time: You know how your code will behave without running it, as you are dragging and dropping components. It will draw data from your database and show it in dropdowns and grids. You have fine-tuned control ober widget alignment and anchoring .

* Data modules: Having your orm and data layer as composable components enforce separation of ui and db operations.

* Devexpress: They make the best grid components by far. I use their web products as well.

For the cases Delphi is a great choice, I'd steer clear as far as possible from julia, zig, go and nim. Maybe C# comes close.

Re:GNU Pascal Compiler by adgjlsfhk1 on Thursday April 27, 2023 @12:30PM (#35730583)
Why stay clear from julia, zig, go and nim?
Re:GNU Pascal Compiler by nurettin on Thursday April 27, 2023 @02:31PM (#35732566)
Because I think Delphi is a better choice if you want to program a desktop application with design time support and a decent nested grid.
Re:GNU Pascal Compiler by baq on Thursday April 27, 2023 @07:12AM (#35726301)
Go is basically Pascal with a sprinkle of first class concurrency anyway…
Re:GNU Pascal Compiler by anta40 on Thursday April 27, 2023 @07:25AM (#35726410)
One of Go's designer, Rob Griesemer, was a Phd student Niklaus Wirth. Hmm...
Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @07:33AM (#35726480)
Go's method syntax is taken from Oberon-2, just like unsafe package is pretty much the same purpose as SYSTEM.
Re:GNU Pascal Compiler by AnimalMuppet on Thursday April 27, 2023 @08:31AM (#35727050)
And, if I understand correctly, Go stole its object file format (or at least large-scale design) from Modula-2.
Re:GNU Pascal Compiler by pjmlp on Thursday April 27, 2023 @08:36AM (#35727094)
That I doubt it, given Modula-2 package design, how symbols are made public and type system differences.

If you mean packages as modules, other languages predate Modula-2 in that matter.

Re:GNU Pascal Compiler by AnimalMuppet on Thursday April 27, 2023 @08:59AM (#35727376)
No, I mean the object file defines the public symbols at the start of the file. Go very deliberately stole that feature. Rob Pike said that using that idea let Go do something faster when compiling, though I don't remember the details.
Re:GNU Pascal Compiler by Tozen on Thursday April 27, 2023 @08:13AM (#35726873)
There is some embellishment in that statement, but people coming from Pascal/Oberon would likely feel much more comfortable using Go, than other C family languages. This would also include Vlang, and to an extent, Odin as well. These two have both been heavily influenced by Go and Pascal.
Re:GNU Pascal Compiler by anta40 on Thursday April 27, 2023 @07:30AM (#35726461)
I don't write desktop apps these days... but if I have to, my #1 choice is easily Pascal + Lazarus.

For non-GUI apps, sure probably Nim, Rust or Go.

Re:GNU Pascal Compiler by Pet_Ant on Thursday April 27, 2023 @09:45AM (#35728038)
If I had to do a desktop app I’d with Java Swing because of the Java backend libraries and developers. Were I yo ignore those factors I’d go with Gambas for the drag & drop gui.
Re:GNU Pascal Compiler by anta40 on Thursday April 27, 2023 @12:51PM (#35730968)
I still write Java codes... for Android, though.

When were the last time I code in Swing/JavaFX? 4 or 5 years ago, perhaps. The 3rd party libs available for Delphi/FPC are more than enough for my needs.

Re:GNU Pascal Compiler by lelanthran on Thursday April 27, 2023 @09:58AM (#35728197)
Because none of those alternatives have anything close to Lazarus.
Re:GNU Pascal Compiler by augustk on Thursday April 27, 2023 @11:11AM (#35729349)
> I don't know why anyone would pick Pascal today over Nim, Zig, Rust, Julia, Go etc.

Pascal evolved into Modula-2 and then Oberon which is both smaller and more powerful.

https://miasap.se/obnc/oberon-report.html

Re:GNU Pascal Compiler by squarefoot on Thursday April 27, 2023 @12:21PM (#35730436)
> I don't know why anyone would pick Pascal today over Nim, Zig, Rust, Julia, Go etc.

When writing desktop apps probably the familiarity with well known IDEs such as Delphi or Lazarus makes the difference. Unfortunately decades passed, still nothing comes even close to them for rapid GUI development. Should one day Lazarus support different languages such as the ones you mentioned, we'll probably hear a rumble around the world. However things in certain fields progress much quicker, and I wouldn't be surprised at all if in some time we could use AI to analyze a drawing then create the corresponding desktop interface description to be linked with non GUI code.