Ksharp – k version 3 Language Interpreter in C#

54 points by tosh a day ago on hackernews | 15 comments
What happened with the emoji galore?

troupo | 19 hours ago

Likely AI-generated. LLMs love putting emojis on lists.

Edit. From Authorship section:

This ksharp interpreter implementation was coded originally by SWE-1.5 and 1.6 with significant contributions from Kimi K-2.5 and 2.6 and Claude Opus/Sonnet 4.5, 4.6 and 4.7 based on specifications, direction, prompts, comments and manual fixes provided by Eusebio Rufian-Zilbermann.

nurettin | 17 hours ago

Feels like 7/2025 claude. Nowadays it doesn't do that very often, only when you get it into a happy-go-lucky mode.

reconnecting | 18 hours ago

I don't see how this codebase could possibly be "inspired on K" (as the author writes). k is known to have ascétique aesthetic.

Also, it's `k` as per Arthur Whitney's website (1).

1. https://k.nyc/

adrian_b | 16 hours ago

I doubt this, because for example in this interview with Arthur Whitney from 2009, his languages are named "K" and "Q":

https://spawn-queue.acm.org/doi/pdf/10.1145/1515964.1531242

The same in this article from 2004:

https://web.archive.org/web/20070101213150/http://vector.org...

The present site of KX has some mentions about a "q", so perhaps they have changed the spelling at some point, but at least many years ago I remember seeing only "K" and "Q".

Perhaps "k" and "q" refer to the interpreters of the languages, not to the languages themselves.

EDIT: TFA has links to a reference manual and a user manual from 1998, which use "K programming language" for the language and "K environment" for the program that includes the user interface and the K interpreter, so I have no idea who has ever used "k" for anything related to this.

reconnecting | 15 hours ago

Perhaps this was prior to shakti times.

I have a letter from Mr. Whitney, and I'd say he doesn't use the shift key at all, therefore I assume it's k.

Pompidou | 16 hours ago

Great. But you have to simplify the sources.

FrustratedMonky | 15 hours ago

just a question.

couldn't this have been easier by expanding F#? or were they trying to hit a wider audience with C#?

Eu_RZ | 10 hours ago

ksharp doesn't "expand" C# it's just written in C#.

The FFI loads .NET dll's which could be written in a variety of .NET languages, including F#

small_model | 15 hours ago

Why C#? would be good if you added explanation of the reason.

[OP] tosh | 14 hours ago

I'm not very familiar with k3 and how it's ffi story looks like but it sounds like ksharp has a dedicated C# and .net ecosystem angle:

https://github.com/ERufian/ksharp#foreign-function-interface...

troupo | 14 hours ago

My own initial reaction is... why not? :) Especially if the author knows C# already.

gwbas1c | 14 hours ago

I'm trying to understand "the point." The linked K manuals are from the 1990s. Is this project a way of running legacy code on a modern system? Is there a die-hard group of K enthusiasts who are behind this? Does K have forgotten concepts and / or paradigms that make it worth learning? Are there advantages to K compared to more modern languages / toolkits / frameworks from the past 20 years?

tangentstorm | 12 hours ago

Yes to pretty much all of the above. It's an extremely terse array programming language in the APL family, but with ASCII primitives and strong distributed programming / IPC support. There are also at least a couple companies that still use K3 (I work at one), and no official support from the author (who went on to make other versions of K that are also awesome but completely different).

IMHO the biggest thing holding K back is lack of a production-ready / batteries included open source implementation. (There are a couple nice open source implementations of K but none of them are as feature complete as this one... Plus this one has at least a start on interoperating with .NET)

[OP] tosh | 11 hours ago

re 1990s:

not everything that is old is bad

k3 is a refinement of a refinement […] of APL and math notation that is both terse and composable

definitely very much worth learning today

especially if you are interested in data crunching, machine learning, and high performance computing (think GPUs, SIMD, …)

the patterns at the core of k and APL are everywhere, once you get into them you see them everywhere

the world looks different, more rich

"A language that doesn't affect the way you think about programming, is not worth knowing." — Alan Perlis

when you flip it around:

k is worth learning

in the 90s, today, and possibly 100s of years from today