Posts

Showing posts from April, 2012

Build a java virtual machine that is actually readable/modifiable for Win32

Is it possible to build a Java virtual machine for Win32 in an sort of understandable way?  It is mostly impossible.  The OpenJDK build will take hours just to build and will take a day to prepare your environment.   If you aren't a core JVM developer, who actually is going to take several days to prep their environment so that they can hack OpenJDK.  The jikes RVM may work with cygwin/win32 but it is mostly designed for linux or some other open platform.  You are really only left with JamVM.  I was actually able to install all of the dependencies with cygwin and perform a build in 15 minutes.  And then actually edit the C source, add a log statement, rebuild and run against a bytecode class file.  JamVM is the only JVM project that is understandable (20-30 core C files) and the build actually works with a modern version of cygwin. I will go through some of the setup.  It helps to actually install JamVM through cygwin.  Full install. 1. Run cygstart and use cygports as your cyg

Code snippet of the day: Haskell for the dumb idiot lazy programmers

Image
The euler project problem reads as such, "If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000." Here is one of many implementations in Haskell.  I used a verbose recursive approach, iterate up to 1000 and then build a list with the items of interest.  In this case, 'multiples of 3 or 5'.  The first implementation contains a logging utility for writing a string at each iteration. Figure 1: Euler Problem1 in Haskell Here is the second source snippet, I just wanted to provide something more practical, a log parsing example that you can run against your web log files. Figure 2: Applied Haskell, simply read each line of a file, find a term and output the results to another file. Source: https://javanotebook.googlecode.com/svn/trunk/math/MathServices/docs/haskell