archives

Advice for a young researcher

Hi! I'm looking for some advice about PL research. I am professionally halfway between game development (mostly Xbox+Steam) and PL research at an Italian university.

So far I have been studying scripting languages, monads and coroutines, and I've managed to build a concurrent extension to F# that can easily surpass the state of the art (namely LUA) in terms of safety, performance and clean syntax. Now I'd like to tackle a larger problem: I wish to study how to define a game with a mixture of (declarative) rules and invariants and events and scripts; this apparent asymmetry works pretty well since games require lots of complex rules and lots of articulated behaviors, which I believe are best expressed with different formalisms.

The idea is the following; we define a state in terms of nested sets of triplets (label, type, rules). As an example consider a space-shooting game with starships and projectiles:

State = 
  Ships : Set[Ship] = {ship : ship \in Ships and ship.Life > 0}
  Projectiles : Set[Projectile] = {proj : proj \in Projectiles and proj.Life > 0}
  …

Ship =
  Colliders : Set[Projectile] = {p : p \in state.Projectiles and collides(self,p)}
  Life : float = self.Life - sum{p.damage : p \in Colliders}
  …

also, some fields are event handlers, like:

ShipEvents =
  Created : Event[ShipCreatedArgs] = on_ship_created
  Selected : Event[SelectionArgs] = on_ship_selected

where on_ship_created and on_ship_selected are coroutines (lightweight threads) which are added to the scheduler when the respective events are fired.

My questions are the following:
1. is this more PL research or software engineering?
2. are there people studying languages and games out there?
3. is this approach of mixing declarative and procedural aspects known, and if so can somebody provide some pointers?

Thanks