Re: [Pharo-dev] [Bloc] Do we want <return: #Point> or <return: Point>
Hi, At the moment, it is used for documentation purposes in Bloc. It is part of the effort of Alex to document Bloc thoroughly. I think it is an interesting idea, in that we would have a significant case study for that can be used later as optional types information to improve static tool support. And it does not hurt at the moment. What do you think? Cheers, Doru
On Feb 23, 2016, at 10:25 AM, Alain Plantec via Pharo-dev <pharo-dev@lists.pharo.org> wrote:
From: Alain Plantec <alain.plantec@yahoo.com> Subject: Re: [Pharo-dev] [Bloc] Do we want <return: #Point> or <return: Point> Date: February 23, 2016 at 10:23:33 AM GMT+1 To: Pharo Development List <pharo-dev@lists.pharo.org>
I donât like it too. Alain
Le 23 févr. 2016 à 09:50, Nicolai Hess <nicolaihess@gmail.com> a écrit :
2016-02-23 9:47 GMT+01:00 stepharo <stepharo@free.fr>: Hi
I saw that something <return: #Point> or <return: Point> I do not know why but I have the impression that <return: #Point> is better. Because we may have code not present and still want to load the code.
I would like to know for what this is used. I don't like it.
Stef
-- www.tudorgirba.com www.feenk.com "We are all great at making mistakes."
On Tue, Feb 23, 2016 at 5:33 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
At the moment, it is used for documentation purposes in Bloc. It is part of the effort of Alex to document Bloc thoroughly. I think it is an interesting idea, in that we would have a significant case study for that can be used later as optional types information to improve static tool support. And it does not hurt at the moment.
What do you think?
I have often wonder what a system would be like if you *only* typed the return values of selectors, defined globally so each selector has just *one* return type (but it wouldn't a particular object, more a method-set-fingerprint, you might be able to statically check that the each message in a chain would be understood - but I never think deep enough on it to understand the benefit/cost of it. cheers -ben
Cheers, Doru
On Feb 23, 2016, at 10:25 AM, Alain Plantec via Pharo-dev <pharo-dev@lists.pharo.org> wrote:
From: Alain Plantec <alain.plantec@yahoo.com> Subject: Re: [Pharo-dev] [Bloc] Do we want <return: #Point> or <return: Point> Date: February 23, 2016 at 10:23:33 AM GMT+1 To: Pharo Development List <pharo-dev@lists.pharo.org>
I donât like it too. Alain
Le 23 févr. 2016 à 09:50, Nicolai Hess <nicolaihess@gmail.com> a écrit :
2016-02-23 9:47 GMT+01:00 stepharo <stepharo@free.fr>: Hi
I saw that something <return: #Point> or <return: Point> I do not know why but I have the impression that <return: #Point> is better. Because we may have code not present and still want to load the code.
I would like to know for what this is used. I don't like it.
Stef
-- www.tudorgirba.com www.feenk.com
"We are all great at making mistakes."
2016-02-23 12:00 GMT+01:00 Ben Coman <btc@openinworld.com>:
On Tue, Feb 23, 2016 at 5:33 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
At the moment, it is used for documentation purposes in Bloc. It is part of the effort of Alex to document Bloc thoroughly. I think it is an interesting idea, in that we would have a significant case study for that can be used later as optional types information to improve static tool support. And it does not hurt at the moment.
What do you think?
I have often wonder what a system would be like if you *only* typed the return values of selectors, defined globally so each selector has just *one* return type (but it wouldn't a particular object, more a method-set-fingerprint, you might be able to statically check that the each message in a chain would be understood - but I never think deep enough on it to understand the benefit/cost of it.
It feels it does not really work well as for example #at: is used in many places, and on Array the return type is Object whereas on ByteArray it is SmallInteger. Other frequent messages have the same problems (#add:, #+ etc) and they are the most used. Usually for partial typing, one types only: - return type of methods/closures - parameters of methods/closures - instance variables Hack (optionally typed PHP by Facebook) is done like that, one can type only these 3 aspects and all the types are fully optional. Reportedly it is very good. You can read about it here: https://docs.hhvm.com/hack/types/annotations. If one follows the microsoft guidelines to develop in C#, one also types these 3 aspects only. Although in the case of C# those 3 aspects have to be typed, they can't remain untyped as in Hack, and even if it's optional, typing is available for the rest of the code. That implies that according to development guidelines, no temporary variables or literal variables are typed in both languages. Typed people are not confused, as the IDE infers for them the type of any variable they mouse over. Untyped people have little constraints compared to typing everything. The Hack direction is probably the direction to go to introduce types in Pharo like the Hack guys did for PHP. Untyped people can keep typing nothing, while typed people still have all the information they need. With a setting to display or not the type annotations in the source code in the core libraries, everyone is happy.
cheers -ben
Cheers, Doru
On Feb 23, 2016, at 10:25 AM, Alain Plantec via Pharo-dev <
pharo-dev@lists.pharo.org> wrote:
From: Alain Plantec <alain.plantec@yahoo.com> Subject: Re: [Pharo-dev] [Bloc] Do we want <return: #Point> or <return:
Point>
Date: February 23, 2016 at 10:23:33 AM GMT+1 To: Pharo Development List <pharo-dev@lists.pharo.org>
I donât like it too. Alain
Le 23 févr. 2016 à 09:50, Nicolai Hess <nicolaihess@gmail.com> a écrit :
2016-02-23 9:47 GMT+01:00 stepharo <stepharo@free.fr>: Hi
I saw that something <return: #Point> or <return: Point> I do not know why but I have the impression that <return: #Point> is better. Because we may have code not present and still want to load the code.
I would like to know for what this is used. I don't like it.
Stef
-- www.tudorgirba.com www.feenk.com
"We are all great at making mistakes."
I do not think that Pharo will become a static language :) For the moment we can let it as a documentation. Now I would prefer to have tests because such annotations may be obsolete. Anyway the code quality of aleksei is really good. Le 23/2/16 10:33, Tudor Girba a écrit :
Hi,
At the moment, it is used for documentation purposes in Bloc. It is part of the effort of Alex to document Bloc thoroughly. I think it is an interesting idea, in that we would have a significant case study for that can be used later as optional types information to improve static tool support. And it does not hurt at the moment.
What do you think?
Cheers, Doru
On Feb 23, 2016, at 10:25 AM, Alain Plantec via Pharo-dev <pharo-dev@lists.pharo.org> wrote:
From: Alain Plantec <alain.plantec@yahoo.com> Subject: Re: [Pharo-dev] [Bloc] Do we want <return: #Point> or <return: Point> Date: February 23, 2016 at 10:23:33 AM GMT+1 To: Pharo Development List <pharo-dev@lists.pharo.org>
I donât like it too. Alain
Le 23 févr. 2016 à 09:50, Nicolai Hess <nicolaihess@gmail.com> a écrit :
2016-02-23 9:47 GMT+01:00 stepharo <stepharo@free.fr>: Hi
I saw that something <return: #Point> or <return: Point> I do not know why but I have the impression that <return: #Point> is better. Because we may have code not present and still want to load the code.
I would like to know for what this is used. I don't like it.
Stef
-- www.tudorgirba.com www.feenk.com
"We are all great at making mistakes."
On Feb 23, 2016, at 1:17 PM, stepharo <stepharo@free.fr> wrote:
I do not think that Pharo will become a static language :)
Certainly not a static language! :))
For the moment we can let it as a documentation. Now I would prefer to have tests because such annotations may be obsolete.
Certainly. They should come.
Anyway the code quality of aleksei is really good.
:) Doru
Le 23/2/16 10:33, Tudor Girba a écrit :
Hi,
At the moment, it is used for documentation purposes in Bloc. It is part of the effort of Alex to document Bloc thoroughly. I think it is an interesting idea, in that we would have a significant case study for that can be used later as optional types information to improve static tool support. And it does not hurt at the moment.
What do you think?
Cheers, Doru
On Feb 23, 2016, at 10:25 AM, Alain Plantec via Pharo-dev <pharo-dev@lists.pharo.org> wrote:
From: Alain Plantec <alain.plantec@yahoo.com> Subject: Re: [Pharo-dev] [Bloc] Do we want <return: #Point> or <return: Point> Date: February 23, 2016 at 10:23:33 AM GMT+1 To: Pharo Development List <pharo-dev@lists.pharo.org>
I donât like it too. Alain
Le 23 févr. 2016 à 09:50, Nicolai Hess <nicolaihess@gmail.com> a écrit :
2016-02-23 9:47 GMT+01:00 stepharo <stepharo@free.fr>: Hi
I saw that something <return: #Point> or <return: Point> I do not know why but I have the impression that <return: #Point> is better. Because we may have code not present and still want to load the code.
I would like to know for what this is used. I don't like it.
Stef
-- www.tudorgirba.com www.feenk.com
"We are all great at making mistakes."
-- www.tudorgirba.com www.feenk.com "If you can't say why something is relevant, it probably isn't."
On Tue, Feb 23, 2016 at 8:17 PM, stepharo <stepharo@free.fr> wrote:
I do not think that Pharo will become a static language :) For the moment we can let it as a documentation. Now I would prefer to have tests because such annotations may be obsolete.
Maybe not if those pragmas become *active* when the unit tests are run. Then they might be treated like asserts without application runtime penalty. The benefit over unit tests for package A, would be these asserts would be active when called from the unit tests of package B. (??) cheers -ben
Hello Doru,
On 23 Feb 2016, at 10:33, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
At the moment, it is used for documentation purposes in Bloc. It is part of the effort of Alex to document Bloc thoroughly. I think it is an interesting idea, in that we would have a significant case study for that can be used later as optional types information to improve static tool support. And it does not hurt at the moment.
What do you think?
Experimenting optional types is a good idea. We could have Tools to dynamically check them. What about a separate typing model that could be used to add/remove the types annotations ? Also, I wonder if Bloc is the good package to experiment optional types. Maybe it is not stable enough. Cheers Alain
Cheers, Doru
On Feb 23, 2016, at 10:25 AM, Alain Plantec via Pharo-dev <pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>> wrote:
From: Alain Plantec <alain.plantec@yahoo.com <mailto:alain.plantec@yahoo.com>> Subject: Re: [Pharo-dev] [Bloc] Do we want <return: #Point> or <return: Point> Date: February 23, 2016 at 10:23:33 AM GMT+1 To: Pharo Development List <pharo-dev@lists.pharo.org>
I donât like it too. Alain
Le 23 févr. 2016 à 09:50, Nicolai Hess <nicolaihess@gmail.com> a écrit :
2016-02-23 9:47 GMT+01:00 stepharo <stepharo@free.fr>: Hi
I saw that something <return: #Point> or <return: Point> I do not know why but I have the impression that <return: #Point> is better. Because we may have code not present and still want to load the code.
I would like to know for what this is used. I don't like it.
Stef
-- www.tudorgirba.com <http://www.tudorgirba.com/> www.feenk.com <http://www.feenk.com/>
"We are all great at making mistakes."
participants (5)
-
Alain Plantec -
Ben Coman -
Clément Bera -
stepharo -
Tudor Girba