Live data from Hacker News

K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

github.com

41–50 of 93 posts

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#42
post #11

Earlier quoted context omitted.

Sounds right. Additional examples at https://github.com/louyx/aplus/blob/master/src/a/k.h https://code.jsoftware.com/wiki/Essays/Incunabulum How would you characterize that? Heavy use of the C preprocessor and C defaults to embed a functional programming language. Language with a small number of core functions and ability to apply functions to lists of atoms. Aesthetically favoring short identifiers and minimal white…

You know how when you first start learning to code, the kids who really "get it" right away start off thinking shorter code = smarter code = better code? k always seemed like a bunch of those kids managed to become highly accomplished and brilliant engineers without ever breaking that terrible habit. Is there actually a reason to write these array languages (and interpreters for them, apparently) this way, or is it j…

An occasional HN poster did a presentation a few years ago about his compiler, written in a similar sort of style: https://news.ycombinator.com/item?id=13638086

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#43

I have a longstanding fascination with K and other "modern" APL derivatives. There are a few intersecting truisms about coding that I believe: one is that people's working memory varies: some have an immense amount, some less. Humans definitely process spatially better than in time series (e.g. comparing side by side rather than turning over a page.) This implies you should prefer succinct code and languages because…

my fascination with Q/kdb/K/... disappeared once I had to debug it in production

you want a stack trace? tough luck, you'll get back:

`type

and that's it

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#45
post #23

I recall a chap called Geocar demoing kOS, in a very impressive fashion. (I additionally recall an individual had to awkwardly hold the mic for the whole presentation) Did anything ever come of kOS?

Everything I've found that's public is documented here:

https://gist.github.com/chrispsn/da00835bb122c42f429a084df83...

The kparc.com links are down though.

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#46
post #43

I have a longstanding fascination with K and other "modern" APL derivatives. There are a few intersecting truisms about coding that I believe: one is that people's working memory varies: some have an immense amount, some less. Humans definitely process spatially better than in time series (e.g. comparing side by side rather than turning over a page.) This implies you should prefer succinct code and languages because…

my fascination with Q/kdb/K/... disappeared once I had to debug it in production you want a stack trace? tough luck, you'll get back: `type and that's it

Kx has much improved Q/k's debugging capabilities - including stack traces.

see: https://code.kx.com/q/basics/debug/

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#47
post #43

I have a longstanding fascination with K and other "modern" APL derivatives. There are a few intersecting truisms about coding that I believe: one is that people's working memory varies: some have an immense amount, some less. Humans definitely process spatially better than in time series (e.g. comparing side by side rather than turning over a page.) This implies you should prefer succinct code and languages because…

my fascination with Q/kdb/K/... disappeared once I had to debug it in production you want a stack trace? tough luck, you'll get back: `type and that's it

backtrace has been supported for some time. the debug facilities are nice

https://code.kx.com/q/basics/debug/#stack-frames

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#48
post #43

I have a longstanding fascination with K and other "modern" APL derivatives. There are a few intersecting truisms about coding that I believe: one is that people's working memory varies: some have an immense amount, some less. Humans definitely process spatially better than in time series (e.g. comparing side by side rather than turning over a page.) This implies you should prefer succinct code and languages because…

my fascination with Q/kdb/K/... disappeared once I had to debug it in production you want a stack trace? tough luck, you'll get back: `type and that's it

Oh absolutely. Pg talks at some point about how LISP macros can create a sense of godlike power / mania, and I think there's some of that in APL-land too. The true titans don't need to debug in the traditional sense - a whole program fits on a single screen, they can load it in their head, reason about it, and see what happened.

Non-titanic engineers accidentally generate bugs in these languages with high "floor" IQ requirements, and debugging someone else's K code is terrible. Debugging your own K code is terrible, not less because when you get help you will feel very, very stupid indeed :)

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#49

Anyone know what is happening, or happened, with shakti db[1]? It's been years since Arthur started this other k-variant. 1- https://shakti.com/

It's around, and they recently stopped providing free download links for recent versions, from which I take it that they have a reasonable enterprise sales program rolling now.

The feature split on the free / enterprise edition holds a lot back; my vibe on the free version was it was just enough to validate that shakti is performant, and then they want you to pay.

Re: K/simple: a tiny K interpreter for educational purposes by Arthur Whitney

#50

I have a longstanding fascination with K and other "modern" APL derivatives. There are a few intersecting truisms about coding that I believe: one is that people's working memory varies: some have an immense amount, some less. Humans definitely process spatially better than in time series (e.g. comparing side by side rather than turning over a page.) This implies you should prefer succinct code and languages because…

I don't know about Golang but there are languages where this sort of highly domain-optimized, super terse syntax could be embedded as a domain-specific sublanguage, in a significantly less hackish way than what C allows.

I'm not that knowledgeable, and def not a C apologist, but what language are you thinking of? To my eyes, that is some heavy abuse of the preprocessor in a way that I don't think almost any modern "safe" language could possibly countenance.

I read that code like he got the expressivity benefits of a lisp macro system with close-to-the-metal C speeds in like 100 lines of code. I'm curious what else could do this.

Post reply on HN