What does HackerNews think of ok?

An open-source interpreter for the K5 programming language.

Language: JavaScript

#1 in Python
check out oK[0] by John Earnest, who is the author of the content of this post.

it has a well-written manual and is a great jumping off point. the source is written in ~1000 lines of js. so you can look at how each primitive is implemented.

there is a k-enthusiast element.io server[1] where you can ask any question you like. folks are friendly!

EDIT: another commenter shared most of this info. oops :-) i'll add as well ngn-k browser repl[2] which has some docs and a fuller feature-set than oK. this is probably the most-used open source k right now. the author is active in the above element server, and still patches bugs and makes updates.

[0] https://github.com/JohnEarnest/ok

[1] https://matrix.to/#/#aplfarm-k:matrix.org

[2] https://ngn.codeberg.page/k/#

I have tried to learn J, it seems to be one of the most well documented.

And Ike itself is not a bad environment to play around with K https://johnearnest.github.io/ok/ike/ike.html

It has a repl as well in: https://johnearnest.github.io/ok/ you can find source here: https://github.com/JohnEarnest/ok and manual here: https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual....

If this is the entirety of K - https://kparc.com/k.txt it does fit on a single full-screen page.

As best I can understand, K is proprietary and you need to have a business relationship with Arthur Whitney to get access to the latest. You can get a free trial for personal use here: https://kx.com/download-kdb/. There are some open source clones like: https://codeberg.org/ngn/k https://github.com/kevinlawler/kona https://github.com/JohnEarnest/ok , and inspired languages: http://t3x.org/klong/
If you want to play with a modern Hypercard, I recommend John Earnest's Decker[1]. It even has the Mac look. John created Lil, a scripting language from it that is declarative, functional, and vector oriented. He is also the creator of oK[2] an interpreter for a K-type programming language with a web interface and graphics and sound primitives. Amazing and fun stuff!

[1] https://beyondloom.com/decker/

[2] https://github.com/JohnEarnest/ok

There's only one Q.

