Snow Leopard compatible AntiRSI

It is still a beta, because I wanted to do some more work on it. But it works fine, and is Snow Leopard compatible. Likely no longer 10.4 compatible.

This leaves behind the hack to expose some internal screen saver API, in favor of apple sanctioned API (which was not available when I started AntiRSI).

Download it here: AntiRSI

» More

Hotel at day 365 minus 1 week; A Year of Hotel

To be fair, after the last hotel blog post in October, not much has happend. The status than was a c implemented parser, emitting a total of 50 different bytecodes, and a runtime that was somewhat functional. However, it didn't seem like I was going to reach the goal of simplicity.

Development on attempt 1 stalled, and died. (Also because my day job became very demanding; we are working on something new and cool. More on that in the near future.)

But ...

» More

Detecting memory pressure in the JVM

Because java is garbage collected, detecting how you are doing memory wise is difficult. You can use the Runtime.freeMemory() and other methods, but they count all memory, ignoring all garbage.

So ideally, what you want to know is how the memory was doing just after the last garbage collection round. Internally, the jvm has the cpp function Universe::get_heap_used_at_last_gc() which could be used for that, but it is not exposed anywhere (AFAIK).

So why ...

» More

Hotel and Objects

I'm getting closer to finally implementing and expirementing with the features that set hotel apart: its objects, modules and closures with importing. Just today I made the following Queue implementation work:

fun Queue() {
    var _content
    
    fun fragment(v, prev) {
        return self
    }

    fun is_empty() { 
        return _content == null
    }
    
    fun size() {
        fun size(c) {
            if (c == null) return 0
            return 1 + size(c.prev)
 ... 

» More

Some hotel, finally

No I haven't been working on hotel much; seems like every weekend there is something to do. But something does keep moving every now and then.

Already two weeks ago, I added some expiremental extension support, and added an ncurses binding. The following works and moves an x around in the (terminal) screen:

initscr()

var x = 10
var y = 10
var ch = 1

while (true) {
    ch = getch()
    if (ch == 65) x = x - 1  # up
    if (ch == 66) x = x + 1  # down
    if (ch == ... 

» More

Theory behind Hotel

In hotel there are a few basic building blocks: numbers, strings, arrays, tables (hashtables; a.k.a associative arrays or dictionaries) and scopes. Scopes are not necessarily functions, because some scopes you cannot explicitly call, they will be executed when encountered.

The idea behind hotel is that as a scope is executing its code, a table is formed containing the locally defined names. Normally when a scope has finished, a value is returned and the table is discarded. ...

» More

Hotel at day ... 9, 10, 11 ...

Didn't have any time last weekend. And no internet at home this week (internet is back, so I'm putting this up now). Not good. But I did put in about 2 hours every evening, starting monday. I got calling functions working on monday, recursive scopes on tuesday, and some basic file input and parser enhancements wednesday. Result is that fibonacci works!

fun fib(x) {
    if (x < 2) return x
    return fib(x - 1) + fib(x - 2)
}
print(fib(8));

And it prints 21! ...

» More

Hotel at day 6 - function calling

Did nothing on hotel day 5; except to think about it. On day 6 in the evening I completed the parser for functions and after some refactoring it kindof just worked. Next I should work out arguments to functions and that should enable some basics like fibonacci. That would really be a first milestone.

Second stop would be completing the lexer and adding a rich messaging infrastructure to the parser. Currently a syntax error is an ...

» More

Hotel at day 4 - a vm and some confusion

Didn't do much yesterday, but this morning I awoke really early; couldn't sleep anymore. As I lay awake, thinking about hotel, I figured what the heck, lets go for a vm straight! Got out of bed and coded the first idea. This evening I finished it. Well, finished is a big word, what used to work in the evaluator now works again in the vm, and the evaluator is now a parser that emits bytecode. But it is very, very rough.

So, unfortunately, implementing proper ...

» More

Hotel at day 2 - A nice start?

I guess yesterday was pretty productive, I put in about seven hours or so. And I also read up on some other languages, and investigated parrot for a bit.

I am at a junction though; the code base is growing, is just around a 1000 lines of c now. But I have been writing a parser and evaluator in one. That means that as parser goes over a part of a program it executes it, but what about the false part of a if/else statement? and what about function calls? Time for ...

» More

Last modified: 2007-11-19 20:13 GMT