Skip to content

Commit

Permalink
add initial uncomplete thoughts of mole syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
cotto committed Jun 30, 2011
1 parent 699a72f commit ef0bd22
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions syntax
@@ -0,0 +1,46 @@
possible syntax for mole ("M0 Overlay LanguagE")

- types

registers: I, N, S, P
primitive string: cs


- struct

struct {
I int_thingy;
N n_thingy;
} struct_thingy;

- functions

chunk main (I a1, I a2, I a3) {
const I stdout 1;
const cs hello "ohai. im in ur m0";

// annotation for the right file will be added by m1 compiler
m0::print_i stdout, hello;

var I i_thingy;

i_thingy += a3++;

c::fprintf(stdout, "asdfw %d\n", i_thingy);



}

- composed op
* acts like a function
* has temporary registers
* does not have an explict return statement

compose init_cf(I a1, I a2, I a3, N a4)
tmp I tmp0,
tmp N tmp1,
{


}

0 comments on commit ef0bd22

Please sign in to comment.