Interesting rant about Scala's issues

2014-04-02 Thread Andrei Alexandrescu
A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg Andrei

Re: Interesting rant about Scala's issues

2014-04-02 Thread bearophile
Andrei Alexandrescu: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg The slides: http://www.slideshare.net/extempore/keynote-pnw-scala-2013 Bye, bearophile

Re: Interesting rant about Scala's issues

2014-04-02 Thread Walter Bright
On 4/2/2014 6:55 PM, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg Reminds me of our empty-front-popFront discussion. Trying to support all kinds of variations on that results in unoptimizable code.

Re: Interesting rant about Scala's issues

2014-04-02 Thread Walter Bright
On 4/2/2014 6:55 PM, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg at about 44:00: "I begged them not to do them [AST macros]." :-)

Re: Interesting rant about Scala's issues

2014-04-02 Thread bearophile
Andrei Alexandrescu: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg I agree that D language/compiler could improve its integration with versioning systems (slide 31). How to design this? Bye, bearophile

Re: Interesting rant about Scala's issues

2014-04-03 Thread Bienlein
My knowledge of compiler constructions is fairly limited and I might be wrong, but it seems to me that the Scala compiler is broken. Scala has gained some bad reputation for long build times (just google for Scala and build time) which IMHO cannot be explained by the large number of language fe

Re: Interesting rant about Scala's issues

2014-04-03 Thread Rikki Cattermole
On Thursday, 3 April 2014 at 08:18:01 UTC, Bienlein wrote: My knowledge of compiler constructions is fairly limited and I might be wrong, but it seems to me that the Scala compiler is broken. Scala has gained some bad reputation for long build times (just google for Scala and build time) which

Re: Interesting rant about Scala's issues

2014-04-03 Thread Bienlein
If I remember what the state of Groovy is (around 2012). The compiler devs focussed quite heavily on functionality not performance. Even refused to go that direction. It was quite bad. Its a real shame. I liked it. Although if they had and had unsigned types I probably wouldn't be in D! Sinc

Re: Interesting rant about Scala's issues

2014-04-03 Thread bachmeier
On Thursday, 3 April 2014 at 08:18:01 UTC, Bienlein wrote: My knowledge of compiler constructions is fairly limited and I might be wrong, but it seems to me that the Scala compiler is broken. Scala has gained some bad reputation for long build times (just google for Scala and build time) which

Re: Interesting rant about Scala's issues

