Oberon Community Platform Forum
November 19, 2019, 06:00:33 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: Comparison of the C and Oberon-2 langauges  (Read 69025 times)
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #15 on: June 07, 2011, 08:44:46 AM »


[...]
to wondering how Modula-3 compares to Oberon-2

It's very good! IMHO.


I had a deep look at Modula-3 in the mid 1990ies, but I prefered the Oberon design and its "art of simplicity" approach compared to the "art of complexity" approach used in the design of Modula-3.

In the mean time I discoverd Hoare's quotation : "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies." (see http://en.wikiquote.org/wiki/C._A._R._Hoare#The_Emperor.27s_Old_Clothes). I am not convinced that the complexity approach of Modula-3 is really helpful, although I also had sometimes the impression that too many useful features had been eliminated in Oberon.

regards
    Bernhard
Logged
leledumbo
Jr. Member
**
Posts: 96



WWW
« Reply #16 on: June 07, 2011, 04:36:01 PM »

One thing I don't like about Modula-3 is that its developed independently without any accordance with Prof. Wirth. I feel somehow it has lost the main touch of Pascal family of language: simplicity without (too many) features sacrificed.

Why can't it look at Oberon? Method implementation right in the class definition (taken by Java), exceptions as rescued statement in blocks (taken by Ruby), this shows Oberon's influential features despite its very simple language grammar (33 productions, even a toy language from compiler construction class in my university has 80 productions!), which IMHO Modula-3 should consider.
Logged
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #17 on: June 07, 2011, 08:08:20 PM »

I am not convinced that the complexity approach of Modula-3 is really helpful, although I also had sometimes the impression that too many useful features had been eliminated in Oberon.

I'm not getting the impression that the current Opencm3 "system" is overly complicated. Just the opposite! It has a nice web-based IDE; a great tutorial! CM3 syntax is as easy as Modula-2 or Oberon-2, IMHO. The compiler is stand-alone - no need for yet-another-OS.  Smiley  Of course, I'm still test-driving, and have not gone too deep.
--
Duke
Logged

duke
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #18 on: June 07, 2011, 08:12:56 PM »

One thing I don't like about Modula-3 is that its developed independently without any accordance with Prof. Wirth. I feel somehow it has lost the main touch of Pascal family of language: simplicity without (too many) features sacrificed

http://opencm3.net/doc/reference/complete/html/1_1History.html

--
Duke
Logged

duke
greim
Newbie
*
Posts: 11


« Reply #19 on: June 08, 2011, 11:17:42 AM »

 
....C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application. ...



Brian W. Kernighan  Dennis M. Ritchie

Preface of "The C Programming Language"

(my personal copy of 1978)

M. Greim
Logged
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #20 on: June 08, 2011, 01:15:54 PM »

....C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application.

Sorry! I'm missing your point ....

--
Duke
Logged

duke
leledumbo
Jr. Member
**
Posts: 96



WWW
« Reply #21 on: June 08, 2011, 04:33:43 PM »

One thing I don't like about Modula-3 is that its developed independently without any accordance with Prof. Wirth. I feel somehow it has lost the main touch of Pascal family of language: simplicity without (too many) features sacrificed

http://opencm3.net/doc/reference/complete/html/1_1History.html

--
Duke
That doesn't prove Prof. Wirth was part of the committee (and AFAIK he was not), he only gave blessing to the language to born.
Logged
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #22 on: June 08, 2011, 06:32:26 PM »

Quote
That doesn't prove Prof. Wirth was part of the committee (and AFAIK he was not), he only gave blessing to the language to born.

Exactly! And if he had wanted to be further involved, I'm sure that he would have been accomodated.  But what's the difference? Wirth "zigged"; and Modula-3 "zagged" - a little bit. It still appears to be a great language with or without Wirth having held their hands, and wiped their noses while it was being developed.  Smiley
--
Duke
Logged

duke
Dsar
Newbie
*
Posts: 40


« Reply #23 on: June 08, 2011, 11:27:33 PM »

This is an uninformed opinion, but I think that the Modula/Oberon family of languages can probably compete nose-to-nose with C/C++ for most tasks.
My opinion is different, C/C++ cannot compete with a language of Modula-2 family ;-)

Anyway, efficiency depends a lot by the compiler. It's easy to generate fast code with C because it has nothing, in a strongly typed language instead you should bring (for example) type information and other stuff in the binary file. But you can program a Modula-2 compiler that generates fast code as C without these checks and informations, the real question is: is it worth to lost these important checks and informations? A safe C program does these checks with macros written by the programmer and becomes slow. Then it has no sense.

