Wednesday, September 20, 2006

Yhc.Core API available

Yhc.Core is now a publically available and somewhat supported API! There are no docs on it, but check out the Yhc repo and see src/compiler98/Yhc/Core. Just add "import Yhc.Core" at the top and you can do all cool sorts of things.

Step 1 is to generate Core files, with the .ycr extension. If you are compiling Yhc adding scons core=1 to the command line, and all the libraries will have .ycr files generated along with the .hi and .hbc files. If you are compiling an individual file, then add the yhc -corep flag, and it will generate a .ycr file.

The .ycr files are stored in Binary, but thats OK, because if you want to view one, its literally as simple as:

import Yhc.Core
showFile x :: FilePath -> String
showFile x = loadCore x >>= return . show

(There will be a flag/program/command to view a .ycr file at some point - its not hard to do, but it is hard to figure out where the flag should go and what it should be called!)

Now once you've got Core, what can you do? Take a look at the data structure in the Yhc.Core.Type file, to see what it contains. There are already two programs that depend on Yhc.Core, Catch and Dr Haskell. In particular if you take a look at the main file of Dr Haskell, you can see some trivial ways to play with Core.

Hopefully Yhc.Core will be useful for many projects - if it interests you please drop an email to yhc -AT-, saying what you want to do etc. (Of course, you don't have to, but we're curious folk!)

Sunday, September 17, 2006

Nofib suite getting there!

Some good news to report, slowly but surely more of the nofib benchmark suite is running successfully - we now have 24 tests in the nofib benchmark going through nicely, and added to the buildbot.

The issue tracker is starting to see more use, getting more of the thoughts that were marked down as "oh, we should do that" and converting them into concrete bugs that one day someone might solve. Its also useful for tracking down where things are going.

We can now output core for all the libraries Yhc builds with - simply pass core=1 to Scons and it will do the hard work for you. Not massively helpful, unless you're me, but might be of general use one day!

We also have a few more features merged in - no need to give the -unlit flag for .lhs files, and the OPTIONS_YHC pragma is supported in a similar manner to the OPTIONS_GHC pragma.

Yhc is slowly getting more useful, once the base libraries are useable with Yhc, it will be good enough to start eating our own dogfood!