2014-04-03 Thread Bienlein
On Thursday, 3 April 2014 at 11:03:56 UTC, bachmeier wrote: What about Clojure? It is getting real world use. The recent release makes it easier to call Clojure from Java. Example: IFn map = Clojure.var("clojure.core", "map"); IFn inc = Clojure.var("clojure.core", "inc"); map.invoke(inc, Clojure

Re: Interesting rant about Scala's issues

2014-04-03 Thread Rikki Cattermole
On Thursday, 3 April 2014 at 08:43:33 UTC, Bienlein wrote: If I remember what the state of Groovy is (around 2012). The compiler devs focussed quite heavily on functionality not performance. Even refused to go that direction. It was quite bad. Its a real shame. I liked it. Although if they had

Re: Interesting rant about Scala's issues

2014-04-03 Thread Paulo Pinto
On Thursday, 3 April 2014 at 11:19:14 UTC, Bienlein wrote: On Thursday, 3 April 2014 at 11:03:56 UTC, bachmeier wrote: What about Clojure? It is getting real world use. The recent release makes it easier to call Clojure from Java. Example: IFn map = Clojure.var("clojure.core", "map"); IFn inc =

Re: Interesting rant about Scala's issues

2014-04-03 Thread Bienlein
On Thursday, 3 April 2014 at 13:23:16 UTC, Paulo Pinto wrote: I think you missed the post date. I think so too ...

Re: Interesting rant about Scala's issues

2014-04-03 Thread w0rp
I notice that he mentioned the objection to defining equality and so on for the root object. I have heard this before from Philip Wadler, and the more I think about it, the more it makes sense. This is essentially the idea of removing every method from Object, which we have dicussed before.

Re: Interesting rant about Scala's issues

2014-04-03 Thread Meta
On Thursday, 3 April 2014 at 01:55:48 UTC, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg Andrei His examination of the compare function was interesting. I think, though, that it's misguided, and not one of Scala's problems.

Re: Interesting rant about Scala's issues

2014-04-03 Thread Meta
A more interesting point of his is the limitation of Scala's ability to optimize functions like filter... This is also a problem in D, but not as visible as we do not have macros to perform the sort of transformation he describes (turning filter f1, filter f2, filter f3 into filter f1 f2 f3). M

Re: Interesting rant about Scala's issues

2014-04-03 Thread Meta
On Friday, 4 April 2014 at 01:14:37 UTC, Meta wrote: A more interesting point of his is the limitation of Scala's ability to optimize functions like filter... This is also a problem in D, but not as visible as we do not have macros to perform the sort of transformation he describes (turning fil

Re: Interesting rant about Scala's issues

2014-04-03 Thread Meta
Whoops, should be: import std.stdio; void main() { float x1 = long.max; float x2 = long.max - int.max; writeln(typeof(x2).stringof, " ", x2); } Not that it makes a difference.

Re: Interesting rant about Scala's issues

2014-04-03 Thread bearophile
Meta: Returning an int to denote less than, equal, and greater than is a very small complexity, and makes it very fast to check the result. The point of that part of the rant is that using an integer is very not-precise, typing-wise. Having more precise typing sometimes helps. In a little

Re: Interesting rant about Scala's issues

2014-04-03 Thread Ben Boeckel
On Fri, Apr 04, 2014 at 00:59:23 +, Meta wrote: > His examination of the compare function was interesting. I think, > though, that it's misguided, and not one of Scala's problems. Maybe not major, but it's not completely ignorable. > Returning an int to denote less than, equal, and greater th

Re: Interesting rant about Scala's issues

2014-04-03 Thread Walter Bright
On 4/3/2014 6:14 PM, Meta wrote: A more interesting point of his is the limitation of Scala's ability to optimize functions like filter... This is also a problem in D, but not as visible as we do not have macros to perform the sort of transformation he describes (turning filter f1, filter f2, fil

Re: Interesting rant about Scala's issues

2014-04-03 Thread Meta
On Friday, 4 April 2014 at 01:31:20 UTC, bearophile wrote: The point of that part of the rant is that using an integer is very not-precise, typing-wise. Having more precise typing sometimes helps. In a little higher level language using a 3-value enum (as in Haskell, more or less) is still su

Re: Interesting rant about Scala's issues

2014-04-03 Thread Ben Boeckel
On Thu, Apr 03, 2014 at 18:51:56 -0700, Walter Bright wrote: > Since in D you can detect if a function is pure, and specialize > accordingly, it is not necessary to require that the filter function > be pure. Is there a built-in compose operator or function (Haskell's (.) operator)? How would you

Re: Interesting rant about Scala's issues

2014-04-03 Thread Meta
On Friday, 4 April 2014 at 01:51:58 UTC, Walter Bright wrote: Since in D you can detect if a function is pure, and specialize accordingly, it is not necessary to require that the filter function be pure. That's true, but then somebody somewhere accidentally passes in a delegate that reference

Re: Interesting rant about Scala's issues

2014-04-03 Thread bearophile
Meta: I would agree if D actually had type-safe enums. enum a { val = 1 } enum b { val = 1 } assert(a.val - b.val == 0); C enums are mostly type unsafe. C++11 has enum class that is strongly typed. D enums are intermediate (and it has final switches). I have asked for full

Re: Interesting rant about Scala's issues

2014-04-03 Thread Walter Bright
On 4/3/2014 7:01 PM, Ben Boeckel wrote: Is there a built-in compose operator or function (Haskell's (.) operator)? How would you copy the common attributes of the composed functions to the new function (if not builtin)? The compiler does attribute inference for template functions and lambdas.

Re: Interesting rant about Scala's issues

2014-04-03 Thread Walter Bright
On 4/3/2014 7:00 PM, Meta wrote: The upside in D is that you can explicitly mark delegates as pure and have the compiler check for you, but that still puts the onus on the user to be disciplined and not forget. It's really like everything else in programming - at some point, if you don't avail

Re: Interesting rant about Scala's issues

2014-04-03 Thread Walter Bright
On 4/3/2014 7:19 PM, bearophile wrote: I have asked for fully typesafe enums in D, but in several years I think Walter has never answered, nor he has explained why D has chosen such intermediate point. I presume this choice is based on practical reasons, but I don't know exactly what they are (pe

Re: Interesting rant about Scala's issues

2014-04-03 Thread Walter Bright
On 4/3/2014 7:19 PM, bearophile wrote: I have asked for fully typesafe enums in D, You can do this: struct MyInt { int x; alias this x; ... put your various constraints here ... } to get typesafe enums. In fact, you can use this construct to create a type that over

Re: Interesting rant about Scala's issues

2014-04-03 Thread Meta
On Friday, 4 April 2014 at 04:31:41 UTC, Walter Bright wrote: On 4/3/2014 7:19 PM, bearophile wrote: I have asked for fully typesafe enums in D, You can do this: struct MyInt { int x; alias this x; ... put your various constraints here ... } to get typesafe enums.

Re: Interesting rant about Scala's issues

2014-04-04 Thread Walter Bright
On 4/3/2014 9:54 PM, Meta wrote: In the case of your example, alias this does not make it typesafe, as a MyInt can still be implicitly converted to int. You can disable the implicit conversion to int with this scheme. The alias this only takes effect if there is no other member that will take

Re: Interesting rant about Scala's issues

2014-04-04 Thread Rory McGuire
On Fri, Apr 4, 2014 at 9:05 AM, Walter Bright wrote: > You can disable the implicit conversion to int with this scheme. The alias > this only takes effect if there is no other member that will take the > operation. > What is the exact method of disabling the implicit cast? I had a look after you

Re: Interesting rant about Scala's issues

2014-04-04 Thread Bienlein
On Thursday, 3 April 2014 at 01:55:48 UTC, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg Andrei He's got a point in mentioning things like "def equals(x: Any): Boolean" and "def compare(x: T, y: T): Int" (although the latter

Re: Interesting rant about Scala's issues

2014-04-04 Thread Paulo Pinto
On Thursday, 3 April 2014 at 22:58:24 UTC, w0rp wrote: I notice that he mentioned the objection to defining equality and so on for the root object. I have heard this before from Philip Wadler, and the more I think about it, the more it makes sense. This is essentially the idea of removing every

Re: Interesting rant about Scala's issues

2014-04-04 Thread Paulo Pinto
On Friday, 4 April 2014 at 07:43:18 UTC, Bienlein wrote: On Thursday, 3 April 2014 at 01:55:48 UTC, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg Andrei He's got a point in mentioning things like "def equals(x: Any): Boolean

Re: Interesting rant about Scala's issues

2014-04-04 Thread w0rp
On Friday, 4 April 2014 at 07:43:18 UTC, Bienlein wrote: On Thursday, 3 April 2014 at 01:55:48 UTC, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg Andrei He's got a point in mentioning things like "def equals(x: Any): Boolean

Re: Interesting rant about Scala's issues

2014-04-04 Thread renoX
On Friday, 4 April 2014 at 08:00:09 UTC, w0rp wrote: I think this is a really interesting argument. Don't write ugly things to get performance. Instead write obviously correct things and then make obvious optimisations. Bah, except that if you use everywhere big ints, floating point intervals

Re: Interesting rant about Scala's issues

2014-04-04 Thread Paulo Pinto
On Friday, 4 April 2014 at 08:05:58 UTC, renoX wrote: On Friday, 4 April 2014 at 08:00:09 UTC, w0rp wrote: I think this is a really interesting argument. Don't write ugly things to get performance. Instead write obviously correct things and then make obvious optimisations. Bah, except that if

Re: Interesting rant about Scala's issues

2014-04-04 Thread Dicebot
On Friday, 4 April 2014 at 08:16:20 UTC, Paulo Pinto wrote: Says who? And slow to whom? 1 - Write correct code 2 - Use a profiler, if the code isn't fast enough for the use case being written for 3 - If desired use case isn't there, use the profiler information to improve the specific hotpa

Re: Interesting rant about Scala's issues

2014-04-04 Thread Walter Bright
On 4/4/2014 12:23 AM, Rory McGuire wrote: On Fri, Apr 4, 2014 at 9:05 AM, Walter Bright mailto:newshou...@digitalmars.com>> wrote: You can disable the implicit conversion to int with this scheme. The alias this only takes effect if there is no other member that will take the operation.

Re: Interesting rant about Scala's issues

2014-04-04 Thread Paulo Pinto
On Friday, 4 April 2014 at 09:07:31 UTC, Dicebot wrote: On Friday, 4 April 2014 at 08:16:20 UTC, Paulo Pinto wrote: Says who? And slow to whom? 1 - Write correct code 2 - Use a profiler, if the code isn't fast enough for the use case being written for 3 - If desired use case isn't there, us

Re: Interesting rant about Scala's issues

2014-04-04 Thread Rory McGuire
okay, awesome, I guessed correctly then. (on where to find it anyway). On Fri, Apr 4, 2014 at 11:16 AM, Walter Bright wrote: > On 4/4/2014 12:23 AM, Rory McGuire wrote: > >> On Fri, Apr 4, 2014 at 9:05 AM, Walter Bright > > wrote: >> >> You can disable the

Re: Interesting rant about Scala's issues

2014-04-04 Thread bearophile
Walter Bright: Because every cast breaks the type system. A type system that requires too many casts for normal things is NOT a type safe system. I have explained this on numerous occasions. You have discussed many times about the unsafety of casts and I agree with your point of view. I tr

Re: Interesting rant about Scala's issues

2014-04-04 Thread bearophile
I suspect that in my D code most cast usage does not need casts if you replace them with stronger casts as the "enum class" of C++11, but I have no proof of this. Too much casting. I meant to say: I suspect that in my D code most usages of enum don't need casts if you replace them with strong

Re: Interesting rant about Scala's issues

2014-04-04 Thread Bienlein
On Friday, 4 April 2014 at 07:43:22 UTC, Paulo Pinto wrote: Java came up with it most likely as it was the way in Smalltalk. That's right. As Smalltalk is dynamically typed it is not an issue there anyway and Java to begin with had to parameterized types till JDK4. I guess you need to be

Re: Interesting rant about Scala's issues

2014-04-04 Thread Dmitry Olshansky
04-Apr-2014 13:16, Walter Bright пишет: On 4/4/2014 12:23 AM, Rory McGuire wrote: On Fri, Apr 4, 2014 at 9:05 AM, Walter Bright mailto:newshou...@digitalmars.com>> wrote: You can disable the implicit conversion to int with this scheme. The alias this only takes effect if there is no oth

Re: Interesting rant about Scala's issues

2014-04-04 Thread Rory McGuire
First use alias this go "import" functionality transparently. Then use opImplicitCast to set what can be implicitly casted to. On 04 Apr 2014 12:45 PM, "Dmitry Olshansky" wrote: > 04-Apr-2014 13:16, Walter Bright пишет: > >> On 4/4/2014 12:23 AM, Rory McGuire wrote: >> >>> On Fri, Apr 4, 2014 at

Re: Interesting rant about Scala's issues

2014-04-04 Thread Jesse Phillips
On Friday, 4 April 2014 at 09:16:26 UTC, Walter Bright wrote: It's supposed to be by adding your own opImplicitCast overload, but that isn't implemented yet. Wait, this is back? What else did the community get wrong when trying to interpret discussions? http://prowiki.org/wiki4d/wiki.cgi?Lan

Re: Interesting rant about Scala's issues

2014-04-04 Thread Walter Bright
On 4/4/2014 3:24 AM, bearophile wrote: You see I care of casts also from the little casts statistic I've done on your Warp: http://forum.dlang.org/thread/lhf0u6$2r80$1...@digitalmars.com?page=3#post-wjjivmmeyeismgkntwsj:40forum.dlang.org Most of the casts in Warp come from the workarounds I had

Re: Interesting rant about Scala's issues

2014-04-04 Thread Meta
On Friday, 4 April 2014 at 18:02:02 UTC, Walter Bright wrote: Here's one: enum Index { A, B, C } T[Index.max] array; // Error: Index.max is not an int ... array[B] = t; // Error: B is not an int And another: array[A + 1] = t; // Error: incompatible types Index and int And another

Re: Interesting rant about Scala's issues

2014-04-04 Thread Meta
On Friday, 4 April 2014 at 18:15:43 UTC, Meta wrote: And another: array[A + 1] = t; // Error: incompatible types Index and int And another: enum Mask { A=1,B=4 } Mask m = A | B; // Error: incompatible operator | for enum and on it goes. These are routine and normal uses of enums. http

Re: Interesting rant about Scala's issues

2014-04-04 Thread bearophile
Walter Bright: Thank you for the answers. Here's one: enum Index { A, B, C } T[Index.max] array; // Error: Index.max is not an int ... array[B] = t; // Error: B is not an int In the last months I've grown a moderate desire for optionally strongly typed array indexes in D (as seen

Re: Interesting rant about Scala's issues

2014-04-04 Thread bearophile
Meta: Also, if I remember correctly, min and max are terribly broken for enums in the first place. Yes, perhaps they need to be deprecated. Also, there is a ugly name clashing between enum field names and the enum properties. The solution is to group them into a single namespace (like "meta

Re: Interesting rant about Scala's issues

2014-04-04 Thread Araq
And another: enum Mask { A=1,B=4 } Mask m = A | B; // Error: incompatible operator | for enum That would be a 'set of enum' in Pascal/Delphi.

Re: Interesting rant about Scala's issues

2014-04-04 Thread Ben Boeckel
On Fri, Apr 04, 2014 at 11:02:01 -0700, Walter Bright wrote: > Most of the casts in Warp come from the workarounds I had to do to > get around the auto-decode of std.array.front(). I have designed > byChar, byWchar and byDchar ranges for Phobos to get around this > issue, but that is stalled now be

Re: Interesting rant about Scala's issues

2014-04-04 Thread bearophile
array[Succ!(Index.A)] = t; auto i = Index.A; array[i.succ] = t; And with "enum precondition" in the succ() function you can do both cases with a single function: array[Index.A.succ] = t; auto i = Index.A; array[i.succ] = t; Bye, bearophile

Re: Interesting rant about Scala's issues

2014-04-04 Thread Walter Bright
On 4/4/2014 11:47 AM, bearophile wrote: Also, there is a ugly name clashing between enum field names and the enum properties. The solution is to group them into a single namespace (like "meta"), and then forbid an enum member with the name of the namespace. https://d.puremagic.com/issues/show_bu

Re: Interesting rant about Scala's issues

2014-04-04 Thread Walter Bright
On 4/4/2014 12:05 PM, bearophile wrote: And with "enum precondition" in the succ() function you can do both cases with a single function: array[Index.A.succ] = t; auto i = Index.A; array[i.succ] = t; What about i+10? Do you expect the person to write i.succ.succ.succ.succ.succ.succ.succ.succ.

Re: Interesting rant about Scala's issues

2014-04-04 Thread John Colvin
On Friday, 4 April 2014 at 18:57:44 UTC, Ben Boeckel wrote: On Fri, Apr 04, 2014 at 11:02:01 -0700, Walter Bright wrote: Most of the casts in Warp come from the workarounds I had to do to get around the auto-decode of std.array.front(). I have designed byChar, byWchar and byDchar ranges for Pho

Re: Interesting rant about Scala's issues

2014-04-04 Thread Ben Boeckel
On Fri, Apr 04, 2014 at 13:04:28 -0700, Walter Bright wrote: > On 4/4/2014 12:05 PM, bearophile wrote: > >And with "enum precondition" in the succ() function you can do both cases > >with a > >single function: > > > >array[Index.A.succ] = t; > >auto i = Index.A; > >array[i.succ] = t; > > What abo

Re: Interesting rant about Scala's issues

2014-04-04 Thread Ben Boeckel
On Fri, Apr 04, 2014 at 20:11:39 +, John Colvin wrote: > unicode decoding. front decodes a code-point from a string instead of > a code-unit (single char) Another reason for separating 'byte' and 'char' types? --Ben

Re: Interesting rant about Scala's issues

2014-04-04 Thread Simen Kjærås
On 2014-04-04 04:31, Walter Bright wrote: On 4/3/2014 7:19 PM, bearophile wrote: I have asked for fully typesafe enums in D, You can do this: struct MyInt { int x; alias this x; ... put your various constraints here ... } to get typesafe enums. In fact, you ca

Re: Interesting rant about Scala's issues

2014-04-05 Thread Leandro Lucarella
bearophile, el 4 de April a las 18:39 me escribiste: > Walter Bright: > > Thank you for the answers. > > >Here's one: > > > > enum Index { A, B, C } > > T[Index.max] array; // Error: Index.max is not an int > > ... > > array[B] = t; // Error: B is not an int > > In the last months I've gr

Re: Interesting rant about Scala's issues

2014-04-05 Thread Marc Schütz
On Friday, 4 April 2014 at 01:54:16 UTC, Ben Boeckel wrote: There is *zero* rationale as to why this would be a compilable implementation of comparison: int compare(int a, int b) { return a * b; } The fact that this compiles when used as a comparison is *insane* when you take

Re: Interesting rant about Scala's issues

2014-04-05 Thread Timon Gehr
On 04/03/2014 04:45 AM, Walter Bright wrote: On 4/2/2014 6:55 PM, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg at about 44:00: "I begged them not to do them [AST macros]." :-) (This is a misquote.)

Re: Interesting rant about Scala's issues

2014-04-05 Thread Walter Bright
On 4/5/2014 2:40 AM, Leandro Lucarella wrote: enum Symbolic { Dogs, Cars, Trees }// not implicitly casteable (and // maybe not even expose the // internal value) ? struct Symbolic { private static struct _im

Re: Interesting rant about Scala's issues

2014-04-05 Thread Walter Bright
On 4/5/2014 10:10 AM, Timon Gehr wrote: On 04/03/2014 04:45 AM, Walter Bright wrote: On 4/2/2014 6:55 PM, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg at about 44:00: "I begged them not to do them [AST macros]." :-) (This

Re: Interesting rant about Scala's issues

2014-04-05 Thread Seth Tisue
On Saturday, 5 April 2014 at 18:47:50 UTC, Walter Bright wrote: In response to a question about macros & reflection: "I begged them not to, not to just export the compiler to I begged them I begged them not to do it." A reboot is in progress on this, too: http://scalareflect.org

Re: Interesting rant about Scala's issues

2014-04-05 Thread Leandro Lucarella
Walter Bright, el 5 de April a las 11:04 me escribiste: > On 4/5/2014 2:40 AM, Leandro Lucarella wrote: > >enum Symbolic { Dogs, Cars, Trees }// not implicitly casteable (and > >// maybe not even expose the > >// internal

Re: Interesting rant about Scala's issues

2014-04-05 Thread Walter Bright
On 4/5/2014 6:28 PM, Leandro Lucarella wrote: Walter Bright, el 5 de April a las 11:04 me escribiste: Of course, you can hide all this in a template. Well, you can "emulate" enums as they are now with structs too, so that doesn't change anything in the argument about why to provide syntax sug

Re: Interesting rant about Scala's issues

2014-04-06 Thread Andrei Alexandrescu
On 4/6/14, 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that makes sense only because you are used to the current semantics, not be

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 4:26 AM, bearophile wrote: So do you have an example of this risk? Algol is a rather famous one. A counterexample is Go, which has gotten a lot of traction with a simple syntax.

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that makes sense only because you are used to the current semantics, not b

Re: Interesting rant about Scala's issues

2014-04-06 Thread Eric
On Sunday, 6 April 2014 at 16:46:12 UTC, Andrei Alexandrescu wrote: On 4/6/14, 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that

Re: Interesting rant about Scala's issues

2014-04-06 Thread Ola Fosheim Grøstad
On Sunday, 6 April 2014 at 11:26:41 UTC, bearophile wrote: Walter Bright: Having special syntax for everything makes the language unusable. While there are ways to reach excesses in every design direction, and make things unusable, the risk discussed here seems remote to me. Too much synta

Re: Interesting rant about Scala's issues

2014-04-06 Thread Paulo Pinto
Am 06.04.2014 19:54, schrieb Walter Bright: On 4/6/2014 4:26 AM, bearophile wrote: So do you have an example of this risk? Algol is a rather famous one. A counterexample is Go, which has gotten a lot of traction with a simple syntax. It has more to do with Google than with the language's de

Re: Interesting rant about Scala's issues

2014-04-06 Thread Araq
On Sunday, 6 April 2014 at 17:52:19 UTC, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that makes

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 2:26 PM, Araq wrote: The fact that you are unaware of how it's properly done (hint: Pascal got right with 'set of enum' being distinct from 'enum') makes it a historical accident. I wrote a Pascal compiler before the C one.

Re: Interesting rant about Scala's issues

2014-04-06 Thread Ola Fosheim Grøstad
On Sunday, 6 April 2014 at 19:53:43 UTC, Paulo Pinto wrote: A counterexample is Go, which has gotten a lot of traction with a simple syntax. It has more to do with Google than with the language's design. That, and being perceived as a http-server-language and having standard libraries and a

Re: Interesting rant about Scala's issues

2014-04-06 Thread Andrei Alexandrescu
On 4/6/14, 10:52 AM, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibilities). You showed a lot of examples that makes sense only because y

Re: Interesting rant about Scala's issues

2014-04-06 Thread bearophile
Walter Bright: Having special syntax for everything makes the language unusable. While there are ways to reach excesses in every design direction, and make things unusable, the risk discussed here seems remote to me. So do you have an example of this risk? Or examples of languages that ha

Re: Interesting rant about Scala's issues

2014-04-06 Thread Leandro Lucarella
Walter Bright, el 5 de April a las 21:15 me escribiste: > On 4/5/2014 6:28 PM, Leandro Lucarella wrote: > >Walter Bright, el 5 de April a las 11:04 me escribiste: > >>Of course, you can hide all this in a template. > > > >Well, you can "emulate" enums as they are now with structs too, so that > >

Re: Interesting rant about Scala's issues

2014-04-06 Thread Walter Bright
On 4/6/2014 4:17 PM, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wrote: I use enums a lot in D. I find they work very satisfactorily. The way they work was deliberately designed, not a historical accident. Sorry, I think they ought to have been better. -- Andrei Sorry, yer

Re: Interesting rant about Scala's issues

2014-04-07 Thread Regan Heath
On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they make (more) sense (than other possibil

Re: Interesting rant about Scala's issues

2014-04-07 Thread Dicebot
On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote: Got a DIP/spec/design to share? R I think biggest mistake of D enums is merging constants and actual enumerations into single entity which has resulted in weak typing of enumerations.

Re: Interesting rant about Scala's issues

2014-04-07 Thread Eric
On Monday, 7 April 2014 at 12:04:15 UTC, Dicebot wrote: On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote: Got a DIP/spec/design to share? R I think biggest mistake of D enums is merging constants and actual enumerations into single entity which has resulted in weak typing of enume

Re: Interesting rant about Scala's issues

2014-04-07 Thread Paulo Pinto
Am 07.04.2014 12:07, schrieb Regan Heath: On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because th

Re: Interesting rant about Scala's issues

2014-04-07 Thread Regan Heath
On Mon, 07 Apr 2014 16:15:41 +0100, Paulo Pinto wrote: Am 07.04.2014 12:07, schrieb Regan Heath: On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of

Re: Interesting rant about Scala's issues

2014-04-07 Thread Andrei Alexandrescu
On 4/7/14, 3:07 AM, Regan Heath wrote: On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wrote: On 4/6/2014 3:31 AM, Leandro Lucarella wrote: What I mean is the current semantics of enum are as they are for historical reasons, not because they

Re: Interesting rant about Scala's issues

2014-04-07 Thread Andrei Alexandrescu
On 4/7/14, 5:04 AM, Dicebot wrote: On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote: Got a DIP/spec/design to share? R I think biggest mistake of D enums is merging constants and actual enumerations into single entity which has resulted in weak typing of enumerations. That ain't t

Re: Interesting rant about Scala's issues

2014-04-07 Thread Andrei Alexandrescu
On 4/6/14, 6:49 PM, Walter Bright wrote: On 4/6/2014 4:17 PM, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wrote: I use enums a lot in D. I find they work very satisfactorily. The way they work was deliberately designed, not a historical accident. Sorry, I think they ought to

Re: Interesting rant about Scala's issues

2014-04-07 Thread w0rp
On Monday, 7 April 2014 at 21:02:04 UTC, Andrei Alexandrescu wrote: This program compiles and flag free and no cast in sight but fails at runtime. Textbook example of unsound type design. import std.stdio; enum A { x = 2, y = 4 } void main() { A a = A.x | A.y; final switch (a) {

Re: Interesting rant about Scala's issues

2014-04-08 Thread Leandro Lucarella
Dicebot, el 7 de April a las 12:04 me escribiste: > On Monday, 7 April 2014 at 10:07:03 UTC, Regan Heath wrote: > >Got a DIP/spec/design to share? > > > >R > > I think biggest mistake of D enums is merging constants and actual > enumerations into single entity which has resulted in weak typing of

Re: Interesting rant about Scala's issues

2014-04-08 Thread Paulo Pinto
Using Ada code examples below: On Monday, 7 April 2014 at 16:25:45 UTC, Regan Heath wrote: On Mon, 07 Apr 2014 16:15:41 +0100, Paulo Pinto wrote: Am 07.04.2014 12:07, schrieb Regan Heath: On Mon, 07 Apr 2014 00:17:45 +0100, Andrei Alexandrescu wrote: On 4/6/14, 10:52 AM, Walter Bright wr

Re: Interesting rant about Scala's issues

2014-04-09 Thread Bruno Medeiros
On 03/04/2014 02:55, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg Andrei One interesting point near the end. He glossed over it since he was running out of time, but this was in the slides: " What I'm after * I don't need

Re: Interesting rant about Scala's issues

2014-04-09 Thread Nick Sabalausky
On 4/9/2014 4:21 PM, Bruno Medeiros wrote: Sure, the language may be the core, and one of the most important aspects, but the rest of the tool-chain is extremely important too. I don't think everyone in the D community (and outside it too) fully stands behind this idea. I think a big part of

Re: Interesting rant about Scala's issues

2014-04-09 Thread deadalnix
On Saturday, 5 April 2014 at 18:47:50 UTC, Walter Bright wrote: On 4/5/2014 10:10 AM, Timon Gehr wrote: On 04/03/2014 04:45 AM, Walter Bright wrote: On 4/2/2014 6:55 PM, Andrei Alexandrescu wrote: A lot of them could apply to us as well. https://www.youtube.com/watch?v=TS1lpKBMkgg at about

Re: Interesting rant about Scala's issues

2014-04-09 Thread Christof Schardt
"Bruno Medeiros" schrieb im Newsbeitrag news:li4a40$tn2> What I'm after > * I don't need a programming language. > * I need a coherent set of tools for creating software. A "language" is > incidental. > " > > I totally agree. Sure, the language may be the core, and one of the most > important a

Re: Interesting rant about Scala's issues

2014-04-10 Thread Walter Bright
On 4/9/2014 1:58 PM, Nick Sabalausky wrote: Tooling is certainly very important, but until someone comes up with a substitute for "programming languages" that actually *works well* as a *complete* substitute (decades of attempts, still zero successes), then unlike tooling, the language is still t