November 2004
[ bamboo ] 08:18, Tuesday, 23 November 2004

From the looney who came up with prevayler: Sovereign Computing.

Are you ready to join the crowd and make it happen? Too scared?

Sovereign Computing

[ bamboo ] 07:45, Tuesday, 23 November 2004

Nice teaser but I just can't wait to see Sam Rockwell playing Zaphod.

[ bamboo ] 21:35, Thursday, 11 November 2004
Doug reminded me that we don't actually need the jbooish stub to explore the java libraries:

$ ./booish
>>> load("d:/dotnet/ikvm/bin/IKVM.GNU.Classpath.dll")
>>> import java.lang
>>> System.getProperty("java.vendor")
'Jeroen Frijters'
>>>
[ bamboo ] 19:27, Thursday, 11 November 2004
rodrigob@bambook /cygdrive/d/dev/boo/build
$ ./ikvm -classpath "booish.jar;." jbooish
>>> v = Class.forName("java.util.Vector").newInstance()
[]
>>> v.add("Hello")
true
>>> v.add("Java!")
true
>>> v
[Hello, Java!]
>>>


How to
  1. download ikvm
  2. unpack the binaries to your boo build or bin directory
  3. ikvmstub booish.exe
  4. create a little java stub that instantiates booish.InteractiveInterpreter, let's call it jbooish, mine is at the end of this entry
  5. javac -classpath "$CLASSPATH;.;booish.jar" jbooish.java
  6. ./ikvm -classpath "booish.jar;." jbooish
  7. boo your way through the java libraries!
Is this nice or what? Now I get to work with boo even when I work with java.

jbooish.java
import cli.booish.InteractiveInterpreter;

public class jbooish {
    public static void main(String[] args) {
        InteractiveInterpreter interpreter = new InteractiveInterpreter();
        interpreter.set_RememberLastValue(true);
        interpreter.SetValue("Class", jbooish.class);
        interpreter.ConsoleLoopEval();
    }
}
[ bamboo ] 09:17, Thursday, 11 November 2004
I did fell in love with java once.

I guess that after years of reinterpret_cast<void**>(&spUnk.p), java seemed like nothing but a beautiful sunday morning.

Reading a char array from a file the java way
    public static char[] readChars(File file) throws IOException {
        FileInputStream stream = new FileInputStream(file);
        try {            
            // HACK: assume 1 byte per char
            char[] buffer = new char[(int)file.length()];            
            InputStreamReader reader = new InputStreamReader(stream);
            reader.read(buffer);
            return buffer;
        } finally {
            stream.close();
        }
    }


Reading a char array from a file the .net way
def readChars(fname as string):
    using reader=File.OpenText(fname):
        return reader.ReadToEnd().ToCharArray()


[ bamboo ] 09:37, Wednesday, 10 November 2004

Q. How do you get a list of files matching a specific wildcard?
A. java.io.File.listFiles(FilenameFilter)

FilenameFilter??? What's wrong with Directory.GetFiles("*.boo")?

And by the way we don't even have a java.io.Directory, it's everything on java.io.File. F#?%#!a a...

Ok, let's just breath... I'll need my yoga classes more than ever now that I'll be doing lots of java.

[ bamboo ] 11:33, Tuesday, 9 November 2004

I'm working a lot with the Eclipse JDT core model lately (yes, yes, I confess, I'm doing lots of java lately :-)).

I find it amazing how the Eclipse AST model is similar to one of the first AST models I designed for the boo compiler. Even some classes and interfaces have the same name (!!). The déjà vu climax was org.eclipse.jdt.core.dom.IBinding. It's been a long time (+8 months) since I renamed IBinding to IEntity but still...

Do we have an explanation to that? Strikingly similar artifacts created independently of each other.

Patterns of software? or patterns of the nature itself?

[ bamboo ] 09:27, Wednesday, 3 November 2004
Amen, Hammett.