:: Re: [DNG] Modula 3 is not Oberon
Góra strony
Delete this message
Reply to this message
Autor: nick
Data:  
Dla: dng
Temat: Re: [DNG] Modula 3 is not Oberon


Thankyou Hendrik for the correction. I think perhaps it is only Oberon that has memory safety then? I think there is also a Modula 2+ by a third party, or was it Modula 3+? Totally confused now. As I am writing on mobile it is difficult for me to pop over to another tab and double check before putting my foot in my mouth.



Actually I wish I had taken proper notes whilst I was researching this topic as it is all rather confusing. For instance IIRC Wirth and colleagues had decided to radically simplify Oberon by taking out all language features that were rarely used, so it's not a linear progression from Pascal to Modula to Modula 2 to Oberon, it's more like two steps forward one step back. And whilst I applaud the idea of reducing complexity, i thought it was a shame they reduced the set datatype to something so generic as to be useless. I think that's a reason why I decided to look further at other options such as Modula 3.



Has anyone heard the old joke that was given by a chair at a Modula conference as he introduced Wirth to the audience? He said: We Europeans tend to pronounce Wirth as Veert. Whereas, Americans tend to pronounce Wirth as Worth. That's because we call him by name, they call him by value!



Kind regards,

Nick



Ps thanks also to everyone else for the info on Modula family languages, Ada, Spark!











