Earlier quoted context omitted.
If you look closely at it, there's not much there - it's actually easy to understand - defines a variant struct and an bunch of accessors to the different types within the embedded union. He prefers short names, and finally years later, java recommends short variable names for lambdas too!
Short names make sense if they are easily understandable locally: This means either something extremely common throughout the codebase (I think the most common example being localisation wrappers for string literals. They should ideally be linked to a more clear explanation easily, e.g. from renaming import statements), or defined (clearly) and used only within a very small area of code. This API is neither of those.
32 bit version of KDB+ is now free for commercial use
21–30 of 34 posts
Re: 32 bit version of KDB+ is now free for commercial use
#22Earlier quoted context omitted.
If you look closely at it, there's not much there - it's actually easy to understand - defines a variant struct and an bunch of accessors to the different types within the embedded union. He prefers short names, and finally years later, java recommends short variable names for lambdas too!
So, I guess I need to look closer than the pixels then: typedef struct k0{signed char m,a,t;C u;I r;union{G g;H h;I i;J j;E e;F f;S s;struct k0 k;struct{J n;G G0[1];};};} K; Sorry I guess I'm just not seeing the "not much there and actually easy to understand" Whatever a 'H' is
H is a short in k/q, so H refers to a short here as well. This naming scheme is true for all of the above letters.
Re: 32 bit version of KDB+ is now free for commercial use
#23Except financial applications what is it good for ?
Sure, you can do the same in R or python, but the whole process is very quick and easy in q.
Re: 32 bit version of KDB+ is now free for commercial use
#24Re: 32 bit version of KDB+ is now free for commercial use
#25Earlier quoted context omitted.
If you look closely at it, there's not much there - it's actually easy to understand - defines a variant struct and an bunch of accessors to the different types within the embedded union. He prefers short names, and finally years later, java recommends short variable names for lambdas too!
So, I guess I need to look closer than the pixels then: typedef struct k0{signed char m,a,t;C u;I r;union{G g;H h;I i;J j;E e;F f;S s;struct k0 k;struct{J n;G G0[1];};};} K; Sorry I guess I'm just not seeing the "not much there and actually easy to understand" Whatever a 'H' is
Re: 32 bit version of KDB+ is now free for commercial use
#26Earlier quoted context omitted.
If you look closely at it, there's not much there - it's actually easy to understand - defines a variant struct and an bunch of accessors to the different types within the embedded union. He prefers short names, and finally years later, java recommends short variable names for lambdas too!
So, I guess I need to look closer than the pixels then: typedef struct k0{signed char m,a,t;C u;I r;union{G g;H h;I i;J j;E e;F f;S s;struct k0 k;struct{J n;G G0[1];};};} K; Sorry I guess I'm just not seeing the "not much there and actually easy to understand" Whatever a 'H' is
To elaborate: K uses one letter mnemonic codes for all of it's basic storage types:
G = General = 8-bit unsigned int
H = sHort = 16-bit signed int
I = Integer = 32-bit signed int
J = bigger integer = 64-bit signed int
(Note how G,H,I,J follow each other?) E = 32-bit floating point "rEal"
F = 64-bit Floating point
(Again, they are near each other) S = Symbol
K = "general list type", the central K language type
And that's mostly it; the last unnamed union (with fields "n" and "G0") is for vectors, n being the length and G0 being the data.The only other field you are ever going to need is "t" for type (saying whether which union member is actually in use). The rest are internal implementation details, but are also easy to remember: r=reference count; u=flags; m and a have something to do with memory mapping and allocation).
There are a few more basic types: b=boolean, t=time,d=date,p=datetime,u=month - but they are merely different interpretations of the EFGHIJSK members above; to access data from C, all you need is the list given above.
Re: 32 bit version of KDB+ is now free for commercial use
#27Re: 32 bit version of KDB+ is now free for commercial use
#28I'm not sure about the Q language, but their C API reads like obfuscated C contest entry: http://kx.com/q/c/c/k.h
If you look closely at it, there's not much there - it's actually easy to understand - defines a variant struct and an bunch of accessors to the different types within the embedded union. He prefers short names, and finally years later, java recommends short variable names for lambdas too!
// remove more clutter
#define O printf
#define R return
#define Z static
...
Removes clutter indeed... :)Re: 32 bit version of KDB+ is now free for commercial use
#29Careful with these guys. I once built an open source implementation of the q language, and these guys immediately threatened to sue me, my employer, and our clients. The language is not that interesting, it's easy to reproduce, and these guys will threaten you if you prove this.
Re: 32 bit version of KDB+ is now free for commercial use
#30Except financial applications what is it good for ?
I barely did any q / kdb; only made a functional and usable UI, and did some prototyping of new ideas in other languages (Java, Max/MSP, Csound). I spent some time looking into q and was thoroughly baffled. Still am. It was really, really fast, though!
As I vaguely understand and can explain it, the k/q system made it easy to do fuzzy searches and deal with missing pieces of data. If the user missed a note, or our pitch detection failed, or our source data was bad, we were still able to find matches. (Yes, I wish I'd been able to understand this more at the time. Bygones, now...)