Recent

Author Topic: Modula, Oberon or Ada  (Read 2856 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 610
Re: Modula, Oberon or Ada
« Reply #30 on: December 20, 2019, 09:34:05 am »
Cactus stack also rings a bell. To be honest I think if one would want to resurrect this, one would have to dig into old implementations and their usecases.

I think this is implicit to any language that allows up-level addressing via chained frames or a "display" which keeps track of areas of the stack(s). You can pass (the address of) a variable on a stack to a thread's constructor, or simply assume that variables remain valid.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

MarkMLl

  • Hero Member
  • *****
  • Posts: 610
Re: Modula, Oberon or Ada
« Reply #31 on: December 20, 2019, 09:36:37 am »
Quote
Unfortunately ALGOL's inline conditional a := IF b THEN c ELSE d;, which I consider to be an unfortunate omission from Pascal etc., is at least visually inconsistent with this.
Too ugly for Pascal, but an internal IIF() would be fine instead of external big IfThen().
Emphasising that an inline IF does not evaluate both expressions, while an IfThen() does. And I'm unhappy with something like IIF() that looks like a function but has different evaluation rules.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

MarkMLl

  • Hero Member
  • *****
  • Posts: 610
Re: Modula, Oberon or Ada
« Reply #32 on: December 20, 2019, 09:40:03 am »
Quote
Quote
  • End 'procedurename'  at the end of a block. A mixed blessing, made refactoring code more complicated, but "missing end"  kind of errors were less confusing. I think a distinct procedural END is a good thing, but recycling the procedurename a bridge too far.
Is this still necessary when most people use an IDE [Lazarus] to program?

IDE/Lazarus has no influence. What might make it less needed is that the use of OO extensions make nested procedures not as common as they were. Still it improved the error handling in the case of missing ENDs, and narrowed its scope.

Also any help that the syntax gives to external refactoring etc. tools is probably valuable.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7863
Re: Modula, Oberon or Ada
« Reply #33 on: December 20, 2019, 11:26:33 am »
Cactus stack also rings a bell. To be honest I think if one would want to resurrect this, one would have to dig into old implementations and their usecases.

I think this is implicit to any language that allows up-level addressing via chained frames or a "display" which keeps track of areas of the stack(s). You can pass (the address of) a variable on a stack to a thread's constructor, or simply assume that variables remain valid.

Yes. It is also the case with nested procedures. ( type  tprocedure = procedure is nested;), only valid till the parent returns. It was needed for ISO and was made visible in the FPC dialects via is nested.

But what I meant is if the feature has such caveats, then it depends IMHO on the value of the usecases, if it should be reimplemented in a future M2 implementation (does gm2 do it?)

Hmm. GM2 site:

Quote
coroutines have been implemented in the PIM style and these are accessible from SYSTEM. A number of supporting libraries (executive and file descriptor mapping to interrupt vector libraries are available through the -flibs=pim-coroutines,pim switch).

Also interesting:

Quote
much better dwarf-2 debugging support and when used with gdb the programmer can display RECORDs, ARRAYs, SETs, subranges and constant char literals in Modula-2 syntax
« Last Edit: December 20, 2019, 11:30:09 am by marcov »

MarkMLl

  • Hero Member
  • *****
  • Posts: 610
Re: Modula, Oberon or Ada
« Reply #34 on: December 20, 2019, 12:01:15 pm »
Yes. It is also the case with nested procedures. ( type  tprocedure = procedure is nested;), only valid till the parent returns. It was needed for ISO and was made visible in the FPC dialects via is nested.

No, since when you have a nested procedure you know that upper-level stackframes are still valid. You don't know that for threads or coroutines which have their own stack, but might internally have references to the parent stack.

  • Procedure A starts coroutine B and transfers control to it.
  • Coroutine B from somewhere gets a reference to A's current stackframe.
  • B transfers control back to A.
  • A returns to its caller.
  • Caller transfers control to B which now has a pointer into a freed stackframe.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7863
Re: Modula, Oberon or Ada
« Reply #35 on: December 20, 2019, 12:05:24 pm »
Yes. It is also the case with nested procedures. ( type  tprocedure = procedure is nested;), only valid till the parent returns. It was needed for ISO and was made visible in the FPC dialects via is nested.

No, since when you have a nested procedure you know that upper-level stackframes are still valid. You don't know that for threads or coroutines which have their own stack, but might internally have references to the parent stack.

No. A function might store the nested function reference in a list to be called later, and return. Then later it gets called.

It doesn't matter if the list is some structure related to coroutines, or some eventhandler list in Turbo/free vision

I meant to say both cases have stack related boundary conditions that are not enforced.

guest65109

  • Guest
Re: Modula, Oberon or Ada
« Reply #36 on: January 14, 2020, 11:53:14 am »
What I dislike most from Oberon and Component Pascal is they are case sensitive and they force keywords to be UPPERCASE. I tried to write code in Oberon with OBNC compiler but as soon as I tried to write something more complex than HelloWorld everything turned out to be a nightmare. I realized I hate having to press CAPS LOCK every time I want to type a keyword so finally I gave up and quit. Anyway, this Free Pascal currently still is the best Pascal dialect because it's suitable practical purpose, not only teaching like these later Wirthian languages. It's a balance between verbose and practical.

These languages must have very intelligent and powerful IDEs to make them usable because they are overly verbose. The IDEs have to generate all of the boilerplate code for us (the OOP of them is very different, where object is pointer to procedure) and when we type keywords in lowercase it has to convert them to uppercase on the fly.

Because of their over verbose these languages (no, I didn't include Ada) are rarely adopted by the mass. Finding a text editor with proper syntax highlighting for them is very difficult let alone such powerful IDEs! After hours searching the net, finally, I found one text editor could highlight Oberon code (despite not complete, but having something partially work is better than nothing), it's Cudatext. Thank you, Alextp, for this text editor.

MarkMLl

  • Hero Member
  • *****
  • Posts: 610
Re: Modula, Oberon or Ada
« Reply #37 on: January 14, 2020, 12:32:17 pm »
What I dislike most from Oberon and Component Pascal is they are case sensitive and they force keywords to be UPPERCASE. I tried to write code in Oberon with OBNC compiler but as soon as I tried to write something more complex than HelloWorld everything turned out to be a nightmare.

I've written a microkernel using Modula-2 which was case-sensitive. Editing wasn't particularly arduous, even allowing for the comparatively crude IDEs available in the 1990s.

Try debugging on bare metal. That will give you something to complain about >:-)

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

Awkward

  • Jr. Member
  • **
  • Posts: 50
Re: Modula, Oberon or Ada
« Reply #38 on: January 14, 2020, 01:40:25 pm »
Finding a text editor with proper syntax highlighting for them is very difficult let alone such powerful IDEs!
https://github.com/programmingthomas/Oberon-Highlight oberon highlight for VIM
https://github.com/kekcleader/FreeOberon Oberon text IDE with code highlight
https://sourceforge.net/projects/npp-plugins/files/Oberon2Lexer/ Notepad++ oberon lexer
and i thin, FAR's Colorer have it too
if only i wanted, i can find more oberon code highlight tools and even IDE. (even if some of them are old and forgotten)

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7863
Re: Modula, Oberon or Ada
« Reply #39 on: January 14, 2020, 02:45:05 pm »
What I dislike most from Oberon and Component Pascal is they are case sensitive and they force keywords to be UPPERCASE.

I don't like it either.

Quote
  Free Pascal currently still is the best Pascal dialect because it's suitable practical purpose, not only teaching like these later Wirthian languages. It's a balance between verbose and practical.

Not dialect, but development system as a whole. Actively maintained, reasonably complete, first class windows support  (at least compared to the other Wirthian languages)

Quote
These languages must have very intelligent and powerful IDEs to make them usable because they are overly verbose.

As said in other threads, I don't subscribe to your whole verbosity argumentation (and even less so for M2 which has tighter block structure).

If it was all true, people would complain about curly braces languages wearing out the shift buttons to make all those  {}&! etc. You never hear that, so it is all in the head.

Quote
The IDEs have to generate all of the boilerplate code for us (the OOP of them is very different, where object is pointer to procedure) and when we type keywords in lowercase it has to convert them to uppercase on the fly.

Oberon however is one of the languages with the shortest grammar. Writing a highlighter and some tools should be a breeze. But what to use it with ?

Afaik Microsoft supported component pascal with the first iterations of .NET.  So an old Visual Studio (2003, 2005?) might do.

« Last Edit: January 14, 2020, 02:54:23 pm by marcov »

MarkMLl

  • Hero Member
  • *****
  • Posts: 610
Re: Modula, Oberon or Ada
« Reply #40 on: January 14, 2020, 02:48:58 pm »
Synedit at https://github.com/SynEdit/SynEdit/blob/master/Source/SynHighlighterM3.pas has a highlighter for Modula-3 which could probably be fairly easily made compatible with the Lazarus IDE and then modified for Oberon.

This is something where whining is quite simply inexcusable: if somebody doesn't like it then fix it.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

guest65109

  • Guest
Re: Modula, Oberon or Ada
« Reply #41 on: January 14, 2020, 04:06:46 pm »
What I dislike most from Oberon and Component Pascal is they are case sensitive and they force keywords to be UPPERCASE. I tried to write code in Oberon with OBNC compiler but as soon as I tried to write something more complex than HelloWorld everything turned out to be a nightmare.

I've written a microkernel using Modula-2 which was case-sensitive. Editing wasn't particularly arduous, even allowing for the comparatively crude IDEs available in the 1990s.

Try debugging on bare metal. That will give you something to complain about >:-)

