Live data from Hacker News

The Q Language

code.kx.com

51–60 of 161 posts

Re: The Q Language

#51
post #31

... and can you use the 32bit version in commercial use? (Last I checked, no...) The license already changed once (for the worse, IMnsHO), so what's to say that won't happen again. Too risky to touch. No, can't use it (32bit version) for commercial, so this is a non-starter. Sorry. kOS? really? https://news.ycombinator.com/item?id=8475809

You can purchase a license if you want to be unaffected by future license changes. It might not be the right price for you, but it is for some. They are, in fact, courting only rich customers. Some languages are worth learning to expand your horizons. Lisp is one of them, even if you never use it, and the APL family (of which K/Q are members) is another. My C code has become faster, simpler, shorter and less buggy af…

>My C code has become faster, simpler, shorter and less buggy after I dabbled in K.

Interesting. Can you explain why you think that has happened?

Re: The Q Language

#52
post #45

The KDB code is terse to an unhealthy extreme. Check this gem: // remove more clutter #define O printf #define R return #define Z static #define P(x,y) {if(x)R(y);} #define U(x) P(!(x),0) #define SW switch #define CS(n,x) case n:x;break; https://github.com/KxSystems/kdb/blob/master/c/c/k.h#L96 Or this wall of code: https://github.com/KxSystems/kdb/blob/master/c/c.cs

Welp, you were not kidding: https://github.com/KxSystems/kdb/blob/master/c/c/curl.c This code is basically obfuscated by hand. Absolutely unapproachable. Only the original author(s) can understand it. Judging by other comments, it seems to work well. So they seem to be good programmers producing working code. It's just not intelligible by other human beings, which is a pretty bad thing, but not the only factor in sof…

I don't see where this code is getting a definition for K. (The return type of the ctype function).

It's not in the "k.h" header, though that references it also.

Maybe the build system injects it through the compiler command line or a forced-include header. Though the gcc command line alluded to in the block comment header shows no evidence of that.

Edit: Found it! It's a typedef for a pointer to a struct k0:

  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;

Re: The Q Language

#53
post #48
post #45

Earlier quoted context omitted.

Welp, you were not kidding: https://github.com/KxSystems/kdb/blob/master/c/c/curl.c This code is basically obfuscated by hand. Absolutely unapproachable. Only the original author(s) can understand it. Judging by other comments, it seems to work well. So they seem to be good programmers producing working code. It's just not intelligible by other human beings, which is a pretty bad thing, but not the only factor in sof…

It takes time getting used to, yes. And it is not for all people. But it's just a foreign language; You could look at Japanese text[0] and make similar statements, and would be just as valid (or rather, invalid) as your statement. You expect to be able to read it because you're used to a class of languages which are all similar enough at the surface level -- perhaps you are even familiar with more than one fundamenta…

[deleted]

Re: The Q Language

#54
post #46

The KDB code is terse to an unhealthy extreme. Check this gem: // remove more clutter #define O printf #define R return #define Z static #define P(x,y) {if(x)R(y);} #define U(x) P(!(x),0) #define SW switch #define CS(n,x) case n:x;break; https://github.com/KxSystems/kdb/blob/master/c/c/k.h#L96 Or this wall of code: https://github.com/KxSystems/kdb/blob/master/c/c.cs

I'm a vocal convert. This approach helps me find bugs and repetition in my programs which makes my code shorter and faster as a result.

I can see the argument for terseness. In fact I loathe how verbose Java is, I try to minimize LOC, and I enjoy using ?:. However, I don't think it's a good idea to use this extreme single-character, single-line style in languages not designed for it. If you really want this style, you should use APL or design your own language.

Re: The Q Language

#55

Notes from my KX/kdb experience: 1.) The in-memory DB .exe was around 500 KB. Imagine that. 2.) The Q language syntax, while consistent, is fairly arcane and throwback to decades past. 3.) The documentation and driver support is abysmal. 4.) It's supposedly extremely fast, but I can't help but wonder if this is a lot of successful PR and hype (like hedge fund bosses insisting on Oracle because it's the only db that '…

Any other downsides? Management has been convinced and we're apparently switching to it at work soon but there is so little information and most of that is marketing, so it's hard to get an idea of what we're walking into.

Re: The Q Language

#56
post #46

Earlier quoted context omitted.

I'm a vocal convert. This approach helps me find bugs and repetition in my programs which makes my code shorter and faster as a result.

I can see the argument for terseness. In fact I loathe how verbose Java is, I try to minimize LOC, and I enjoy using ?:. However, I don't think it's a good idea to use this extreme single-character, single-line style in languages not designed for it. If you really want this style, you should use APL or design your own language.

They are using APL. This style is used in APL/J/K/etc implementations as well as the languages themselves.

Re: The Q Language

#57
post #46

Earlier quoted context omitted.

I'm a vocal convert. This approach helps me find bugs and repetition in my programs which makes my code shorter and faster as a result.

I can see the argument for terseness. In fact I loathe how verbose Java is, I try to minimize LOC, and I enjoy using ?:. However, I don't think it's a good idea to use this extreme single-character, single-line style in languages not designed for it. If you really want this style, you should use APL or design your own language.

Basically, this really wants to be using a custom preprocessor for a cleaner notation.

Re: The Q Language

#59
post #48

Earlier quoted context omitted.

It takes time getting used to, yes. And it is not for all people. But it's just a foreign language; You could look at Japanese text[0] and make similar statements, and would be just as valid (or rather, invalid) as your statement. You expect to be able to read it because you're used to a class of languages which are all similar enough at the surface level -- perhaps you are even familiar with more than one fundamenta…

APL isn't really readable by other humans either. This is idiotic.

Could you please stop breaking the guidelines? We just asked you to comment more substantively than this.

https://news.ycombinator.com/newsguidelines.html

Re: The Q Language

#60
post #46

Earlier quoted context omitted.

I'm a vocal convert. This approach helps me find bugs and repetition in my programs which makes my code shorter and faster as a result.

I can see the argument for terseness. In fact I loathe how verbose Java is, I try to minimize LOC, and I enjoy using ?:. However, I don't think it's a good idea to use this extreme single-character, single-line style in languages not designed for it. If you really want this style, you should use APL or design your own language.

> I can see the argument for terseness

The argument is that my programs are shorter and faster and more correct?

> I don't think it's a good idea to use this extreme single-character, single-line style in languages not designed for it.

You think if I need to write C, that I should do things that make my program larger and slower and less correct?

That doesn't make any sense to me at all.

Post reply on HN