7 ms·
my k interpreter[0] is less than 1000 lines of JS. Big compared to many on this list, but still human-scale. Looking back on it I see many opportunities left to
by RodgerTheGreat 7y ago
my k interpreter[0] is less than 1000 lines of JS. Big compared to many on this list, but still human-scale. Looking back on it I see many opportunities left to simplify.
further back, I wrote a compiler for part of the language described in Dijkstra's A Discipline of Programming in a dialect of forth[1].
one of my colleagues, Stevan Apter, has a number of interesting toy interpreters on his site[2], particularly concatenative languages.
[0] https://github.com/JohnEarnest/ok/blob/gh-pages/oK.js https://github.com/JohnEarnest/ok/blob/gh-pages/oK.js
[1] https://github.com/JohnEarnest/Mako/blob/master/demos/FiDo.fs https://github.com/JohnEarnest/Mako/blob/master/demos/FiDo.f...
[2] http://nsl.com http://nsl.com
- mamcx 7y agoThis great. I wish exist more information on the array family (and with less "condensed" syntax :)). I'm building a relational language and have tried to borrow some ideas, but apart from the very basics is not much info out (and most are about numerics). For example, how about crud operations.? Lazy evaluation?
- kick 7y agoThe condensed "syntax" (notation) is actually a feature! Read "Notation as a Tool of Thought" to learn more, it's actually one of the best parts of APL as a whole.
- mamcx 7y agoYeah, i have read it (is good!). But could be useful to de-compress it and see how is used "normally" then the step back, I think.
- Firadeoclus 7y agoIndeed, as someone who's learning a bit of APL on the side I'd love to have a tool that can "explain" a line of APL on demand, e.g. show the parse tree, name built-in functions and operators, expand trains, possibly name common idioms. I find the concepts in APL very simple. The difficulty for me is in becoming comfortable reading it. Such a tool would make it quick and easy to confirm one's initially very tentative guesses as to what a line means, and gradually you'd come to depend less on it as you get more confident that your initial understanding is right.
- kick 7y agoHave you seen the FinnAPL idiom library? https://www.finnapl.fi/idilib.htm https://www.finnapl.fi/idilib.htm And not that I'd recommend using proprietary software, but something that might be helpful for you regarding naming is that Dyalog APL has a top bar with every character used in modern APL, the name of them, and (I think, I've never actually used the system) an example of how to use them.
- Firadeoclus 7y agoThanks for the link. Yes, I've seen other idiom libraries as well, and what I'd like to see is automatic lookup of those idioms, with a name, and optional further breakdown.
- kick 7y agoThanks so much for sharing (I knew about [0] and [2], but not [1])! Always a pleasure to hear about the stuff you've done!
- User23 7y agoIt’s a wonderful book. The “sequel” Predicate Calculus and Program Semantics by Dijkstra and Scholten gives a more rigorous treatment of the ideas presented in A Discipline of Programming. Both are fantastic.
- kick 7y agoI've read the book (and almost everything Dijkstra's written barring a few EWDs I couldn't find), I just wasn't aware that 'RodgerTheGreat had done anything related to it.
- User23 7y agoNice to see a fellow read-all-the-EWDs buddy. I have to skip the Dutch language ones, but I think I've read all of the English ones too, barring the ones that aren't on the UT Austin site. So much good stuff.
- artemonster 7y agoOmg, its you! I want to say huuge thank you. Mako VM was something that unified my love for forth, game consoles and writing interpeters and I've learned SO MUCH by studying your well written source code. You can't even imagine what a profound influence you've had on my life :D thank you again ^^^
- RodgerTheGreat 7y agoMako was a great learning experience for me. It is wonderful to hear that you got something out of it, too!
- chrispsn 7y ago> Looking back on it I see many opportunities left to simplify. What would you do?