5 ms·
In case you've jumped straight to the comments, here are some intro links. Many of these also appear in ngn/k's readme. First, direct links to ngn/k in the bro
by chrispsn 4y ago
In case you've jumped straight to the comments, here are some intro links. Many of these also appear in ngn/k's readme.
First, direct links to ngn/k in the browser:
- REPL: https://ngn.bitbucket.io/k/#r https://ngn.bitbucket.io/k/#r
- Editor: https://ngn.bitbucket.io/k/ https://ngn.bitbucket.io/k/
Second, the best one-stop shop for an overview of k6's primitives (both ngn/k and oK are based on k6). https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual.md https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual....
The best intro examples are in John Earnest's k editor iKe - there's a dropdown at the bottom right. http://johnearnest.github.io/ok/ike/ike.html http://johnearnest.github.io/ok/ike/ike.html
ngn/k's editor also has an 'examples' dropdown in its menu.
For an illustration of k's strengths,
Razetime's matmul refactoring is brilliant: https://github.com/razetime/ngn-k-tutorial/blob/main/c-thinking-in-k.md https://github.com/razetime/ngn-k-tutorial/blob/main/c-think...
Finally, some nice examples of concise k:
{$[2>#?x;x;,/o'x@&'~:\x<*1?x]} / Quicksort
(+':,)\~!10 / Pascal's triangle
{x x}{x{x[x]y}y} / Y-combinator
Executable versions of above:
- Quicksort (via Kelas's KCC guide): https://ngn.bitbucket.io/k/#eJwrLLaqVok2slO2r7CusNbRz1evcFBTr7OKqbDRMrSviK3l4iosVspIzcnJVyjPL8pJUQIAgGcPkw== https://ngn.bitbucket.io/k/#eJwrLLaqVok2slO2r7CusNbRz1evcFBT...
- Pascal (via Richie/Attila): https://ngn.bitbucket.io/k/#eJzT0Fa30tGMqVM0NAAADYMCZg== https://ngn.bitbucket.io/k/#eJzT0Fa30tGMqVM0NAAADYMCZg==
- Y-combinator (via ngn): https://ngn.bitbucket.io/k/#eJyLtKquUKiora6oroiuiK2srax14IqMro5Os66IVVCJrrCu0EpTqNA1tDaMrY015eLS0jfUVjQFABmvES8= https://ngn.bitbucket.io/k/#eJyLtKquUKiora6oroiuiK2srax14IqM...