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

Can't get a working modula-2

37 views
Skip to first unread message

DougT

unread,
Nov 26, 2011, 9:39:18 PM11/26/11
to
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

unread,
Nov 27, 2011, 12:56:06 AM11/27/11
to
Hi,

On Nov 26, 8:39 pm, DougT <D...@DougTelford.com> wrote:
> Frustrated!!

:-(

> 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?

> 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.

> Perhaps the message is not to use modula-2.

Heh, no, the message is that installation and rebuilding are often
problematic.

> 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

unread,
Nov 27, 2011, 5:58:16 AM11/27/11
to
On Nov 27, 3:39 am, DougT <D...@DougTelford.com> wrote:
> 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

unread,
Nov 27, 2011, 5:18:01 PM11/27/11
to
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

unread,
Nov 27, 2011, 7:37:14 PM11/27/11
to
Hi,

On Nov 27, 4:18 pm, DougT <D...@DougTelford.com> wrote:
>
> 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

unread,
Nov 28, 2011, 7:47:39 AM11/28/11
to
On Sun, 27 Nov 2011 14:18:01 -0800, DougT wrote:

> On Nov 26, 7:39 pm, DougT <D...@DougTelford.com> wrote:
>> 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

unread,
Nov 28, 2011, 12:25:06 PM11/28/11
to
On Nov 28, 4:47 am, Brian Drummond <br...@shapes.demon.co.uk> wrote:

-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

Brian Drummond

unread,
Nov 29, 2011, 4:35:38 AM11/29/11
to
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

unread,
Nov 29, 2011, 12:41:31 PM11/29/11
to
On Nov 29, 1:35 am, Brian Drummond <br...@shapes.demon.co.uk> wrote:
-snip-
> 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.

Nomen Nescio

unread,
Nov 29, 2011, 12:09:14 PM11/29/11
to
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

unread,
Nov 29, 2011, 3:51:29 PM11/29/11
to
On Nov 29, 9:09 am, Nomen Nescio <nob...@dizum.com> wrote:
-snip-
> 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

Brian Drummond

unread,
Nov 29, 2011, 5:11:11 PM11/29/11
to
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

unread,
Nov 30, 2011, 10:27:08 AM11/30/11
to
I read your comment as *so* much milder than disparage :-)
0 new messages