On Fri, 2006-08-25 at 00:10 +0300, Mark Wotton wrote:
> Is C++ the only backend available?
At the moment yes. I have done considerable work
to replace C++ hacks in the front end with proper
combinators, delegating all the C++ specifics
to the code generator, however this work isn't complete.
However that's the easy part: the system also relies on
certain 'features' of the target language semantically,
for example it must have 'goto' instruction.
> I'd really like to have a backend generating PicBasic, which is a
> fairly standard Basic dialect for programming controllers that I
> happen to have a compiler for... is there a low-level representation
> of Felix that isn't totally reliant on C++?
Yes, but there is no way to output it. If you look in
the Ocaml file
src/flx_type.mli
you will see a sum type containing variants:
`BEXE_goto _
`BEXE_call _
etc. These are the primitive instructions of the IL.
There is a similar set for expressions:
`BEXPR_...
> I'm interested mostly in
> the synchronous -> asynchronous transformation.
You could easily hand write the driver(scheduler) logic
for a microcontroller based on the C++ driver.
You could also probably do the required control inversion
with a Felix like program in Haskell more easily than
unravel the Felix system itself .. the algorithm
is fairly trivial eg replace
...
call F A
...
with
switch (pc) { ...
pc = next;
return new F(this,A);
case next:
....
}
although on a micro controller you'd use a computed jump
(Which Felix also uses with gcc). It's just basic
continuation passing model, except using a mutable object
that typically is its OWN continuation.
This is something FP people just don't get. Procedural
programming IS continuation passing. There is in fact
no other possible computational model!
What is the 'program counter' but a continuation?
> (Background: I'm doing some lighting programming, and writing my own
> event loops and queues gets old fast.)
Oh? For whom? Curious because I *invented* the software
part of the digital dimmer :)
[The hardware was designed by John Gunton of Dynalite]
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language