Saturday, March 29, 2014

API design should be an alternating optimization

Every tool you ever build will have some goal it supports. Start with writing the code/examples you want your tool to enable! They wont be quite right, but it gives you a start and a set of examples to evaluate your tool on. Then go write the dumbest implementation of the operations needed to make those examples run. Then write more examples, and discover better refinements for that API, and thence iterate back and forth quickly between top-down and bottom-up approaches to library engineering.

I've spent too much of the past year bogged down in bottom-up only, and just now now starting to see the power of an "alternating minimization" approach.

Speaking of which, I hope to start sharing some interesting writing about how to write and use Numerical solvers and optimization routines in the coming weeks, and Alternating Minimization will (I hope) be one class of optimization routines I'll discuss.

Its been a busy year, and its about to get even busier and much more awesome. Numerical Computing, Compilers, Debugging, Optimization Routines, oh my!

Friday, August 31, 2012

Stuff I tell people to read

If you're doing any technical work whatsoever, or talking with startups (or technical companies generally) in some way, the following really lucid articles are required reading. I need to reread them myself sometimes! :)

heres some helpful reading regarding career navigation etc

why or why not for most startups are a terrible idea to work at :-)

ANYWAYS, I've been dabbling with Agda and Idris lately, along with reading some fun things like a cute tome of bit twiddling called "Hackers Delight", a wonderful sequel to the famous "HACKMEM" memo that is pretty cool reading itself. Thats just been my procrasti(coding | reading), not my "day time" focus. Stay tuned :) 

Tuesday, August 14, 2012

On Blas and Hmatrix

So one thing I've been up to is sorting out how to help Haskell have working BSD3 licensed lin alg tools on hackage right now™. There are two packages on hackage that have all the basic algorithmic batteries presently!

Heres their names, whats good/bad about them, and what i've done to help improve things :)

Blas: bsd3, and has bindings to a whole bunch of blas, with support for banded matrices etc. Not currently maintained and the current hackage version wont build. I spoke with the author last week and he is no longer maintaining it, and pointed out that it does have a few problems in terms of api aesthetics etc.

I have a buildable version that you can use on my github here: There were a bunch of little things that needed to be fixed up so it'd build. (but now it does!)

If someone is interested in taking over maintainer ship and cleaning up the api a bit plus updating the test suite code to use more modern unit test, and tracking down why 5 pieces of code in the test suite fail on certain instances in the complex double case. Also: only supports Doubles and Complex Doubles presently (which is fine, but seems like a needless restriction / overhead for folks who don't need as much precision in their computation)

Has a nice api, but because GSL is tightly woven into some of the vector code, which means the entire package,  even the linear algebra parts, is GPL licensed, which is viewed as problematical by the community.
I've had some conversations with the maintainer Alberto (super nice guy), and if the blas/lapack/vector stuff can be factored out and no longer use the GSL code, he's open to refactoring the core hmatrix package into the lin alg part ("hmatrix-base") and a part with the gsl code ("some other name").
(edit for clarity: the goal here being that hmatrix-base would be made bsd3)

So right now I'm midway through a slash and burn rewrite of what i hope will become the "hmatrix-base" piece, in branch towardsBSD3 at my repo One handy thing about getting the Blas package in working shape is that I actually can (hopefully) repurpose some of its vector c code for this. So for now I have a copy of the various C code bits from the hs-linear-algebra in the same subdir as the offending code.

Basically the main piece of code that'll need to be changed is the code in
hmatrix / lib / Numeric / BSD/ Vector-aux.c  , perhaps using the cbits code from blas as the starting point? (though it'll need to extended to Float and Complex Float cases). Basically i'm doing a hack and slash job in a branch, and then i'll do surgery merge / refactor later and then talk with Alberto about moving things along license wise etc.

Thats not all I'm up to, but its all I can share right now :)

Whats currently afoot! (amazing numerical things in haskell)

Hey internet. Sorry we've not spoken lately.

So a few months ago I started working on designing some tools for doing numerical computation in a much nicer way (in haskell of course!). I've been pretty busy with it, but its very exciting stuff. I was even at one point considering submitting a proposal for technical area 1 of the DARPA XDATA initiative (which was a bit of a challenge to even try to organize, as I only found out about the solicitation 2 weeks before it was due!).

Anyways, turns out real businesses want to use (and pay for) my data analysis tools ( "Cashew") the moment I have them ready! So I'm a bit buried with coding right now. But stay tuned!

Yes, Haskell + Data Analysis & Numerical Computation + business users! Have a look see at whats going on at  this fall to find out more :)

(edit: one thing I'm also doing aside from writing these tools is doing a bunch of work to improve the open source numerical ecosystem in haskell. eg trying to get a bsd3 lin alg out the door, whether via teaming with a maintainer of current packages, or rolling my own. One way or another twill happen. see github for a rough view of the current state of that :) )

(edit2: assuming the business gets off the ground this fall, hopefully i'll be fortunate enough to have the challenging problem of finding great colleagues to join me full time in my escapades)

Monday, July 4, 2011

Math renders! Time for Content!

so to answer will it  math? \( f(x)=\partial \phi / \sin \pi\)

yes it does.

Ok, now that I have a nice math rendering blog thing setup, I"ll stick with it :)

another test post

I will \(\dfrac{\partial E}{\partial \widehat{C}}\)

testing latex

\[\int f(x)=\partial g(y)\cdot \Theta\]