[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] code compiled by GM2

From: Gaius Mulley
Subject: Re: [Gm2] code compiled by GM2
Date: Mon, 05 Oct 2015 09:10:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Gour <address@hidden> writes:

> On Thu, 01 Oct 2015 16:56:58 +0100
> Gaius Mulley <address@hidden> wrote:
>> I am using gm2 to build a physics game engine which is in the
>> gm2/examples/pge directory.  It builds as an a.out or as a shared
>> library which becomes a Python module - so the 'main' program is
>> Python which calls upon the Modula-2 to do the heavy work.  
> I'll definetely explore it. Btw, do you use some Python GUI, which
> one?


most of the programs in this category use gm2/python/pygame, which does
not have gui (menu etc).

>> It uses MemStream and swig to communicate with Python.  gm2 works well
>> here as it implements runtime checking - exceptions and Python can
>> catch these etc.
> Do you find that Modula-2+Python combo works better interms of
> type-safety etc. (which are Modula-2's virtues) than e.g. using
> Object Pascal (FPC)?

I don't know much about Object Pascal or FPC.  However it does work well
with gm2, the runtime checking and ease of producing a shared library is

>> I also use gm2 for embedded work with the Atmega 328p, very small
>> embedded projects.  Also I have a microkernel written in Modula-2.
> Thanks, although I'm not interested for that field.
>> Lastly I like writing simple games in Modula-2, such as chess, halma,
>> pegfive and penguin tower.

they are built from two components.  The command line text based
application written in Modula-2 and then the pygame front end which
interacts with the Modula-2 program using the pexpect module.

This allows traditional debugging of the AI command line program in
Modula-2.  Once this is complete - then the pygame front end is written
and the two are bolted together.

if you are interested I'll put the code into the download area?

> Those games are, I assume, text-only?
>> Of course much of the front end of gm2 is also written in Modula-2.
> I'm curios to know what is the percentage of Modula-2 code in the gm2's
> front-end?

very roughly 

 25000   lines of C
157000   lines of Modula-2  (including libraries).
 16000   grammar files.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]