nomyx / Nomyx

The Nomyx game
83 stars 9 forks source link

Add interpreter in the DSL #31

Open cdupont opened 10 years ago

cdupont commented 10 years ago

The idea is to allow the player to interpret himself some strings as a Nomex (). This would allow the rules themselves to read code inputted by the players. Currently the players are inputting the new rules through a dedicated field not controlled by the rules.

cdupont commented 10 years ago
  1. Add a primitive able to interpret code in the Exp GADT:

    Inter :: String -> Nomex (Either String (Nomex ()))

    When executed, it interprets the given string. If the type is a Nomex (), then the corresponding function is returned. Otherwise an error message is given.

  2. move the "Engine" part of Nomyx-Language into Nomyx-Core to allow it to access the interpreter
  3. add an evaluation for the Inter primitive. This requires to add an IO layer in the evaluator.
cdupont commented 10 years ago

Steps 2 done