Recent

Author Topic: A question on Modula2 vs Free Pascal  (Read 14040 times)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11726
  • FPC developer.
Re: A question on Modula2 vs Free Pascal
« Reply #30 on: March 16, 2024, 02:26:25 pm »
Backwards compatibility is simply key. Both with self and Delphi.  This is very on-topic since it touches the "purity" argument in this thread. You don't want a revision every few years that invalidates existing sources, that is something for compilers that will never amount to anything.

Agreed, but at that point we should be asking "we've got A and B, how can we unify them into a single concept such that nothing breaks?".

That is the problem. Such mandatory compromise encourages exactly the mess where we are now, with a dozen string types, two generic syntax and all kinds of rarely used constructs (like case of string), operator overloading syntax etc etc.

And of course every person coming up with an extension thinks he has perfect reasons

Quote
Quote
Frankly I would rather remove the current macro facility, and point to an external macro processor like M4 for the very few cases when it is really needed.

Except that something like M4 can't say "the parameter in this context is a Pascal expression, taking into account other macros".

Such advanced macro use is a can of worms, adding a whole dimension of long term pain to the project, not unlike a feature like generics. It would need extremely good reasons IMHO to even consider it.

Quote
Quote
In an era where global/LTO optimisation is a buzzword, macros are IMHO a dated band-aid.

Maybe. But I did say "syntax-aware", not "text-substitution".

Syntax aware is a built-in IMHO, not a macro.

Quote
The thing I'm trying to /not/ do is add language extensions, in fact I'd rather remove them. We need a "meta extension" which can define a way of extending the syntax (lexer and parser), novel in the same way that defining that a program should be able to reference an arbitrary number of libraries each containing functions with parenthesised parameters was novel in the 1970s.

Rather vague.

Quote
But we're still stuck with a situation where overloadable operators can't be added, and where a novel delimiter or escape can't be described to the lexer.

Yes, which IMHO is pretty normal for a production programming language. Anyway, it is all so academic and vague and so all-encompassing that I don't see it happening, so I won't wast my breath.

IMHO we should get rid of the moniker of "FPC, the hot bed for Wirthian language experimentation"
« Last Edit: March 16, 2024, 02:29:06 pm by marcov »

Awkward

  • Full Member
  • ***
  • Posts: 138
Re: A question on Modula2 vs Free Pascal
« Reply #31 on: March 16, 2024, 02:52:47 pm »
...so pity what XDS compiler was not true multiplatform.
btw, why you talking about modula-2 (i like this language really) but no modula-3? component pascal, black box or any other Oberon compiler?

MarkMLl

  • Hero Member
  • *****
  • Posts: 7478
Re: A question on Modula2 vs Free Pascal
« Reply #32 on: March 16, 2024, 04:55:45 pm »
...so pity what XDS compiler was not true multiplatform.
btw, why you talking about modula-2 (i like this language really) but no modula-3? component pascal, black box or any other Oberon compiler?

Well volunteered that man! We look forward to your succinct comparison of M2+, M3, Oberon and for that matter Ada against FPC, in the spirit of the first couple of postings in this thread.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DoDep

  • New Member
  • *
  • Posts: 26
Re: A question on Modula2 vs Free Pascal
« Reply #33 on: March 16, 2024, 05:01:34 pm »
...so pity what XDS compiler was not true multiplatform.
btw, why you talking about modula-2 (i like this language really) but no modula-3? component pascal, black box or any other Oberon compiler?
Well, M3 (as far as I know, I might very well be mistaken), is not a true Wirthian language, ---cf. Olivetti group--- and Oberon is garbage collected. That's why my initial question was on M2 only.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11726
  • FPC developer.
Re: A question on Modula2 vs Free Pascal
« Reply #34 on: March 16, 2024, 05:56:18 pm »
Afaik M3 was also intended for garbage collection, but a bit vague on exactly how.

Anyway, M2 got quite some attention as a safe firmware development language, the follow ups are mostly explorations of language concepts rather than widely used languages.

MarkMLl

  • Hero Member
  • *****
  • Posts: 7478
Re: A question on Modula2 vs Free Pascal
« Reply #35 on: March 16, 2024, 09:37:32 pm »
Under normal circumstances I'd use this as an excuse to look at Oberon etc., but I've got PC problems (a failing disc in my mirror and general shortage of RAM since the last Debian version hike) which I need to address: I should have hardware arriving over the next few days.

However I do want to say that I consider Modula-3's "safe vs unsafe" marking to be a significant innovation, and believe that that combined with enforced module ownership and/or signing would be potentially useful.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DoDep

  • New Member
  • *
  • Posts: 26
