Log inskip to content

Archive for the 'Software Development' Category

Will Oscigen be OCaml’s killer app in 2009?

Friday, January 9th, 2009

Ocsigen could be OCaml’s Rails to push the language forward fully into the spotlight this year.  If you look at the Eigenclass writeup of basic hello world functionality you can certainly see the potential.

Rails dragged a bunch of PHP coders into the world of meta programming and code generation, can OCaml’s simple deployment succeed where Seaside failed? ( I realize that most rails users just ‘cargo cult’ a lot of the meta programming but at this point in my career I’m happy to see baby steps)

The Joy of C++

Tuesday, April 22nd, 2008

Recently Phusion announced the release of their apache integration for rails, modrails(passenger).

Having played around with the other rails deployment systems I was interested to see how this compared so I downloaded the gem to my OpenSolaris machine and was greeted with a great many build errors, it seems that even after all this time C++ still isn’t ready for prime time portability between platforms, let alone between compiler implementations.

I currently use Blastwave for most of my software as maintaining the scaffolding of my machine manually long ago became a chore. One of the quirks of this is that a majority of the software on my system is compiled via SunWorkshop (I’m currently using v 12) rather than the ubiquitous GCC which is really the only game in town for BSD/Linux systems. To complicate the issue Passenger uses C++ and Boost.

The Issues

The first problem came from the native ruby extension, they were accessing some Posix fields that aren’t normally included in the Solaris headers, some quick googling came up with the proper -D definitions of _XPG4_2 and __EXTENSIONS__ to solve this, these definitions were also required for later stages so I threw them in the root Rakefile provided by the build. (I still need to look into what environment variables I should have set to have mkmf generate a proper makefile on its own.)

After this the compile built the required Boost support libraries, Boost being what it is requires a very good implementation of the STL which basicly means you’re using STLPort, luckily Sun has realized this and there’s simply a compiler declaration of -library=stlport4 which needs to be added to all compile and link lines. The Rakefile also assumed you were building which g++ so I changed it to call CC (Sun Workshop’s c++ compiler) instead. There is also an issue with Boost assuming certain integer defines don’t exist on Solaris and redefining them but I’ll address that in the next section.

Finally onto the apache module itself, this was actually the most difficult section to get compiling because for testing purposes it contains sections that get compiled differently during the test build than during the deployable build. One of the major issues is that the ‘proper’ c++ headers cstdlib etc don’t always define all the ’standard’ functions that stdlib.h do. Some examples are realpath, setenv, unsetenv etc. I tried to work around this various ways but I eventually just decided to revert all the headers to the classic version, which works it just polutes the main namespace which in this case isn’t really an issue since it seems that GCC does this anyways. As well there are various mutex references which conflict with the fact that /sys in Solaris contains mutex definitions so all those needed to be qualified as boost::mutex. Some functions from the standard library weren’t being dereferenced as std:: so I fixed those as well. After all this I ran into some interesting problems with the boost library cstdint which doesn’t properly realize that Solaris already defines the types it wants to define, so I just removed the inclusion of those headers for the Solaris build. After all this I got a successful build, and then I simply had to remove the -lstdc++ library from the link path as this is included automatically on Solaris and doesn’t exist as a library.

The test and benchmark code caused some minor problems as they assumed that stdlib was being brought in automatically (I think gcc does this to be helpful) so I needed to add that header for Solaris. As well I needed to add the standard solaris -lsocket and -lnsl declarations for the link stage.

The only problem remaining was their deployment script which assumes you need gcc etc, so after a little path hacking and some changes to stop it from trying to rebuild my jiggered build I got it successfully deployed.

My dirty tarball is located here for people who are interested in playing with it, but I certainly wouldn’t use it for a production site at this point without a lot more testing.

Kinesis Ergo

Tuesday, January 17th, 2006

(This page from my old site seems to get a lot of incoming traffic so I’ve brought it back to life, however I’ve changed the permalink structure when I moved servers and I doubt anyone following the link will bother to find it.  I installed a permalink redirector so it lives again! )

So Bill Clementson has purchased a Kinesis keyboard. I’ve been using a kinesis since around the Summer of 2000 for very similar reasons.  Due to a lot of text based gaming with bad key layouts in the 90’s I was in constant pain on the outside of my hands.

I own a Kinesis Pro PS/2 and I now have a second Advantage Pro USB for work.

The keyboard does take a bit of time to get used to, simply because the keys are straight up and down so you’ll tend to hit a key to the side of the one you actually intended. I was back to full speed in a couple of weeks, it probably would have taken less time but I was in the middle of a big project when it first arrived and due to time constraints I kept switching to my old keyboard to get work done at my regular pace. Now that I’m used to it I’d say I easily type faster than with my old keyboard and with much less effort as the action of the keyboard is excellent.

I’ve done the standard key switching in that I swapped esc and caps lock. I also run it with the ctr/alt keys at the top of both thumb sections as I found the windows/mac key not particularly useful. I’m tempted to try the tab swap that one of Bill’s linked pages suggested although that will take some time to get used to. I will note that if you have one of these at work you can expect to get a lot of attention and a good deal of ribbing. Expecially if you decide to use the gas pedals.

I’m always suprised that programmers will spend money everywhere except the piece of the device they use most to interact with it. Most programmers probably spent more on their mouse than they did on their keyboard.

If there’s one negative about the device its that if you are used to playing first person shooter games and you use the standard asdw movement layout it will take some time to get used to it. I’d actually recommend getting a dedicated flat tablet keypad for games as even after a few years I don’t think I’m as good with my Kinesis as I was with a traditional keyboard. It could be because I never tried an alternate layout like learning to use a row for forward/back/left/right instead of multiple rows. If you’re in Canada you can purchase items from Ergo Canada who I’ve bought both my keyboards from and have been very pleased with the service.