digitalmars.D - too much sugar not good for the health
- Neal Becker (12/12) Mar 21 2007 Reading through "D Specification", I'm a bit surprised. I believe the g...
- Johan Granberg (6/21) Mar 21 2007 I agree that to much features is a bad idea. But I don't feel that the a...
- Jarrett Billingsley (6/11) Mar 21 2007 The only response I have to this is: have a look at Java to see a langua...
- janderson (21/35) Mar 21 2007 Agreed. Even Java are adding more an more sugar with each release. Also
- Falk-Florian Henrich (8/13) Mar 21 2007 Without discussing what "successful" is supposed to mean in the realm of...
- janderson (12/29) Mar 22 2007 By successful I mean most widely used, which is what we want D to become...
- Walter Bright (8/13) Mar 22 2007 What I read about English:
- Jeff Nowakowski (3/5) Mar 23 2007 Syntax is more like grammar than vocabulary.
-
Stewart Gordon
(5/11)
Mar 23 2007
- Walter Bright (2/14) Mar 23 2007 Since it was one source, I presume it was using the same definition.
- Ary Manzana (8/28) Mar 23 2007 English is not succesful because of the language itself, but because of
- Walter Bright (3/7) Mar 23 2007 One reason English is successful is its shamelessness in adopting useful...
- torhu (6/14) Mar 24 2007 This isn't quite true. English is 'successful' because of the
- Walter Bright (5/21) Mar 24 2007 I did say one reason - there are many. Some languages look inward, not
-
Stewart Gordon
(5/17)
Mar 24 2007
- Kevin Bealer (10/31) Apr 02 2007 A few steps behind Klingon, I would expect.
- Dan (4/13) Apr 03 2007 Hehe. yeah, I took Linguistics in the first part of university and got ...
- Bruno Medeiros (7/15) Mar 24 2007 Huh? I'm under the impression that that also happens a lot in other
- Walter Bright (4/13) Mar 24 2007 Sure, and I suspect that a language that refuses to do so is one that
- torhu (15/31) Mar 25 2007 The languages that I'm aware of that do this, also create replacement
- Bruno Medeiros (6/37) Mar 24 2007 Man, I am the only programmer to actually (moderately) like the Java
- David B. Held (9/12) Mar 24 2007 I think for many people it's language envy because Java is so
- Ary Manzana (6/44) Mar 24 2007 I like Java a lot because of all those things. Having seen the video
- janderson (12/43) Mar 24 2007 Neither Java or English would have any chance of being successful if it
- Charlie (3/39) Mar 24 2007 My bets on chinese ;).
- Sean Kelly (3/8) Mar 24 2007 http://en.wikipedia.org/wiki/Chung_Kuo
- janderson (3/45) Mar 24 2007 You may be right. One interesting fact is that China has the biggest
- Davidl (10/27) Mar 21 2007 it's totally not arbitrary. since AA in D is a container, but we lack of
- Andrei Alexandrescu (See Website For Email) (3/13) Mar 21 2007 We definitely should get rid of the shameful .sort and .reverse though.
- Stewart Gordon (4/6) Mar 21 2007 What is shameful about them?
- Andrei Alexandrescu (See Website For Email) (3/9) Mar 21 2007 They should be free functions, and sort should also allow a predicate.
- Stewart Gordon (4/13) Mar 21 2007 If you mean a comparator, it's been said already. But how would getting...
- Andrei Alexandrescu (See Website For Email) (4/18) Mar 21 2007 The problem is that reverse and sort should be, as in STL, algorithms
- Sean Kelly (7/15) Mar 21 2007 I agree. But until then, adding such free functions fortunately does
- Derek Parnell (10/12) Mar 21 2007 ... and replace them with more suitable implementations as I'm sure the
-
Stewart Gordon
(23/32)
Mar 21 2007
- Alexander Panek (5/19) Mar 21 2007 You have a point, though the beauty & readability of D pretty much
- David B. Held (4/9) Mar 21 2007 I think the ridiculous size of the front-end is a pretty good existence
- Andrei Alexandrescu (See Website For Email) (3/12) Mar 21 2007 Take a look at Polyglot. Even Java syntax is heinous to parse.
- Dan (5/17) Mar 21 2007 Oh my!
- David B. Held (7/19) Mar 21 2007 Actually, D's front-end was a lot smaller than I was expecting. Only
- Andrei Alexandrescu (See Website For Email) (3/14) Mar 21 2007 Posted at 09:42 am? Somebody has a skewed clock :o).
- Walter Bright (3/4) Mar 21 2007 I figure in two weeks my Linux box will fix itself (at least until next
- Dejan Lekic (1/1) Mar 23 2007 Mr. Becker, You can always forget those fancy features, and use those Yo...
Reading through "D Specification", I'm a bit surprised. I believe the goal of D is to be a clean, improved C++. Yet, there are a number of instances where syntactic 'sugar' is added in ways that seem almost arbitrary. The latest example I found is 'Functions as Array Properties'. I'm not sure what overwhelming need this syntax fulfills, maybe I'm missing something. There is a lot of extra conceptual overhead in adding extra syntax. One might argue that "You don't have use it if you don't like it.". That is, unfortunately, not really true. If other's use it and I have to grok there code, I need to understand the extra rules. I've been following D with great interest. I hope the language will not add such 'features' without great need - it really detracts from the purity and simplicity.
Mar 21 2007
Neal Becker wrote:Reading through "D Specification", I'm a bit surprised. I believe the goal of D is to be a clean, improved C++. Yet, there are a number of instances where syntactic 'sugar' is added in ways that seem almost arbitrary. The latest example I found is 'Functions as Array Properties'. I'm not sure what overwhelming need this syntax fulfills, maybe I'm missing something. There is a lot of extra conceptual overhead in adding extra syntax. One might argue that "You don't have use it if you don't like it.". That is, unfortunately, not really true. If other's use it and I have to grok there code, I need to understand the extra rules. I've been following D with great interest. I hope the language will not add such 'features' without great need - it really detracts from the purity and simplicity.I agree that to much features is a bad idea. But I don't feel that the array property syntax is an unneeded feature, rather I fell that it should be generalized to cover all types and not just arrays. (It could be used to replace methods but I don't think that would be a good idea for D, at least not in the shot term)
Mar 21 2007
"Neal Becker" <ndbecker2 gmail.com> wrote in message news:etr33u$46c$1 digitalmars.com...I've been following D with great interest. I hope the language will not add such 'features' without great need - it really detracts from the purity and simplicity.The only response I have to this is: have a look at Java to see a language with virtually no sugar. It's so bland and unexpressive it _hurts_. A tiny bit of sugar can go a long way to making the language more intuitive to use, not just prettier.
Mar 21 2007
Jarrett Billingsley wrote:"Neal Becker" <ndbecker2 gmail.com> wrote in message news:etr33u$46c$1 digitalmars.com...Agreed. Even Java are adding more an more sugar with each release. Also reading all that bland code takes more time to learn then simply learning a new feature. Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything. Really, for a beginner learning D its not that much more to learn. Having said that, I'm still learning things about C++ (after 10years) and it is meant to be one of the smaller languages (well not compared with java, but anyhow). I think its more to do with the unexpected and sometimes weird behaviors of its syntax. I have no problem figuring out what I think D is more straight forward, things work as expected and will often encourage/replace well established design patterns. D may have more terms however many replace what would otherwise be a more complicated in C++. Which all adds up to getting more done in less time. It only takes a minute or 2 to learn a new concept. If you use it more then twice, then you've probably got that time back. -JoelI've been following D with great interest. I hope the language will not add such 'features' without great need - it really detracts from the purity and simplicity.The only response I have to this is: have a look at Java to see a language with virtually no sugar. It's so bland and unexpressive it _hurts_. A tiny bit of sugar can go a long way to making the language more intuitive to use, not just prettier.
Mar 21 2007
Am Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:Jarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 21 2007
Falk-Florian Henrich wrote:Am Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:By successful I mean most widely used, which is what we want D to become. I guess, once a word is added to the English language it doesn't go away easily. English reached the 1-million mark last year. I've heard that most people stick to around 2000 world in their everyday speak. I think languages will slowly converge into one universal language being made up primarily of English (although its name may change). I think programming languages and file formats will be one of the biggest driving forces behind this. Since most people want technology and much of it is English at some level. http://www.literacytrust.org.uk/Database/language.html -JoelJarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 22 2007
janderson wrote:I guess, once a word is added to the English language it doesn't go away easily. English reached the 1-million mark last year. I've heard that most people stick to around 2000 world in their everyday speak. I think languages will slowly converge into one universal language being made up primarily of English (although its name may change).What I read about English: 1,000,000 total number of words 30,000 vocabulary of college graduate 10,000 vocabulary of high school graduate 2,000 vocabulary of TV shows What this tells me is one could become reasonably fluent in a language by learning just 2,000 words.
Mar 22 2007
Walter Bright wrote:What this tells me is one could become reasonably fluent in a language by learning just 2,000 words.Syntax is more like grammar than vocabulary. -Jeff
Mar 23 2007
Walter Bright Wrote: <snip>What I read about English: 1,000,000 total number of words 30,000 vocabulary of college graduate 10,000 vocabulary of high school graduate 2,000 vocabulary of TV shows<snip> But considering the possible interpretations of the word "word", are you sure they're all talking in the same units? Stewart.
Mar 23 2007
Stewart Gordon wrote:Walter Bright Wrote: <snip>Since it was one source, I presume it was using the same definition.What I read about English: 1,000,000 total number of words 30,000 vocabulary of college graduate 10,000 vocabulary of high school graduate 2,000 vocabulary of TV shows<snip> But considering the possible interpretations of the word "word", are you sure they're all talking in the same units?
Mar 23 2007
janderson escribió:Falk-Florian Henrich wrote:English is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs). Maybe D should consider becoming succesful by other means besides of the language itself? :-) AryAm Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:By successful I mean most widely used, which is what we want D to become.Jarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 23 2007
Ary Manzana wrote:English is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs).One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.
Mar 23 2007
Walter Bright wrote:Ary Manzana wrote:This isn't quite true. English is 'successful' because of the dominating position of the US, and earlier the UK. People very rarely choose between languages based on how 'good' they are. On the other hand, two thirds of the English vocabulary is supposed to originate from Latin.English is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs).One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.
Mar 24 2007
torhu wrote:Walter Bright wrote:I did say one reason - there are many. Some languages look inward, not wanting to accept foreign words. English, as you say, is mostly foreign words. Like the blob, English tends to absorb whatever it comes in contact with <g>.Ary Manzana wrote:This isn't quite true. English is 'successful' because of the dominating position of the US, and earlier the UK. People very rarely choose between languages based on how 'good' they are. On the other hand, two thirds of the English vocabulary is supposed to originate from Latin.English is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs).One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.
Mar 24 2007
Walter Bright Wrote:torhu wrote:<snip>Walter Bright wrote:<snip>One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.This isn't quite true. English is 'successful' because of the dominating position of the US, and earlier the UK.I did say one reason - there are many. Some languages look inward, not wanting to accept foreign words. English, as you say, is mostly foreign words. Like the blob, English tends to absorb whatever it comes in contact with <g>.Interesting. But where does that put Esperanto, with its basic vocabulary being a mixture of languages but having compound words (and translations of Latin abbreviations) all its own? Stewart.
Mar 24 2007
Stewart Gordon wrote:Walter Bright Wrote:translations oftorhu wrote:<snip>Walter Bright wrote:<snip>One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.This isn't quite true. English is 'successful' because of the dominating position of the US, and earlier the UK.I did say one reason - there are many. Some languages look inward, not wanting to accept foreign words. English, as you say, is mostly foreign words. Like the blob, English tends to absorb whatever it comes in contact with <g>.Interesting. But where does that put Esperanto, with its basic vocabulary being a mixture of languages but having compound words (andLatin abbreviations) all its own? Stewart.A few steps behind Klingon, I would expect. But (slightly more) seriously, Esperanto seems like a cautionary tale for those who would design computer (and other synthetic) languages, in that it tried to solve a compatibility problem without actually motivating anyone to adopt it in any material way. It has aesthetics but no special 'killer features'. Now, if esperanto had array slicing... Kevin
Apr 02 2007
Kevin Bealer Wrote:A few steps behind Klingon, I would expect. But (slightly more) seriously, Esperanto seems like a cautionary tale for those who would design computer (and other synthetic) languages, in that it tried to solve a compatibility problem without actually motivating anyone to adopt it in any material way. It has aesthetics but no special 'killer features'. Now, if esperanto had array slicing...Hehe. yeah, I took Linguistics in the first part of university and got rather involved in language theory. I thought it was an excellent exercise creating an isolating morphology, VSO, CV, with semantic/phonetic enhancements.. Ultimately though, spoken language will be irrelevant with the implementation of the DNI - so inventing a spoken language that won't be spoken is folly. DNI has killer features. Like array slicing. : )
Apr 03 2007
Walter Bright wrote:Ary Manzana wrote:Huh? I'm under the impression that that also happens a lot in other languages. In fact it likely happens much more often in other languages, who borrow a lot of *english* words in these modern times. ;) -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#DEnglish is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs).One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.
Mar 24 2007
Bruno Medeiros wrote:Walter Bright wrote:Yes, it does. But some actively work to try and prevent this.One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.Huh? I'm under the impression that that also happens a lot in other languages.In fact it likely happens much more often in other languages, who borrow a lot of *english* words in these modern times. ;)Sure, and I suspect that a language that refuses to do so is one that will fade away into irrelevance.
Mar 24 2007
Walter Bright wrote:Bruno Medeiros wrote:The languages that I'm aware of that do this, also create replacement words. If not, people will just use the foreign words, they often do anyway. One example would be Icelandic. I don't see how a living language would become 'irrelevant' because of the lack of words. People create, alternatively 'borrow' the words they need. But I'm sure there are counter-examples anyway. A language generally dies when parents teach their children another language in place of their own mother tongue, because they consider their own language to be of little use to them. After a couple of generations there is noone left that can speak the original language. This also probably happens when all the users of the language are spread to areas where other languages dominate, so the concentration of users is too low to keep the language alive, maybe there is little of use the language in writing, etc.Walter Bright wrote:Yes, it does. But some actively work to try and prevent this.One reason English is successful is its shamelessness in adopting useful words and phrases from other languages. Sort of like what D does <g>.Huh? I'm under the impression that that also happens a lot in other languages.In fact it likely happens much more often in other languages, who borrow a lot of *english* words in these modern times. ;)Sure, and I suspect that a language that refuses to do so is one that will fade away into irrelevance.
Mar 25 2007
Ary Manzana wrote:janderson escribió:Man, I am the only programmer to actually (moderately) like the Java language? :P -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#DFalk-Florian Henrich wrote:English is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs). Maybe D should consider becoming succesful by other means besides of the language itself? :-) AryAm Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:By successful I mean most widely used, which is what we want D to become.Jarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 24 2007
Bruno Medeiros wrote:[...] Man, I am the only programmer to actually (moderately) like the Java language? :PI think for many people it's language envy because Java is so unreasonably successful. For others it's just plain language parochialism. I happen to think Java is a great language, and obviously researchers love how easy it is to extend. That doesn't mean I think Java is always the most appropriate language or that it doesn't have any warts, but the same is true for C++, D, Perl, and any other language you can think of. Dave
Mar 24 2007
Bruno Medeiros escribió:Ary Manzana wrote:I like Java a lot because of all those things. Having seen the video about Java closures, and being a Java programmer for about six years I realize it has some drawbacks, and that some code is larger than it should. But, on the other hand, there are great tools that makes those problems fade away... (or makes you think so :-P)janderson escribió:Man, I am the only programmer to actually (moderately) like the Java language? :PFalk-Florian Henrich wrote:English is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs). Maybe D should consider becoming succesful by other means besides of the language itself? :-) AryAm Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:By successful I mean most widely used, which is what we want D to become.Jarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 24 2007
Ary Manzana wrote:janderson escribió:Neither Java or English would have any chance of being successful if it was difficult to learn. Of course there are better languages out there however what I'm saying is that less then 100 terms in D is extremely tiny by comparison to the monster that is English. A learning language is great, I don't think D should have to be written in infinite speak just so new people can get it (there are other languages for that). It should be written so that we can produce less bug prone code at a faster rate. When you come across a term/grammar that you haven't seen before, you should be able to learn it from the surrounding code 90% of the time. -JoelFalk-Florian Henrich wrote:English is not succesful because of the language itself, but because of other reasons (power, articles, books). Just like Java is succesful but nowhere near because of the language (I guess VM, nice documentation system, IDEs). Maybe D should consider becoming succesful by other means besides of the language itself? :-) AryAm Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:By successful I mean most widely used, which is what we want D to become.Jarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 24 2007
I thinklanguages will slowly converge into one universal language being made up primarily of English (although its name may change).My bets on chinese ;). janderson wrote:Falk-Florian Henrich wrote:Am Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:By successful I mean most widely used, which is what we want D to become. I guess, once a word is added to the English language it doesn't go away easily. English reached the 1-million mark last year. I've heard that most people stick to around 2000 world in their everyday speak. I think languages will slowly converge into one universal language being made up primarily of English (although its name may change). I think programming languages and file formats will be one of the biggest driving forces behind this. Since most people want technology and much of it is English at some level. http://www.literacytrust.org.uk/Database/language.html -JoelJarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 24 2007
Charlie wrote:I think > languages will slowly converge into one universal language being made up > primarily of English (although its name may change). My bets on chinese ;).http://en.wikipedia.org/wiki/Chung_Kuo Great series, but hard to track down (it's out of print).
Mar 24 2007
Charlie wrote:I think > languages will slowly converge into one universal language being made up > primarily of English (although its name may change). My bets on chinese ;).You may be right. One interesting fact is that China has the biggest speaking English population in the world.janderson wrote:Falk-Florian Henrich wrote:Am Wed, 21 Mar 2007 08:16:08 -0700 schrieb janderson:By successful I mean most widely used, which is what we want D to become. I guess, once a word is added to the English language it doesn't go away easily. English reached the 1-million mark last year. I've heard that most people stick to around 2000 world in their everyday speak. I think languages will slowly converge into one universal language being made up primarily of English (although its name may change). I think programming languages and file formats will be one of the biggest driving forces behind this. Since most people want technology and much of it is English at some level. http://www.literacytrust.org.uk/Database/language.html -JoelJarrett Billingsley wrote: Personally I don't think D is anywhere near the threshold of having to much. Take a look at the most successful langugage (English), it keeps getting bigger and bigger every day. We just don't have enough syntax to describe everything.Without discussing what "successful" is supposed to mean in the realm of natural languages, I think the syntax of English is shrinking rather than growing. Plus, today's lingua franca is a tiny subset of English with a type discipline comparable to that of K&R C. Apart from that, I agree with you that D's syntax is a lot easier to understand than that of C++. Falk
Mar 24 2007
it's totally not arbitrary. since AA in D is a container, but we lack of method to operate on it and even more with any resort to add method for it on user land. So functions as Array Properties in a language with AA is a must. it looks beautiful, and we can extend our AA with funcs and they work as methods like way. it's reasonable. i used to think in ur way either. But after u post this, and i consider the AA's func stuff, i finally realize why we don't get rid of this feature.Reading through "D Specification", I'm a bit surprised. I believe the goal of D is to be a clean, improved C++. Yet, there are a number of instances where syntactic 'sugar' is added in ways that seem almost arbitrary. The latest example I found is 'Functions as Array Properties'. I'm not sure what overwhelming need this syntax fulfills, maybe I'm missing something. There is a lot of extra conceptual overhead in adding extra syntax. One might argue that "You don't have use it if you don't like it.". That is, unfortunately, not really true. If other's use it and I have to grok there code, I need to understand the extra rules. I've been following D with great interest. I hope the language will not add such 'features' without great need - it really detracts from the purity and simplicity.
Mar 21 2007
Davidl wrote:it's totally not arbitrary. since AA in D is a container, but we lack of method to operate on it and even more with any resort to add method for it on user land. So functions as Array Properties in a language with AA is a must. it looks beautiful, and we can extend our AA with funcs and they work as methods like way. it's reasonable. i used to think in ur way either. But after u post this, and i consider the AA's func stuff, i finally realize why we don't get rid of this feature.We definitely should get rid of the shameful .sort and .reverse though. Andrei
Mar 21 2007
Andrei Alexandrescu (See Website For Email) Wrote: <snip>We definitely should get rid of the shameful .sort and .reverse though.What is shameful about them? Stewart.
Mar 21 2007
Stewart Gordon wrote:Andrei Alexandrescu (See Website For Email) Wrote: <snip>They should be free functions, and sort should also allow a predicate. AndreiWe definitely should get rid of the shameful .sort and .reverse though.What is shameful about them?
Mar 21 2007
Andrei Alexandrescu (See Website For Email) Wrote:Stewart Gordon wrote:What do you mean?Andrei Alexandrescu (See Website For Email) Wrote:They should be free functions,We definitely should get rid of the shameful .sort and .reverse though.What is shameful about them?and sort should also allow a predicate.If you mean a comparator, it's been said already. But how would getting rid of it fix that problem? Stewart.
Mar 21 2007
Stewart Gordon wrote:Andrei Alexandrescu (See Website For Email) Wrote:The problem is that reverse and sort should be, as in STL, algorithms decoupled from the container they work on. AndreiStewart Gordon wrote:What do you mean?Andrei Alexandrescu (See Website For Email) Wrote:They should be free functions,We definitely should get rid of the shameful .sort and .reverse though.What is shameful about them?and sort should also allow a predicate.If you mean a comparator, it's been said already. But how would getting rid of it fix that problem?
Mar 21 2007
Andrei Alexandrescu (See Website For Email) wrote:Stewart Gordon wrote:I agree. But until then, adding such free functions fortunately does not conflict with the built-in properties so long as the free functions require parameters. For the record, Tango has a predicate-based sort routine in tango.core.Array. It currently performs about the same as the built-in routine. SeanAndrei Alexandrescu (See Website For Email) Wrote: <snip>They should be free functions, and sort should also allow a predicate.We definitely should get rid of the shameful .sort and .reverse though.What is shameful about them?
Mar 21 2007
On Wed, 21 Mar 2007 08:53:07 -0700, Andrei Alexandrescu (See Website For Email) wrote:So functions as Array Properties in a language with AA is a must.We definitely should get rid of the shameful .sort and .reverse though.... and replace them with more suitable implementations as I'm sure the functionality is in itself useful (i.e. I use it in my code <g>) -- Derek (skype: derek.j.parnell) Melbourne, Australia "Justice for David Hicks!" 22/03/2007 9:23:09 AM
Mar 21 2007
Davidl Wrote:it's totally not arbitrary. since AA in D is a container, but we lack of method to operate on it and even more with any resort to add method for it on user land. So functions as Array Properties in a language with AA is a must. it looks beautiful, and we can extend our AA with funcs and they work as methods like way. it's reasonable. i used to think in ur way either. But after u post this, and i consider the AA's func stuff, i finally realize why we don't get rid of this feature.<snip top of upside-down reply> I've never been sure about this feature. The notation makes it look as though the property is part of the type, when it could be part of the code that's using someone else's type. This gets more complicated when you try allowing it for structs and classes. But even sillier is this: ---------- import std.stdio; class Qwert { int yuiop(int[] asdfg) { return asdfg[0]; } int hjkl(int[] asdfg) { return asdfg.yuiop(); } } void main() { Qwert zxcvb = new Qwert; writefln(zxcvb.hjkl([3, 4, 5])); } ---------- Moreover, why is the doc calling them properties, even though it doesn't work without the ()? Another way that extending basic types could have been implemented is by enhanced typedefs. For example: typedef char[] String { char[] toUpper() { ... } } Stewart.
Mar 21 2007
Neal Becker wrote:Reading through "D Specification", I'm a bit surprised. I believe the goal of D is to be a clean, improved C++. Yet, there are a number of instances where syntactic 'sugar' is added in ways that seem almost arbitrary. The latest example I found is 'Functions as Array Properties'. I'm not sure what overwhelming need this syntax fulfills, maybe I'm missing something. There is a lot of extra conceptual overhead in adding extra syntax. One might argue that "You don't have use it if you don't like it.". That is, unfortunately, not really true. If other's use it and I have to grok there code, I need to understand the extra rules. I've been following D with great interest. I hope the language will not add such 'features' without great need - it really detracts from the purity and simplicity.You have a point, though the beauty & readability of D pretty much nullifies that. The syntax sugar that is added so far does not actually complicate the parsing so much, so D's syntax can still be seen as clean, IMHO.
Mar 21 2007
Alexander Panek wrote:[...] You have a point, though the beauty & readability of D pretty much nullifies that. The syntax sugar that is added so far does not actually complicate the parsing so much, so D's syntax can still be seen as clean, IMHO.I think the ridiculous size of the front-end is a pretty good existence proof. Take a look, Neal. Dave
Mar 21 2007
David B. Held wrote:Alexander Panek wrote:Take a look at Polyglot. Even Java syntax is heinous to parse. Andrei[...] You have a point, though the beauty & readability of D pretty much nullifies that. The syntax sugar that is added so far does not actually complicate the parsing so much, so D's syntax can still be seen as clean, IMHO.I think the ridiculous size of the front-end is a pretty good existence proof. Take a look, Neal.
Mar 21 2007
Andrei Alexandrescu (See Website For Email) Wrote:David B. Held wrote:Oh my! We all know that D's front end is bad, Java's is heinous, and C++ is starting to become a moral issue (it's just WRONG! you may cry) That said, I agree with the above. Arrays should not have a native, non-library sort or reverse "property" that's really a method. We should and can also bind methods to AA's, or build our own structures that act like AA's and attach methods to them. Essentially all you need to do is populate the associative array with function*'s. You may have to dereference them...Alexander Panek wrote:Take a look at Polyglot. Even Java syntax is heinous to parse.[...] You have a point, though the beauty & readability of D pretty much nullifies that. The syntax sugar that is added so far does not actually complicate the parsing so much, so D's syntax can still be seen as clean, IMHO.I think the ridiculous size of the front-end is a pretty good existence proof. Take a look, Neal.
Mar 21 2007
Andrei Alexandrescu (See Website For Email) wrote:David B. Held wrote:Actually, D's front-end was a lot smaller than I was expecting. Only 1.5 MB of C++ code, whereas g++ is almost 4 MB tarred & zipped. Granted, that includes a backend, but if I recall correctly, gcc's source is around 20 MB uncompressed (though with how many front-ends, I'm not sure). DaveAlexander Panek wrote:Take a look at Polyglot. Even Java syntax is heinous to parse.[...] You have a point, though the beauty & readability of D pretty much nullifies that. The syntax sugar that is added so far does not actually complicate the parsing so much, so D's syntax can still be seen as clean, IMHO.I think the ridiculous size of the front-end is a pretty good existence proof. Take a look, Neal.
Mar 21 2007
David B. Held wrote:Alexander Panek wrote:Posted at 09:42 am? Somebody has a skewed clock :o). Andrei[...] You have a point, though the beauty & readability of D pretty much nullifies that. The syntax sugar that is added so far does not actually complicate the parsing so much, so D's syntax can still be seen as clean, IMHO.I think the ridiculous size of the front-end is a pretty good existence proof. Take a look, Neal. Dave
Mar 21 2007
Andrei Alexandrescu (See Website For Email) wrote:Posted at 09:42 am? Somebody has a skewed clock :o).I figure in two weeks my Linux box will fix itself (at least until next year!).
Mar 21 2007
Mr. Becker, You can always forget those fancy features, and use those You like, right? :)
Mar 23 2007