MarkMLl

I would prefer all of my code to be lowercase. As of now I'm still write my pascal code in lowercase and don't care about any convention.

guest65109

  • Guest
Re: Modula, Oberon or Ada
« Reply #42 on: January 14, 2020, 04:10:26 pm »
Finding a text editor with proper syntax highlighting for them is very difficult let alone such powerful IDEs!
https://github.com/programmingthomas/Oberon-Highlight oberon highlight for VIM
https://github.com/kekcleader/FreeOberon Oberon text IDE with code highlight
https://sourceforge.net/projects/npp-plugins/files/Oberon2Lexer/ Notepad++ oberon lexer
and i thin, FAR's Colorer have it too
if only i wanted, i can find more oberon code highlight tools and even IDE. (even if some of them are old and forgotten)

I'm Linux. So npp is out. I don't use vim. I even don't know how to exit vim. So vim is out. FreeOberon is not an text editor. I want an text editor with Oberon/Component Pascal syntax highlight, not an IDE. So all of your suggestions are out.

Cudatext, on the other hand, truly available everywhere. You could check on it homepage. It covers all of the platforms I currently run: BSDs, Linux, OI, Haiku and Windows. This again thanks to Free Pascal and Lazarus.

guest65109

  • Guest
Re: Modula, Oberon or Ada
« Reply #43 on: January 14, 2020, 04:23:03 pm »
As said in other threads, I don't subscribe to your whole verbosity argumentation (and even less so for M2 which has tighter block structure).

