[Yhc] yca2swf? was coreFunc has extra argument

Jeremy Shaw jeremy at n-heptane.com
Tue Mar 4 13:00:11 EST 2008


At Tue, 4 Mar 2008 11:38:01 -0500,
Dimitry Golubovsky wrote:
> 
> Hi,

> Jeremy: could you please elaborate on this? It doesn't even google.
> 
> Does this involve actionscript in any way (but I may ask mistakenly as
> I am not much familiar with shockwave/adobe stuff)?

I have been working a Haskell->shockwave flash compiler for a
while. Currently I use yhc to compile Haskell->.yca, and then I have
another program that compiles the yca->swf.

As of a few days ago, it kind of works. However it is not yet very
useful because the FFI is extremely limited (and broken). I am working
on improving the FFI now so that it can create objects and invoke
methods on objects and marshall types between Haskell and the flash
virtual machine (for example, Bool).

I believe all you need to do is:

darcs get http://www.n-heptane.com/nhlab/repos/haskell-swf

runhaskell Setup.hs configure &&  runhaskell Setup.hs build &&  sudo runhaskell Setup.hs install

then:

darcs get http://www.n-heptane.com/nhlab/repos/yhc/

run scons to build the yhc binary
cd src/translator/avm2/
edit the YHC_BASE_PATH in Makefile
run 'make' to generate test.swf from SimpleTest.hs

Alternatively you can just point your browser at:

http://seereason.com/~jeremy/test.swf

Which is the output from the program,

swfMain :: IO ()
swfMain =
	do putChr 'h'
 	   putChr 'i'

The top box is 'stdout', the bottom box is debug information. As you
can see, it currently takes a lot of work to print 'hi' :)

j.

ps. One thing you should definitely *not* do, I repeat, *not* do is
attempt to look at the source code for the yca2swf compiler. It is a
horrible mess and full of comments that are completely wrong. :)

The yca2swf compiler is based on the STG machine paper -- which is
also not really a good way to do it. My plan is to finish the FFI
stuff for the current version, and then start over.


More information about the Yhc mailing list