Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

M3 programming workflow

65 views
Skip to first unread message

duke

unread,
Jun 4, 2011, 8:05:11 PM6/4/11
to
Hello Group ...

As much as I think `cm3ide' is very cool, I'm too used to
working with `emacs'. I'd like to establish an emacs-centric
workflow for using cm3 - if that's possible. Advise please.

In the meantime, I have the following code in a M3 "learning"
directory:

MODULE Main;

IMPORT IO;
VAR name: TEXT;

BEGIN
IO.Put("Enter your name: ");
name := IO.GetLine();
IO.Put("Your name is: " & name & "\n");
END Main.

The c3makefile is:

import("libm3")
implementation("Main")
program("my_hello")

It compiles, but with this warning:

dnormandin@select-man:~/Programming/Modula-3/code$
cm3
--- building in LINUXLIBC6 ---

new source -> compiling Main.m3
"../Main.m3", line 8: warning: potentially unhandled exception: IO.Error
1 warning encountered
-> linking my_hello

I like to clean up all warnings - so what did I do wrong in the above
code or makefile? TIA

--
Duke

Daniel Benavides

unread,
Jun 9, 2011, 6:37:44 PM6/9/11
to
Hi all:
yes, it's correct, as for historical reasons, the compiler must warn
that you may have not caught and exception. a related effort catched
many of those kind of awful RT errors. Meanwhile then you may not
ignore them, you are correct, but even if not available this is better
than nothing. Historic reasons, you may find ina comp.lang.c++ here:
http://groups.google.com/group/comp.lang.modula2/browse_thread/thread/c24b5482cc9f4ecf/71b433f5f7cdcd93?hl=en&ie=UTF-8&q=modula2+c%2B%2B+acorn+exceptions#71b433f5f7cdcd93

http://groups.google.com/group/comp.lang.modula3/browse_thread/thread/e2e443efb0864469/cbd1b92695428e89?hl=en&ie=UTF-8&q=olivetti+exceptions+modula3#cbd1b92695428e89

Interestingly in Acorn/olivetti did an experiment with an Modula-2+
written OS, they changed the exceptions policy "rule" twicking the
compiler and found several places where there were undeclared
exceptions, for such an OS it was even wrote ina research report.

Interestingly deeper in the comp.lang lists (found Modula-2 RT and
tool chain for Modula-2+) more information come to my light:
Try to check this featured Hello world, sort of nice, and hope helps
you understand the message a bit more:
http://www.ucam.org/chat/FAQ.0.3.html

Thanks in advance

PS: may more data become on the time as they recorded everything of
meeting sessions on Modula-3 design, just that by human error erased!
but some bits are in the SPWM3 alst chapter 7. May be that more become
available if such over time to come.

duke

unread,
Jun 10, 2011, 9:00:23 AM6/10/11
to
On Jun 9, 4:37 pm, Daniel Benavides <dabenavid...@gmail.com> wrote:
> Hi all:
> yes, it's correct, as for historical reasons, the compiler must warn
> that you may have not caught and exception. a related effort catched
> many of those kind of awful RT errors. Meanwhile then you may not
> ignore them, you are correct, but even if not available this is better
> than nothing. Historic reasons, you may find ina comp.lang.c++ here:http://groups.google.com/group/comp.lang.modula2/browse_thread/thread...
>
> http://groups.google.com/group/comp.lang.modula3/browse_thread/thread...

I'm slowly getting the picture about how Modula-3 operates ...

> Interestingly in Acorn/olivetti did an experiment with an Modula-2+
> written OS, they changed the exceptions policy "rule" twicking the
> compiler and found several places where there were undeclared
> exceptions, for such an OS it was even wrote ina  research report.
>
> Interestingly deeper in the comp.lang lists (found Modula-2 RT and
> tool chain for Modula-2+) more information come to my light:
> Try to check this featured Hello world, sort of nice, and hope helps
> you understand the message a bit more:http://www.ucam.org/chat/FAQ.0.3.html

Holy cow! what a difference between C and M3!

So ... the bottom line is what? That I failed to test for some
"xception" - some "corner case"?

Daniel Benavides

unread,
Jun 10, 2011, 1:18:46 PM6/10/11
to
Hi all:
just the "only" exception undeclared exception the compiler complains
about, that is IO interface:

MODULE Main;

IMPORT IO;
VAR name: TEXT;

BEGIN
IO.Put("Enter your name: ");

TRY


name := IO.GetLine();
IO.Put("Your name is: " & name & "\n");

EXCEPT
IO.Error =>
IO.Put ("Sorry illegal end of line");
END
END Main.

So more or less the same, but not the same for example Rd/Wr
interfaces, that is a really good designed package, you can read it
about in SPWM3 in chapter 6. Most of it is written in safe grounds and
some UNSAFE, still most of the common errors are detected if so by RT.
Very interesting, even they got to catch some RT errors there using
Extended Static Checking (as uncaught exception,a s a warning at ESC
time).

Thanks in advance

Daniel Benavides

unread,
Jun 11, 2011, 3:24:29 PM6/11/11
to
Hi all:
about your emacs question, there is certainly an emacs package [1]
from:
http://www.amazon.de/CHASID-Semantics-Oriented-Authoring-Environment-Informatik/dp/3832240934

It's a framework with rwe, see:
http://www.se.rwth-aachen.de/tikiwiki/tiki-download_file.php%3FfileId=275

, and see:
http://www.se.rwth-aachen.de/tikiwiki/tiki-download_file.php%3FfileId=273

built with Progres, XML and connecting with Emacs and another program,
see:

http://www.se.rwth-aachen.de/tikiwiki/tiki-index.php%3Fpage_ref_id=219.html

It is to be free software, in their terms, actually there was a

[1] F. Gatzemeier, CHASID: A Semantics-Oriented Authoring Environment,
1st ed. Shaker Verlag GmbH, Germany, 2005.

There is an small IDE actually for your purposes written by Michael
Daganais:
http://www.professeurs.polymtl.ca/michel.dagenais/pkg/m3ide.tgz

And there was a macro to convert lower to upper case keywords (I don't
have a copy, if some body maybe have one, called m3su):
http://www.faqs.org/faqs/Modula-3-faq/

There is actually another one (a developer called Martin Bishop, may
give you a hint hopefully martinbishop at bellsouth.com is his email
address).

Ok, hope it helps, thanks in advance

duke

unread,
Jun 12, 2011, 8:23:45 AM6/12/11
to
Thank you Daniel, for the editted code snippet. Now I'm getting the idea of what the compiler was complaining about.

Much obliged!
--
Duke

duke

unread,
Jun 12, 2011, 8:29:10 AM6/12/11
to
@Daniel re: emacs

Thanks! You should not have gone to so much trouble, as I'm not sure if I will even stay with Modula-3. The Oxford Oberon-2 compiler is looking simpler to use and just as effective. We'll see. Again, very much obliged!
--
Duke

Manuel Antolín Baigorri

unread,
Sep 22, 2015, 1:19:24 AM9/22/15
to
I think that giving cm3IDE a clue to select emacs, provided you cet an cygwin-like environment on windows, or straightaway in linux
it suffices to tell in configuartion that editing is to be done with the editor you wish to use.
--> MAB

0 new messages