LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-07-2010, 07:28 PM   #16
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Talking


Quote:
Originally Posted by shadow771 View Post
plus, i would like to take the chance and report that all the mocka complier links you got on your website are ( Forbidden/dead ).

anyway, i really appreciate your reply and thank you.
Free University Berlin has rearranged their website again. Silly germans.

Here is the http://lwb.mi.fu-berlin.de/inf/mocka/installation.shtml link to the page where and how to install mocka. Since this page is in german I guess you cannot read it. So here is the link to the compiler: ftp://ftp.mi.fu-berlin.de/lwb/pakete/mocka.tgz

Get it, then follow the instructions in http://fruttenboel.verhoeven272.nl/mocka/setup.html

Modula-2 is OOP-ing without constantly having to say 'oops!'

Full windowing operating systems were written with Modula-2 when MicroSchoft was still stomping out DOS 4 textmode programs.
 
Old 06-07-2010, 07:49 PM   #17
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by Sergei Steshenko View Post
Wise. By the way, IIRC, Modula-2 System module is dangerous - intentionally and by design - which makes Modula-2 a universal language, i.e. one can also program hardware in it.

And beginners are simply forbidden to use the module.
you won't even need SYSTEM for that. If, on a DOS style machine, you define a byte as a bitset you can manipulate individual bits in memory. Fast screen writes were usually done by having a big array at the address of the VGA screen buffer.

On Linux systems, the SYSTEM module is not dangerous at all. You will need root privileges for special things.

In general, Modula-2 is safe because it

won't let you do pointer arithmetic
won't allow math with different TYPE's
is VERY picky about procedures that return something
has no (real) goto / label construct
has definite END clauses for each IF
wants to be a MINIMAL system, whereas C, Java, C++ etc strive to be complete
implements code hiding and reuse
allows overloading in a SAFE way
does not require complex MAKE files

among many other things. Furthermoe, the compiler is there to help you, not to fight you.

A warning from my side:

IF youKnowModula2 = TRUE THEN
LearningJava := Troublesome ()
ELSE
LearningJava := Problematic ()
END

Java is more TYPEsafe than the other C-ish languages. But it suffers from the same amount of onamentation. Zillions of libraries just to be compelte for all persons in all places on all planets.

For GUI-ish programs I try to make a mix of Tcl/Tk front ends, which float on top of Modula-2 compiled executables.
 
Old 06-07-2010, 07:59 PM   #18
shadow771
LQ Newbie
 
Registered: Jan 2009
Location: Egypt/Alexandria
Distribution: not yet..
Posts: 17

Original Poster
Rep: Reputation: 2
Red face OMG!!

@Sergei Steshenko

ops, i forgot to mention haskel, thanks its on my list now.

@fruttenboel

wow i just wrote a big wall of text (used proxy and called isp and ....)

bad me didn't click refresh :P


thanks i will download and install it following your instructions, but what if i needed a little help on the learning process? may i contact you on jan AT verhoeven272 DOT nl? or you got an msn?

Edit: found this but the book is "incomplete"
http://freepages.modula2.org/report4/modula-2.html

also, the book is in german O.o that can be a problem...
http://www.amazon.co.uk/Programming-...5963981&sr=8-3

Thanks again

Last edited by shadow771; 06-07-2010 at 09:29 PM.
 
Old 06-07-2010, 09:02 PM   #19
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by fruttenboel View Post
...
On Linux systems, the SYSTEM module is not dangerous at all. You will need root privileges for special things.
...
I meant using SYSTEM module is to the same extent dangerous as using pointers, even more specifically, void *, in "C".
 
Old 06-07-2010, 09:02 PM   #20
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by fruttenboel View Post
...
Full windowing operating systems were written with Modula-2 when MicroSchoft was still stomping out DOS 4 textmode programs.
Yep.
 
Old 06-10-2010, 03:39 AM   #21
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by shadow771 View Post
@Sergei Steshenko

ops, i forgot to mention haskel, thanks its on my list now.

@fruttenboel

thanks i will download and install it following your instructions, but what if i needed a little help on the learning process? may i contact you on jan AT verhoeven272 DOT nl? or you got an msn?
Of course.

Quote:
Edit: found this but the book is "incomplete"
http://freepages.modula2.org/report4/modula-2.html

also, the book is in german O.o that can be a problem...
http://www.amazon.co.uk/Programming-...5963981&sr=8-3

Thanks again
You will find a lot of small sources on my mocka pages.

I still have a copy of "Modula-2 a complete guide". You can have it for the shipping charges.
 
Old 06-10-2010, 07:32 AM   #22
shadow771
LQ Newbie
 
Registered: Jan 2009
Location: Egypt/Alexandria
Distribution: not yet..
Posts: 17

Original Poster
Rep: Reputation: 2
@fruttenboel

Thanks a lot

the Author wrote this ... "Modula-2: A Complete Guide is both a comprehensive Modula-2 reference and a text for learning Modula-2. The only background required of the reader is experience writing programs in a structured, high-level language such as Pascal, PL/l, Ada, or C."