I had a deep look at Modula-3 in the mid 1990ies, but I prefered the Oberon design and its "art of simplicity" approach compared to the "art of complexity" approach used in the design of Modula-3.
Modula-3 and Oberon are different successors of Modula-2 with different thinking about the term of "simplicity", as it is documented in the report of Modula-3. Wirth had his ideas, at DEC they had their ones. Anyway, Modula-3 is not so different from Modula-2, it was the answer to the complexity of Algol 68, Ada, C++ and other languages of that period and starting from Modula-2 was a good base. If you compare Modula-3 with other languages, it is not so complex.
If you think Modula-3 is a complex language, I invite you to give a look at Ada, if you want to master the language in all details there is a an annotated reference manual of about 1200 pages. One day I wanted to investigate the behaviour of the new operator, and it behaves differently on the kind of data, in some cases it allocates on the stack, in other in the heap. Maybe they thought it should be invisible to the programmer in an high level language and it allows full control and optimisations by the compiler.
But it is really impossible to master the language in all details for a non-professional programmer like me.
Complexity is: when there are a lot of information to remember, no exact definition of a particular behaviour and a lot of missing information.
Simple concepts and predictable behaviours are an important aspect of a language. I consider Modula-3 simple.

I've moved way from the C/C++ vs Oberon-2 comparison, to wondering how Modula-3 compares to Oberon-2 +? I installed the Critical Mass M3 system on my Xubuntu box.  It's very good! IMHO.
Modula-3 is a revised Modula-2 with some issues corrected, for example name clash in enumeration and export/with qualification (in Modula-3 WITH is an alias tool). It also added genericity, multithreading, exception handling and OOP in a minimal way.
Wirth instead used another approach, remove non-essential features.
If you are interested in the motivation of these changes, I suggest "From Modula-2 to Oberon" by Wirth and the report of Modula-3.

It's not easy to do a comparison between Modula-3 and Oberon-2. Both are excellent languages, the use depends on your needs. For my needs I use Oberon-2, because for example I don't need subranges and other features. It has all the safety I need for my personal projects. Also, I prefer simple and reliable compilers for a language that doesn't have a large community.

Brian W. Kernighan  Dennis M. Ritchie

Preface of "The C Programming Language"
WARNING!
This is the most DANGEROUS book I've ever read!
Authors give a lot of BAD ideas to the newbie programmers! They often suggest a lot of unreadable syntax and wrong concepts, and say that professional programmers prefer these forms! some examples from this book:

Code:
while ((to[i] = from[i]) != '\0') ++i;

while ((s[i++] = t[j++]) != '\0'); <-- this is a statement!

return (bufp > 0) ? buf[--bufp] : getchar();

for ( ; --lim > 0; w++) { ... }

This book should be banned from bookstores.
Logged
leledumbo
Jr. Member
**
Posts: 96



WWW
« Reply #24 on: June 09, 2011, 05:36:05 PM »

Quote
WARNING!
This is the most DANGEROUS book I've ever read!
Authors give a lot of BAD ideas to the newbie programmers! They often suggest a lot of unreadable syntax and wrong concepts, and say that professional programmers prefer these forms! some examples from this book
Well... since C was designed not to be coded readably and structured, I think the authors had done it as intended Grin
Logged
Cleverson
Newbie
*
Posts: 5


« Reply #25 on: June 16, 2011, 06:50:10 PM »

What about Go, the Google's recently released language?
http://golang.org/
Opinions?
Logged
leledumbo
Jr. Member
**
Posts: 96



WWW
« Reply #26 on: June 17, 2011, 04:01:05 PM »

Quote
What about Go, the Google's recently released language?
An uglified (C-ed) version of than Modern (Object) Pascal, with built-in map data type (isn't it supposed to be library's job?), built-in concurrency support (Ehm... Active.. Ehm... Oberon...), and type bound procedures a la Oberon-2.
Logged
Dsar
Newbie
*
Posts: 40


« Reply #27 on: June 18, 2011, 11:21:21 AM »

What about Go, the Google's recently released language?
http://golang.org/
Opinions?

Go is very similar to Oberon-2, but it has a simpler form of polymorphism (interface based), it is limited to 1 level of extension (then no type hierarchy) and only to record with type bound procedures (interface types), this allow a safe multiple inheritance that is useful in component oriented programming.
It also has concurrency. About this argument I strongly suggest to read "Thread cannot be implemented as a library" by Hans-J. Boehm. There are some issues about correctness if concurrency is implemented as library. If concurrency is on the compiler side, it can optimize the memory model. Ada and Fortran have proved a great performance in multitasking/multithreading programs.

Anyway, I don't like Go. It shares syntax with C and It's easy to code unreadable programs by mixing some of these (unusual) operators: &^ , &^= , <<= , <-.

Logged
ewnuz
Newbie
*
Posts: 1


« Reply #28 on: June 19, 2011, 01:49:38 AM »

While this thread has digressed a bit from the original question, language comparisons are an interesting topic, even interesting enough for me to create an account here. Let me first criticize the forum administrators for forcing me to install Flash in order to solve their stupid captcha, which apparently doesn't have the effect of keeping spammers out, which I can tell from yesterday's topic "wholesale designer handbags". Flash, seriously? I am actually considering to check the registration form at some point in the future for the removal of that requirement and leave this place on general principle in the event that that insanity is kept in place, but well, I'm here for now.

