What does HackerNews think of ok?
An open-source interpreter for the K5 programming language.
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
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.
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.
ngn/k: https://codeberg.org/ngn/k
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/
[3] https://github.com/JohnEarnest/ok [4] https://github.com/JohnEarnest/ok/tree/gh-pages/ike
I love the little Web UI this guy wrote along with it as well.
1: https://github.com/jsoftware/
2: https://bitbucket.org/ngn/k/src/master/
3: https://github.com/JohnEarnest/ok
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.
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.
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.
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.
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/
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
https://github.com/JohnEarnest/ok/tree/gh-pages/ike
https://github.com/JohnEarnest/ok
And related APL/J/K subreddit: https://www.reddit.com/r/apljk/
Good hunting!
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.
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.
++++++++++[->+++++++<].
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
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...
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.