Recent

Author Topic: What are Modula2 And Oberon?  (Read 22641 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 18787
  • To Europe: simply sell USA bonds: dollar collapses
Re: What are Modula2 And Oberon?
« Reply #45 on: July 28, 2023, 08:15:35 pm »
I grew up with: any os or language that fits the job....
It is plain silly to choose a programming language without knowing what you want to achieve.
Programming languages are just tools for us people, both pro and amateur, to achieve logical goals.
Any other interpretation is flawed, if not wrong.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

440bx

  • Hero Member
  • *****
  • Posts: 6149
Re: What are Modula2 And Oberon?
« Reply #46 on: July 29, 2023, 02:12:27 am »
Wikipedia is a propaganda tool disguised as an excellent source of info.
I constantly use Wikipedia for quite a few purposes, many of them quite technical including engineering and math. 

I can say that Wikipedia is an excellent source of information both, technical and non-technical.  For non-technical information they are one of the very few sources that disclaims when an "article" is biased and lacks verifiable sources or suffers from other deficiencies.

The statement you made above about Wikipedia had the net effect of greatly devaluing your opinion in my eyes but, I believe every one should be given the opportunity to support their statement(s), therefore if you can support that statement with _verifiable facts_ then I invite you to do so.

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Kays

  • Hero Member
  • *****
  • Posts: 632
  • Whasup!?
    • KaiBurghardt.de
Re: What are Modula2 And Oberon?
« Reply #47 on: July 29, 2023, 05:00:28 pm »
https://www.lysator.liu.se/c/bwk-on-pascal.html
Sadly the criticisms levied against the original Pascal in that paper are all valid.
You choose a programming language based on your application’s needs. If Pascal’s “deficiencies” render it unsuitable for your application, choose a different programming language.

Modula-2, of course, has coroutines which- from experience- go a very long way towards moving context switches into the language: neither C nor Pascal can do that unaided.
That's one of those features I believe doesn't belong in a language because it involves scheduling.  IMO, a task scheduler belongs in the O/S not in a programming language.
No, the Modula‑2 notion of coroutines merely provides you a framework for cooperative multitasking. You will need to “instantiate” a routine with NEWPROCESS. Inside such a coroutine you may TRANSFER control to a different coroutine. Without invoking TRANSFER your coroutine behaves just like a vanilla routine with extra overhead.

[…] I strongly suspect there is some "macho programming" at work there, i.e, if the code is hard to understand it _presumably_ reflects the high I.Q and capability of the author, which is obviously laughable […]
Interesting hypothesis, but there is definitely also the language factor: Recently I read the following code fragment (originally in C):
Code: Pascal  [Select][+][-]
  1. if supercalifragilisticBooleanExpression then
  2.         foo(badaBingBadaBoomVariable, 0)
  3. else
  4.         foo(badaBingBadaBoomVariable, 1);
Now you are very tempted to make it more complex and shorten the entire thing to
Code: Pascal  [Select][+][-]
  1. foo(badaBingBadaBoomVariable, ord(not supercalifragilisticBooleanExpression));
Is this better? Or just mere showboating? (Keep in mind expressions in C can look terrifying.)

Wikipedia is a propaganda tool disguised as an excellent source of info.
I second that with respect to social topics. But technical articles are not always accurate either:
« Last Edit: July 29, 2023, 05:02:26 pm by Kays »
Yours Sincerely
Kai Burghardt

440bx

  • Hero Member
  • *****
  • Posts: 6149
Re: What are Modula2 And Oberon?
« Reply #48 on: July 29, 2023, 07:54:31 pm »
You choose a programming language based on your application’s needs. If Pascal’s “deficiencies” render it unsuitable for your application, choose a different programming language.
In that case, the original Pascal is perfectly well suited to write a "Hello World" application and _maybe_ something _slightly_ more elaborate. 

Now you are very tempted to make it more complex and shorten the entire thing ...
if the result isn't easier to understand then it is, more often than not, simply showing off.  In some _rare_ cases, performance considerations _may_ justify the added complexity.  I emphasize the word rare.

I second that with respect to social topics. But technical articles are not always accurate either:
You've just joined @Joanna at demonstrating how ill-conceived, devoid of logic and unreasonably biased your "argument" is.  A large number of people (maybe anyone ?) can edit a Wikipedia article and all it takes is a covfefe mind (in the past, referred to as "mediocre minds") to make the edits you showed.  To its credit Wikipedia catches and removes these obvious samples of human mediocrity and biased judgement. 

The edits you linked to show that Wikipedia does what it can to preserve accuracy.  Your using them to pretend Wikipedia is failing in some way reflects very poorly on you.

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

VisualLab

  • Hero Member
  • *****
  • Posts: 714
Re: What are Modula2 And Oberon?
« Reply #49 on: July 30, 2023, 12:54:01 am »
I second that with respect to social topics. But technical articles are not always accurate either:
You've just joined @Joanna at demonstrating how ill-conceived, devoid of logic and unreasonably biased your "argument" is.  A large number of people (maybe anyone ?) can edit a Wikipedia article and all it takes is a covfefe mind (in the past, referred to as "mediocre minds") to make the edits you showed.  To its credit Wikipedia catches and removes these obvious samples of human mediocrity and biased judgement. 

The edits you linked to show that Wikipedia does what it can to preserve accuracy.  Your using them to pretend Wikipedia is failing in some way reflects very poorly on you.

I absolutely disagree with the statement made by 440bx. At the same time, I have to defend what Kays wrote. Joanna is also somewhat right, although she exaggerates with this planned propaganda. Rather, they are the usual, uncoordinated scribbles ("folk myths" and "urban legends)" of fanatical monkeys who accidentally got their hands on a computer keyboard.

The main problem with Wikipedia is its credibility. So what if there are references to sources and quotes in the articles, if the text contains: far-fetched statements, someone else's (nonsense) opinions or mere fabrications? And the longer the text, the easier it is to smuggle in nonsense or lies. If someone is familiar with the subject, they will immediately pick up false information. But such a man does not need Wikipedia, because he already knows the subject. On the other hand, the one who does not know the topic will not be able to detect false content (unless it is completely moronic). Then such a person will need the help of someone who knows the subject. And in such a situation, it is better to immediately ask someone familiar with the subject or reach for a textbook, book or compendium. Only that in such a situation Wikipedia is unnecessary. The reliability of the information provided is crucial. At universities, students learn from their teachers that various blogs and social networking sites available on the Internet are not a source of reliable information. Wikipedia is also frowned upon for the same reason.

I myself tried many times to straighten the nonsense contained in some IT articles in Wikipedia (e.g. C language, Python language). After a few days, some fanatic was posting his nonsense again. This is a fight against windmills. The idea of Wikipedia was noble, but utopian. According to Murphy's law, "if something can be broken, it will be broken sooner or later." I don't think this can be changed by civilized means.

440bx

  • Hero Member
  • *****
  • Posts: 6149
Re: What are Modula2 And Oberon?
« Reply #50 on: July 30, 2023, 01:20:24 am »
A lot of criticism is going around but, what is conspicuously missing is an example of an article where genuinely far-fetched statements appear.

Therefore, for credibility's sake, would anyone care to provide a link to an _article_, not an edit, where a genuinely far-fetched statement appears ?... of course, it would be nice if more than one link to such articles were provided. 

After all, I am sure that somewhere in Wikipedia, there is at least one article where some, at least questionable statements appear.

As far as how Wikipedia is funded, instead of simply raising questions about how its funded, how about showing what is specifically objectionable about its funding ?... is that too difficult to do for people who find it so easy to criticize it without foundation ?

Just in case, Wikipedia isn't perfect but, maybe this will be news for those who criticize it: neither are you!.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

440bx

  • Hero Member
  • *****
  • Posts: 6149
Re: What are Modula2 And Oberon?
« Reply #51 on: July 30, 2023, 02:26:31 am »
The reason I don’t share the articles in question is because I don’t want to get into some ugly off topic debate about things on Wikipedia.
But you have no problem making accusations and providing the above statement as an excuse for leaving the accusations fully unsupported.

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Peter H

  • Sr. Member
  • ****
  • Posts: 272
Re: What are Modula2 And Oberon?
« Reply #52 on: July 30, 2023, 04:58:25 am »
To come back to the original Question:

There where other languages which had big influence but where not as successful as Pascal and C.
Algol 60 and 68.

At this time compilers where expensive and difficult to implement and standardization was very bad.

This was better with Pascal, but not perfect.
However C, because it had less features than others but more degrees of freedom was easier to standardize or to port.
There where much less portability problems with C.
Also C came for free with each UNIX machine.

So far I know, first versions of Mac OS, Windows and Photoshop where written in Pascal.

Here are three interesting videos, interview of a contemporary computer scientist.

This sheds some light on the situation at this time and gives one practical example: Triple ref pointers.
So far I understand it, this and other low level stuff could - at this time - not be implemented in Pascal, but in Assembler, ALGOL68 and C.

https://youtu.be/0ZEX_l0DFK0
https://youtu.be/nA_FXCzibgw
https://youtu.be/TdzsB-iYj4Y
https://youtu.be/SVYBJlCmRxE


« Last Edit: July 30, 2023, 05:44:22 am by Peter H »

Joanna

  • Hero Member
  • *****
  • Posts: 1419
Re: What are Modula2 And Oberon?
« Reply #53 on: July 30, 2023, 02:37:44 pm »
That’s some interesting stuff. Algo68 was before my time and nobody ever mentioned it in any computer courses.

It’s hard to imagine a pointer that has an address of its own rather than a pointer to address in memory.  Does this mean that all pascal pointers don’t have an address of their own?

VisualLab

  • Hero Member
  • *****
  • Posts: 714
Re: What are Modula2 And Oberon?
« Reply #54 on: July 30, 2023, 02:51:33 pm »
That’s some interesting stuff. Algo68 was before my time and nobody ever mentioned it in any computer courses.

It’s hard to imagine a pointer that has an address of its own rather than a pointer to address in memory.  Does this mean that all pascal pointers don’t have an address of their own?

Well, you can check it yourself. Try to declare a few variables in a simple program. Let one be, for example, an integer, and let the others be pointers.

Besides, what do you think: if for FPC (Delphi) there are modules that refer to Linux libraries, then it's probably not so bad with current versions of Pascal.

Yes, there are problems with some C elements, such as flex arrays.

Joanna

  • Hero Member
  • *****
  • Posts: 1419
Re: What are Modula2 And Oberon?
« Reply #55 on: July 30, 2023, 10:48:34 pm »
It doesn’t make sense to have pointers to pointers, with the linked lists , weren’t those pointers to records that contained pointers?

I’m not sure what flex arrays are..

Peter H

  • Sr. Member
  • ****
  • Posts: 272
Re: What are Modula2 And Oberon?
« Reply #56 on: July 31, 2023, 07:53:28 am »
I believe in these early versions Pascal supported only pointers for (otherwise anonymous) heap variables and not for normal variables.
The use of pointers was much more intentionally restricted than today.
I do not know if type casting was allowed as much as today, or if it was supported at all.
Possibly it was intentionally forbidden to take the address of pointer variables.

At this time Algol 68 had pointers and it had reference variables in the same way as C# today.

I had, when I was younger, more than 40 years ago, a programming language "PEARL" which was running on my 68000 DIY home computer.
This language was derived from ALGOL 68 (but much simpler) and had no pointers, but had reference variables like ALGOL and today C#. This means you can not determine the address of reference variables, and not manipulate them  but they can point to anywhere. I personally believe this concept is better it makes pointers almost superfluous. (For special cases there was inline Assembler)

At these early times there was another philosophy about programming languages. There where opinions that recursion and reentrancy are superfluous features. There where languages that did not support it.
The language had to isolate programmer and machine as much as possible and hide machine limitations and machine features.
This approach has failed, in my opinion and is used in script languages only.
These automatic reference types, which are in todays object pascal where unthinkable. These do move pascal into the direction of Algol.
In the modern languages the language must make the minimum machine requirements obvious to the writer and reader of a program.
« Last Edit: July 31, 2023, 08:45:49 am by Peter H »

MarkMLl

  • Hero Member
  • *****
  • Posts: 8551
Re: What are Modula2 And Oberon?
« Reply #57 on: July 31, 2023, 09:24:47 am »
It doesn’t make sense to have pointers to pointers, with the linked lists , weren’t those pointers to records that contained pointers?

OK, that's a good point. So "a pointer to a (naked) pointer" was invalid, while "a pointer to a pointer contained in a record" was valid.

However an example where a pointer to a naked pointer would be useful would be if, at the application level, pointers were actually references to a linear table of naked pointers, and this table was updated by the runtimes as blocks were moved around to prevent heap fragmentation.

Trying to stick to your original question, when Wirth implemented Pascal he had previously been a user of at least one system which implemented memory management at the OS and hardware level, so even if he'd really thought about what was going on he'd not have had to (in fact would have been forbidden to) manipulate that sort of thing directly. However when he moved on to design Modula-2, which was designed to be usable as a systems programming language, it would have had to accommodate that sort of thing.

Apropos your earlier microrant about Wikipedia. I'd suggest that while "tell me about XXX since I can't be bothered to read Wp" is very much out of order, a quiet "I've read about XXX on Wp, can I trust that?" might be treated a bit more sympathetically (at least by me :-) The bottom line is that while there is a great deal of misleading crap on the Internet (and, in my opinion, you've demonstrated that you're receptive to it), there's also a lot of accurate factual information: the key thing is trying to balance the putative crap you think you're getting from Wp, the putative crap we think you're getting from some social agitation site, and the opinions held by the members of this forum (which are, of course, beyond reproach :-)

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

MarkMLl

  • Hero Member
  • *****
  • Posts: 8551
Re: What are Modula2 And Oberon?
« Reply #58 on: July 31, 2023, 09:36:49 am »
This language was derived from ALGOL 68 (but much simpler) and had no pointers, but had reference variables like ALGOL and today C#. This means you can not determine the address of reference variables, and not manipulate them  but they can point to anywhere. I personally believe this concept is better it makes pointers almost superfluous. (For special cases there was inline Assembler)

That makes sense, although I'm uncomfortable with a blanket "can't take the address of a reference" prohibition. However I believe that any language needs, at its lowest level, to be able to do pointer arithmetic etc. since otherwise it will need to have its memory manager written in something like C or assembler... and the latter case will definitely have portability problems.

Quote
At these early times there was another philosophy about programming languages. There where opinions that recursion and reentrancy are superfluous features. There where languages that did not support it.

A lot of that however was chauvinism from the FORTRAN brigade (to whom recursion hadn't really occurred) and from IBM mainframe users (who didn't have a hardware stack). ALGOL supported it, systems designed to run ALGOL (as opposed to being designed to run FORTRAN) supported it, and it really took off when people worked out how to write recursive descent compilers. The problem then was that every second-rate programmer and his dog jumped onto the bandwagon and it got vastly overused, in much the same way that Picasso vastly overused blue pigment when it suddenly became affordable.

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

MarkMLl

  • Hero Member
  • *****
  • Posts: 8551
Re: What are Modula2 And Oberon?
« Reply #59 on: July 31, 2023, 02:03:00 pm »
I am happy that modern pascal has recursion, i enjoy using it.

Pascal has always had recursion, as did ALGOL- certainly ALGOL-60, can't really speak for ALGOL-58- before it.

Quote
its also interesting that pascal and c have a common ancestor..
I still wonder why delphi didn't adopt some of the modula2 features if it had plenty of corporate funding. Was it because the delphi users didn't need to do systems programming or whatever modula 2 had improved?

C is actually closer to ALGOL-60 than Pascal is. In particular, ALGOL had very little idea of the concept of types, except where they defined grossly different underlying data which was handled by different subsystems of the computer running it (e.g. completely separate hardware to handle character processing) or grossly different subranges (e.g. integers as a subrange of floating point).

You should find that earlier in the thread I've described how Borland had (and disposed of) a Modula-2 compiler in the 1980s. There had been numerous attempts by then to have a common code-generation backend support multiple frontend languages, none of which had been successful and whose failure had in many cases sunk the company attempting the exercise. Based on the fact that the JPI/TopSpeed v1 compiler was really rather good I speculate that Borland originally developed it as a more-serious successor to Turbo Pascal, but when TP's sales took off in (roughly) 1985 they decided to place their bets on that horse. As such TP progressed incrementally targeting 8- and 16-bit systems, was joined by Delphi v1 targeting Win-16, and shortly after by Delphi v3 targeting Win-32 (i.e. Windows NT etc.); v2 attempted to support both Win-16 and Win-32 but didn't have a particularly high profile. Borland's Pascal implementation progressed incrementally during that time, and while it /is/ possible to have one compiler which handles both Pascal-style and Modula-2-style syntax they probably felt that there was too much risk involved.

Quote
Well I think that we can both agree that I probably already know about wikipedia and googling since we are using the internet here. If i was the antisocial sort I probably would avoid other humans and only talk to the computer. I should be obvious by now that talking to a computer is not the experience I'm in search of  ;D I already do it enough as it is. Im not trying to waste anyone's time if they don't want to answer my questions that is fine. but where will we be if we stop talking to each other and choose dodgy websites over interacting with real people? The main reason I prefer dialog is that I am able to ask the person giving me information questions if I don't understand something. Hence I don't much care for one way communication if I can avoid it.

The internet is so full of garbage that it is almost unusable for certain types of searches. Often When I search for things i get page after page of websites that look like they were generated by ai and have almost identical content and are full of advertising. i lack the skill to write a search engine to prevent this from happening.

Well /yes/, and I agree with your overall point. But this is really a maturity thing: we all need to develop a toolkit to evaluate what we read, read and if necessary seek out viewpoints which are at odds with our own, and ultimately to decide what is wheat and what is chaff.

I would add that watching people- including self-styled smart people- use the Internet can be depressingly instructive. They start off with Google, hit a Wikipedia page, read it until they hit a term they don't understand, and since they don't realise that it's a /link/ go back to Google until they find a Facebook or Twitter page which gives them an easily-digested answer in the first sentence.

And they're completely oblivious to the fact that the answer they've accepted might be wide of the mark.

Quote
Author’s Note

All of the true things I am about to tell you are shameless lies.

– Bokonon

It is very easy when reading a document to be seduced by the fact that it is typeset and contains few obvious grammatical errors or spelling mistakes. This is curious, since we have been living with printed material- political pamphlets, advertising handbills, newspapers and paper currency- for several hundred years, and by now really should be used to it.

This manual is compiled and maintained on a “best effort” basis, and whilst every endeavour is made to ensure that the content is a reasonable description of reality there might be cases where it is inaccurate or out of date.

MarkMLl
« Last Edit: July 31, 2023, 03:05:26 pm by 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

 

TinyPortal © 2005-2018