5 ms·
Do you also will do multi-methods? And how it could be another path for object-oriented programming? This is unexpected for me. --- Other pet peeve of mine is
by mamcx 9y ago
Do you also will do multi-methods? And how it could be another path for object-oriented programming? This is unexpected for me.
---
Other pet peeve of mine is how build control-flows. Using continuations is complicated (I'm using F#) and cause a drop in performance. I wonder what else could be use that allow to make exceptions/coroutines.
Or how make delimited continuations to work reasonable well. The code I have found is in scheme/lisp and it look hard to dechiper.
- munificent 9y ago> Do you also will do multi-methods? No, the book will only go into implementing single dispatch. I'd love to talk about implementing multimethods, but I don't know how to implement them very well either. :) I've read a few papers on it, but there doesn't seem to be a lot of literature. Maybe it's mostly locked up in tribal knowledge and you have to be in the right room with the right people to learn it.
- unnikked 9y ago> Maybe it's mostly locked up in tribal knowledge and you have to be in the right room with the right people to learn it. This is sad.
- munificent 9y agoTell me about it. As someone who works in programming languages professionally but has no academic background in it, it's maddening how much stuff is impossible to learn because "you can't publish a paper on it because everyone knows it already".
- mncharity 9y agoSimilarly in the sciences, the gaps can be surprisingly large between insightful discussion among principals at conferences, and "you have to know the people involved to evaluate them" narrow papers, and misleading texts, and at great remove, introductory material.
- mncharity 9y agoYears ago I dreamed that Lambda the Ultimate had added a wiki, so language implementation was quickening. Waking up... :(
- fasquoika 9y agoI'm assuming that you've seen this then? http://people.csail.mit.edu/jrb/Projects/pd.pdf http://people.csail.mit.edu/jrb/Projects/pd.pdf
- munificent 9y agoNo, I haven't. Thanks for the reference!
- mncharity 9y agohttps://github.com/googoogaga/goo https://github.com/googoogaga/goo continued for a bit, then didn't. OT: With Google Chrome's new Turbofan, and its altered inlining budgeting, there now seems a chance of inlining dispatch trees. Combined with PICs, and cpu branch prediction and speculation... there seems hope for wizzy multiple dispatch in javascript. Maybe. I don't know of anyone pushing on it.
- junke 9y agoYou mention CLOS in your article; to dive deeper into implementation issues, see also https://en.wikipedia.org/wiki/The_Art_of_the_Metaobject_Protocol https://en.wikipedia.org/wiki/The_Art_of_the_Metaobject_Prot....
- munificent 9y agoYup, I read AMOP several years ago. But as I recall, it doesn't talk too much about low-level implementation shenanigans.
- junke 9y agoWhat I liked about it is the discussion about design decisions: where and how to let the protocol be open to extensions, etc. (btw, sorry about the pedantic tone of the previous comment).
- mamcx 9y agoAlso: Any idea why multi-methods are resolved on runtime? Is not possible for a static compiler?
- Rusky 9y agoOne way to do delimited continuations might be to build on the state machine transformation behind generators and async/await. You can drop the `await`/`yield` primitives that C#/Javascript use and introduce a `shift` primitive instead. In non-recursive situations you can even make the continuation objects statically sized. Kotlin goes this direction, for example, though it still requires an annotation on all functions that participate in continuations. This makes it fairly straightforward to tell where the `prompt` is- the root `suspend fun` passed to whatever API drives it. Making every function implicitly `suspend` would let you treat any function as a `prompt`.
- mamcx 9y agoAny example in how this is done? The info I have gathered is none what you have described!
- Rusky 9y agoThe best examples would just be the implementations of yield/async/await in C#, Javascript, Kotlin, Rust, etc. The only novel thing I'm proposing here is a shift in the syntax from explicit suspension points and implicit initiation of async operations, to implict suspension points and explicit initiation of async operations. Kotlin (which I mentioned) already mostly does this.