Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For curious, several facts i noticed by running anaconda distributed shakti:

1) k7 implementation obviosly is completely different codebase from current kdb+. I ran the following query on kdb+ and k7

  a1:1000000?1000000;b1:1000000?1000000;
  \t select #a by b from (+`a`b!(a1;b1));
And difference seems to be in order of magnitude (k7 is 650 msec, kdb+ is 77 msec), also on k7, time increases for subsequent execution of same query ==> memory leak? Looks like it's very early stage.

2) null number (0N) and infinity are now represented as non-ascii symbols Ø and ∞, also parsed as such.

3) type operator (@) returns symbols (`i, `j) for ints and longs etc, was returning shorts before. Interesting how do we distinguish arrays/scalars now.

4) default numeric type (e.g. 12345) is now int, was long.

5) entering overflow numeric literal returns Ø, was throwing exception.

6) k in anaconda is not stripped 675K linux x64 executable, stripped is 220K, while kdb+ is 657K as sold.



One might add that by typing "\", the K7 description gets printed (similar to the description on kparc.com).


> 3) type operator (@) returns symbols (`i, `j) for ints and longs etc, was returning shorts before. Interesting how do we distinguish arrays/scalars now.

Upper/lower case:

   @1
  `i
   @1 2
  `I
   @`a
  `n
   @`a`b
  `N


I saw that, but how do you make simple check if it is uppercase?


I guess you can check the ASCII value of the char:

   li:{(*$@x)within "AZ"}
   li 1
  0
   li 1 2 3
  1
Or can have a list of uppercase chars as names & check with 'in':

   li2:{(@:y)in x}[`$,:'`c$"A"+!26]
   li2 1 2 3
  1
   li2 1
  0
'li2' seems to be considerably faster:

   \t:10000 li 1 2 3
  13
   \t:10000 li2 1 2 3
  6
There may well be a better way though


this seems not to be in the spirit of language. Testing if type is array or not is so common, and adding this function (li, li2) to "standard library" would introduce "standard library". Maybe we overlooked some other obvious solution.


Perhaps the performance difference is due to resource limitations in the Shakti trial?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: