[Dynamite] July (attn Ewan)

Ian Holmes ihh@fruitfly.org
Tue, 23 May 2000 15:47:29 -0700 (PDT)


On Tue, 23 May 2000, Guy Slater wrote:

> On Tue, 23 May 2000, Ian Holmes wrote:
> 
> > yeah... i really want the dynamite language to *look* like a functional
> > programming language, but without having to do significantly more coding
> > ;)
> 
> It reckon it would probably require less coding in space, but more in time.
> 
> Anyway, I suppose the existing dynamite is kind of a functional language.
> Well, it isn't imperative.  Hmmm.

exactly -- I reckon it should *look* functional in some pseudo-Bayesian
sense. A sort of ULTRA-STOOPID functional language.

NB Ewan, Searls and Murphy's 1995 ISMB paper was in Prolog, which is a
functional language, so the idea of using FP for DP should not be all
*that* alien.

I think Telegraph should let you write lines that "imperatively" describe
a functional object, i.e. a state machine for sequence alignment.

For example (just brainstorming) here are a few different formats for
proto-Telegraph clauses describing a codon-to-protein match transition
with an associated splice score on the second base:
(NB I have put lots of params in here that are unnecessary most of the
time, just to illustrate the difference in terseness between (i) and (ii))

(i) vaguely Dynamite-like (C-influenced):

model my_model {

...

  transition {
    source             start_state;
    dest               match_state;
    name               start_to_match;
    query_emit         3;
    target_emit        1;
    query_params       splice[1];
    target_params      void;
  };
};


(ii) more functional:

MOVE my_model FROM start_state(i,j) TO match_state(i+3,j+1) = start_to_match(@i,@j) * splice(i+1);



I suppose the Dynamite-like one is closer to XML, but I prefer the
second form. Especially since we will already have to have big blocks of
equations like

  start_to_match(CTC,L) = ...
  start_to_match(CTA,L) = match(L) * f(C) * f(T) / (f(C) + f(T) * (f(A) + f(G)));
  start_to_match(CTG,L) = ...

A functional-like macro language with macros like "forall" and "make_nmer"
would be useful for making these long equation blocks terser, but I don't
think it's time-viable at the minute.

Ian