>
> On 1 Oct 2024 at 11:47 am, dng-request <dng-request@???> wrote:
>
>
> Send Dng mailing list submissions to
> dng@???
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> or, via email, send a message with subject or body 'help' to
> dng-request@???
>
> You can reach the person managing the list at
> dng-owner@???
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Dng digest..."
>
>
> Today's Topics:
>
> 1. Re (2): C, Ada, Oberon (peter@???)
> 2. Re: C, Ada, Oberon (kc-devuan@???)
> 3. Re: C, Ada, Oberon (Didier Kryn)
> 4. Modula 3 is not Oberon (Hendrik Boom)
> 5. C vs ADA : advice sought (o1bigtenor)
> 6. Re: C vs ADA : advice sought (Bruce Perens)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: 30 Sep 2024 09:38:33 -0700
> From: peter@???
> To: dng@???
> Subject: [DNG] Re (2): C, Ada, Oberon
> Message-ID: <mailman.4689.1727747247.6705.dng@???>
>
> From: nick <nick@???>
> Date: Tue, 1 Oct 2024 02:16:53 +1000
> > ... seems these languages do not have pointers.
>
> The Oberon systems use pointers although not the way they are used in
> C. The concepts can appear as strange as any unfamiliar system.
>
> Any example you describe here is likely to raise an enlightening
> discussion. https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
> The elegance of a solution to a problem may surprise you.
>
> Regards, ... P.
>
>
> --
> VoIP: +1 604 670 0140
> work: https://en.wikibooks.org/wiki/User:PeterEasthope
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 30 Sep 2024 18:03:31 +0100 (GMT+01:00)
> From: kc-devuan@???
> To: dng@???
> Subject: Re: [DNG] C, Ada, Oberon
> Message-ID: <c70d775e-6448-4a42-b4ba-f443ecf68456@???>
> Content-Type: text/plain; charset=UTF-8
>
> 30 Sept 2024 17:17:13 nick <nick@???>:
>
> > It is called Spark. I haven't tried Spark or Ada but I think it could well be worth a look.
>
> Robert Dewar once said that Ada has better support for pointer arithmetic than C.
>
> Of course it isn't needed and best avoided in Ada. There are far better options.
>
> Spark is a proving tool that understands the flow of an Ada program at compile time. It is more capable than Rust and the good thing about it being a separate tool is that this proving does not impact compilation time. The Gnat compiler still sees if you have specified that some code or a whole package is in spark mode and will give an error if you use a feature such as dynamic oop that isn't allowed in spark due to it breaking the ability to perform compile time flow analysis.
>
> Spark actually supports borrowing now and even prevents memory leaks (rust doesn't). I think it is much neater than Rusts borrowing. You can see that demonstrated here.
>
> https://youtu.be/97G1V2U8Drk?si=o5AL5OpoLVlMHwS1
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 30 Sep 2024 22:03:00 +0200
> From: Didier Kryn <kryn@???>
> To: dng@???
> Subject: Re: [DNG] C, Ada, Oberon
> Message-ID: <cbf32cc8-3da0-4981-8ccb-41dbac801ca7@???>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Le 30/09/2024 ? 19:03, Kevin Chadwick via Dng a ?crit?:
> > Robert Dewar once said that Ada has better support for pointer
> > arithmetic than C.
> >
> > Of course it isn't needed and best avoided in Ada. There are far better
> > options.
> >
> > Spark is a proving tool that understands the flow of an Ada program at
> > compile time. It is more capable than Rust and the good thing about it
> > being a separate tool is that this proving does not impact compilation
> > time. The Gnat compiler still sees if you have specified that some code
> > or a whole package is in spark mode and will give an error if you use a
> > feature such as dynamic oop that isn't allowed in spark due to it
> > breaking the ability to perform compile time flow analysis.
> >
> > Spark actually supports borrowing now and even prevents memory leaks
> > (rust doesn't). I think it is much neater than Rusts borrowing. You can
> > see that demonstrated here.
> >
> > https://youtu.be/97G1V2U8Drk?si=o5AL5OpoLVlMHwS1
>
> ??? SPARK is much promoted by Adacore. It was already 15 years ago,
> when I was programming in Ada. But the spectacular demonstration in the
> video assumes familiarity with the language. One doesn't need SPARK to
> learn Ada and one does not need to know all of Ada features to enjoy
> writing beautifull and safe programs. The presentation reminds me of
> another safety feature, beside defining the range of a variable: you
> cannot create a reference to a variable unless this variable has been
> declared "aliased". There is also a demonstration of packed data and bit
> fields, which shows the remarkable ability of Ada to represent the hardware.
>
> ??? The presentation is spectacular because the guy uses an IDE which
> automatically compiles and analyses the program when a modification is
> made. I never used an IDE, just Emacs and a terminal emulator to run
> gcc, gnatbind, gnatlink or gnatmake. BTW Emacs has a nice Ada mode.
>
> -- ??? Didier
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://mailinglists.dyne.org/cgi-bin/mailman/private/dng/attachments/20240930/4b582d76/attachment.htm>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 30 Sep 2024 16:53:11 -0400
> From: Hendrik Boom <hendrik@???>
> To: dng@???
> Subject: [DNG] Modula 3 is not Oberon
> Message-ID: <ZvsPt1VmJZTuLLl5@???>
> Content-Type: text/plain; charset=us-ascii
>
> On Tue, Oct 01, 2024 at 02:16:53AM +1000, nick wrote:
> >
> >
> > For a while I was enthusiastic about Oberon, also Modula 3 which is very similar.
>
> Modula 3 is a very different language from eother Modula, Modula 2, and Oberon.
> Modula 3 was not designed by Wirth.
>
> > I read all the papers and obtained some compilers for experiments
> > (the compiler situation is honestly not great which is probably due to the small number of people using these languages and the researchy nature of them).
> > The drawcard was that it promised to be a memory-safe language with similar features to C.
> > However, in the end I was disappointed as it seems these languages do not have pointers.
>
> Modula 3 *does* have pointers.
> Perhaps you didn't notice them because they are usually intimately associated with the object-oriented
> features of the language.
>
> Not only that, but it provides both pointers to garbage-collected data
> and pointers to data that are not garbage-collected. The second kind of pointers
> involve explicit free operations. which are considered unsafe.
>
> I have never had any problem building intricate data structures linked by pointers in Modula 3.
>
> -- hendrik
>
> > They do have pass by reference which is an improvement on java,
> > but otherwise the feature set is basically the same as java.
> > And apparently the designer of java (James Gosling) studied Oberon/M3 carefully in the process of specifying java.
>
> >
> >
> >
> > So unless you are particularly keen to use the special syntax of Oberon/M3 for creating modules
> > (which are something like a class but not quite, maybe Ada has something closer to it),
> > then I recommend to use java instead of Oberon/M3.
>
> Except pf course that Modula 3 does have pointers and classes, and they are not the same
> as the modules it also provides.
>
> > I would however be interested to learn more about Ada. There is also an extension of Ada which allows to specify invariants and have them enforced by the compiler, which supposedly gives you the same ability that Rust has of reasoning about ownership but in a more generic way. It is called Spark. I haven't tried Spark or Ada but I think it could well be worth a look.
> >
> >
> >
> > Kind regards,
> >
> > Nick
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 30 Sep 2024 20:18:03 -0500
> From: o1bigtenor <o1bigtenor@???>
> To: Devuan ML <dng@???>
> Subject: [DNG] C vs ADA : advice sought
> Message-ID:
> <CAPpdf5-tQZtfa1Nghbwv62FX-vGkVbbScX8mpE4_8vpDDe-jwA@???>
> Content-Type: text/plain; charset="utf-8"
>
> Greetings
>
> The game thus far:
>
> 1. I asked why learn C vs python/micropython for embedded systems
> (microcontrollers + more)
> There was a huge outpouring of learn C. (Thanks to those that
> responded.)
>
> 2. Then I was asking for what to learn C from.
> Again there were quite a few responders (and I started digging into
> books on C) .
>
> 3. So I'm continuing my digging around and poking my nose into all kinds of
> exotic software
> corners then I find that it is possible to use ADA for programming
> microcontrollers and
> embedded systems and there is a great deal of built in 'safety' so I
> might be less likely to
> generate poor quality code.
>
> So the question:
>
> if I were to want to choose between learning C (and likely adding C++) and
> learning ADA for programming microcontrollers and embedded systems what - -
> - besides amount of usage would you use to advise me - - - which should I
> learn (and why please (this is at least as important as your choice!!!))?
>
> TIA
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://mailinglists.dyne.org/cgi-bin/mailman/private/dng/attachments/20240930/ad357986/attachment.htm>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 30 Sep 2024 18:47:13 -0700
> From: Bruce Perens <bruce@???>
> To: o1bigtenor <o1bigtenor@???>
> Cc: Devuan ML <dng@???>
> Subject: Re: [DNG] C vs ADA : advice sought
> Message-ID:
> <CAK2MWOt=a7xufiwiYXfaBxyORCC3XxuV5+sVT+jK_pdoM2dqiA@???>
> Content-Type: text/plain; charset="utf-8"
>
> Excuse me for saying so, but this sounds archaic or worse. I guess I missed
> the part where you explained why Rust was unacceptable? It's not the
> easiest language to learn, but if you are going to make the investment in
> learning a compiled systems language, that should probably be the one, with
> Zig being a second choice.
>
> On Mon, Sep 30, 2024 at 6:18?PM o1bigtenor via Dng <dng@???>
> wrote:
>
> > Greetings
> >
> > The game thus far:
> >
> > 1. I asked why learn C vs python/micropython for embedded systems
> > (microcontrollers + more)
> > There was a huge outpouring of learn C. (Thanks to those that
> > responded.)
> >
> > 2. Then I was asking for what to learn C from.
> > Again there were quite a few responders (and I started digging into
> > books on C) .
> >
> > 3. So I'm continuing my digging around and poking my nose into all kinds
> > of exotic software
> > corners then I find that it is possible to use ADA for programming
> > microcontrollers and
> > embedded systems and there is a great deal of built in 'safety' so I
> > might be less likely to
> > generate poor quality code.
> >
> > So the question:
> >
> > if I were to want to choose between learning C (and likely adding C++) and
> > learning ADA for programming microcontrollers and embedded systems what - -
> > - besides amount of usage would you use to advise me - - - which should I
> > learn (and why please (this is at least as important as your choice!!!))?
> >
> > TIA
> > _______________________________________________
> > Dng mailing list
> > Dng@???
> > https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> >
>
>
> --
> Bruce Perens K6BP
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://mailinglists.dyne.org/cgi-bin/mailman/private/dng/attachments/20240930/9da5d5ee/attachment.htm>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>
>
> ------------------------------
>
> End of Dng Digest, Vol 121, Issue 1
> ***********************************
>