News for hackers. Stuff that matters.
Re:K Programming Language by mlochbaum on Saturday September 11, 2021 @01:45PM (#28494013)
There's now ngn/k[0] for a free implementation of K6. The author prefers K6 to Shakti, which is K9. And there are a number of other open-source K dialects and array languages as well[1]. For learning about K, the recently-created K wiki[2] is a great resource.

[0] https://codeberg.org/ngn/k

[1] https://aplwiki.com/wiki/List_of_open-source_array_languages

[2] https://k.miraheze.org/wiki/Main_Page

Re:K Programming Language by pcc on Saturday September 11, 2021 @08:10PM (#28497340)
OT, but for months already, Googling for "ngn/k" also displays a totally non-sensical calculator result, with no apparent way to report, like:

1 Nigerian naira / Boltzmann constant = 1.75931815 × 10^20 m^-2 kg^-1 s^2 K U.S. dollars

Re:K Programming Language by aseipp on Saturday September 11, 2021 @02:48PM (#28494683)
Is there any summary of what's changed between K versions, or their lineage, for someone who's not "K-fluent" but a tiny bit familiar with array languages? What changed between K6, 7, and 9?

Since Kx is the proprietor of the main toolchain I assume such any such description would be more of an oral history rather than a technical document with a changelog, but I'm curious either way!

EDIT: There is a wiki page for this but it hasn't been filled out (yet) unfortunately. Sad trombone. https://k.miraheze.org/wiki/History

Re:K Programming Language by razetime on Sunday September 12, 2021 @12:39AM (#28498665)
Hello, one of the maintainers of the wiki here. The major changes are generally divided into:

K2-K4

K5-K6

K7-K9

From my knowledge. Each group has the same general primitives and syntax, and major changes happen between those eras. Since K's design allows removal and addition of features, this is very hard to document. This, combined with Arthur Whitney's rocky relationship with documentation makes most sources of changes anecdotal. Most changes to primitives have been documented in the wiki's primitive pages. I'll have to summarize them in the history pages.

K4 has good docs, and K6 has a well-written manual on oK's repository. The rest are a fill-in-the-blanks game which have to be fished from archive pages and a lot of trial and error. K9, the latest one is still undergoing changes, but there are ongoing efforts to make tutorials in kparc/kcc and estradajke/k9-simples on github.

Re:K Programming Language by 1vuio0pswjnm7 on Saturday September 11, 2021 @07:08PM (#28496940)
Theres also a version of K2, plus a PDF K2 reference manual and many example programs on nsl.com that are still available.

Back in 2002, I remember reading an article on kuro5hin where the author wrote: "I have heard rumors that there would be interest in opening up the language if there would be enough community response around it."

https://web.archive.org/web/20050621080857/http://www.kuro5h...

The source code for J7 is still available and it still compiles with only a few small edits:

https://web.archive.org/web/20161024144956/http://www.math.u...

People commenting on today's web like to make fun of the idea that anything about computing was "better" in the past (and they like to crticise C too), but just look at how portable this code was designed to be. Moreover, it is as old as the web itself and it still compiles today.

What is the longevity of something written in Javascript.

Re:K Programming Language by 1vuio0pswjnm7 on Saturday September 11, 2021 @09:16PM (#28497716)
"Back in 2002..."

There was this on Slashdot:

"Arthur told me that he will open-source it, if there is sufficient interest. It is not very difficult to obtain the source from kx for your private use right now."

http://developers.slashdot.org/comments.pl?sid=28597&cid=307...

Re:K Programming Language by antonvs on Thursday September 16, 2021 @03:49AM (#28549169)
> What is the longevity of something written in Javascript.

I wrote some JavaScript in the late 90s which is still being used as part of a complex financial services value chain.

The idea that computing was better in the past is indeed silly, and completely ignores all the advances in understanding that have been made in the last many decades.

If your opinion is different, I can assure you that's due to ignorance.

Re:K Programming Language by Bostonian on Saturday September 11, 2021 @01:53PM (#28494095)
Do Octave and R qualify as array languages? You could say that Python is not because Numpy is not part of the language.
Re:K Programming Language by mlochbaum on Saturday September 11, 2021 @02:24PM (#28494422)
It's hard to say how exactly to draw the line, but "array language" to an APLer usually means a language whose primary influence is APL. So these scientific languages that throw out most of the syntax are nearby but don't quite belong. From a practical standpoint the APL Wiki is centered on APL and exists to document the kind of niche material Wikipedia wouldn't cover, which is why there's nothing about these more mainstream languages currently.
Re:K Programming Language by stingraycharles on Saturday September 11, 2021 @01:59PM (#28494170)
I’d argue that array languages are far, far more limited than Python, to the point that the only thing you can reasonably do with them is processing array data (but they’re really good at it!)
Re:K Programming Language by mlochbaum on Saturday September 11, 2021 @02:10PM (#28494296)
Sounds like you're generalizing, based on... early APLs? NumPy? You could translate any BASIC code to, say, Dyalog APL easily without significant loss in fidelity. Different languages take different approaches but most modern ones (the ones that aren't just made to be calculators like Ivy) support either a generic functional or imperative style just fine.

K is inspired by Lisp, although you can't adapt that style directly because of the limited scoping rules: variables are either local or global, so a function can't see variables from containing functions. This means no closures, which K implementers consider a feature (I don't).

Re:K Programming Language by eiz on Saturday September 11, 2021 @02:46PM (#28494662)
> This means no closures, which K implementers consider a feature (I don't).

having not touched K in about 15 years, when did this change? in k3:

    K 3.2 2004-09-23 Copyright (C) 1993-2004 Kx Systems
    LIN32 16CPU 15985MB ubuntu 0 EVAL  
    
      f:{a:x+1;{a+x}}
      g:f 1
      g
    {a+x}
      g 2
    4
      a
    value error
    a
    ^
    parse error
Re:K Programming Language by mlochbaum on Saturday September 11, 2021 @04:54PM (#28495877)
This comes as a surprise to me! I thought none of Whitney's Ks had closures—although I did neglect to mention that kuc and oK add them. Digging around and asking on the K Matrix/Discord I found some posts that suggest that the K3 form is very limited. My read of these is that functions can refer to variables in the immediately surrounding scope (only one level up), and their values will be copied in when the function is reached in the source code. So it would be equivalent to adding extra arguments to g and passing the variable values in that way. And it wouldn't allow the programmer to create object-like things and couldn't create reference loops requiring garbage collection.

See https://news.ycombinator.com/item?id=22572778, as well as https://chat.stackexchange.com/transcript/message/53999576#5... with more discussion on following days.

Re:K Programming Language by moonchild on Sunday September 12, 2021 @01:02AM (#28498746)
> their values will be copied in when the function is reached in the source code. So it would be equivalent to adding extra arguments to g and passing the variable values in that way. And it wouldn't allow the programmer to create object-like things and couldn't create reference loops requiring garbage collection.

That is definitely desirable! K (and kin) are fully referentially transparent and have value semantics. It would be bizarre and inconsistent to break referential transparency for closures.

Re:K Programming Language by smabie on Saturday September 11, 2021 @04:15PM (#28495489)
No closures is one of the biggest pain points of k/q, it's incredibly limiting and frustrating. Besides that though, it's a wonderful language which allows you to solve problems very quickly with pretty good performance, assuming the problem is naturally vectorizable.
Re:K Programming Language by SaulJLH on Sunday September 19, 2021 @12:22AM (#28581673)
what was the point of the OP in this thread? I went to that page, but I can't make sense of what the page is all about!?!

https://kparc.com/

Re:K Programming Language by gaze on Monday September 13, 2021 @08:34AM (#28510661)
affero? dang.