View mode: basic / threaded / horizontal-split · Log in · Help
March 31, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread adoption(tm)
"Walter Bright" <newshound1@digitalmars.com> wrote in message 
news:hp08a9$19la$2@digitalmars.com...
> Nick Sabalausky wrote:
>> And here's an even crazier idea: Some sort of well-thought-out UCF format 
>> (Unicode Code Format) that is like plain-text, but includes a standard 
>> metadata header (typically hidden while editing) that can help sort all 
>> this stuff out, and maybe other things as well. Obviously it would 
>> require special support from compilers and editors, but if it was 
>> well-designed (including discouragement of proprietary extensions - don't 
>> want a repeat of HTML) then I think it would be worth trying to push.
>
> Sorry, but anything that requires D users to use a custom editor for a 
> special source code file format is doomed to failure.

I was thinking of it as whole-programming-world kind of thing not specific 
to any langauge, kind of like how UTF has been replacing ASCII and code 
pages (although this would use UTF). Basically kind of like a programmer's 
RTF (although it obviously wouldn't involve setting fonts and colors, but 
rather things like tab settings).

I agree that getting it to actually happen would be an uphill battle 
(especially if there's no large organization backing it :( ), but it could 
be worth the potential benefits if it were to happen.
March 31, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread adoption(tm)
"Walter Bright" <newshound1@digitalmars.com> wrote in message 
news:hp087r$19la$1@digitalmars.com...
> Nick Sabalausky wrote:
>> Alhough it wouldn't necessarily even need to be a full-fledged source 
>> formatter. Just something to sanitize the whitespace between 
>> start-of-line and anything non-whitespace would be a huge improvement 
>> *and* be cross-language.
>
> I think that's a great idea. Yesterday, I wrote the following program and 
> added it to the dmd makefile so that all checkins and installs run the 
> source code through it first. I welcome improvements. The current version 
> replaces tabs with spaces, and removes trailing whitespace.
>

Sounds great.

> If someone is ambitious, a full fletched D source code pretty printer 
> would be valuable that anyone could use, and which all Phobos source code 
> could be run through in order to enforce a common style.

For bonus points, they could expose it as a library so editors and other 
tools can make use of it without shuffling everything through command-line 
params, stdout and the filesystem.
March 31, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread adoption(tm)
Nick Sabalausky Wrote:

> "Walter Bright" <newshound1@digitalmars.com> wrote in message 
> news:hp087r$19la$1@digitalmars.com...
> > Nick Sabalausky wrote:
> >> Alhough it wouldn't necessarily even need to be a full-fledged source 
> >> formatter. Just something to sanitize the whitespace between 
> >> start-of-line and anything non-whitespace would be a huge improvement 
> >> *and* be cross-language.
> >
> > I think that's a great idea. Yesterday, I wrote the following program and 
> > added it to the dmd makefile so that all checkins and installs run the 
> > source code through it first. I welcome improvements. The current version 
> > replaces tabs with spaces, and removes trailing whitespace.
> >
> 
> Sounds great.
> 
> > If someone is ambitious, a full fletched D source code pretty printer 
> > would be valuable that anyone could use, and which all Phobos source code 
> > could be run through in order to enforce a common style.
> 
> For bonus points, they could expose it as a library so editors and other 
> tools can make use of it without shuffling everything through command-line 
> params, stdout and the filesystem.
> 
> 

Will it work with multiline strings?

char[] s = r""" I am very
    wide

string""";
March 31, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread adoption(tm)
Nick Sabalausky wrote:
> And here's an even crazier idea: Some sort of well-thought-out UCF format 
> (Unicode Code Format) that is like plain-text, but includes a standard 
> metadata header (typically hidden while editing) that can help sort all this 
> stuff out, and maybe other things as well. Obviously it would require 
> special support from compilers and editors, but if it was well-designed 
> (including discouragement of proprietary extensions - don't want a repeat of 
> HTML) then I think it would be worth trying to push.
> 
	You mean like the Emacs/vim headers which allow to specify
everything in special comments near the top or bottom of the file
and Emacs/vim sets the appropriate options automatically upon
loading the file?
http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html

		Jerome
-- 
mailto:jeberger@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr
March 31, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread adoption(tm)
Nick Sabalausky Wrote:

> I was thinking of it as whole-programming-world kind of thing not specific 
> to any langauge, kind of like how UTF has been replacing ASCII and code 
> pages (although this would use UTF). Basically kind of like a programmer's 
> RTF (although it obviously wouldn't involve setting fonts and colors, but 
> rather things like tab settings).

You mean something like PTSC - http://www.synchro.net/ptsc_hdr.html
March 31, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread
Jérôme M. Berger:
> 	Uncrustify already claims to support D:
> http://uncrustify.sourceforge.net/

I have tried that "Universal Indent GUI" with Uncrustify. It seems nice but it has so many options that finding the correct ones is lot of work, even if you use that GUI:
http://uncrustify.sourceforge.net/config.txt
It seems unable to recognize foreach and foreach_reverse.

Bye,
bearophile
April 01, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread adoption(tm)
On Wed, 31 Mar 2010 11:49:31 -0600, Nick Sabalausky <a@a.a> wrote:

>
> Alhough it wouldn't necessarily even need to be a full-fledged source
> formatter. Just something to sanitize the whitespace between  
> start-of-line
> and anything non-whitespace would be a huge improvement *and* be
> cross-language.
>

Crimson Editor (my preferred D text editor) has menu options to convert  
tabs to spaces, convert leading tabs to spaces, convert spaces to tabs,  
and remove trailing spaces.
April 01, 2010
Re: Solution for Fatal flaw in D design which is holding back widespread adoption(tm)
On Wed, 31 Mar 2010 21:10:22 -0600, Phil Deets <pjdeets2@gmail.com> wrote:

> On Wed, 31 Mar 2010 11:49:31 -0600, Nick Sabalausky <a@a.a> wrote:
>
>>
>> Alhough it wouldn't necessarily even need to be a full-fledged source
>> formatter. Just something to sanitize the whitespace between  
>> start-of-line
>> and anything non-whitespace would be a huge improvement *and* be
>> cross-language.
>>
>
> Crimson Editor (my preferred D text editor) has menu options to convert  
> tabs to spaces, convert leading tabs to spaces, convert spaces to tabs,  
> and remove trailing spaces.

Correction: It has leading spaces to tabs, not leading tabs to spaces.
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home