On 4/16/07, skaller <[EMAIL PROTECTED]> wrote: > In the model: > > spawn_fthread { Sin (xin, yout); }; > > shows that a chip is different from a procedure. > Here Sin is a *design* for a chip, but it is actually > the fthread which is the chip: in other words, > this is a dynamic instantiation of a template which not > only creates an actual chip .. it also plugs it into > the circuit by connecting particular wires to it.
This reminds me a lot of Pict [1]... Pict is based on the pi calculus and has channels which are much like Felix's channels (except that they are asynchronous). The equivalent of a "chip" is a "process definition", with the difference being that processes are spawned once each time they are needed, rather than running as a single-threaded server. (In pi calculus this is represented as starting an infinite number of single-threaded servers in parallel.) > in Cauchy illustrates one of the problems. We're actually > connecting here to a Newton chip which does this: > > var &b : double <- read bin; > var &n : int <- read nin; > > It's vital that reads and writes be correctly ordered, > or the circuit deadlocks. This seems like Forth or assembler, where a failure to call a function with the proper number of arguments in the proper order results in a runtime error. I could be missing something, but why not just pass a tuple? And for "variable-length" calls where you really want to read items sequentially (as in the inner loop of Newton), you could pass a channel to the process as an argument. That way you could take full advantage of the type system to ensure that no deadlocks occur when "calling" a process. Overall I like the idea but I disagree that it's any more modular than a good functional programming language. Functional module systems such as O'Caml's really get to the heart of modularity: you can manipulate both "ends" of a module functor the same way you can manipulate the inputs and outputs of a chip. I'm at the tail end of a course about component-based software engineering; I find it fascinating how naturally the professor's "provides/requires" circuit diagrams map to module functors... unfortunately the professor does everything in Java so there's never any mention of such a relationship :) - Chris [1] http://www.cis.upenn.edu/~bcpierce/papers/pict/Html/Pict.html ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language