Starting in MGS

Ok, you got a runable executable from the MGS distribution web page and you want to write your first MGS program. Before going further, note that MGS is an experimental programming language, mainly used as a vehicle to test and validate ideas in unconventional programming. So, beware that the syntax is especially fluctuating with the interpreters version. This warning done, here are some information to help you to write your first MGS program.



First Step

Long ago, we have started to write an MGS introduction:

  • The seminal report on MGS (long) is available and introduce a lot of concepts. The pages 17 to 37 will be especially usefull.
  • This tutorial in French is partial, unfinished and the syntax has dramatically changed, but it still gives a good flavor of the current MGS interpreter with a progressive learning curve.
  • We have started an english translation but only 15 pages on a total of 115 :-\ have been translated.



Second Phase

In a second step, take a look at the example in the MGS gallery: all examples include snipets of commented code.

Then dowload the compressed tar file containing the complete coding of the examples presented and developed in the following two papers:

  • scw 2012 for
    • the normalisation of boolean formula (Disjunctive Normal Form)
    • A Simple Space Subdivisions Scheme using a straightforward implementation of quadtrees using nesting
    • the emulation of fraglets, a DSL developped for the programmation of active network
  • interaction based modeling for 3 simulation of the same model: the growth of a “T”-shape.

After downloading the tarball (mgs_code_example.tgz) you decompress it (on linux tar xvzf mgs_code_example.tgz) which gives you a directory Code containing the following file:

  • Disjunctive Normal Form
    • fnd.mgs
    • fnd2.mgs
  • Quadtree: quadtree.mgs
  • Fraglet: fraglets.mgs
  • tshaped.mgs contains the 3 models of the growth of a “T”-shape. The file annotated-tshaped.txt contains the same code but slightly edited and with comments. But read the corresponding report before readng this file.
    • The following files contain the trace of a model run. These trace can be played using the jbview viewer. jbview is a Java program jbview.jar
      • ac.out the output of the cellular automata model
      • geoprox.out the output of the model relying on geoproximal collection
      • chain.out the abstract cellular complex model
    • And there are even some associated movies
      • t-proximal.mov
      • t-shaped.mov



To go further



Related Web Pages


Personal Tools