News for hackers. Stuff that matters.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by 1vuio0pswjnm7 on Tuesday May 09, 2023 @02:34AM (#35870866)
Why use Javascript?
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by revskill on Tuesday May 09, 2023 @02:41AM (#35870903)
It's fast.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by tcfhgj on Tuesday May 09, 2023 @02:46AM (#35870942)
Not really
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by sgtnoodle on Tuesday May 09, 2023 @03:24AM (#35871181)
Reminds me of an interview I conducted years ago. I asked the candidate what they would do to make their code run faster. They suggested using the V8 JavaScript engine so that it would be JIT compiled. We were talking about code written in C++, intended to be run on an embedded microcontroller...

Also reminds me of many years ago in college, when somebody gave a presentation claiming that java was unquestionably more efficient than C++. I had a lot of questions...

Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by lynx23 on Tuesday May 09, 2023 @03:48AM (#35871333)
Only tangentially related, but this reminds me of a MCSE training I once attended in the 90s, where the trainer claimed Microsoft Passwords are so secure that they can not be cracked in a reasonable amount of time. I couldn't hide my amusment. Since this got him fired up, he went as far as saying "If you believe otherwise, find my password!" to which I replied "No need for that, already done." Thanks l0phtCrack, you made my day.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by 1vuio0pswjnm7 on Tuesday May 09, 2023 @09:11AM (#35873805)
I met many Microsoft lawyers over the years who behaved the same way. The enthusiasm is effective perhaps, even when it's grounded in ignorance. MS is like a cult.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by samwillis on Tuesday May 09, 2023 @03:58AM (#35871406)
> more efficient

I was going to make a quip about efficiency being more than execution, with development efficiency also being important. But then with it being a comment about C++ vs Java I decide not to...

Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by kindawinda on Tuesday May 09, 2023 @02:50AM (#35870973)
Why ask a question that will spawn a comment thread about language superiority without testing or acknowledge what the author provided?

Setup stress testing and worked flawlessly. Impressive work author.

Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by croes on Tuesday May 09, 2023 @02:57AM (#35871017)
Critique or honest question?

For the former, because the developer wanted to use Javascript.

Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by Sosh101 on Tuesday May 09, 2023 @02:58AM (#35871030)
Why use anything?
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by vidarh on Tuesday May 09, 2023 @03:03AM (#35871061)
On the server? As an example of equivalent (to the k and q versions) code.

On the client? Because endlessly refreshing the page to refresh chat messages is an awful design that we had enough of already in the 90's.

Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by HotGarbage on Tuesday May 09, 2023 @03:18AM (#35871147)
Could be done with long polling or a never-closing HTTP response.

POST to an iframe to keep the page from reloading on send.

Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by vidarh on Tuesday May 09, 2023 @03:30AM (#35871224)
That's true, and those options are also awful options we used in the 90's and promptly abandoned once better options became available, though they wouldn't make that much difference here. The alternatives are all brittle and limited in different ways.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by IshKebab on Tuesday May 09, 2023 @03:35AM (#35871261)
Well sort of. Server Sent Events is basically "official long polling" and it works very well. Way simpler than websockets in many cases. Websockets is obviously better here though.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by vidarh on Tuesday May 09, 2023 @04:04AM (#35871439)
The point isn't that the way the data is sent from the server matters much, but that using javascript to handle the retrieval is beneficial. The first Javascript enabled chats still relied on the same methods of retrieval for a long time, but still significantly improved usability.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by holoduke on Tuesday May 09, 2023 @03:21AM (#35871167)
Because its the most convenient language on the client there is.
Re:Kchat: Persistent group chat in <50 lines using kdb+/k/q ... by 1vuio0pswjnm7 on Tuesday May 09, 2023 @08:56AM (#35873650)
This submission would not have made the front page unless I jump started some discussion. Mine was the first comment. It worked. Front page.

Years ago I had used k-based chat, with GUI, on Windows. Without Javascript. (Many years ago, k used to have a built-in GUI.)

"Why use Javascript" was a genuine question.