April 18, 2003 Re: Commentary on D (or "Using Sather as a Model") | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark Evans | Hi Mark, I agree with the fact that call/cc is the more general concept. From the standpoint of the compiler implementor they can be treated very similarly. Indeed, for the specific case of iterators, the CML docs you linked mention them only in the coroutines section. -Call/cc being used to implement thread context switching. Where call/cc comes in is when the compiler would be expected to optimize tail-recursion to a reasonable degree such that there is inherently zero cost in calling functions recursively for purposes of iteration. I find the coroutine model directly maps to the case of 'foreach' loops as well as other more complicated iters. They are quite easy to implement and optimize. Call/cc I would put in separate feature request though. Has there been much talk of it here, or any concensus on it? There is also the Sather-K streams model. Call/cc can be compared to iterators which can be stored on the heap and later be reused. The idea being that when (in Sather) looping over: loop { 1.upto!(10); #OUT + myarr.elt! + "\n"; } the array 'myarr' may still have data that you wish to process. If you can save that stream and reuse it after this loop block, you come closer, semantically, to call/cc. I'm not sure what you mean about your statement on code inclusion. In Sather - like Objective C, Smalltalk, and Java - inheritance (subtyping) is separate from inclusion (reuse of code). There is a nice section on this at the following Sather tutorial: (section 1.5.4) http://www.cip.informatik.uni-muenchen.de/~hafner/sather/tutorial/intro79.html#AEN132 I am quite impressed with the cleanliness and flexibility of this design as opposed to every other model I've used to date. --thomas Mark Evans wrote: > First mention of Sather on D news was from yours truly, http://www.digitalmars.com/drn-bin/wwwnews?D/10827 > > Sather might be getting more attention than it deserves, but the interest is gratifying anyway. > > Coroutines are not the most general concept, but continuations. My > earlier > posts about the subject are linked below. They are pertinent to D as a > low-level systems language. > > http://www.digitalmars.com/drn-bin/wwwnews?D/11434 > http://www.digitalmars.com/drn-bin/wwwnews?D/11439 > "Microkernel operating systems should expose continuations, not threads, > as the low-level interface to the kernel. Threads should be provided as a > library in user-space layered on top of the microkernel. Richard Draves' > thesis demonstrated that using continuations as a programming technique > within the MACH 3.0 kernel simplified the code and vastly improved > performance." > > http://web.access.net.au/felixadv/files/output/book/c2344.html "Continuations ... are a primitive notion that can be used to model any flow of control, including long-distance transfers such as raising exceptions." > > > Sather's "include" construct is purely syntactical. Develop what opinions you will from that fact. > > Mark -- COMPASS [for the CDC-6000 series] is the sort of assembler one expects from a corporation whose president codes in octal. -- J.N. Gray |
April 18, 2003 Re: Commentary on D (or "Using Sather as a Model") | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas D. Marsh | >I'm not sure what you mean about your statement on code inclusion. --thomas It's effectively preprocessing. I think what you really want for this purpose are mixin classes, not a preprocessor. Simple forwarding is another option (below). Mark http://www.stat.cmu.edu/~minka/PLE/sather/sather.html "Sather's textual substitution semantics for inheritance give rise to the fragile base class problem. Suppose class D includes code from B. In order to compile D, B's code must be available. Furthermore, if B changes, D must be rebuilt. Hence, B is fragile; it needs careful handling to prevent problems in D. Pure virtual base classes, such as in Python and Self, avoid this problem. An alternative to inheritance, which also avoids this problem, is forwarding: D contains an instance of B which it sends messages. The code for B, since it remains behind an abstraction barrier, is not needed to compile D." |
April 18, 2003 Re: Commentary on D (or "Using Sather as a Model") | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark Evans | Oh, stop acting like you're the source of enlightenment in this newsgroup. People here are informed, whatever you may think, and read the same things on the net (almost 90% of your "news" posts are related to discussions in LtU - http://lambda.weblogs.com/ ). Who cares if you mentioned Sather first? This is quoted from your post: > First mention of Sather on D news was from yours truly, http://www.digitalmars.com/drn-bin/wwwnews?D/10827 > > Sather might be getting more attention than it deserves, but the interest is > gratifying anyway. Why you're saying that Sather is "getting more attention than it deserves"? It's a very nice programming language developed by dozens of intelligent people and most OO languages today are more primitive than Sather. Also "the interest is gratifying anyway." is a pretty bizarre statement. Many people here knew about Sather before. Some heard about it from messages (every other month someone say something about Sather/Eiffel/OCaml/Haskell/Whatever) other than yours. And some see one of the hundreds of links you post when you're browsing. They follow the links and discover something they like, paying the attention it deserves. Plonk! "Mark Evans" <Mark_member@pathlink.com> escreveu na mensagem news:b7nlac$1hv9$1@digitaldaemon.com... > Fair enough. We were withing days of each other and Sather was the main topic > of my post, not just a passing reference. > Mark --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.471 / Virus Database: 269 - Release Date: 11/4/2003 |
April 18, 2003 Re: Commentary on D (or "Using Sather as a Model") | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Yokomiso | No one has acted like that, Daniel. The reason for going back to the old post and calling it 'first' was to connect the stray chain links of Sather discussion between their most remote points. I won't mount a defense for trying to be helpful. The theme of my last post (which launched your tirade I guess) was that in spite of attribution error, it made sense to connect the chain exactly where I did - a contemporary thread dedicated to the Sather language itself, not some other topic. Take all the glory you want, I don't need it. The interest is 'gratifying' in that it's good not to talk about C/C++/Java/C# all the time, but to branch out. (That's why I post languages to D news; purpose fulfilled = gratification.) 'Getting more attention than it deserves' is a relative statement in that other languages could be explored and talked about. It also means that certain Sather features are being a bit over-hyped IMO. Over-hyped with respect to capability and also novelty vis-a-vis other languages and generic CS concepts. Clear? LtU covers all the languages known to man, as far as I can tell. I suppose it would be hard to talk about any language that hasn't shown up there. I do my own research at my own pace and hope others find it useful. It has served me well for years. It's true there are informed people on D news. No one said otherwise. You are a case in point! Mark |
Copyright © 1999-2021 by the D Language Foundation