www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - FYI: Ceylon

reply "Paul D. Anderson" <paul.d.removethis.anderson comcast.andthis.net> writes:
I took a quick look at the Ceylon language 
(http://ceylon-lang.org/) which is supposed to be a follow on to 
Java (they disavow the name "Java Killer" <wink, wink, nudge, 
nudge>).

One of their design goals is "familiar, readable syntax", but 
they seemed to have missed the boat on that one. Their type 
system is Byzantine and it is the heart of the language.
But I thought this little fragment from their spec dealing with 
type constraints was interesting:

(The words "given", "satisfies", "abstracts", "of" and "is" are 
keywords.)

<quote>
There are five different kinds of type constraint:

• an upper bound, given X satisfies T, specifies that the type 
parameter X is a subtype of a given type T,

• a lower bound, given X abstracts T, specifies that a given 
type T is a subtype of the type parameter X,

• an enumerated bound, given X of T|U|V specifies that the type 
parameter X represents one of the enumerated types,

• a parameter bound, given X(...) specifies that the type 
parameter X is a concrete class with the given parameter types, 
and

• a metatype bound, given X is T, specifies that the concrete 
metatype of the type parameter is a subtype of a given type T.
</quote>

They also have couple of operators, '===' and '<=>' meaning 
'identical' and 'compare', respectively. They have an identity 
operator but also have the keyword 'is', which should give you an 
inkling of the languages complexity. I assume 'compare' is the 
same as D's 'opCmp', and it strikes me as a useful operator. 
(Although I think the unusual comparison operators in D ('!<>=') 
wound up high on the list of the "too many features" post.

Paul
Jul 13 2012
parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sat, Jul 14, 2012 at 01:31:02AM +0200, Paul D. Anderson wrote:
 I took a quick look at the Ceylon language (http://ceylon-lang.org/)
[...]
 They also have couple of operators, '===' and '<=>' meaning
 'identical' and 'compare', respectively.
Yikes! As soon as I saw '===', I went "no way, no how". That's one of the most egregious flaws of languages like JavaScript. And they have 'is' on top of that?! Double yikes! What _must_ their type system look like?!
 They have an identity operator but also have the keyword 'is', which
 should give you an inkling of the languages complexity. I assume
 'compare' is the same as D's 'opCmp', and it strikes me as a useful
 operator. (Although I think the unusual comparison operators in D
 ('!<>=') wound up high on the list of the "too many features" post.
[...] Yeah... when I got to operators in my D lexer toy implementation, I was dumbstruck at how many ASCII UFOs ^W^W I mean, comparison operators D has. Most of which I have a hard time imagining a use for. T -- The most powerful one-line C program: #include "/dev/tty" -- IOCCC
Jul 13 2012
next sibling parent =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <alex lycus.org> writes:
On 14-07-2012 01:49, H. S. Teoh wrote:
 On Sat, Jul 14, 2012 at 01:31:02AM +0200, Paul D. Anderson wrote:
 I took a quick look at the Ceylon language (http://ceylon-lang.org/)
[...]
 They also have couple of operators, '===' and '<=>' meaning
 'identical' and 'compare', respectively.
Yikes! As soon as I saw '===', I went "no way, no how". That's one of the most egregious flaws of languages like JavaScript. And they have 'is' on top of that?! Double yikes! What _must_ their type system look like?!
 They have an identity operator but also have the keyword 'is', which
 should give you an inkling of the languages complexity. I assume
 'compare' is the same as D's 'opCmp', and it strikes me as a useful
 operator. (Although I think the unusual comparison operators in D
 ('!<>=') wound up high on the list of the "too many features" post.
[...] Yeah... when I got to operators in my D lexer toy implementation, I was dumbstruck at how many ASCII UFOs ^W^W I mean, comparison operators D has. Most of which I have a hard time imagining a use for. T
They were originally meant for some potential close-to-the-machine FPU code. I have yet to see any actual code that needed them (i.e. as opposed to library helper routines). -- Alex Rønne Petersen alex lycus.org http://lycus.org
Jul 13 2012
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 7/13/2012 4:49 PM, H. S. Teoh wrote:
 Yeah... when I got to operators in my D lexer toy implementation, I was
 dumbstruck at how many ASCII UFOs ^W^W I mean, comparison operators D
 has. Most of which I have a hard time imagining a use for.
Those are on the "to deprecate" list.
Jul 13 2012
parent reply "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On Friday, July 13, 2012 17:58:27 Walter Bright wrote:
 On 7/13/2012 4:49 PM, H. S. Teoh wrote:
 Yeah... when I got to operators in my D lexer toy implementation, I was
 dumbstruck at how many ASCII UFOs ^W^W I mean, comparison operators D
 has. Most of which I have a hard time imagining a use for.
Those are on the "to deprecate" list.
Which really should become the "deprecated" list. We have quite a few things that we've long said we're getting rid of but haven't yet, and in many cases, people continue to write code which uses them without realizing that they won't be around long term. We're creating headaches for ourselves and others by delaying the deprecation of this stuff. - Jonathan M Davis
Jul 13 2012
parent "bearophile" <bearophileHUGS lycos.com> writes:
Jonathan M Davis:

 Which really should become the "deprecated" list. We have quite 
 a few things
 that we've long said we're getting rid of but haven't yet, and 
 in many cases,
 people continue to write code which uses them without realizing 
 that they
 won't be around long term. We're creating headaches for 
 ourselves and others
 by delaying the deprecation of this stuff.
+1 Bye, bearophile
Jul 13 2012
prev sibling parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Fri, 13 Jul 2012 16:49:03 -0700
"H. S. Teoh" <hsteoh quickfur.ath.cx> wrote:

 On Sat, Jul 14, 2012 at 01:31:02AM +0200, Paul D. Anderson wrote:
 I took a quick look at the Ceylon language (http://ceylon-lang.org/)
[...]
 They also have couple of operators, '===' and '<=>' meaning
 'identical' and 'compare', respectively.
Yikes! As soon as I saw '===', I went "no way, no how". That's one of the most egregious flaws of languages like JavaScript. And they have 'is' on top of that?! Double yikes! What _must_ their type system look like?!
Indeed. '===' operators are generally, if not always, indicative of a thoroughly broken '=='.
Jul 13 2012
next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sat, Jul 14, 2012 at 01:00:18AM -0400, Nick Sabalausky wrote:
 On Fri, 13 Jul 2012 16:49:03 -0700
 "H. S. Teoh" <hsteoh quickfur.ath.cx> wrote:
 
 On Sat, Jul 14, 2012 at 01:31:02AM +0200, Paul D. Anderson wrote:
 I took a quick look at the Ceylon language (http://ceylon-lang.org/)
[...]
 They also have couple of operators, '===' and '<=>' meaning
 'identical' and 'compare', respectively.
Yikes! As soon as I saw '===', I went "no way, no how". That's one of the most egregious flaws of languages like JavaScript. And they have 'is' on top of that?! Double yikes! What _must_ their type system look like?!
Indeed. '===' operators are generally, if not always, indicative of a thoroughly broken '=='.
What boggles my mind is the fact that they have '===' *and* 'is'. I don't think I want to know what's the difference between them. One of these days, I should invent a language that sports the ==== operator. Along with the associated <====> operator and the ^_^ operator. T -- The two rules of success: 1. Don't tell everything you know. -- YHL
Jul 13 2012
next sibling parent Paulo Pinto <pjmlp progtools.org> writes:
Am 14.07.2012 07:13, schrieb H. S. Teoh:
 On Sat, Jul 14, 2012 at 01:00:18AM -0400, Nick Sabalausky wrote:
 On Fri, 13 Jul 2012 16:49:03 -0700
 "H. S. Teoh"<hsteoh quickfur.ath.cx>  wrote:

 On Sat, Jul 14, 2012 at 01:31:02AM +0200, Paul D. Anderson wrote:
 I took a quick look at the Ceylon language (http://ceylon-lang.org/)
[...]
 They also have couple of operators, '===' and '<=>' meaning
 'identical' and 'compare', respectively.
Yikes! As soon as I saw '===', I went "no way, no how". That's one of the most egregious flaws of languages like JavaScript. And they have 'is' on top of that?! Double yikes! What _must_ their type system look like?!
Indeed. '===' operators are generally, if not always, indicative of a thoroughly broken '=='.
What boggles my mind is the fact that they have '===' *and* 'is'. I don't think I want to know what's the difference between them. One of these days, I should invent a language that sports the ==== operator. Along with the associated<====> operator and the ^_^ operator.
Easily doable in any language where operators are plain function names, like ML-family, Lisp, Smalltalk, ...
Jul 14 2012
prev sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On 07/14/2012 07:13 AM, H. S. Teoh wrote:
 What boggles my mind is the fact that they have '===' *and* 'is'. I
 don't think I want to know what's the difference between them.
'is' is not a binary operator. It is the equivalent of 'instanceof' in Java. is Type object
Jul 14 2012
prev sibling parent =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <alex lycus.org> writes:
On 14-07-2012 07:00, Nick Sabalausky wrote:
 On Fri, 13 Jul 2012 16:49:03 -0700
 "H. S. Teoh"<hsteoh quickfur.ath.cx>  wrote:

 On Sat, Jul 14, 2012 at 01:31:02AM +0200, Paul D. Anderson wrote:
 I took a quick look at the Ceylon language (http://ceylon-lang.org/)
[...]
 They also have couple of operators, '===' and '<=>' meaning
 'identical' and 'compare', respectively.
Yikes! As soon as I saw '===', I went "no way, no how". That's one of the most egregious flaws of languages like JavaScript. And they have 'is' on top of that?! Double yikes! What _must_ their type system look like?!
Indeed. '===' operators are generally, if not always, indicative of a thoroughly broken '=='.
The way Ceylon did it is definitely insane. But, I don't think having === *or* is, in addition to ==, is inherently bad. === would just be the reference comparison operator, while == would always be for whatever equality a class/interface has defined. -- Alex Rønne Petersen alex lycus.org http://lycus.org
Jul 14 2012