This is Kresten Krab Thorup's Typepad Profile.
Join Typepad and start following Kresten Krab Thorup's activity
Join Now!
Already a member? Sign In
Kresten Krab Thorup
Århus, Denmark
I'm an idealist programmer, full of ideas
Recent Activity
This past weekend I’ve been reading Roubini and Mihm’s [Crisis Economics](, a worthwhile read if you’d like to understand *what went wrong*. ![Crisis Economics]( I’m “just an ordinary guy” when it comes to international-scale economics; and like most people probably... Continue reading
Posted May 21, 2013 at Java to the Limit
Here is just a short note on the unfortunate choice of name for the concept Eventual Consistency. To many non-native speaking people, it sounds like Maybe Consistent. Many languages have a word derived from the latin word eventualis (German: eventuell,... Continue reading
Posted Oct 22, 2012 at Java to the Limit
"Monitors are *nothing* like Unix signals" Of cause you're right; signal handlers interrupt the receiving process and are very difficult to get right, erlang monitors are easier to work with and less intrusive... but the analogy with SIGCHLD was the best I could think of as something that people may know as a useful way to get cross-process exit notifications in an os-like context.
Whenever developers fall in love with Erlang (as many tend to do these days) they are too often busy promoting it to their friends and colleagues as a cool language for *concurrency* and *functional programming*. Which is a pity, for... Continue reading
Posted May 23, 2011 at Java to the Limit
Riak doesn't come with means to do secondary indexes out of the box. This limits many applications of Riak; and it's a bit tricky to implement correctly oneself. The module [`riak_link_index`]( provides a mechanism that can be applicable for some... Continue reading
Posted Apr 26, 2011 at Java to the Limit
Thanks for the reference to monoids; you're much stronger into those foundations than I am, I'm just a hacker. Once I get a first one or two implementations off the ground (I'm working on Erlang and Java for now, surprise!), it would be great to have people help implement it in other languages too and provide one coherent set of implementations for easy use.
Toggle Commented Feb 21, 2011 on Introducing Vector Maps at Java to the Limit
> This post introduces a new data structure - the vector map - which solves some issues related to storing collections in MVCC data stores. Further, vector maps have some super nice use cases for "occasionally connected" systems. > The... Continue reading
Posted Feb 21, 2011 at Java to the Limit
The last few weeks I've been working on understanding vector clocks (or rather, [version vectors]( When working with distributed data stores like [Riak]( and [Voldemort]( which are using this to manage consistency, it is important to have a deep understanding... Continue reading
Posted Jan 27, 2011 at Java to the Limit
At the Erlang User Conference in Stockholm, I received the thirteenth "Erlang User of the Year" award, and was presented with the traditional gift, a beautiful hand-carved Erlang logo made in wood by Kanevad in Gamla Linköping. I have to... Continue reading
Posted Nov 19, 2010 at Java to the Limit
Erik has been hacking the interpreter the last few weeks, and now we're finally at a state where it is useful (though there are still some issues). ### Interpreter?? Yep, now Erjang has two modes of operations. - The default... Continue reading
Posted Nov 4, 2010 at Java to the Limit
Right. these numbers are fairly vague, and the voting system is far from ideal, ... but we still get ~85% of attendees to cast a vote which is well beyond what we could do with any other setup. If you however, for each talk, multiply the #attendees by the approval rate (used above); the top "positive infludence" list looks like this: Dan Ingall's Keynote: 40 Years of Fun with Computers Bill Buxton's Keynote: On the Role of Design Jonas Jacobi: HTML5 WebSockets Dion Almaer: HTML5 vs. Apps Tim Bray: Doing It Wrong But such a list is double-biased by people's expectations. As for further details on numbers, we only share those with the speakers themselves and the track host/pc members who invited the speaker. Sorry.
Toggle Commented Oct 11, 2010 on GOTO Top 20 Talks at Java to the Limit
Here's a quick tally of the top talks at last week's [GOTO Aarhus conference.]( The rating is based on the red, green and yellow "exit-poll", computed as (#green - #red) / #total votes. > Make sure to [evaluate the conference... Continue reading
Posted Oct 11, 2010 at Java to the Limit
It's been quiet on Erjang for a while, and I've been busy with other things. Going to JavaZone two weeks ago however, got me all psyched up again on my little Erlang on the JVM project. I met some guys... Continue reading
Posted Sep 29, 2010 at Java to the Limit
### I Hate Time-Outs A recurring issue in the design of concurrent and/or distributed systems is to choose those dreaded time out values. It seems that they are inevitable, doesn't it? They seem arbitrary, baked-in in an way that often... Continue reading
Posted Sep 23, 2010 at Java to the Limit
In Erlang, all inter-process communication is performed by a simple mailbox-per-process model plus selective receive. This allows a process to elegantly disregard certain messages, hiding complexity in certain cases. But the model also has some issues. Continue reading
Posted Aug 4, 2010 at Java to the Limit
I've spent some time trying to get Riak up and running on Erjang, and here's a note on current status. We're very early, but it is basically "up and humping". - runs on a "hacked" R13B4 with crypto-2.0 copied from... Continue reading
Posted Jun 25, 2010 at Java to the Limit
Just a little note to let you know that I spend a day hacking a new [Riak]( client library for Java based on the protocol buffers API. You can find it here at []( We're currently evaluating Riak for some... Continue reading
Posted Jun 24, 2010 at Java to the Limit
I do agree with Roberts comments; and in that sense I am as much a "language lawyer" as him; and I whole-heartedly believe that the power of Erlang lies in the clear separation of process states; and all the good that comes from that. At it's core, exposing (potential) mutability the way I propose is dangerous, but not more so than what is made possible (and easy) with NIFs. In the grand scheme of things, NIFs are bad for you, in exactly the same way as this kind of Java integration is bad for you. The only "issue" with the Java interface is that it is so much *easier* :-) Rather than writing NIFs as a tool to get performance, it would be better to make the VM faster, and this is a gradual transition that has happened in Java space: ten years ago "native code" was fairly common in Java applications (for stuff such as data base drivers, or to make a certain small piece of code faster), but now the JVMs are fast enough so we do not have to do that, and we have all come to believe in the power of a "managed environment". Where the real value of a direct interface to the VM's environment is -- as far as I can see -- when it permits you to *reuse* some existing high-quality component or service which would be meaningless or prohibitively expensive to rewrite in Erlang. Clearly, my toy examples of using Java HashMaps directly in Erlang code are the wrong ones to bring forward. So how to improve the Java API that I proposed? One way I have considered is to impose restrictions on a JavaObject pseudo term, so that it is usable only in the process that created it. In practice, I would implement this by having each such foreign object reference carry an owner reference, and only the correct owner can use it in ways that would expose it's state. Perhaps you can send it to another process in a message, but outside the creator you can not use it as a target or argument of another java method; but perhaps it can be matched against some special tuple like {java_object, OwnerPID, ObjectID}. This would be completely possible, but perhaps it would just be an invitation to hide the shared mutable state inside some java code somewhere? Another aspect of the API is to consider if it is implementable in BEAM also; perhaps with some hooks in error_handler and/or code_server to create modules on-demand if they match an existing Java class in a JVM loaded in a linked-in driver. BTW: looking forward to see this in action in combination with LFE too!
Toggle Commented Jun 16, 2010 on A Java API for Erjang? at Java to the Limit
Yes, JavaObjects get garbage collected; right now I have no map with object identities or such. If you want to preserve the identity of a JavaObject then you must keep it around yourself (i.e. you cannot decompose it with pattern matching, and then stitch it together again; only the original reference will do).
Toggle Commented Jun 14, 2010 on A Java API for Erjang? at Java to the Limit
At the recent [Erlang Factory]( I had a lot of fun pairing with [Krzysiek Goj](, extending Erjang with a new API for calling Java code. After the conference jetlag, I spent a night hacking on making this a bit more... Continue reading
Posted Jun 14, 2010 at Java to the Limit
Erjang already runs the Eshell, mnesia, mochi-web, and self-hosts the Erlang compiler. Last weekend was spent running micro-benchmarks and optimizing some tight loop stuff such as small integer performance, loops and function application. This has resulted in an over-all improvement for the "estone" Erlang performance test by a whopping 50% Continue reading
Posted Jun 1, 2010 at Java to the Limit
I have no idea when these tests came about, but I assume they must have been there for many years. I found them in the source checkout - perhaps they are not in the source tar, only if you check out otp from github? Dunno. You can read about the "real" test_server here
Toggle Commented May 23, 2010 on Running Erlang/OTP Tests at Java to the Limit
Here is just another update on Erjang progress. Two weeks ago I started looking seriously at running some of the OTP tests. There's a lot of them part of the standard otp distro, and so it's a great source of... Continue reading
Posted May 17, 2010 at Java to the Limit
Today I released the first version of [Triq - Trifork QuickCheck]( (or `triq` for short), a free clone of [QuviQ eqc]( While `triq` is being developed for the purpose of testing [Erjang]( it is "plain erlang" all the way, with... Continue reading
Posted May 4, 2010 at Java to the Limit
The last few days I've been working on completing Erjang's implementation of function object (fun's); specifically being able to pass fun values from one node to another, and I'd like to share some of the detail of how that works.... Continue reading
Posted May 2, 2010 at Java to the Limit