On Jun 1, 2013, at 5:37 PM, Kevin Lawler wrote:
> On Jun 1, 2013, at 2:55 PM, Bakul Shah <
ba...@bitblocks.com> wrote:
>
>> But you are right; porting the current arch would be hard.
>> Should I decide to pursue this I will prototype this in a
>> separate directory and `steal' code from kona!
>
> That's how I would do it. The array operations should work as is. The execution I might rewrite entirely.
>
> I also suspect I got Amend (dot/at) wrong structurally. I might also redo the struct the memory pooler returns. I have notes on how a rewrite should go.
I would be interested in your notes!
>> K3 is rumored to fit in "not quite" 1K (but presumably close).
>> That is very encouraging as it tells me is that k's features
>> fit together well even from an implementation point of view.
>
> 1K source? Not even. Discounting any K written in K, Kona must be pretty close in size. There's no way to write much of this shorter in C. Discounting formatting also, I would guess Kona is within 1.25x. Worst case...2x-3x? If my assumptions about the world are horribly wrong.
I think that is 1k lines, not bytes. Assuming "Whitney style"!
I may have misremembered or misunderstood but from what I remember, on K mailing list over 10 years ago, Whitney said he is "trying" to fit K in 1K but didn't think he can do it but then the description he gave seemed to fit k4. k3 is much simpler. Now "trying" to me means it is at least in the realm of possibility! I wouldn't try to reduce something by a factor of 10! Though I did once rewrote someone else's server code to 1/3 the size and 3 times the performance. The way it came about is I couldn't understand his code so I started implementing pieces I did understand and two weeks later I realized it did most everything! But that sort of improvement is very hard if the starting point is some well written code.
Anyway, the point I was making is that everything seems to dovetail very well and that means most code would just "flow" -- and if something needs a complicated kludge, that would means something is either not in the right place or misunderstanding. The goal would be not 1K lines but close to the lowest entroy code!
kona is about 7K lines, not counting the header files. Array ops & possibly many other things can be reused almost verbatim.