Discussion:
Can't get a working modula-2
(too old to reply)
DougT
2011-11-27 02:39:18 UTC
Permalink
Frustrated!!

I have tried about 6 modula-2 installations for my system (linux
Fedora 15 X86-64). None of them work.

On some the libraries are the wrong versions and others just hang up.
Many of the installations are quite dated. gm2 (gnu modula-2) comes
close, but simple programs get an error

gm2 -fpim power.mod
/home/dtelford/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/
StrIO.def:60:1: error: unable to obtain the MIN value for type the
ZType
/home/dtelford/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/
StrIO.def:60:1: error: unable to obtain the MAX value for type the
ZType

I get the same error if I try the iso library (and change the IMPORT
statement). I have posted the problem to the gm2 mailing list.

Perhaps the message is not to use modula-2.

Any suggestions?

Regards,
Doug
Rugxulo
2011-11-27 05:56:06 UTC
Permalink
Hi,
Post by DougT
Frustrated!!
:-(
Post by DougT
I have tried about 6 modula-2 installations for my system (linux
Fedora 15 X86-64).  None of them work.
Which ones did you try? For sure I wouldn't expect Mocka to work, but
others should be okay. (But do you have/want GCC installed also?)

Are you trying to get 64-bit output or will 32-bit suffice?
Post by DougT
On some the libraries are the wrong versions and others just hang up.
Many of the installations are quite dated.  gm2 (gnu modula-2) comes
close, but simple programs get an error
(snip)
 I have posted the problem to the gm2 mailing list.
I don't think GM2 comes as .RPM, so I have no idea. Perhaps you can
use something (Alien??) to convert the .deb. But I wouldn't recommend
compiling it from scratch.
Post by DougT
Perhaps the message is not to use modula-2.
Heh, no, the message is that installation and rebuilding are often
problematic.
Post by DougT
Any suggestions?
http://freepages.modula2.org/compi.html#liunix

XDS works in Linux also but perhaps needs GCC. You could also try
building m2f. Actually, I could tell you how to build ACK, it's fairly
easy. Heck, I could .tar.gz (or use CDEPACK) to bundle it up for you.
Or if you're really desperate, try installing Oxford Oberon or CM3
Modula-3 (probably close enough).
jan272
2011-11-27 10:58:16 UTC
Permalink
Post by DougT
Frustrated!!
just install obc (mike spivey) http://spivey.oriel.ox.ac.uk/corner/Oxford_Oberon-2_compiler

the days of modula were short, beautiful and over. alas. with tears in
my voice.

obc is nice, it works, is cross platform, and unsupported.
DougT
2011-11-27 22:18:01 UTC
Permalink
Post by DougT
Frustrated!!
I have tried about 6 modula-2 installations for my system (linux
Fedora 15 X86-64).  None of them work.
On some the libraries are the wrong versions and others just hang up.
Many of the installations are quite dated.  gm2 (gnu modula-2) comes
close, but simple programs get an error
gm2 -fpim power.mod
/home/dtelford/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/
StrIO.def:60:1: error: unable to obtain the MIN value for type the
ZType
/home/dtelford/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/
StrIO.def:60:1: error: unable to obtain the MAX value for type the
ZType
I get the same error if  I try the iso library (and change the IMPORT
statement).  I have posted the problem to the gm2 mailing list.
Perhaps the message is not to use modula-2.
Any suggestions?
Regards,
Doug
Taking the advice of a responder, I tried cm3 (modula-3). It is a
very nice system (at least so far), and they had a distribution for 64
bit linux. Installed and running with no problem.

In response to what systems I tried:
m2f, MOCKA, ACK (maybe could have got this to work playing with the
gcc library), XDS (wanted GLIBC 2.0, and from what I read, this would
not be easy to do on my system), gm2 (problem as originally posted) I
compiled the source which took more than 20 minutes on a 4 core 3.5GHz
4GB memory system (seems very complicated), Garden Point (Red Hat
release 7 would not work on my system). I didn't require a 64 bit
system, but sometimes there are library problems with 32 bit systems.

Regards,
Doug
Rugxulo
2011-11-28 00:37:14 UTC
Permalink
Hi,
Taking the advice of a responder, I tried cm3 (modula-3).  It is a
very nice system (at least so far), and they had a distribution for 64
bit linux.  Installed and running with no problem.
Be sure to read the SRC report(s), they are freely available. It's not
quite 100% backwards compatible with M2 (though a converter exists).
It adds objects, exceptions, threads, garbage collection. Though it's
very rarely used these days, sadly, as people prefer other things
which borrowed heavily from it (e.g. Java, Python).
ACK (maybe could have got this to work playing with the gcc library),
Builds pretty easily (despite unconventional build system). For me it
only worked once I installed and used byacc (and not bison). There's a
mailing list, so the current maintainer might be able to help if
really curious. Oh, and make sure to set your prefix accordingly (if
you don't want to pollute your /usr/bin/ or whatever the default local
place is). I put it in /opt/ack for whatever reason. This is probably
your easiest bet (though CM3 is quite good too).
gm2 (problem as originally posted) I compiled the source which took more
than 20 minutes on a 4 core 3.5GHz 4GB memory system (seems very complicated)
Yes, it's silly complicated, that's GCC for you (puke). I mean, it's
awesome, but yeah, build woes are NO FUN! :-(

It has been officially tested and supported under Debian 64-bit, so in
theory it should be easy to build or use for Fedora 64-bit. But I
dunno. For a while I too was running Fedora from liveUSB, but I was
disappointed in (naively) not knowing how to get a working copy. I
like rebuilding stuff, but GCC just gives me nightmares.
I didn't require a 64 bit
system, but sometimes there are library problems with 32 bit systems.
I sympathize, but don't give up, try try again. GM2 is quite nice,
honestly. Surely somebody here knows a good way to get it working,
even if it requires dirty hacks (Alien: DEB -> RPM ???). Ask on the
GM2 mailing list.
Brian Drummond
2011-11-28 12:47:39 UTC
Permalink
Post by DougT
Frustrated!!
I have tried about 6 modula-2 installations for my system (linux Fedora
15 X86-64).  None of them work.
On some the libraries are the wrong versions and others just hang up.
Many of the installations are quite dated.  gm2 (gnu modula-2) comes
close, but simple programs get an error
gm2 -fpim power.mod
/home/dtelford/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/
StrIO.def:60:1: error: unable to obtain the MIN value for type the
ZType
/home/dtelford/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/
StrIO.def:60:1: error: unable to obtain the MAX value for type the
ZType
I get the same error if  I try the iso library (and change the IMPORT
statement).  I have posted the problem to the gm2 mailing list.
Perhaps the message is not to use modula-2.
Any suggestions?
Regards,
Doug
Taking the advice of a responder, I tried cm3 (modula-3). It is a very
nice system (at least so far), and they had a distribution for 64 bit
linux. Installed and running with no problem.
Another option worth mentioning (from an M2 fan since the 1980s) is to
take a look at Ada. In the heyday of Modula-2, Ada was too expensive and
difficult to compile on 1980s workstations to be worth considering.

But now there is a free Ada compiler, and it's a while since I've seen a
1980's workstation...

Gnat is fully integrated into GCC (though not all GCC installations have
it by default, it is usually just a matter of adding a few optional
packages) and works well; the compiled code has similar speed to C or C++.
See http://shootout.alioth.debian.org/ for more on that : incidentally,
M2 seems a bit under-represented there.

Though Ada is a much bigger language, with its object-oriented revisions
in 1995 and 2005, its M2-like parts are sufficiently familiar that I
picked them up quite easily, and found myself liking what I could do in
Ada. (Like M2 with some of the prickles smoothed off)

And after a decade or more stuck in the miasma of C++, it feels more like
healing than learning...

Where to start?
http://en.wikibooks.org/wiki/Ada_Programming
John Barnes : "Programming in Ada 2005"
(for GPL software: ) http://libre.adacore.com/libre/
(for fewer restrictions, get Gnat from the FSF GCC project instead,
or your Linux distro should have packages for it)
and of course, comp.lang.ada

- Brian
Isaac Gouy
2011-11-28 17:25:06 UTC
Permalink
On Nov 28, 4:47 am, Brian Drummond <***@shapes.demon.co.uk> wrote:

-snip-
Post by Brian Drummond
the compiled code has similar speed to C or C++.
incidentally, M2 seems a bit under-represented there.
There really wasn't much sense in doing the work to measure Oberon-2
programs 3 or 4 years ago - but I did because I'd once programmed
Modula-2 -

http://shootout.alioth.debian.org/gp4/compare.php?lang=ooc
Brian Drummond
2011-11-29 09:35:38 UTC
Permalink
Post by Isaac Gouy
-snip-
the compiled code has similar speed to C or C++. See
http://shootout.alioth.debian.org/for more on that : incidentally, M2
seems a bit under-represented there.
There really wasn't much sense in doing the work to measure Oberon-2
programs 3 or 4 years ago - but I did because I'd once programmed
Modula-2 -
http://shootout.alioth.debian.org/gp4/compare.php?lang=ooc
Thanks for running that site! If the Oberon results are like those for
Ada, any slower ones are probably down to lack of optimisation effort
while the C results have been worked on much harder.

- Brian
Isaac Gouy
2011-11-29 17:41:31 UTC
Permalink
On Nov 29, 1:35 am, Brian Drummond <***@shapes.demon.co.uk> wrote:
-snip-
Post by Brian Drummond
Thanks for running that site! If the Oberon results are like those for
Ada, any slower ones are probably down to lack of optimisation effort
while the C results have been worked on much harder.
While no one showed any interest in contributing Modula-2 or Oberon-2
programs, it would not be correct to suggest that I did not make any
effort to optimise those programs.

Also, I have to disagree about the Ada programs - the Ada contributors
have worked and re-worked those programs over years. Of course, there
are just a whole lot more C programmers.
Brian Drummond
2011-11-29 22:11:11 UTC
Permalink
Post by Isaac Gouy
-snip-
Post by Brian Drummond
Thanks for running that site! If the Oberon results are like those for
Ada, any slower ones are probably down to lack of optimisation effort
while the C results have been worked on much harder.
While no one showed any interest in contributing Modula-2 or Oberon-2
programs, it would not be correct to suggest that I did not make any
effort to optimise those programs.
Also, I have to disagree about the Ada programs - the Ada contributors
have worked and re-worked those programs over years. Of course, there
are just a whole lot more C programmers.
Didn't mean to disparage either your efforts or the Ada programmers, I
played a tiny part in that. I only meant that, as you say, there are a
whole lot more C programmers.

- Brian
Isaac Gouy
2011-11-30 15:27:08 UTC
Permalink
Post by Brian Drummond
Post by Isaac Gouy
-snip-
Post by Brian Drummond
Thanks for running that site! If the Oberon results are like those for
Ada, any slower ones are probably down to lack of optimisation effort
while the C results have been worked on much harder.
While no one showed any interest in contributing Modula-2 or Oberon-2
programs, it would not be correct to suggest that I did not make any
effort to optimise those programs.
Also, I have to disagree about the Ada programs - the Ada contributors
have worked and re-worked those programs over years. Of course, there
are just a whole lot more C programmers.
Didn't mean to disparage either your efforts or the Ada programmers, I
played a tiny part in that. I only meant that, as you say, there are a
whole lot more C programmers.
I read your comment as *so* much milder than disparage :-)

Nomen Nescio
2011-11-29 17:09:14 UTC
Permalink
Post by Brian Drummond
Post by Isaac Gouy
-snip-
the compiled code has similar speed to C or C++. See
http://shootout.alioth.debian.org/for more on that : incidentally, M2
seems a bit under-represented there.
There really wasn't much sense in doing the work to measure Oberon-2
programs 3 or 4 years ago - but I did because I'd once programmed
Modula-2 -
http://shootout.alioth.debian.org/gp4/compare.php?lang=ooc
Thanks for running that site! If the Oberon results are like those for
Ada, any slower ones are probably down to lack of optimisation effort
while the C results have been worked on much harder.
- Brian
If you ask on comp.lang.ada they will explain the exact reasons Ada scores
badly on those shootouts. The rules make it hard for Ada to perform
well. Ada can perform well, but not with the shootout's rules.
Isaac Gouy
2011-11-29 20:51:29 UTC
Permalink
On Nov 29, 9:09 am, Nomen Nescio <***@dizum.com> wrote:
-snip-
Post by Nomen Nescio
If you ask on comp.lang.ada they will explain the exact reasons Ada scores
badly on those shootouts. The rules make it hard for Ada to perform
well. Ada can perform well, but not with the shootout's rules.
Really?

"Shootout News: 64 Bits of Sweet Pancake"

http://groups.google.com/group/comp.lang.ada/browse_thread/thread/deb179aa052b8e20?tvc=2&q=%22benchmarks+game%22
Loading...