Xcriber51
2007-03-20 23:20:00 UTC
Hi
I need a bit of advice on using Oberon for programming (on Windows XP).
After spotting Wirth's book on compilers, I've taken an interest in it.
Then I spotted the OS, and I downloaded and installed it. I've started
exploring it the last few days. But you see, I first want to explore
Oberon the programming language, and then study Wirth's compiler book.
Unfortunately - it seems -, as regards compilation, unless one is in the
OS environment, one is not able to utilize the Oberon compiler - at least
not on XP.
I found a third party's compiler: XDS by Excelsior. The trouble is, that
tool, being "free," leaves a few things to be desired. Its own environment
is not very enticing, and, worst, none of the "standard" libraries/modules
Wirth refers to are there. They have their own libraries, which makes it
programming certain things (especially IO interaction) pretty awkward.
Now, is there a way I can use the native Oberon OS compiler and its
libraries in XP without having to work in the OS?
--
Another question, which is a bit more language-specific. I'd like to be
able to write small programs -- while exploring Oberon -- that don't cost
an arm and a leg to interact with. For instance, take this example from
Wirth's "Programming in Oberon:"
PROCEDURE Gcd*;
VAR x, y: INTEGER; S: Texts.Scanner;
BEGIN
Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos);
Texts.Scan(S); x := S.i; Texts.WriteString(W, " x =");
Texts.WriteInt(W, x, 6);
Texts.Scan(S); y := S.i; Texts.WriteString(W, " y =");
Texts.WriteInt(W, y, 6);
WHILE x # y DO...
etc.
Now, my problem is this style of IO interaction is tortuous. Being used to
languages like C or LISP (e.g. as I'm sure you know, C's "agv[arg-#]"
facility makes life so easy), I find myself looking for a simple way of
passing command-line arguments to the compiler executable without all this
thrashing about with
Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos);
-or-
Texts.Scan(S); x := S.i; Texts.WriteString(W, " x =");
Texts.WriteInt(W, x, 6);
etc. Is there a way of doing this - i.e. any standard libraries for that?
Another reason for this is, I'd like to write multiple test/sample
functions in the same module, and then be able to call them by just using
(i.e. parsing)command line options.
(I learned in great joy, for instance, that the Oberon OS allows you to
access the exported functions in module directly, so theoretically you
should be able to call, say, "Math.Sqrt" directly from the command line,
but my trials only resulted in error. Is there a way to achieve this
quickly?)
Thanks in advance.
-- Ken
I need a bit of advice on using Oberon for programming (on Windows XP).
After spotting Wirth's book on compilers, I've taken an interest in it.
Then I spotted the OS, and I downloaded and installed it. I've started
exploring it the last few days. But you see, I first want to explore
Oberon the programming language, and then study Wirth's compiler book.
Unfortunately - it seems -, as regards compilation, unless one is in the
OS environment, one is not able to utilize the Oberon compiler - at least
not on XP.
I found a third party's compiler: XDS by Excelsior. The trouble is, that
tool, being "free," leaves a few things to be desired. Its own environment
is not very enticing, and, worst, none of the "standard" libraries/modules
Wirth refers to are there. They have their own libraries, which makes it
programming certain things (especially IO interaction) pretty awkward.
Now, is there a way I can use the native Oberon OS compiler and its
libraries in XP without having to work in the OS?
--
Another question, which is a bit more language-specific. I'd like to be
able to write small programs -- while exploring Oberon -- that don't cost
an arm and a leg to interact with. For instance, take this example from
Wirth's "Programming in Oberon:"
PROCEDURE Gcd*;
VAR x, y: INTEGER; S: Texts.Scanner;
BEGIN
Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos);
Texts.Scan(S); x := S.i; Texts.WriteString(W, " x =");
Texts.WriteInt(W, x, 6);
Texts.Scan(S); y := S.i; Texts.WriteString(W, " y =");
Texts.WriteInt(W, y, 6);
WHILE x # y DO...
etc.
Now, my problem is this style of IO interaction is tortuous. Being used to
languages like C or LISP (e.g. as I'm sure you know, C's "agv[arg-#]"
facility makes life so easy), I find myself looking for a simple way of
passing command-line arguments to the compiler executable without all this
thrashing about with
Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos);
-or-
Texts.Scan(S); x := S.i; Texts.WriteString(W, " x =");
Texts.WriteInt(W, x, 6);
etc. Is there a way of doing this - i.e. any standard libraries for that?
Another reason for this is, I'd like to write multiple test/sample
functions in the same module, and then be able to call them by just using
(i.e. parsing)command line options.
(I learned in great joy, for instance, that the Oberon OS allows you to
access the exported functions in module directly, so theoretically you
should be able to call, say, "Math.Sqrt" directly from the command line,
but my trials only resulted in error. Is there a way to achieve this
quickly?)
Thanks in advance.
-- Ken