Posts Tagged ‘Haskell’

LambdaVM failure

January 19, 2010 in Research | Comments (0)

Tags: ,

The LambdaVM pro­ject is actu­ally a really bril­liant pro­ject. It’s a modi­fic­a­tion of GHC to tar­get the JVM. I installed it in Octo­ber of last year and played around with it, feel­ing that it might actu­ally have a place in help­ing spread the gos­pel of Pola.

The thing is I can’t expect people to down­load the source to Pola if they want to play around with it, so I have to provide pre-​​compiled bin­ar­ies. OS X, Win­dows and Sol­aris are easy for me to pro­duce bin­ar­ies for, but then you have to think about Linux, BSD, OpenSol­aris, 64-​​bit Win­dows, etc., on vari­ous plat­forms. Tra­di­tion­ally I have about 6 or 7 bin­ar­ies up there for the most pop­u­lar archi­tec­tures — past releases have been most pop­u­lar with x86 Debian and x86 Win­dows — but every time I make a new release I have to rebuild them all.

So I was hop­ing to have a JVM ver­sion of Pola to put up there as a catch-​​all for archi­tec­tures I hadn’t had a chance to build for yet. While the LambdaVM pro­ject has treated me fant­ast­ic­ally well for little toy examples, it doesn’t do well for Pola. I tried it and it crashed after about 2 minutes after run­ning out of heap space. The stack trace showed it was still doing type inference…after two minutes…some­thing which Pola nat­ively com­piled does in less than a hun­dredth of a second.

I’m sure if I fiddled around with it I could get it sort of work­ing, but it doesn’t seem like a good use of my time, espe­cially since the end res­ult will be huge — the JAR file is 18MB, com­pared to 2MB for an uncom­pressed bin­ary — and many orders of mag­nitude slower and since I still have hopes of gradu­at­ing soon.

Still, the LambdaVM pro­ject is pretty awe­some. I hope it ends up kick­ing some ass.


2009 in review

December 31, 2009 in Personal | Comments (0)

Tags: , , , , ,


I still have a few minutes before 2010 so I thought I’d write a little some­thing while Jasna and I are sit­ting on the couch watch­ing cel­eb­ra­tions on TV with her parents.

Well, first off I think I need to take more pic­tures, the evid­ence for that being that the above is my favour­ite pic­ture I took this year. It’s our fat­test cat, Pin­cho.
(more…)


The longevity of make

September 17, 2009 in Research | Comments (0)

Tags: , ,

I recently rewrote the build sys­tem for Pola from ant to GNU make. Keep­ing things in ant was get­ting to be too much work, try­ing to be proper and writ­ing tasks (in Java) rather than just using the shell. I was ini­tially a little wor­ried about how much work it would be to redo the build sys­tem, but I was pleas­antly reminded by how simple it is. It took prob­ably about a quarter the amount of time to rewrite the entire build sys­tem from scratch in make than it would have taken to do a little incre­mental change to the ant sys­tem. As a bonus I man­aged to clean up the pro­ject a lot, redu­cing the build sys­tem down to just two files of a com­bined 70 lines. (more…)


The search for polynomials

June 15, 2009 in Research | Comments (3)

Tags: , ,

First, some excit­ing news that I’ve added the Pola pro­ject as my first pro­ject. There is a Sub­ver­sion repos­it­ory for it as well. We’ve been talk­ing about get­ting a site set up around Pola, with examples and user’s guides and maybe some inter­act­ive fea­tures, so this is a very small first step towards that.

Code-​​wise, what I’ve been work­ing on lately is finally try­ing to do bounds infer­ence prop­erly in the imple­ment­a­tion. The bounds infer­ence still isn’t entirely done and what’s there still isn’t work­ing entirely per­fectly, but it is excit­ingly close! Type in any well-​​typed func­tion which relies only on induct­ive data types and it will give you poly­no­mial bound on the run­ning time! Coin­duct­ive data types will come soon.

In an effort to mak­ing my “bor­ing” research blog more inter­est­ing, I’ve now even got a screen­shot! Is code any more excit­ing when it’s in screen­shot form?

The biggest prob­lem I’ve had so far is writ­ing my own Poly­no­mial data type in Haskell. I don’t even need any­thing fancy: I need addi­tion, sub­trac­tion and mul­ti­plic­a­tion of poly­no­mi­als over arbit­rary vari­ables. Sadly I haven’t found any­thing suit­able and had to build my own. I’m a little out of my depth here: it would be a pretty big under­state­ment to say that I’m ignor­ant when it comes to com­puter algebra. It’s a vir­tual cer­tainty that I’m doing my data rep­res­ent­a­tions and arith­metic oper­a­tions in the least effi­cient way pos­sible. But I can’t worry too much about; this isn’t really what my research is about.

If I find time today I think I’ll go through some com­puter algebra sys­tems to find one which has a suit­ably free licence and has a reas­on­able For­eign Func­tion Inter­face (so that I can use it pain­lessly from Haskell). Does such a thing exist?