News for hackers. Stuff that matters.
Re:The Q Language by geocar on Tuesday December 12, 2017 @05:00PM (#15909918)
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.

Re:The Q Language by modeless on Tuesday December 12, 2017 @05:36PM (#15910131)
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 by kazinator on Tuesday December 12, 2017 @05:50PM (#15910213)
Basically, this really wants to be using a custom preprocessor for a cleaner notation.
Re:The Q Language by modeless on Tuesday December 12, 2017 @07:39PM (#15910949)
That would be a good step, but I don't think a preprocessor alone is enough to make this a good idea. You want good compiler error messages, static analysis tools, debuggers, code editors. You want a whole language.
Re:The Q Language by kazinator on Tuesday December 12, 2017 @08:41PM (#15911299)
They have a whole language there, didn't you notice? Namely, this Q thing that the submission is about.

What we're looking at here is some of its C implementation internals. They are using short identifiers and the C preprocessor to help with terseness. The justification is that this is "like APL". But there is enough C cruft there that it's not really like APL. A possibility would be to generate whatever code those C macros are generating, but with some other preprocessor which polishes the notation a little bit.

Even if those analysis tools and debuggers were developed for Q, they likely wouldn't apply to this code.

Re:The Q Language by modeless on Tuesday December 12, 2017 @09:07PM (#15911441)
The point is that using Q style in C is not a good way to make a C program, regardless of whether said C program is the implementation of Q or not.
Re:The Q Language by kazinator on Tuesday December 12, 2017 @11:40PM (#15912068)
The point (mine, that is) is that I basically agree that it's not a good way to code in C, but perhaps the style could work better as a notation that transliterates to C.
Re:The Q Language by shitgoose on Tuesday December 12, 2017 @08:41PM (#15911298)
what a gap. an abyss. inventor, and users of kdb explicitly and deliberately DO NOT WANT these things (static analysis tools, debuggers, code editors). nor they need it. language is so simple, there is no need for static analysis or code editors. (they compromised on error messages somewhat recently, though; now error messages are two words instead of one)

personally, i disagree with them on debugger. would be nice to have one.

Re:The Q Language by modeless on Tuesday December 12, 2017 @09:16PM (#15911482)
You are right. There is an impassable abyss. I will never agree with anyone who believes that good error messages, analysis tools, or debuggers are not worth having.
Re:The Q Language by geocar on Wednesday December 13, 2017 @08:21AM (#15914014)
> I will never agree with anyone who believes that good error messages, analysis tools, or debuggers are not worth having.

Even if they can do things you cannot do?

What are you doing here if so freely admit you have a closed mind?

Re:The Q Language by tree_of_item on Tuesday December 12, 2017 @05:47PM (#15910192)
They are using APL. This style is used in APL/J/K/etc implementations as well as the languages themselves.
Re:The Q Language by modeless on Tuesday December 12, 2017 @06:45PM (#15910626)
I don't think it's a good idea to import the style of a language into its implementation written in a different language; at least, not to this extent. When in Rome...
Re:The Q Language by mallaidh on Tuesday December 12, 2017 @07:10PM (#15910783)
It's how Whitney's always done it:

http://code.jsoftware.com/wiki/Essays/Incunabulum

Re:The Q Language by geocar on Tuesday December 12, 2017 @06:10PM (#15910370)
> 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.

Re:The Q Language by modeless on Tuesday December 12, 2017 @06:59PM (#15910714)
> You think if I need to write C, that I should do things that make my program larger and slower and less correct?

Yes (marginally), when those things are at odds with the tools and conventions of C, because there are serious downsides you don't list. Compiler error messages will be difficult to understand. Tools for code analysis and debugging will be less useful or even completely unusable. Most importantly, because your personal style is alien to other people you lose the ability to collaborate with other developers.

A language designed for this would mitigate most of those downsides.

Re:The Q Language by geocar on Tuesday December 12, 2017 @08:11PM (#15911130)
> Tools for code analysis and debugging will be less useful or even completely unusable.

If you don’t put bugs in the first place this causes very little problem in practice.

> because your personal style is alien to other people you lose the ability to collaborate with other developers.

Another solution is to expand the program by adding white space and long identifiers after it is written.

This works better for me since if someone wants to change my program it’s because they want it to do something that I didn’t.

Re:The Q Language by kazinator on Tuesday December 12, 2017 @06:40PM (#15910594)
Longer identifiers don't make C programs larger. (Well, shared libraries have larger symbol tables, and unstripped executables have bigger debug info.)

Using multiple lines and indentation doesn't change executable code.

Re:The Q Language by geocar on Tuesday December 12, 2017 @08:07PM (#15911102)
> Longer identifiers don't make C programs larger.

They make the source code larger.

That makes it harder to read.

Re:The Q Language by kazinator on Tuesday December 12, 2017 @08:34PM (#15911258)
I can't understand your comment; can you make greater use of one-letter words?
Re:The Q Language by shitgoose on Tuesday December 12, 2017 @08:45PM (#15911320)
z^n=x^n+y^n

what can be greater than this?

Re:The Q Language by kazinator on Tuesday December 12, 2017 @08:49PM (#15911341)
I have a marvelous response for you, but even if I use nothing but one-letter words, it doesn't fit into this margin.

Oops, I see we are devolving into Reddit. Alas, at least the end is near; recursion bottoms out at 4chan which is just one stack frame down.