Re: [Oberon] Oberon Digest, Vol 237, Issue 4 , In.Char(ch);
Dear Hans, thanks a lot for your reply.
Which development environment do you use? => The current AOS (A2) environnement/IDE/compiler from ETH. https://gitlab.inf.ethz.ch/felixf/oberon
Which Oberon operating system do you use? => Debian Linux 12 "Bookworm" https://debian.ethz.ch/
Use In.Done() in Print.Me => there is no Open() Procedure in In.Mod
Kind regards Daniel On Sun, 2024-02-11 at 12:00 +0100, oberon-request@lists.inf.ethz.ch wrote:
Send Oberon mailing list submissions to oberon@lists.inf.ethz.ch
To subscribe or unsubscribe via the World Wide Web, visit https://lists.inf.ethz.ch/mailman/listinfo/oberon or, via email, send a message with subject or body 'help' to oberon-request@lists.inf.ethz.ch
You can reach the person managing the list at oberon-owner@lists.inf.ethz.ch
When replying, please edit your Subject line so it is more specific than "Re: Contents of Oberon digest..."
Today's Topics:
1. Re: Oberon Digest, Vol 237, Issue 2 (Hans Klaver)
--------------------------------------------------------------------- -
Message: 1 Date: Sat, 10 Feb 2024 17:21:40 +0100 From: Hans Klaver <hklaver@dds.nl> To: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Subject: Re: [Oberon] Oberon Digest, Vol 237, Issue 2 Message-ID: <1A4F0199-77A5-432D-BF59-D08B06B35536@dds.nl> Content-Type: text/plain; charset=us-ascii
Hi Daniel,/ developm/ development environment ent environment
You wrote:
Have no idea how to In.Char(ch);
About 1000 lines of code seem to work fine (a server to poll remote devices via tcp) but now i would like to get a user keyboard input but i get stuck:
PROCEDURE Test2; VAR b: BOOLEAN; ch: CHAR; BEGIN(*PROCEDURE*) Out.String("input: "); b:= In.Char(cWhich Oberon compiler / operating system / development environment do you use?
Unfortunately different implementations of Module In may vary somewhat inWhich Oberon compiler / operating system / development environment do you use? their use:
h); Out.Char(ch); END(*PROCEDURE*) T/ development environment est2;
compiles fine but doesn't even stop for an input? any idea/hint? / develop/ development environment ment environment Which Oberon compiler / operating system / development environment do you use?
Unfortunately different implementations of Module In may vary somewhat in their use:
- Sometimes In.Open has to be called first to initialize the input stream. - It is unusual that In.Char(ch) returns a boolean; all implementations of module In that I know use procedures with VAR parameters for input and do not return any value like your implementation appears to do. - Most implementations of In use a boolean variable In.Done that is declared outside any of the procedures of In (so it is a global variable of module In), which can be tested to see if all the input up to the test was suc/ development environment cessful.
For example using the OBNC command line compiler for Windows/Linux/macOS the following should work: MODULE TestIn; IMPORT In, Out;
PROCEDURE Test2; VAR ch: CHAR; BEGIN Out.String("Input a character and then press <enter>: "); In.Open; (* in OBNC this has no effect, but you could try it *) In.Char(ch); IF In.Done THEN Out.Char(ch) ELSE (* not useful for this character input, *) Out.String("Parameter error") (* but is useful for other input types *) END; Out.Ln END Test2;
BEGIN Test2 END TestIn.
Another example is the use of In in the Oberon System, which has no command line. There its use is more like described in the book by Reiser & Wirth "Programming in Oberon". After compilation the following module prints itself to the System.Log text, even before the text is saved to a file:
MODULE Print; (* Hans Klaver, 09-May-1999 *) (** To execute mark this viewer with * and middle-click Print.Me **) IMPORT In, Out;
PROCEDURE Me*; VAR ch: CHAR; BEGIN In.Open; (* is obligatory in the Oberon System! *) In.Char(ch); WHILE In.Done DO Out.Char(ch); In.Char(ch) END END Me;
END Print.Me*
In Wirth's latest version of the Oberon System: https://people.inf.ethz.ch/wirth/ProjectOberon/index.html modules In.Mod and Out.Mod are lacking. In that case you could use my In.Mod and Out.Mod: https://github.com/hansklav/Oberon-07
Some other versions of the Oberon System include In.Mod and Out.Mod, e.g. https://github.com/andreaspirklbauer/Oberon-extended
Regards,
Hans Klaver
------------------------------
Subject: Digest Footer
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
------------------------------
End of Oberon Digest, Vol 237, Issue 4 **************************************
The US White House put out a document discouraging the use of memory-unsafe languages like C/C++ due to their inherent lack of security. Apparently memory mismanagement is the cause of ~70% of security vulnerabilities. The Gov't recommended a number of safer languages instead, like Rust, Delphi/Pascal, Python, or Javascript. Quoting from the text: The highest leverage method to reduce memory safety vulnerabilities is to secure one of the building blocks of cyberspace: the programming language. Using memory safe programming languages can eliminate most memory safety errors. While in some distinct situations, using a memory safe language may not be feasible – this report examines space systems as a unique edge case and identifies memory safe hardware and formal methods as complementary ways to achieve a similar outcome – in most cases, using a memory safe programming language is the most efficient way to substantially improve software security BACK TO THE BUILDING BLOCKS: A PATH TOWARD SECURE AND MEASURABLE SOFTWARE, FEBRUARY 2024 https://www.whitehouse.gov/wp-content/uploads/2024/02/Final-ONCD-Technical-R...
The reason I posted this note, apart from the intense feeling of satisfaction, is that it may provide an avenue for funding. I do not know how many of you are thinking of the Oberon language and the OS as the forward looking tool. Chris of course. But in any case, a document like this can be a solid launching pad. That's one of the lessons I have learned in the USA. Consider the Gov't roadmaps a funding opportunity. The rest is in the execution of this general idea. If you are in the USA then think how to make it a business. If outside then talk to your own Gov't. Get money, get going, advance the NW legacy. ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of Skulski, Wojciech [skulski@pas.rochester.edu] Sent: Friday, March 1, 2024 12:00 AM To: ETH Oberon and related systems Subject: [EXT] [Oberon] Memory-unsafe languages discouraged by US Government The US White House put out a document discouraging the use of memory-unsafe languages like C/C++ due to their inherent lack of security. Apparently memory mismanagement is the cause of ~70% of security vulnerabilities. The Gov't recommended a number of safer languages instead, like Rust, Delphi/Pascal, Python, or Javascript. Quoting from the text: The highest leverage method to reduce memory safety vulnerabilities is to secure one of the building blocks of cyberspace: the programming language. Using memory safe programming languages can eliminate most memory safety errors. While in some distinct situations, using a memory safe language may not be feasible – this report examines space systems as a unique edge case and identifies memory safe hardware and formal methods as complementary ways to achieve a similar outcome – in most cases, using a memory safe programming language is the most efficient way to substantially improve software security BACK TO THE BUILDING BLOCKS: A PATH TOWARD SECURE AND MEASURABLE SOFTWARE, FEBRUARY 2024 https://www.tomshardware.com/software/security-software/white-house-urges-de...
I read the news about this, and I was gladly surprised to see Delphi-Pascal on the suggestions. I've also read another point of view of the report here: https://hackaday.com/2024/02/29/the-white-house-memory-safety-appeal-is-a-se... And I wonder, is Oberon in any of its versions, a memory-safe language? What mechanisms does it have or need to achieve that goal? Prof. Pablo Cayuela Argentina On Fri, 1 Mar 2024 at 02:18, Skulski, Wojciech <skulski@pas.rochester.edu> wrote:
The reason I posted this note, apart from the intense feeling of satisfaction, is that it may provide an avenue for funding. I do not know how many of you are thinking of the Oberon language and the OS as the forward looking tool. Chris of course. But in any case, a document like this can be a solid launching pad. That's one of the lessons I have learned in the USA. Consider the Gov't roadmaps a funding opportunity. The rest is in the execution of this general idea. If you are in the USA then think how to make it a business. If outside then talk to your own Gov't. Get money, get going, advance the NW legacy. ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of Skulski, Wojciech [skulski@pas.rochester.edu] Sent: Friday, March 1, 2024 12:00 AM To: ETH Oberon and related systems Subject: [EXT] [Oberon] Memory-unsafe languages discouraged by US Government
The US White House put out a document discouraging the use of memory-unsafe languages like C/C++ due to their inherent lack of security. Apparently memory mismanagement is the cause of ~70% of security vulnerabilities. The Gov't recommended a number of safer languages instead, like Rust, Delphi/Pascal, Python, or Javascript.
Quoting from the text: The highest leverage method to reduce memory safety vulnerabilities is to secure one of the building blocks of cyberspace: the programming language. Using memory safe programming languages can eliminate most memory safety errors. While in some distinct situations, using a memory safe language may not be feasible – this report examines space systems as a unique edge case and identifies memory safe hardware and formal methods as complementary ways to achieve a similar outcome – in most cases, using a memory safe programming language is the most efficient way to substantially improve software security
BACK TO THE BUILDING BLOCKS: A PATH TOWARD SECURE AND MEASURABLE SOFTWARE, FEBRUARY 2024
https://www.tomshardware.com/software/security-software/white-house-urges-de... -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Sun, Mar 3, 2024 at 2:58 PM Pablo Cayuela <pablo.cayuela@gmail.com> wrote:
I read the news about this, and I was gladly surprised to see Delphi-Pascal on the suggestions. I've also read another point of view of the report here:
https://hackaday.com/2024/02/29/the-white-house-memory-safety-appeal-is-a-se...
And I wonder, is Oberon in any of its versions, a memory-safe language? What mechanisms does it have or need to achieve that goal?
That alternative point of view includes some good points. Memory-safety is an aspect of the bigger picture which I prefer to call Software Reliability. I talked about this with respect to Oberon-07 in my presentation at the ETH Oberon Day in 2011. There is a video recording of this titled "ARM Embedded Development Using Oberon-07" at https://video.ethz.ch/events/2011/oberon.html In particular, see the section from time 19:00 to 24:50 (mins: secs). In summary I said "I took the 142 rules of the MISRA-C:2004 "Guidelines for the use of the C language in critical systems" and applied them to Oberon-07. I discovered that more than 70% of the rules are NOT required when programming in Oberon-07. They are either already enforced by the language or are not applicable." You can see some examples of these guidelines in an earlier post in this mailing list: Subject: Re: [Oberon] Oberon as (embedded) rtos, 12 November 2018 https://lists.inf.ethz.ch/pipermail/oberon/2018/012534.html Regards, Chris Burrows CFB Software https://www.astrobe.com/RISC5
On Sun, Mar 3, 2024 at 2:58 PM Pablo Cayuela <pablo.cayuela@gmail.com> wrote:
I read the news about this, and I was gladly surprised to see Delphi-Pascal on the suggestions. I've also read another point of view of the report here:
https://hackaday.com/2024/02/29/the-white-house-memory-safety-appeal-is-a-se...
And I wonder, is Oberon in any of its versions, a memory-safe language? What mechanisms does it have or need to achieve that goal?
Subsequent to my previous reply I rediscovered Wirth's paper titled "Modula-2 and Oberon". He describes the language changes that were made to improve safety during the evolution from Pascal to Oberon via Modula-2. "By eliminating all potentially unsafe facilities, the most essential step was finally made to obtain a truly high-level language. Watertight type checking, also across modules, strict index checking at run-time, nil-pointer checking, and the safe type extension concept let the programmer rely on the language rules alone. There is no longer a need to know about the underlying computer, or how the language is translated and data are represented. The old goal, that a language must be defined without mentioning an executing mechanism, had finally been reached." The paper can be downloaded from: https://people.inf.ethz.ch/wirth/Articles/Modula-Oberon-June.doc -- Regards, Chris Burrows CFB Software https://www.astrobe.com/RISC5
participants (4)
-
Chris Burrows -
Daniel Schmid -
Pablo Cayuela -
Skulski, Wojciech