Re: Beginning C++ in FreeBSD

看板FB_chat作者時間22年前 (2004/04/22 20:02), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串9/43 (看更多)
On Wed, 21 Apr 2004 11:05:48 -0700, Chris Pressey <cpressey@catseye.mine.nu> wrote: > On Tue, 20 Apr 2004 23:28:48 -0600 > Dan MacMillan <flowers@users.sourceforge.net> wrote: > >> These are not analagous. The reason things get lost in the >> translation of human language is that it is not possible to represent >> every expression in one human language with complete precision in >> another. > > I challenge you to defend this (Sapir-Worfian) claim with a specific > example. :) Thirty seconds on babelfish will provide more than enough substantiation, and Daniela herself argued my point in one of her prior messages. In crappy, somewhat whimsical pseudocode: the_message != translateFrenchToEnglish( translateEnglishToFrench( the_message ) ) The translations are not reciprocal. Though I guess that's not a specific example. Note that only machine translation is relevant for the sake of this argument, because the information available to a human making a translation is basically unbounded and the process is highly subjective. I do have to confess to some ignorance. I don't know what your 'Sapir-Worfian' parenthetical alludes to. At first I thought it was a Star Trek reference ... but a quick Google shows that "One of the premises of Sapir-Worfian hypothesis implies that semantic systems vary without constraint". Excellent! I'll just hop on my double-jimsen saddle and check the specs on the inline for the rotary girder. Ah, here we go. A further Google shows that my ignorance needs no confession, as my reply makes it quite plain. You've obviously given this at least as much thought as I have and studied it besides. <thpthpthpth> >> However, it =is= possible to represent object orientation >> with complete precision in a procedural language. To support object >> orientation, C++ adds to C an intrinsic this pointer and vtables. >> These concepts can be expressed explicitly in C without loss of >> fidelity. > > That (the Turing-Church thesis) is not at issue. What is at issue is > opportunities for optimization. > > I can't say for "Object Orientation" specifically (since there are as > many definitions of an "OO language" as there are "OO languages",) but > in general, translation between languages *can* result in a loss of > opportunities for optimization. I agree. That's why I asked for a specific example -- because I can't think of an optimization that is possible when compiling C++ code directly to binary that isn't possible when first translating C++ to C, then compiling that to binary. Doing so will obviously take advantage of any C language optimizations, and I can even imagine that there are opportunities for optimization in the decisions the compiler would make translating C++ to C. But are there lost opportunities? I'm dubious. I don't think there are. Of course, I could be wrong. I'm not that smart. That's why I asked for an example! There are few things I enjoy more (or experience less :) than finding out I'm in error. By the way, I'm thinking specifically of C vs C++ -- actually, C vs that subset of C++ needed for the object-oriented features. It's the closest apples-to-apples comparison I can think of between non-OO and OO languages, and is the comparison strongly implied by Daniela's message. > For example, if you translate a program from a language with > partially-specified evaluation order to one with strict & > fully-specified evaluation order, do you not lose the opportunity to > optimize it by reordering evaluations? Yes, and I take your point. But the specific claim that was made was that object-oriented languages are optimized differently from non-object-oriented ones. I just don't see it -- but again, I would enjoy an education. -Danny _______________________________________________ freebsd-chat@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-chat To unsubscribe, send any mail to "freebsd-chat-unsubscribe@freebsd.org"
文章代碼(AID): #10XxH200 (FB_chat)
討論串 (同標題文章)
文章代碼(AID): #10XxH200 (FB_chat)