Re: A question on Modula2 vs Free Pascal
« Reply #36 on: March 17, 2024, 06:57:44 pm »
Sorry for returning to this, but I have to... (OCD...)

According to this page

https://www.nongnu.org/gm2/11/building_on_gcc_11.html

there are prerequisites, like libmpfr-dev libgmp-dev, which are not present in Void Linux.

So the question is this: is there any other option for a (possible, generic) M2 compiler (for Linux) to test?

Thanks for your patience.

Thaddy

  • Hero Member
  • *****
  • Posts: 15505
  • Censorship about opinions does not belong here.
Re: A question on Modula2 vs Free Pascal
« Reply #37 on: March 17, 2024, 07:22:02 pm »
if you insist on void linux instead of something more sensible like debian you will need to compile those from source if they are not in your repository
that is as usual
« Last Edit: March 18, 2024, 04:40:37 pm by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

DoDep

  • New Member
  • *
  • Posts: 26
Re: A question on Modula2 vs Free Pascal
« Reply #38 on: March 17, 2024, 07:43:39 pm »
if you insist on void linux instead of something more sensible like debian you will need to compile those from source if they are not in your repositary
that is as usual
Thanks, but if you have followed the thread you would have read that I have already tried that -without success :(

gidesa

  • Full Member
  • ***
  • Posts: 101
Re: A question on Modula2 vs Free Pascal
« Reply #39 on: March 17, 2024, 07:51:42 pm »
Hello,
here a list of Modula 2 compilers:
https://freepages.modula2.org/compi.html
No bad the ones for Sinclair Spectrum and CP/M  :)

DoDep

  • New Member
  • *
  • Posts: 26
Re: A question on Modula2 vs Free Pascal
« Reply #40 on: March 17, 2024, 08:03:59 pm »
Hello,
here a list of Modula 2 compilers:
https://freepages.modula2.org/compi.html
No bad the ones for Sinclair Spectrum and CP/M  :)
I specified the platform ... Linux...
Thanks

MarkMLl

  • Hero Member
  • *****
  • Posts: 7478
Re: A question on Modula2 vs Free Pascal
« Reply #41 on: March 17, 2024, 08:44:13 pm »
Thanks, but if you have followed the thread you would have read that I have already tried that -without success :(

You've tried building the compiler. You've not investigated the prerequisites, some of which might not be apparent until your program is linked (see my earlier comment about symlinks and .so files).

Oh, and you've not really told us exactly /what/ went wrong.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DoDep

  • New Member
  • *
  • Posts: 26
Re: A question on Modula2 vs Free Pascal
« Reply #42 on: March 17, 2024, 09:18:32 pm »
You've tried building the compiler. You've not investigated the prerequisites, some of which might not be apparent until your program is linked (see my earlier comment about symlinks and .so files).

Oh, and you've not really told us exactly /what/ went wrong.

MarkMLl
Hello again!

I have followed the instructions to be found here:
https://www.nongnu.org/gm2/11/building.html
It seemed that the compilation was successful (make step) and the installation too (make install step). BUT:
a) for instance no gm2 executable was to be found in my system
b) when I tried to compile a sample program it did not work (I tried what you wrote as well, but nothing) -so the switches, probably, were not the actual problem
Regarding the prerequisites, well, I did all the necessary steps mentioned in the link above (which, strangely enough mentions only Debian as the "test bed").
Of course, eventually, something went wrong but I can not estimate what was that. That's why my latest question on alternatives.
Thank you.

PS #1 In PKG.ORG I saw just a few distros (like Fedora and Slackware) which have gm2 in their repos -except Debian. PS #2 Moreover, I searched for Void + GM2 but in vain...
PS #3 Another solution was to have multiple GNU GCC installations on my system (since my distro does not ship gm2),
           but again such a move was neither advised nor easy in practice.
« Last Edit: March 17, 2024, 09:21:58 pm by odysseus »

gidesa

  • Full Member
  • ***
  • Posts: 101
Re: A question on Modula2 vs Free Pascal
« Reply #43 on: March 17, 2024, 09:39:47 pm »
Hello,
here a list of Modula 2 compilers:
https://freepages.modula2.org/compi.html
No bad the ones for Sinclair Spectrum and CP/M  :)
I specified the platform ... Linux...
Thanks

There are also compilers for Linux, and others systems.
Not only for Spectrum...  ( I repeat the joke :) )

DoDep

  • New Member
  • *
  • Posts: 26
Re: A question on Modula2 vs Free Pascal
« Reply #44 on: March 17, 2024, 10:25:35 pm »
( I repeat the joke :) )
Yeah...quite funny....not

 

TinyPortal © 2005-2018