views:

49

answers:

1

On the Io home page it mentions its small size, but it uses a unit of measure I've not seen before:

small vm (~10K semicolons)

Is this just the size in characters (~bytes), or is there something more subtle going on here?

+5  A: 

It's a measure of Logical lines of code.

Rather than simply counting all lines of code, including comments, blank lines, etc., you only measure the lines that end in a semicolon. It's a still-simple but more accurate measure of how large a piece of code is.

RichieHindle
But still very inaccurate, since different programmers use different levels of nesting statements.
Bart van Heukelom
@Bart van Heukelom: that's in fact _precisely_ why "semicolons" are used as a measure. The statements `if (foo) bar();` and `if (foo) { bar(); }` differ in levels of nesting, but not in number of semicolons.
MSalters
Ah-ha - yes, I'm familiar with logical lines of code. 'semicolon' isn't very Google friendly (even with extra search terms) - thank goodness for StackOverflow (and people like you!)
FinnNk
@MSalters: What I mean is `doThingWith(getSomeObject(), getOtherObject(), { technique: "cool", nesting: "deep"}, function(callbackData) { data = callbackData; }); `
Bart van Heukelom
@Bart van Heukelom: that's two _statements_, but a lot of _expressions_.
MSalters
@MSalter: Ok, I used the wrong word, but that doesn't invalidate my statement that lines of code (logical or not) are not a good measure of code size. If any exists, it's probably the number of bytecode instructions :p
Bart van Heukelom