4 ms·
Wow! a text editor in 3 lines of code? It would be nice if a short write up accompanied this?
by max_ 7y ago
Wow! a text editor in 3 lines of code?
It would be nice if a short write up accompanied this?
- aidos 7y agoObligatory clip: Game of Life in APL https://youtu.be/a9xAKttWgP4 https://youtu.be/a9xAKttWgP4
- geocar 7y agoMaybe this will help? I wrote the following up a few years ago now: https://news.ycombinator.com/item?id=8476633 https://news.ycombinator.com/item?id=8476633
- drudru11 7y agoThanks for that write up. Is there a decent reference or tutorial for ‘k’ online that you would recommend? I would like to learn more about it’s semantics. For example, the views concept and how old versions of a view/var? Are available.
- geocar 7y agoNot to my knowledge. There are a fair number of documents[1] describing the language to be sure, but it is difficult to divorce K from its implementation(s), so k2, k3, k4, k5 (etc) are all different languages. Your best bet is to download some implementations and try it out. k4 is built-in to kx's q which has a free download[3], just enter a line with a backslash on it to get into k. Views are just a convenient syntax for memoization. Old versions of the value aren't available. [1]: http://web.archive.org/web/20041022042401/http://www.kx.com/technical/documents/kusrlite.pdf http://web.archive.org/web/20041022042401/http://www.kx.com/... [2]: https://web.archive.org/web/20130801233812/http://www.kuro5hin.org/story/2002/11/14/22741/791 https://web.archive.org/web/20130801233812/http://www.kuro5h... [3]: https://kx.com/ https://kx.com/
- icen 7y agoThere's a decent tutorial now at shakti.com: https://shakti.com/tutorial/ https://shakti.com/tutorial/
- ksherlock 7y agooK is an implementation of K6 in Javascript. No views, but you can play with it in your browser and the documentation is pretty good. http://johnearnest.github.io/ok/index.html http://johnearnest.github.io/ok/index.html https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual.md https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual.... https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Programming.md https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Program...
- LfLxfxxLxfxx 7y agoProbably most of the work is hidden in the underlying "framework" or "language". Here's a text editor in 1 line of html: <textarea></textarea>
- Sir_Cmpwn 7y agoAPL is an extraordinarily concise programming language, even without taking its environment into account. This is a well known implementation of Conway's Game of Life in APL: ↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵
- forgotpwd16 7y agoThe first line loads http://kparc.com/$/view.k http://kparc.com/$/view.k, where the first lines are multiple variable definitions per line. A non obfuscated version is at http://kparc.com/edit.k http://kparc.com/edit.k where some stuff are explained.