34 ms·
Given you're a language designer, I'm really surprised you have not looked at Scala enough to know how it handles constructors. Scala is also your biggest comp
by stephen 11y ago
Given you're a language designer, I'm really surprised you have not looked at Scala enough to know how it handles constructors.
Scala is also your biggest competitor (IMO) on the JVM, which makes it even more odd that you seem to not have looked at it deeply. (I'd understand not reading the latest DOT type calculus/whatever paper, but this is basic syntax/usage.)
Totally your call of course, but stealing the best ideas, in any endeavor, is usually the best way to go. Even if you decide to not steal Scala's constructors, that's fine, it's awesome if you have something better, but to have not even evaluated them...
Just surprised.
- gavinking 11y agoI guess I don't understand what you're saying here. I was already aware of the concept of a constructor, from years of Java. And I already had a set of really extremely tight design constraints in terms of the existing language syntax and semantics, including a set of principles about how the block structure of the language works, rules about definite initialization, the fact we don't have overloading, etc, etc, which are quite specific to _Ceylon_, and aren't found in other similar languages. These constraints were pretty much sufficient to fully determine the resulting design. Furthermore, there was an issue open in Ceylon's issue tracker for almost 2 years, following on from discussions and proposals in two other issues that go back even further, and these issues were read and commented on by many of our community members, including some who have some Scala experience. Now, if you could point to some cool idea in Scala that we obviously aren't aware of, and which could have improved the design of constructors in Ceylon, then I guess you would have a point. But it doesn't seem like you do have anything concrete, just a concern about _process_ rather than _outcome_. And fundamentally I'm a guy who cares about outcome. And I think the outcome is rather excellent.
- jules 11y agoI think what they're saying is that it's good to give credit where credit is due.
- gavinking 11y agoWell since zero credit is due to Scala (read my post below where I utterly demolish the claim that Ceylon constructors are similar to Scala) then doesn't that seem like an utterly rude and obnoxious demand to you?
- jules 11y agoIf that were the case, yes, but it isn't. There are obviously some differences but there are clearly also uncanny similarities.
- gavinking 11y agoName the "uncanny" similarities please. If you can't, I might think you're trolling. To be fair, it's nice to see you acknowledge that there are "obviously some differences". Some tiny little subtle differences like how in Ceylon, I can actually have two constructors that both initialize an immutable field. Like how constructor resolution is by (unambiguous) name and not by (potentially ambiguous) overloaded parameter types. Like how different constructors can delegate to distinct constructors of the superclass. 'Cos, y'know, other than that, it's really just a copy of Scala. Absurd.
- jules 11y agoI assumed duaneb was referring to the whole idea of giving parameters to the class definition.
- gavinking 11y agoWait, you're not talking about constructors here. You're talking about the idea of giving a class a parameter list? A feature that I independently came up with about 7 years ago, before I - or most other people - had even heard of Scala? And then implemented 5 years ago as one of like the very earliest features in the Ceylon type checker? And which is not actually the topic of the linked blog post? You're calling me out for copying that?! Man, seriously, there is such a thing as two people coming up with the same good idea independently. If you can't imagine such a thing happening, I'm at a total loss.
- gavinking 11y agoSo if you scroll down, you'll find my tentative evaluation of Scala's support for constructors. I have not found anything of interest there. Indeed, if my understanding is correct, constructors in Scala have extremely limited capabilities, since all initialization ultimately flows through the primary constructor which is responsible for initializing all fields. In Ceylon we obviously had a more ambitious set of requirements.
- duaneb 11y ago> Indeed, if my understanding is correct, constructors in Scala have extremely limited capabilities Is this not desirable? The wider the definition of a constructor is, the less you can determine from looking at the construction of a resource/variable/whatever. When you delve into e.g. the creation of an ORM this becomes extremely important because it has to reason about data constraints across multiple initializations.
- gavinking 11y agoWait, wait, wait: just two hours ago you were demanding that I give credit to Scala for the design of constructors in Ceylon. And you accused me of quote "just tweaking of the language's constructor patterns and calling it novel". It seems that you now accept that in fact the two designs are dissimilar, and that Ceylon's is significantly more powerful. So, before continuing this discussion, do you think it would appropriate to start by apologizing to my team? Just so we don't get off on the wrong foot?
- duaneb 11y ago> just two hours ago you were demanding that I give credit to Scala for the design of constructors in Ceylon. No, I demanded you reference a similar language to actually compare the benefits of your changes. If you do, I suspect you'll find you gain virtually nothing.
- gavinking 11y agoYou wrote: > Much of the rest of the work seems to mirror what Scala did several years ago, and this seems to nearly replicate that. I have already demolished this claim on this thread, as you very well understand. I personally make it a policy to admit error when I err. It's up to you to decide whether this is also your policy, or whether you prefer goalpost-shifting and prevarication. > No, I demanded you reference a similar language to actually compare the benefits of your changes. I make it a firm policy to not talk about other new languages when I blog about Ceylon, because whenever I have mentioned Scala in the past, even just in passing, I have found myself the subject of quite vicious personal attacks. I'm going to continue with that policy, this thread notwithstanding. But thanks for your feedback anyway.
- stephen 11y ago> But it doesn't seem like you do have anything concrete, just a concern about _process_ Yes, just for clarification, that was my point. You're certainly having to defend yourself a lot in the other comments, so I don't want to continue that. The order of Ceylon initialization is nice. That is a pita in Scala.
- gavinking 11y ago> Yes, just for clarification, that was my point. OK cool. Then my response is simply that we took a whole lot of community feedback, as always, over a span of years, both on the issue tracker and on our Gitter (previously IRC) channel. People with a wide range of programming experience contributed to this discussion. No, I did not look closely at Scala's constructors. I did look at some other languages which are a bigger influence on me, some of which do things very differently to Ceylon. > You're certainly having to defend yourself a lot in the other comments, so I don't want to continue that. Thanks :-/