To the topic, let me first say that while I know neither of the languages discussed so far to the point that I'd be able to do programming with them without a cheat sheet next to me, I have looked at and read a lot about a number of different languages, so that I'd like to join the club, so to speak.

There seems to be some confusion about Modula-3, which I would like to resolve, as I happen, perchance, to have obtained a copy of "Systems Programming with Modula-3" rather recently, which turned out to be a good idea, given the interest I had to learn about its design. I cannot see how Modula-3 would embrace "the art of complexity", as somebody remarked, given the language designers' self-imposed constraint to keep the language report within 50 pages. While I'd consider some of its design decisions of questionable value, all in all I'd say the result is not exactly a bad one. As regards the involvement of Niklaus Wirth, the book says that it was proposed to develop Modula-3 as a successor to Modula-2 starting from Modula-2+ (delevoped earlier at DEC by Paul Rovner, Roy Levin, John Wick et al.), to which he gave his blessing. While he was not in the design committee itself, the book says: "He also reviewed the evolving design and made many valuable suggestions—not one of which was a suggested addition. Indeed, he inspired us with the courage to pull out a number of deep-rooted weeds." The last chapter gives an account of the discussions within the committee that elucidates well why certain decisions in the design have been made. It should be an interesting reading for anybody interested in language design.

As regards Ada, it has seen a number of extensions over the years despite the extensiveness of the language description being said to have been the major criticism from the beginning. Given that it was intended for large-scale software development, the justification for a large language might have been there. My impression of it is that it is not as much of "an insult to the human brain" as C++ has been said to be, but I wonder if a simpler design could not have achieved similar qualities. It seems to have a number of little, useful features for certain usecases, but the ignorant developer might not be unlikely to reimplement their functionality otherwise, for he has either never learned or already forgotten about a particular feature's existence before he first happens to encounter a situation in which it might be useful to him. All in all, featuring a language reference manual of around 800 pages, Ada looks somewhat overengineered to the point where the standardized rules add more complexity than their benefit would justify.

Dsar, as you seem to like Ada, you might be interested in ParaSail, a pet project of Tucker Taft, chief designer of Ada 95. He has blogged about it during the design phase. The reference manual that resulted is on par with Modula-3's 50-page report and can be found at the language's Google Group. There's no compiler as of yet but I'd expect a first one to get ready this year. Maybe you even feel like comparing ParaSail to the Oberon family languages?

I wonder what people here think about functional programming. Did somebody look at Dylan (as you should find its syntax attractive) and has an opinion? Or Scheme anyone? Should syntax be included in the list of language features that should be omitted for simplicity? Opinions welcome, if that is not too much digression from the original topic (well, it is, but we bother not many people here, no?).
Logged
Dsar
Newbie
*
Posts: 40


« Reply #29 on: June 30, 2011, 03:15:20 PM »

As regards Ada, it has seen a number of extensions over the years despite the extensiveness of the language description being said to have been the major criticism from the beginning. Given that it was intended for large-scale software development, the justification for a large language might have been there. My impression of it is that it is not as much of "an insult to the human brain" as C++ has been said to be, but I wonder if a simpler design could not have achieved similar qualities. It seems to have a number of little, useful features for certain usecases, but the ignorant developer might not be unlikely to reimplement their functionality otherwise, for he has either never learned or already forgotten about a particular feature's existence before he first happens to encounter a situation in which it might be useful to him. All in all, featuring a language reference manual of around 800 pages, Ada looks somewhat overengineered to the point where the standardized rules add more complexity than their benefit would justify.

I've something against the number of pages of a reference manual.
Okay a lot of details have a benefit, Ada is the only language I've ever see that compiles equally on every compiler. I did a big project with gnat, when I tried to compile it with ObjectAda and PowerAda it worked flawless (both compilation and execution!). Instead, every compiler of any other language had always some differences in the implementation, 20 or 50 pages are not sufficient for a compiler writer.
But 900 pages for a normal or professional programmer are too much and 1300 pages for a compiler writer is an impossible task, you cannot implement an Ada compiler alone. It requires a large number of programmers and a initial badget. A conformant Ada compiler requires a commercial support.
And a normal programmer that would master the language has a lot of details to remember.

Ada should be simplified, it has a lot of redundant features that can be replaced by a general one (like discriminant type with tagged type) like ParaSail, but honestly I don't like it.

I wonder what people here think about functional programming. Did somebody look at Dylan (as you should find its syntax attractive) and has an opinion? Or Scheme anyone? Should syntax be included in the list of language features that should be omitted for simplicity? Opinions welcome, if that is not too much digression from the original topic (well, it is, but we bother not many people here, no?).

With a lot of code they become unreadable for my taste.

Logged
Pages: 1 [2] 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!