Open source K is likely compatible with ngn/k or oK, both of which are based on k6. There are minor differences between these 2 implementations (one is browser-native, the other isn't) but for the most part code should work identically on both.

Q: https://code.kx.com/q/

ngn/k: https://codeberg.org/ngn/k

oK: https://github.com/JohnEarnest/ok/

You may also be interested in oK[0], which is developed by the same person who created Decker, which has a similar style, although more clean and a little bit more readable IMO than LIL.

[0]: https://github.com/JohnEarnest/ok

Creative coding is my hobby, and I have gone back and forth with graphics and audio. I started with Processing back in the early 2000s, but I have since moved on to Extempore [1], and more recently, Nannou [2].

I like Lisps, and Extempore has two languages: Xtlang a low-level language, and a scheme for higher-level programming. You run the compiler as a service (CAAS) and you livecode and hotload your changes. You can program music/sounds at the note or DSP level.

I started learning Rust and stopped. Then I started playing with Nannou, and I am making good progress and having fun. The compile times can some times interrupt creative flow, but it is getting better. Extempore is great at hotloading changes.

Some more esoteric but fun experiments are ok/ike [3,4] by John Earnest. They are based on the k programming language. I personally use APL/J, but John has really done a great job here for creative coding and array languages.

Looking at these examples, I guess I am jaded by these types of experiments except the last one (neural network imagery from left screen objects). I saw many interactive things done in the last 15 years with interactive "pets", "creatures", etc. to the point where you had them at malls all over (kids stepping on floor-projected fish to scare them). We had a wall of flipdots or sequins at my last job in 2012 that used Kinects to track people and then silhouetted them in black and white as they moved. The combination of the mechanical dots flipping, and the black-and-white moving image was cool. I forget the company that made it. Not to say it is not entertaining, art, or creative coding, but I find myself looking at a piece and thinking is it strong on art, weak on tech, vice versa, or somewhere in the middle. For me, I like when it is very thought provoking and uses either newish tech or existing tech in a novel, unexpected way.

[1] https://extemporelang.github.io/

[2] https://nannou.cc/

[3] https://github.com/JohnEarnest/ok [4] https://github.com/JohnEarnest/ok/tree/gh-pages/ike

Wish I had more to offer, but here's one neat implementation of K that I found through HN a while back: https://github.com/JohnEarnest/ok

I love the little Web UI this guy wrote along with it as well.

J[1], ngn/k[2], oK[3], kona[4], and GNU APL[5] are the big oss interpreters. The main closed-source ones are Dyalog APL, Kx k, and Shakti k (which are still free for non-commercial use).

1: https://github.com/jsoftware/

2: https://bitbucket.org/ngn/k/src/master/

3: https://github.com/JohnEarnest/ok

4: https://github.com/kevinlawler/kona

5: https://www.gnu.org/software/apl/

APL and K does fit mine, J doesn't.

Perhaps it would help you to start with K (e.g. https://github.com/JohnEarnest/ok is free, has a web repl with interactive graphics and stuff)

In a way, K is a cross of C and APL; K is the essence of APL minimized to the absolute minimum usable subset, even though less pure; e.g. complex values are not part of the language, and matrices only as vectors of vectors (unlike APL/J where you can have either). It also does away with user defined operators and a lot of other stuff.

Just in case you want to look at the sources of something similar, here is a good one: https://github.com/JohnEarnest/ok
This concise article describes K2 (version 2 of the K language), and, at the level it describes, little has changed, so it is still a good introduction to the language 12 years later.

However, beyond the basics, a lot has changed since (current commercial version is K4, current dev is K6 AFAIK): Dictionaries have become better integrated in the language, the database layer was rolled into the language, the integrated (bare bones and milspec-looking but ultra effective) electric GUI was dropped, http and web (as both client and server) were added to the core, 64-bit integers, nanosecond timestamps, GUIDs were added as core types, and probably a few more things I forgot.

If you find this article interesting, you may want to experiment with JohnEarnest's ok [0], which provides graphical playground (implemented in JS and runs everywhere) and also read Q for mortals[1] - Q is a syntactic-sugar version of K4, though still the same language underneath.

[0] https://github.com/JohnEarnest/ok

[1] http://code.kx.com/q4m3/

Arthur Whitney seems to have been developing this stuff pretty steadily. There's a sparse-but-quite-informative website at http://kparc.com/ where you could follow the development of the K5 and K6 dialects. It's been pretty quiet the last year or so, but there was a comment on HN a month or two back which suggests that K7 could be on its way.

For playing around with the basic constructs, https://github.com/JohnEarnest/ok is nice (and itself pleasingly concise). Currently targeting the K6 dialect, I think. It doesn't really have any of the "database" side of things, though.

There’s also a JavaScript impl of K, one of the ASCII APL-like languages:

https://github.com/JohnEarnest/ok

But there are:

k variants:

kona (C, interpreter): https://github.com/kevinlawler/kona

klong (C, interpreter): http://t3x.org/klong/

kuc (C++, JITted): http://althenia.net/kuc

oK (JS, interpreter): https://github.com/JohnEarnest/ok (see also iKe by John Earnest)

cousins:

J (C, interpreter) http://jsoftware.com/

A+ (C, interpreter, unmaintained): http://www.aplusdev.org/index.html

Gnu APL (C, interpreter): https://www.gnu.org/software/apl/

apl.js (JS, interpreter): https://github.com/ngn/apl

There's also NARS2000 and a few other APL interpreters

related:

Numpy and R provide similar functionality, albeit with more verbose (and less fluent) composability. They are usually slower.

To my knowledge, there isn't a full OSS implementation of K/Q. I do know of a K5 interpreter in JS [1] but otherwise I've only been able to find the free for personal use 32 bit Q distribution.

[1] https://github.com/JohnEarnest/ok

Check nsl.com and https://github.com/JohnEarnest/ok for playing around with examples. Ofcourse if you want all facilities, you'll need kx. You can play with 32 bit version.
You must be my long lost twin ;) I went from Basic, Assembly and then C to Lisp, Forth and then APL, well J [0], but then some APl (Dyalog). I have decided to do all of my work in either Lisp, Forth or J.

I sometimes have to code in Python (there's always Hylang!), but all of my personal interest stuff is in the other three. I am currently going through the 4th edition of "Fractals, Visualizations and J", which is a great introduction to the J language and graphics.

I am trying to make a livecoding (toplap.org) environment in J similar to oK, but more musical and with webgl shaders [1,2].

I'm convinced the proliferation of using GPUs, distributed processing, and multi-core CPUs are all a good fit for a true array or vector-based language like APL, J, and K. I get more of a functional high on J than in Haskell, and feel like I am writing Math equations after memorizing the 'words' of J, more like operators (nouns, adverbs, conjunctions, verbs, etc...)

Shen is a great mix of Lisp and a typed (optional), lazy (optional) language with great pattern matching that has been implemented on a lot major programming platforms (Python, Ruby, JavaScript, Scheme, Haskell, Common Lisp, Clojure, JVM, and Emacs Lisp) because it runs atop a small set of 46 primitives called KLambda similar to the original Lisp 1.5. If you implement KLambda, and pass the tests, in a given PL, you can then run any Shen program on that platform [3].

  [0]  jsoftware.com
  [1]  https://github.com/JohnEarnest/ok
  [2]  http://johnearnest.github.io/ok/index.html
  [3]  http://www.shenlanguage.org/
Yes, Clojure (that Lisp variety) as well. Forth for embedded as well. But they are niche; it depends where you live etc on which opportunities there are for each of those. But yes, you are right; Kdb (and Clojure btw) are good in some parts of finance and pay well.

Edit: what i'm basically saying is that practicing any of these languages will help you in potentially more than one way; it will open your mind to interesting paradigms and constructs as well as give you job opportunities you would not think of possibly later on.

Edit2: https://github.com/JohnEarnest/ok is interesting for playing around by the way

There's also Kona[1], which targets K3 and my own interpreter called oK[2], which targets K5.

Good hunting!

[1] https://github.com/kevinlawler/kona

[2] https://github.com/JohnEarnest/ok

Very cool! I wrote (and am working on) a K interpreter in JavaScript called "oK". Might be useful to compare notes:

https://github.com/JohnEarnest/ok

I'll have a deeper look at Klong's implementation when I have time to see if there are tricks worth borrowing.

Depressing surprise move for those of us that were interested in this quirky tiny platform.

To announce this in between versions (ie 3.3) without using official channels like Twitter, their news feed, or their KXCommunity blog, is quite baffling.

If you value the way of computing that K and Q enable, some truly free alternatives include:

Kona, a lively and fresh implementation of an earlier version of K (K3): https://github.com/kevinlawler/kona

Kuc, a language that reads much like K, but features some interesting new ideas, such as mmap as a verb, closures (and their direct descendant objects), and an inspectable machine code-like intermediate representation of code (but sadly not data): https://github.com/zholos/kuc

oK.js, the funky, bright JavaScript implementation that is quickly becoming a busy place on Github: https://github.com/JohnEarnest/ok

Sadly, the brilliant Kevin Lawler's Kerf begins to look less interesting once one considers the license. Still, its embrace of Json is something for other implementors note. https://github.com/kevinlawler/kerf

That brings us to http://kparc.com. In the gloomy distance, beyond the pillowy smoke of the fires on which we burnt our printed out Q tutorials for warmth, where we still fight over tattered copies of the crippled pre-crisis K4/32b interpreter, there is an ivory tower, the inhabitants of which, it is said, look down on us mortals with benign disdain.

Kparc promises us the interesting K5 and the life changing kOS. Their frustratingly secret work could be among the most important in the study of sustainable computing and different concepts of implementation.

Here, at long last, Arthur will bring his significant genius to the task of the user interface, still the torpid cesspool of the developers dreary life.

Tantalizing dreams of a free K seem dead now, but some remember those sultry rumors. Sadly, whether or not we'll ever get to actually use it remains an open question.

The BrainFuck interpreter doesn't seem to work properly. For example, I tried

    ++++++++++[->+++++++<].
Which multiplies 10x7 and should print "F" (ascii 70). Nothing appears to print.

I have a K interpreter[1] that could be adapted fairly easy to a system like this. Other good candidates include JSForth[2] and NGN APL[3].

[1] https://github.com/JohnEarnest/ok

[2] http://home.diphi.com/users/jeffr/forth/jsforth.html

[3] https://github.com/ngn/apl

If you like APL, you might like one of its cousins, K.

I've written a (buggy, incomplete!) K interpreter I call oK which similarly runs in your browser: https://github.com/JohnEarnest/ok

Here's a nice little program which calculates terms of the "look-and-say" number sequence:

http://johnearnest.github.io/ok/index.html?run=%2010%7B%2C%2...

And another rather infamous example program:

http://johnearnest.github.io/ok/index.html?run=%20%7B(x%3B%2...

Sure, here's the repository: https://github.com/JohnEarnest/ok

I don't have a rigorous approach for testing compatibility at present; My starting point was the K2 manual, and I've tried to get as many examples from that working as possible. I have been learning the language as I go, so often I don't realize functionality is missing until I stumble across an existing K program that doesn't work properly.

I'm targeting K5, which is unreleased, so there's a great deal of speculation. I think I have a decent subset of the functionality working now, but most of the time when I write new programs using it I still shake out bugs and unhandled edge cases.