digitalmars.D - Time to rename "D" to " D" !?
- John (4/4) Jun 23 2014 The @ symbols used on all those attributes like @nogc @nothrow
- Joakim (5/9) Jun 23 2014 I agree that it looks ugly and is a lot of visual noise, similar
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (4/6) Jun 23 2014 If we want this change we probably have to make them deprecated a
- Martin Krejcirik (1/1) Jun 23 2014 Plaese no.
- Chris Nicholson-Sauls (6/6) Jun 23 2014 Funny enough two of the attributes you mentioned (pure and
- Gary Willoughby (3/10) Jun 23 2014 All are having the @ added: http://wiki.dlang.org/DIP64
- Brian Schott (2/3) Jun 23 2014 This hasn't been decided on. It's just a proposal right now.
- Jesse Phillips (4/7) Jun 26 2014 While I agree with the original statement that the @ is ugly, I
- Jonathan M Davis via Digitalmars-d (10/14) Jun 23 2014 It would be very cool if we could remove @ from all of the built-in
- Mason McGill (8/22) Jun 23 2014 People (I've talked to) seem to like Python decorators and Java
- Jacob Carlborg (11/19) Jun 24 2014 Since we got UDA's that use the @attribute syntax, the idea of appending...
- Marco Nembrini (10/19) Jun 24 2014 Wouldn't an attribute like @nogc only be a keyword for attribute
- Jacob Carlborg (8/17) Jun 25 2014 I guess so.
- bearophile (10/14) Jun 25 2014 Walter in the @nogc pull request has explained why this is a bad
- Grogan (19/23) Jun 23 2014 Give up this idea, right now.
- Tobias Pankrath (2/15) Jun 23 2014 Would be a good use case for dfix. It really isn't hard to rename
- Grogan (7/25) Jun 23 2014 Maybe the future will tell you you're right...
- Grogan (7/33) Jun 23 2014 I meant the 'hoverboard' of course...
- Iain Buclaw via Digitalmars-d (3/40) Jun 25 2014 Godwin's Law.
- w0rp (4/4) Jun 26 2014 I am actually in favour of adding more @ symbols. I think it
- Joakim (7/25) Jun 23 2014 Yep, perfect place to start experimenting with a Dfix and see
- AG (11/11) Jun 24 2014 since D has Attribute lists e.g. @("string", 7, foo, bar)
- Joakim (7/18) Jun 24 2014 Hmm, didn't know you could do that with UDAs, certainly looks
The symbols used on all those attributes like nogc nothrow pure safe make the D code look ugly. If possible, please get rid of those symbols. The attributes look good without the " " symbols.
Jun 23 2014
On Monday, 23 June 2014 at 17:30:19 UTC, John wrote:The symbols used on all those attributes like nogc nothrow pure safe make the D code look ugly. If possible, please get rid of those symbols. The attributes look good without the " " symbols.I agree that it looks ugly and is a lot of visual noise, similar to all the angle brackets that some complain about with C++ templates. However, I'm not sure it can be remedied this late in the game.
Jun 23 2014
On Monday, 23 June 2014 at 17:50:10 UTC, Joakim wrote:If we want this change we probably have to make them deprecated a couple of DMD versions before we active the new keywords which may break existing code.The symbols used on all those attributes like nogc nothrow pure safe make the D code look ugly.
Jun 23 2014
Funny enough two of the attributes you mentioned (pure and nothrow) don't have an on them. Maybe I'm strange, but I don't see any problem with the , and would actually like to see some of the other attributes (including pure and nothrow) adopt them, for consistancy and to free up names. Surely you don't think "safe" should be a keyword? Or "trusted" or "system"?
Jun 23 2014
On Monday, 23 June 2014 at 19:37:49 UTC, Chris Nicholson-Sauls wrote:Funny enough two of the attributes you mentioned (pure and nothrow) don't have an on them. Maybe I'm strange, but I don't see any problem with the , and would actually like to see some of the other attributes (including pure and nothrow) adopt them, for consistancy and to free up names. Surely you don't think "safe" should be a keyword? Or "trusted" or "system"?All are having the added: http://wiki.dlang.org/DIP64
Jun 23 2014
On Monday, 23 June 2014 at 20:08:41 UTC, Gary Willoughby wrote:All are having the added: http://wiki.dlang.org/DIP64This hasn't been decided on. It's just a proposal right now.
Jun 23 2014
On Monday, 23 June 2014 at 20:23:52 UTC, Brian Schott wrote:On Monday, 23 June 2014 at 20:08:41 UTC, Gary Willoughby wrote:While I agree with the original statement that the is ugly, I also would prefer to just bring other attributes into this consistent style.All are having the added: http://wiki.dlang.org/DIP64This hasn't been decided on. It's just a proposal right now.
Jun 26 2014
On Monday, June 23, 2014 17:30:18 John via Digitalmars-d wrote:The symbols used on all those attributes like nogc nothrow pure safe make the D code look ugly. If possible, please get rid of those symbols. The attributes look good without the " " symbols.It would be very cool if we could remove from all of the built-in attributes, but the whole reason that they have them in the first place is because it was decided that we didn't want to add new keywords - and that was several years ago when D had a smaller user base. So, I really don't see it changing at this point. If anything, we might go the _other_ way and add onto the attributes that don't have it in order to make them more consistent (though I hope that we don't do that, because it's ugly and more verbose). I sympathize with you, but I think that we're stuck at this point. - Jonathan M Davis
Jun 23 2014
On Monday, 23 June 2014 at 20:34:59 UTC, Jonathan M Davis via Digitalmars-d wrote:It would be very cool if we could remove from all of the built-in attributes, but the whole reason that they have them in the first place is because it was decided that we didn't want to add new keywords - and that was several years ago when D had a smaller user base. So, I really don't see it changing at this point. If anything, we might go the _other_ way and add onto the attributes that don't have it in order to make them more consistent (though I hope that we don't do that, because it's ugly and more verbose).People (I've talked to) seem to like Python decorators and Java annotations, and they have mandatory " " characters. I like the " " because it helps me (and my editor) distinguish between words that *define* a computation (return type, parameters, etc.) and words that *describe* a computation (attributes).
Jun 23 2014
On 2014-06-23 22:34, Jonathan M Davis via Digitalmars-d wrote:It would be very cool if we could remove from all of the built-in attributes, but the whole reason that they have them in the first place is because it was decided that we didn't want to add new keywords - and that was several years ago when D had a smaller user base. So, I really don't see it changing at this point. If anything, we might go the _other_ way and add onto the attributes that don't have it in order to make them more consistent (though I hope that we don't do that, because it's ugly and more verbose).Since we got UDA's that use the attribute syntax, the idea of appending an symbol in front of an attribute to avoid name collisions doesn't work anymore. From a user point of view, the attributes starting with an symbol are just as much keywords as those who don't.I sympathize with you, but I think that we're stuck at this point.I we want to minimize name collisions it would be better to remove all attributes and only have a single attribute, like this: attribute(nothrow, public, const) void foo (); -- /Jacob Carlborg
Jun 24 2014
On 24.06.2014 21:32, Jacob Carlborg wrote:Since we got UDA's that use the attribute syntax, the idea of appending an symbol in front of an attribute to avoid name collisions doesn't work anymore. From a user point of view, the attributes starting with an symbol are just as much keywords as those who don't.Wouldn't an attribute like nogc only be a keyword for attribute symbols, while something like nothrow is a keyword for everything? E.g. using nogc means I can't define my own "nogc" UDA but I can have a function or variable named nogc, while I can't have a function named "nogc". Being a "attribute keyword" seems a much smaller restriction on user code.If what I wrote above is correct, why not declare existing compiler-attributes "attribute keywords", and then allow a mix of them: (nothrow, public, const, "my_custom_attribute") void foo ();I sympathize with you, but I think that we're stuck at this point.I we want to minimize name collisions it would be better to remove all attributes and only have a single attribute, like this: attribute(nothrow, public, const) void foo ();
Jun 24 2014
On 2014-06-25 01:32, Marco Nembrini wrote:Wouldn't an attribute like nogc only be a keyword for attribute symbols, while something like nothrow is a keyword for everything?I guess that's true.E.g. using nogc means I can't define my own "nogc" UDA but I can have a function or variable named nogc, while I can't have a function named "nogc". Being a "attribute keyword" seems a much smaller restriction on user code.I guess so.If what I wrote above is correct, why not declare existing compiler-attributes "attribute keywords", and then allow a mix of them: (nothrow, public, const, "my_custom_attribute") void foo ();Yeah, if the built-in attributes were implemented as UDA's, defined in object.d, then there would be less of a problem. Then one could always use fully qualified symbol names to disambiguate the attributes. -- /Jacob Carlborg
Jun 25 2014
Jacob Carlborg:Yeah, if the built-in attributes were implemented as UDA's, defined in object.d, then there would be less of a problem. Then one could always use fully qualified symbol names to disambiguate the attributes.Walter in the nogc pull request has explained why this is a bad idea, and I agree with him. There are many things that need to be fixed in D, like the problem of uniqueness. The problem of attributes like nogc being names nogc or nogc is very low on the list. So I suggest to refocus the discussions on more significant things, like tuples, significant missing part of Phobos, etc. Bye, bearophile
Jun 25 2014
On Monday, 23 June 2014 at 17:30:19 UTC, John wrote:The symbols used on all those attributes like nogc nothrow pure safe make the D code look ugly. If possible, please get rid of those symbols. The attributes look good without the " " symbols.Give up this idea, right now. Grammatically it would break all the code using identifiers such as 'safe'... I think it's just not possible. interesting example: --------------------------- import std.stdio; safe int safe() { auto i = 8; return i; } void main(string ars[]) { writeln(safe); } --------------------------- What you want is just impossible...
Jun 23 2014
import std.stdio; safe int safe() { auto i = 8; return i; } void main(string ars[]) { writeln(safe); } --------------------------- What you want is just impossible...Would be a good use case for dfix. It really isn't hard to rename every identifier consistently.
Jun 23 2014
On Monday, 23 June 2014 at 22:02:26 UTC, Tobias Pankrath wrote:Maybe the future will tell you you're right... From my point of view this change is a very unprobable one but who knows ? ^^ People are skeptikal about the the air-skate too... I don't wanna be segregative...import std.stdio; safe int safe() { auto i = 8; return i; } void main(string ars[]) { writeln(safe); } --------------------------- What you want is just impossible...Would be a good use case for dfix. It really isn't hard to rename every identifier consistently.
Jun 23 2014
On Monday, 23 June 2014 at 22:16:22 UTC, Grogan wrote:On Monday, 23 June 2014 at 22:02:26 UTC, Tobias Pankrath wrote:I meant the 'hoverboard' of course... BTW I think ' ' makes sense. And another BTW: in your fantastic nazi plan which consists into eradicating the ' ' prefix, how would look the UDA ? I mean that ' ' has a signification in the D grammar not only for predifined attributes, but also for user ones...Maybe the future will tell you you're right... From my point of view this change is a very unprobable one but who knows ? ^^ People are skeptikal about the the air-skate too... I don't wanna be segregative...import std.stdio; safe int safe() { auto i = 8; return i; } void main(string ars[]) { writeln(safe); } --------------------------- What you want is just impossible...Would be a good use case for dfix. It really isn't hard to rename every identifier consistently.
Jun 23 2014
On 23 June 2014 23:58, Grogan via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Monday, 23 June 2014 at 22:16:22 UTC, Grogan wrote:Godwin's Law.On Monday, 23 June 2014 at 22:02:26 UTC, Tobias Pankrath wrote:I meant the 'hoverboard' of course... BTW I think ' ' makes sense. And another BTW: in your fantastic nazi plan which consists into eradicating the ' ' prefix, how would look the UDA ? I mean that ' ' has a signification in the D grammar not only for predifined attributes, but also for user ones...Maybe the future will tell you you're right... From my point of view this change is a very unprobable one but who knows ? ^^ People are skeptikal about the the air-skate too... I don't wanna be segregative...import std.stdio; safe int safe() { auto i = 8; return i; } void main(string ars[]) { writeln(safe); } --------------------------- What you want is just impossible...Would be a good use case for dfix. It really isn't hard to rename every identifier consistently.
Jun 25 2014
I am actually in favour of adding more symbols. I think it makes it clear which things are attributes, and it makes user defined attributes look like the built in ones. So the built in ones look less special.
Jun 26 2014
On Monday, 23 June 2014 at 22:02:26 UTC, Tobias Pankrath wrote:Yep, perfect place to start experimenting with a Dfix and see what kind of language cleanup it would afford. For those who don't know what we're talking about: http://blog.golang.org/introducing-gofix Andrei seems enthusiastic: http://forum.dlang.org/thread/lmmdej$2j94$1 digitalmars.com#post-lncpdr:242ufh:241:40digitalmars.comimport std.stdio; safe int safe() { auto i = 8; return i; } void main(string ars[]) { writeln(safe); } --------------------------- What you want is just impossible...Would be a good use case for dfix. It really isn't hard to rename every identifier consistently.
Jun 23 2014
since D has Attribute lists e.g. ("string", 7, foo, bar) make them work with build-in attributes or convert build-in attributes to UDA's, then you can use them as single attributes or with attribute lists struct pure; struct safe; struct nothrow; ... pure safe nothrow or (pure, safe, nothrow)
Jun 24 2014
On Tuesday, 24 June 2014 at 12:46:10 UTC, AG wrote:since D has Attribute lists e.g. ("string", 7, foo, bar) make them work with build-in attributes or convert build-in attributes to UDA's, then you can use them as single attributes or with attribute lists struct pure; struct safe; struct nothrow; ... pure safe nothrow or (pure, safe, nothrow)Hmm, didn't know you could do that with UDAs, certainly looks better than this: https://github.com/D-Programming-Language/phobos/blob/master/std/math.d#L385 Maybe we should add another nogc just to make sure. ;) That line's going to look even worse if DIP 64 goes through and more s are added.
Jun 24 2014