Monday, December 26, 2005

Crazy Ideas

Having a small, clean, simple, production strength Haskell compiler lets a lot of people come up with Crazy ideas that just weren't feasible before. (alright, so Yhc certainly isn't production strength yet, but it could be without too much work...)

Some of the crazy ideas are listed at on the wiki, some others have been sent out in emails. Quite a lot aren't crazy at all, but would be really useful! Just a quick summary of some side projects/tools that are being developed, or have been thought of:
  • Haskell HBC -> Java bytecode
  • Javascript runtime for HBC files
  • Python runtime for HBC files
  • Playstation port (entirely speculation so far)
I also came up with a new crazy idea for Yhc, HsNub. Have you ever written a function, and later found out that it did the same as a function in the prelude? Take the Yhc code base, I recently eliminated the function second, which is equivalent to the Prelude function const. It would have been nice if something spotted this and gave out a warning. With a portable bytecode, this isn't that much work - two functions can be seen as equivalent if they are identical at the bytecode level. I intend to write this tool once I have a working bytecode library - I don't expect it to take more than an hour at most - thats the nice thing about having a relatively simple Haskell implementation!

3 Comments:

Blogger Neil Mitchell said...

Certainly possible - I guess a bytecode convertor could be written for any bytecode which is turing complete, which I guess is pretty much all of them.

Want to volunteer? :)

11:44 AM  
Blogger reductor said...

is it easy enough to write yhc bytecode to caml and vice versa translator?
as far as i know caml has a very good bytecode runtime and a lot of good libraries.
I'm not familiar enough with both formats but the whole idea seems ... such translator and consequently yhc <-> caml interoperability would be a bomb.

10:00 PM  
Blogger Neil Mitchell said...

The biggest difference between the runtimes is that Haskell is lazy and Caml is strict - that makes for a very different bytecode format - not to say it couldn't be done, but the interoperability with libraries etc. might be a bit limited.

A better approach would be a Haskell -> O'Caml convertor, which I know someone is working on. That would give perfect library useage between the two.

4:18 PM  

Post a Comment

<< Home