If it was all true, people would complain about curly braces languages wearing out the shift buttons to make all those  {}&! etc. You never hear that, so it is all in the head.

I don't agree with you, either. I could type { as fast as begin and the other } or end; should be automatically inserted by the text editor or IDE itself.

Oberon however is one of the languages with the shortest grammar. Writing a highlighter and some tools should be a breeze. But what to use it with ?

Afaik Microsoft supported component pascal with the first iterations of .NET.  So an old Visual Studio (2003, 2005?) might do.

But in reality, very few IDEs or text editors support these languages. I tried Blackbox Component Builder and I could conclude it's something from the Win95 era, as I remember it's not even has syntax highlighting. I don't know why they could even call it an IDE. The only IDE I think good enough is from cfbsoftware (cpIDE) but it is commercial with a delusional price. If I have to choose between buying it and switch to another language, I definitely choose the later.

I don't know if it's just me, Wirthian languages' IDEs (Delphi, cpIDE) tend to have delusional prices. Another non curry braces language with ridiculous price is Eiffel, check the price of Eiffel Studio and you will see how delusional these guys are.

del

  • Full Member
  • ***
  • Posts: 158
Re: Modula, Oberon or Ada
« Reply #44 on: January 14, 2020, 06:23:56 pm »
IMHO case insensitivity is sloppy, annoying, and distracting. If you're writing code you should be instinctively in the habit of thinking like a machine. To the machine, "A" is quite distinct from "a". What's next in the evolution? A language that's phonetically lenient? In which "aisle" and "isle" compile the same as you dictate your code into a microphone?