www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Time to rename "D" to " D" !?

reply "John" <john.joyus gmail.com> writes:
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
next sibling parent reply "Joakim" <dlang joakim.airpost.net> writes:
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
parent =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Monday, 23 June 2014 at 17:50:10 UTC, Joakim wrote:
 The   symbols used on all those attributes like  nogc  nothrow 
  pure  safe make the D code look ugly.
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.
Jun 23 2014
prev sibling next sibling parent "Martin Krejcirik" <mk-junk i-line.cz> writes:
Plaese no.
Jun 23 2014
prev sibling next sibling parent reply "Chris Nicholson-Sauls" <ibisbasenji gmail.com> writes:
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
parent reply "Gary Willoughby" <dev nomad.so> writes:
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
parent reply "Brian Schott" <briancschott gmail.com> writes:
On Monday, 23 June 2014 at 20:08:41 UTC, Gary Willoughby wrote:
 All are having the   added: http://wiki.dlang.org/DIP64
This hasn't been decided on. It's just a proposal right now.
Jun 23 2014
parent "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
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:
 All are having the   added: http://wiki.dlang.org/DIP64
This hasn't been decided on. It's just a proposal right now.
While I agree with the original statement that the is ugly, I also would prefer to just bring other attributes into this consistent style.
Jun 26 2014
prev sibling next sibling parent reply Jonathan M Davis via Digitalmars-d <digitalmars-d puremagic.com> writes:
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
next sibling parent "Mason McGill" <mmcgill caltech.edu> writes:
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
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
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
parent reply Marco Nembrini <marco.nembrini.co gmail.com> writes:
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.
 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 ();
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 ();
Jun 24 2014
parent reply Jacob Carlborg <doob me.com> writes:
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
parent "bearophile" <bearophileHUGS lycos.com> writes:
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
prev sibling next sibling parent reply "Grogan" <Grogan OD.fr> writes:
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
parent reply "Tobias Pankrath" <tobias pankrath.net> writes:
 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
next sibling parent reply "Grogan" <Grogan OD.fr> writes:
On Monday, 23 June 2014 at 22:02:26 UTC, Tobias Pankrath wrote:
 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.
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...
Jun 23 2014
parent reply "Grogan" <Grogan OD.fr> writes:
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:
 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.
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...
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...
Jun 23 2014
parent reply Iain Buclaw via Digitalmars-d <digitalmars-d puremagic.com> writes:
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:
 On Monday, 23 June 2014 at 22:02:26 UTC, Tobias Pankrath wrote:
 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.
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...
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...
Godwin's Law.
Jun 25 2014
parent "w0rp" <devw0rp gmail.com> writes:
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
prev sibling parent "Joakim" <dlang joakim.airpost.net> writes:
On Monday, 23 June 2014 at 22:02:26 UTC, Tobias Pankrath wrote:
 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.
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.com
Jun 23 2014
prev sibling parent reply "AG" <var.spool.mail700 gmail.com> writes:
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
parent "Joakim" <dlang joakim.airpost.net> writes:
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