i only know C ( Data Types, loops, conditions, statements) i don't really know if i can handle the text without previous programming experience, but i will send you a private message about the shipping address/money transfer...

Thanks again
 
Old 06-10-2010, 03:35 PM   #23
shadow771
LQ Newbie
 
Registered: Jan 2009
Location: Egypt/Alexandria
Distribution: not yet..
Posts: 17

Original Poster
Rep: Reputation: 2
Hi again,

the mocka compiler is acting strange ....

Code:
root@delllaptop:/usr/local/mocka/lib# ./machen
Mocka 0608m
>> .. Compiling Implementation of BasicIO I/0008 II/0008
.. Compiling Implementation of Storage I/0005 II/0005
.. Compiling Implementation of ByteIO I/0018 II/0018
.. Compiling Implementation of RealConv I/0013 II/0013
.. Compiling Implementation of TextIO I/0027 II/0027
.. Compiling Definition of Signals
.. Compiling Implementation of Signals I/0001 II/0001
.. Compiling Implementation of MemPools I/0004 II/0004
.. Compiling Implementation of Clock I/0004 II/0004
.. Compiling Program Module tst I/0001 II/0001
.. Linking tst
>> 
./machen: line 26: mockabin/tst: No such file or directory
Code:
root@delllaptop:/usr/local/mocka/lib# ./makemockabin 
./makemockabin: 12: m2: not found
./makemockabin: 12: m2: not found
./makemockabin: 12: m2: not found
./makemockabin: 12: m2: not found
./makemockabin: 12: m2: not found
./makemockabin: 14: m2: not found
./makemockabin: 22: m2: not found
./makemockabin: 24: tst: not found
root@delllaptop:/usr/local/mocka/lib#
and here is my /etc/profile


Code:
 # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    PS1='\u@\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
	. /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

#i also pasted the export line here but nothing changed.
umask 022

export MOCKA=/usr/local/mocka
Thanks in advance.
 
Old 06-10-2010, 05:49 PM   #24
shadow771
LQ Newbie
 
Registered: Jan 2009
Location: Egypt/Alexandria
Distribution: not yet..
Posts: 17

Original Poster
Rep: Reputation: 2
partially solved.... ubuntu sets environment variables in /etc/environment not /etc/profile

but i still get this:

Code:
root@delllaptop:/usr/local/mocka/lib# ./machen
Mocka 0608m
>> .. Compiling Implementation of BasicIO I/0008 II/0008
.. Compiling Implementation of Storage I/0005 II/0005
.. Compiling Implementation of ByteIO I/0018 II/0018
.. Compiling Implementation of RealConv I/0013 II/0013
.. Compiling Implementation of TextIO I/0027 II/0027
.. Compiling Definition of Signals
.. Compiling Implementation of Signals I/0001 II/0001
.. Compiling Implementation of MemPools I/0004 II/0004
.. Compiling Implementation of Clock I/0004 II/0004
.. Compiling Program Module tst I/0001 II/0001
.. Linking tst
>> 
./machen: line 26: mockabin/tst: No such file or directory
and this:

Code:
root@delllaptop:/usr/local/mocka/lib# ./makemockabin 
Mocka 0608m
>> .. Compiling Implementation of BasicIO I/0008 II/0008
.. Compiling Implementation of Storage I/0005 II/0005
.. Compiling Implementation of ByteIO I/0018 II/0018
.. Compiling Implementation of RealConv I/0013 II/0013
.. Compiling Implementation of TextIO I/0027 II/0027
.. Compiling Definition of Signals
.. Compiling Implementation of Signals I/0001 II/0001
.. Compiling Implementation of MemPools I/0004 II/0004
.. Compiling Implementation of Clock I/0004 II/0004
.. Compiling Program Module tst I/0001 II/0001
.. Linking tst
>> 
./makemockabin: 24: tst: not found
Thanks in advance.
 
1 members found this post helpful.
Old 06-10-2010, 07:45 PM   #25
shadow771
LQ Newbie
 
Registered: Jan 2009
Location: Egypt/Alexandria
Distribution: not yet..
Posts: 17

Original Poster
Rep: Reputation: 2
solved :


Code:
>> nano hello.mod
>> p hello
.. Linking hello
>> ls  
hello  hello.mod  m2bin
>> ./hello    
hey LQ this is modula-2 mocka compiler running
>>
 
1 members found this post helpful.
Old 06-13-2010, 04:21 PM   #26
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by shadow771 View Post
solved :


Code:
>> nano hello.mod
>> p hello
.. Linking hello
>> ls  
hello  hello.mod  m2bin
>> ./hello    
hey LQ this is modula-2 mocka compiler running
>>
Well done!
 
  


Reply

Tags
code, compiler, java, programming



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting courses mijohnst Linux - Newbie 2 10-23-2005 08:19 PM
redhat courses myk3 Linux - General 1 11-17-2003 09:21 AM
Courses butface Linux - General 1 08-06-2003 12:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration