February 03, 2006
James Dunne wrote:

> Dave wrote:
> [snip]
>> 
>> 
>> No changes to D except ignoring the first line of a program if the first two characters are '#!'.
>> 
> 
> A thought occurrs... does UNIX check the BOM first?  If not, then Unicode source code could not be coerced into this...
> 
> [snip]
> 
>

I would be surprised if it didn't, most shells are really unicode aware.
February 03, 2006
James Dunne wrote:

>> No changes to D except ignoring the first line of a program if the first two characters are '#!'.
> 
> A thought occurrs... does UNIX check the BOM first?  If not, then Unicode source code could not be coerced into this...

UTF-8 doesn't need a BOM, which is what makes it nice for such things.

--anders
February 03, 2006
Kris wrote:
> "Sean Kelly" <sean@f4.ca> wrote ...
> 
>>Kris wrote:
>>
>>>So, here's a bit of (somewhat old) speculation:
>>>
>>>* GCC can apparently generate PocketPC compatable code, for ARM/XScale. David Friedman doesn't feel there'd be huge issues getting GDC to take advantage of that.
>>>
>>>* Microsoft has both emulators and debuggers for these devices. Very good ones.
>>>
>>>Do you think it would be cool to get those working together? And then promote the heck out of it? I mean, isn't it potentially a better story than .NET for that market?
>>
>>Definately.  And with Phoenix now available, this may not be terribly difficult, though David would be the one to ask here.
> 

I hate bursting bubbles but I think Phoenix is a C# API.

> 
> So, I suspect the problem be finding volunteers? I'm afraid I don't have the requisite knowledge, time, or skills to take this on; much as I'd dearly love to. It would probably require some debugger support from Walter too, as you noted earlier.
> 
> 
> 
>>>Some GUI would perhaps help? Maybe a DFL for PocketPC? Or perhaps the WinCE version of DWT that Shawn has (the WinCE code is a version'd subset of the Win32 SWT)?
>>
>>The latter, I think.  I'd like to believe a WinCE port of DWT wouldn't be terribly difficult, and it would be nice to have a consistent API across platforms.
> 
> 
> Aye. I think we'd find that Shawns work is already 95% there (he's got version(wince) in the codebase, where SWT had if(WinCE) instead).
>

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/MU/S d-pu s:+ a-->? C++++$ UL+++ P--- L+++ !E W-- N++ o? K? w--- O M--@ V? PS PE Y+ PGP- t+ 5 X+ !R tv-->!tv b- DI++(+) D++ G e++>e h>--->++ r+++ y+++
------END GEEK CODE BLOCK------

James Dunne
February 03, 2006
In article <ds0bh0$jiv$1@digitaldaemon.com>, Kris says...
>
>> Of course if the D specification allowed such a directive, convienently
>> named
>> '!' (*coughwalter?cough*), then there wouldn't be any problem with D shell
>> scripts being compilable via conventional means. ;)
>
>
>Can you expound on that a bit further, please?
>

Sure!  The spec could be expanded by augmenting the "SpecialTokenSequence" which is only being used for '#line' right now:

SpecialTokenSequence
# line Integer EndOfLine
# line Integer Filespec EndOfLine
# ! Filespec

Filespec
" Characters "

It would be an easy fix.  DMD would just throw the filespec out.  The real question here is: is it worth it?

- EricAnderton at yahoo
February 03, 2006
In article <ds0cfe$k9u$1@digitaldaemon.com>, James Dunne says...
>
>Dave wrote:
>[snip]
>> 
>> 
>> No changes to D except ignoring the first line of a program if the first two characters are '#!'.
>> 
>
>A thought occurrs... does UNIX check the BOM first?  If not, then Unicode source code could not be coerced into this...
>

While I'm no Unix hacker, I'd be willing to bet that the check for '#!' is done in a very binary way: just look at the first two bytes.  I say this because I think it does the same thing to identify *binary* executables as well.

Is there a concession or some kind of short-hand for "write this character as a single byte" in unicode?

- Eric Anderton at yahoo
February 03, 2006
"pragma" <pragma_member@pathlink.com> wrote om...
[snip]
> SpecialTokenSequence
> # line Integer EndOfLine
> # line Integer Filespec EndOfLine
> # ! Filespec
>
> Filespec
> " Characters "


Again, thanks.


> It would be an easy fix.  DMD would just throw the filespec out.  The real question here is: is it worth it?


Well, one concern (that nobody mentioned yet) is that such things are for *nix only; yes?


February 03, 2006
"pragma" <pragma_member@pathlink.com> wrote...
> In article <ds0cfe$k9u$1@digitaldaemon.com>, James Dunne says...
>>
>>Dave wrote:
>>[snip]
>>>
>>>
>>> No changes to D except ignoring the first line of a program if the first
>>> two
>>> characters are '#!'.
>>>
>>
>>A thought occurrs... does UNIX check the BOM first?  If not, then Unicode source code could not be coerced into this...
>>
>
> While I'm no Unix hacker, I'd be willing to bet that the check for '#!' is
> done
> in a very binary way: just look at the first two bytes.  I say this
> because I
> think it does the same thing to identify *binary* executables as well.
>
> Is there a concession or some kind of short-hand for "write this character
> as a
> single byte" in unicode?

Sort of: you'd typically use UTF-8 to eliminate the need for a BOM. But that precludes saving a file as UTF-16 or UTF-32, which D explicitly supports. It may not be a major issue, but would certainly cause problems for some folks.

However, UTF-8 files can also have a BOM/signature called UTF-8N. The signature is "efbbbf" hex. Thus, one cannot rely on any unicode form to preclude a signature.



February 03, 2006
In article <ds0dut$le6$1@digitaldaemon.com>, Kris says...
>
>"pragma" <pragma_member@pathlink.com> wrote om...
>[snip]
>> SpecialTokenSequence
>> # line Integer EndOfLine
>> # line Integer Filespec EndOfLine
>> # ! Filespec
>>
>> Filespec
>> " Characters "
>
>
>Again, thanks.
>
>
>> It would be an easy fix.  DMD would just throw the filespec out.  The real question here is: is it worth it?
>
>
>Well, one concern (that nobody mentioned yet) is that such things are for *nix only; yes?
>

As far as the "shebang" line stuff, yes: its *nix specific.

Under Windows, you'd have to configure a file type association to make this work.  As it turns out, those associations happen to apply to files in the shell as well (under XP or later ... I don't think Win2k does this).  Just try "executing" a .jpg file and you'll see what I mean.

- Eric Anderton at yahoo
February 03, 2006
James Dunne wrote:
> Kris wrote:
>> "Sean Kelly" <sean@f4.ca> wrote ...
>>
>>> Kris wrote:
>>>
>>>> So, here's a bit of (somewhat old) speculation:
>>>>
>>>> * GCC can apparently generate PocketPC compatable code, for ARM/XScale. David Friedman doesn't feel there'd be huge issues getting GDC to take advantage of that.
>>>>
>>>> * Microsoft has both emulators and debuggers for these devices. Very good ones.
>>>>
>>>> Do you think it would be cool to get those working together? And then promote the heck out of it? I mean, isn't it potentially a better story than .NET for that market?
>>>
>>> Definately.  And with Phoenix now available, this may not be terribly difficult, though David would be the one to ask here.
>>
> 
> I hate bursting bubbles but I think Phoenix is a C# API.

Even if it is, it might not be too difficult to create a managed C++ wrapper for the DMD/GDC front-end.  Also, the Phoenix docs indicate that it accepts MSIL, so code-level integration may not be necessary.


Sean
February 03, 2006
In article <ds0dut$le6$1@digitaldaemon.com>, Kris says...
>
>"pragma" <pragma_member@pathlink.com> wrote om...
>[snip]
>> SpecialTokenSequence
>> # line Integer EndOfLine
>> # line Integer Filespec EndOfLine
>> # ! Filespec
>>
>> Filespec
>> " Characters "
>
>
>Again, thanks.
>
>
>> It would be an easy fix.  DMD would just throw the filespec out.  The real question here is: is it worth it?
>
>
>Well, one concern (that nobody mentioned yet) is that such things are for *nix only; yes?
>

It wouldn't have to be - you (or an installation) could set up a windows association to '.d' files that would run 'rdmd for windows'. If the '#!' was there it would run it like linux, otherwise it could complain that it isn't executable (or it could do more advanced things like look for another association, like an editor or ide).