Re: Where did the specification ebook go?

2012-03-03 Thread Jakob Ovrum
On Sunday, 4 March 2012 at 06:29:06 UTC, Walter Bright wrote: On 3/3/2012 9:25 PM, Jakob Ovrum wrote: There is a link to a file `dlangspec.mobi` on this page: http://dlang.org/spec.html The ebook link is dead. I tried building an ebook myself using the makefile, but to no avail; kindlegen enc

Re: dereferencing null

2012-03-03 Thread Sandeep Datta
If you're dealing with plugins from an unknown source, it's a good design to separate plugins and such as entirely separate processes. Then, when one goes down, it cannot bring down anyone else, since there is no shared address space. They can communicate with the OS-supplied interprocess com

Re: dereferencing null

2012-03-03 Thread Sandeep Datta
1. SEH isn't portable. There's no way to make it work under non-Windows systems. Ok after some digging around it appears (prima facie) that Linux doesn't have anything close to SEH. I am aware of POSIX signals but I am not sure if they work for individual threads in a process. Last I checked

Re: dereferencing null

2012-03-03 Thread Sandeep Datta
A misbehaving plugin could easily corrupt your process. Destroying data is always much worse than crashing. At this point I usually say memory corruption is not an option for type safe languages but D doesn't really provide runtime type safety guarantees, or does it? I think in the future (

Re: dereferencing null

2012-03-03 Thread Martin Nowak
On Sun, 04 Mar 2012 03:53:53 +0100, Sandeep Datta wrote: It's been there for 10 years, and turns out to be a solution looking for a problem. I beg to differ, the ability to catch and respond to such asynchronous exceptions is vital to the stable operation of long running software. It i

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread Martin Nowak
T Wasn't the latest proposal that we add a working AA implementation to the runtime and switch the compiler after that has settled?

Re: Where did the specification ebook go?

2012-03-03 Thread Walter Bright
On 3/3/2012 9:25 PM, Jakob Ovrum wrote: There is a link to a file `dlangspec.mobi` on this page: http://dlang.org/spec.html The ebook link is dead. I tried building an ebook myself using the makefile, but to no avail; kindlegen encountered dozens of problems with the generated dlangspec.html.

Re: dereferencing null

2012-03-03 Thread Walter Bright
On 3/3/2012 8:20 PM, H. S. Teoh wrote: Don't know how this would work on Windows, but presumably there are clean ways of doing it that doesn't endanger the health of the process creating the sandbox. If you're dealing with plugins from an unknown source, it's a good design to separate plugins

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread H. S. Teoh
On Sun, Mar 04, 2012 at 03:24:47PM +1100, Daniel Murphy wrote: > "Andrei Alexandrescu" wrote in message > news:jiuol3$rqb$1...@digitalmars.com... [...] > > I think we must migrate the arrays into the runtime. > > > > Andrei > > I know. It was before my time, but I assume you were the one who >

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread H. S. Teoh
On Sun, Mar 04, 2012 at 03:34:26PM +1100, Daniel Murphy wrote: > "H. S. Teoh" wrote in message > news:mailman.372.1330833051.24984.digitalmar...@puremagic.com... [...] > > Is that when struct AssociativeArray came into being? I'm still > > trying to understand how exactly AssociativeArray is conn

Where did the specification ebook go?

2012-03-03 Thread Jakob Ovrum
There is a link to a file `dlangspec.mobi` on this page: http://dlang.org/spec.html The ebook link is dead. I tried building an ebook myself using the makefile, but to no avail; kindlegen encountered dozens of problems with the generated dlangspec.html. Anyway, spec.html is not even reac

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread Daniel Murphy
"H. S. Teoh" wrote in message news:mailman.372.1330833051.24984.digitalmar...@puremagic.com... >> Then, a few of years ago they were moved into druntime, so that the >> implementation and interface could be improved without modifying the >> compiler. > > Is that when struct AssociativeArray came

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread Daniel Murphy
"Andrei Alexandrescu" wrote in message news:jiuol3$rqb$1...@digitalmars.com... > On 3/3/12 9:19 PM, Daniel Murphy wrote: >> We're basically stuck with this until someone comes up with a solution >> that >> lets everything work as it should, with AAs completely in the runtime or >> the >> compil

Re: dereferencing null

2012-03-03 Thread H. S. Teoh
On Sat, Mar 03, 2012 at 07:34:50PM -0800, Walter Bright wrote: [...] > 3. Intercepting and recovering from seg faults, div by 0, etc., all > sounds great on paper. In practice, it is almost always wrong. The > only exception (!) to the rule is when sandboxing a plugin (as you > suggested). Making s

Re: dereferencing null

2012-03-03 Thread H. S. Teoh
On Sun, Mar 04, 2012 at 04:29:27AM +0100, Adam D. Ruppe wrote: > On Sunday, 4 March 2012 at 03:15:19 UTC, Sandeep Datta wrote: > >All we have to do now is provide a more specific exception (say > >NullReferenceException) so that the programmer has the ability to > >provide a specific exception hand

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread H. S. Teoh
On Sat, Mar 03, 2012 at 09:47:49PM -0600, Andrei Alexandrescu wrote: > On 3/3/12 9:19 PM, Daniel Murphy wrote: > >We're basically stuck with this until someone comes up with a > >solution that lets everything work as it should, with AAs completely > >in the runtime or the compiler. > > I think we

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread H. S. Teoh
On Sun, Mar 04, 2012 at 02:19:42PM +1100, Daniel Murphy wrote: > "H. S. Teoh" wrote in message [...] > > But perhaps a more pertinent question is, why is there so much > > duplication between aaA.d and object.AssociativeArray? For example, > > object.AssociativeArray basically copies (with modifi

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread Andrei Alexandrescu
On 3/3/12 9:19 PM, Daniel Murphy wrote: We're basically stuck with this until someone comes up with a solution that lets everything work as it should, with AAs completely in the runtime or the compiler. I think we must migrate the arrays into the runtime. Andrei

Re: dereferencing null

2012-03-03 Thread Walter Bright
On 3/3/2012 6:53 PM, Sandeep Datta wrote: It's been there for 10 years, and turns out to be a solution looking for a problem. I beg to differ, the ability to catch and respond to such asynchronous exceptions is vital to the stable operation of long running software. It is not hard to see how t

Re: dereferencing null

2012-03-03 Thread Adam D. Ruppe
On Sunday, 4 March 2012 at 03:15:19 UTC, Sandeep Datta wrote: All we have to do now is provide a more specific exception (say NullReferenceException) so that the programmer has the ability to provide a specific exception handler for NullReferenceException etc. Looks like it is pretty easy to

Re: Is it bad for object.di to depend on core.exception?

2012-03-03 Thread Daniel Murphy
"H. S. Teoh" wrote in message news:mailman.370.1330829036.24984.digitalmar...@puremagic.com... > So I'm still working on fixing issue 5030, which *should* have been a > trivial fix. But I'm running into a bunch of circumstantial problems, > among which is this new method in AssociativeArray(Key,V

Re: dereferencing null

2012-03-03 Thread Sandeep Datta
You can catch it in D (on Windows): This is great. All we have to do now is provide a more specific exception (say NullReferenceException) so that the programmer has the ability to provide a specific exception handler for NullReferenceException etc. I gave it a try on Linux but unfortunatel

Re: AssociativeArray.opIndex

2012-03-03 Thread Daniel Murphy
"Jonathan M Davis" wrote in message news:mailman.354.1330804749.24984.digitalmar...@puremagic.com... > On Saturday, March 03, 2012 22:50:10 Daniel Murphy wrote: >> "H. S. Teoh" wrote in message >> news:mailman.341.1330753339.24984.digitalmar...@puremagic.com... >> >> > Value opIndex(Key key, in

Re: AssociativeArray.opIndex

2012-03-03 Thread Daniel Murphy
"H. S. Teoh" wrote in message news:mailman.350.1330790511.24984.digitalmar...@puremagic.com... > On Sat, Mar 03, 2012 at 10:50:10PM +1100, Daniel Murphy wrote: >> "H. S. Teoh" wrote in message >> news:mailman.341.1330753339.24984.digitalmar...@puremagic.com... >> > Value opIndex(Key key, int fil

Re: dereferencing null

2012-03-03 Thread Adam D. Ruppe
On Sunday, 4 March 2012 at 02:53:54 UTC, Sandeep Datta wrote: Thus the inability of handling such exceptions undermines D's ability to support dynamically loaded modules of any kind and greatly impairs modularity. You can catch it in D (on Windows): import std.stdio; void main() { int

Re: dereferencing null

2012-03-03 Thread Sandeep Datta
It's been there for 10 years, and turns out to be a solution looking for a problem. I beg to differ, the ability to catch and respond to such asynchronous exceptions is vital to the stable operation of long running software. It is not hard to see how this can be useful in programs which dep

Is it bad for object.di to depend on core.exception?

2012-03-03 Thread H. S. Teoh
So I'm still working on fixing issue 5030, which *should* have been a trivial fix. But I'm running into a bunch of circumstantial problems, among which is this new method in AssociativeArray(Key,Value): Value opIndex(Key key, string file=__FILE__, size_t line=__LINE__) { auto p = k

Re: Fixing the SortedRange

2012-03-03 Thread Andrei Alexandrescu
On 3/3/12 12:44 PM, Dmitry Olshansky wrote: It's annoyingly strange that e.g. the following won't work as of yet: auto sorted = assumeSorted(["hello", "world"]); //assume lots of strings auto x = sorted.lowerBound("Try that?"d); Yeah, I know the immutable(dchar)[] vs immutable(char)[] can't be

Re: dereferencing null

2012-03-03 Thread Vladimir Panteleev
On Saturday, 3 March 2012 at 22:24:59 UTC, Walter Bright wrote: On 3/3/2012 12:29 PM, Sandeep Datta wrote: I would recommend doing what Microsoft does in this case, use SEH (Structured exception handling) on windows i.e. use OS facilities to trap and convert hardware exceptions into software e

Re: dereferencing null

2012-03-03 Thread Walter Bright
On 3/3/2012 12:29 PM, Sandeep Datta wrote: I would recommend doing what Microsoft does in this case, use SEH (Structured exception handling) on windows i.e. use OS facilities to trap and convert hardware exceptions into software exceptions. D for Windows already does that. It's been there for

Re: Review of Jose Armando Garcia Sancio's std.log

2012-03-03 Thread Andrei Alexandrescu
On 3/3/12 5:51 AM, Sönke Ludwig wrote: Am 17.02.2012 21:48, schrieb Andrei Alexandrescu: On 2/17/12 12:06 PM, Jose Armando Garcia wrote: info("%s message", Severity.info); I think defaulting to formatted stuff may be confusing. Andrei Do you often log static messages? In my experience the

Re: Extending UFCS to templates

2012-03-03 Thread kennytm
Andrej Mitrovic wrote: > I thought I'd be cool if we could use UFCS for templates. For example > instead of this: > > template isOneOf(X, T...) > { > static if (!T.length) > enum bool isOneOf = false; > else static if (is(Unqual!X == T[0])) > enum bool isOneOf = true; >

Re: dereferencing null

2012-03-03 Thread Sandeep Datta
I would recommend doing what Microsoft does in this case, use SEH (Structured exception handling) on windows i.e. use OS facilities to trap and convert hardware exceptions into software exceptions. See the /EHa flag in the Microsoft C++ compiler. I hope Linux has something similar, then we are a

Re: dereferencing null

2012-03-03 Thread Timon Gehr
On 03/03/2012 09:00 PM, deadalnix wrote: Le 03/03/2012 20:06, Walter Bright a écrit : On 3/3/2012 2:13 AM, bearophile wrote: Walter: Adding in software checks for null pointers will dramatically slow things down. Define this use of "dramatically" in a more quantitative and objective way, pl

Re: dereferencing null

2012-03-03 Thread deadalnix
Le 03/03/2012 20:06, Walter Bright a écrit : On 3/3/2012 2:13 AM, bearophile wrote: Walter: Adding in software checks for null pointers will dramatically slow things down. Define this use of "dramatically" in a more quantitative and objective way, please. Is Java "dramatically" slower than C

Re: AssociativeArray.opIndex

2012-03-03 Thread Jonathan M Davis
On Saturday, March 03, 2012 22:50:10 Daniel Murphy wrote: > "H. S. Teoh" wrote in message > news:mailman.341.1330753339.24984.digitalmar...@puremagic.com... > > > Value opIndex(Key key, int file=__FILE__, int line=__LINE__) > > The AssociateArray stuct has semantic run on it with errors gagged.

Re: dereferencing null

2012-03-03 Thread Walter Bright
On 3/3/2012 2:13 AM, bearophile wrote: Walter: Adding in software checks for null pointers will dramatically slow things down. Define this use of "dramatically" in a more quantitative and objective way, please. Is Java "dramatically" slower than C++/D here? You can try it for yourself. Take

Fixing the SortedRange

2012-03-03 Thread Dmitry Olshansky
It's annoyingly strange that e.g. the following won't work as of yet: auto sorted = assumeSorted(["hello", "world"]); //assume lots of strings auto x = sorted.lowerBound("Try that?"d); Yeah, I know the immutable(dchar)[] vs immutable(char)[] can't be compared using straight <. That's acceptable

Re: AssociativeArray.opIndex

2012-03-03 Thread H. S. Teoh
On Sat, Mar 03, 2012 at 10:50:10PM +1100, Daniel Murphy wrote: > "H. S. Teoh" wrote in message > news:mailman.341.1330753339.24984.digitalmar...@puremagic.com... > > Value opIndex(Key key, int file=__FILE__, int line=__LINE__) > > The AssociateArray stuct has semantic run on it with errors gagge

Re: Mac Installer - Can't find druntime/import and phobos/src after install

2012-03-03 Thread Jacob Carlborg
On 2012-03-03 11:26, Jacob Carlborg wrote: On Friday, 2 March 2012 at 21:59:15 UTC, bryan costanich wrote: Jacob: the compiler is installed in usr/local/bin. but that doesn't matter, that's not what i need to locate. :) If no one has changed the installer since I created it, it's only a symlin

Re: Poll of the week: main OS and compiler

2012-03-03 Thread Daniel Murphy
"Rainer Schuetze" wrote in message news:jit3hk$tgb$1...@digitalmars.com... > > A good step forward would be a better separation of the object file format > from the target OS and the host OS. Removing that preprocessor hell is > needed anyway if you want to switch between object file formats by

Re: Review of Jose Armando Garcia Sancio's std.log

2012-03-03 Thread mist
log!(knownCause|unknownEffect|breaksFlow)("This is a severe message."); Simply defining log level enum in terms of this bit field would help a lot. Like, what is the first thing I do when getting a new log lib? Checking all pre-defined log levels and deciding when to use them. And, woah, here

Re: Mac Installer - Can't find druntime/import and phobos/src after install

2012-03-03 Thread David Nadlinger
On Friday, 2 March 2012 at 21:59:15 UTC, bryan costanich wrote: this is what it comes down to, installing this and getting it running should be painless. it's pretty close with the mac installer, but the mac installer needs to install those support files too. if it did, we'd be in good shape.

Re: Poll of the week: main OS and compiler

2012-03-03 Thread Rainer Schuetze
On 3/3/2012 12:44 PM, Daniel Murphy wrote: "Bernard Helyer" wrote in message news:nlzougvwvlvnmjbuf...@forum.dlang.org... No one thinks that's a bad idea. The trouble is the amount of developers that actually understand the backend enough to implement another object format (which is what's n

Re: AssociativeArray.opIndex

2012-03-03 Thread Alix Pexton
On 03/03/2012 11:50, Daniel Murphy wrote: "H. S. Teoh" wrote in message news:mailman.341.1330753339.24984.digitalmar...@puremagic.com... Value opIndex(Key key, int file=__FILE__, int line=__LINE__) The AssociateArray stuct has semantic run on it with errors gagged. Spot the error in the line

Re: dereferencing null

2012-03-03 Thread James Miller
On 3 March 2012 23:13, bearophile wrote: > Walter: > >> Adding in software checks for null pointers will dramatically slow things >> down. > > Define this use of "dramatically" in a more quantitative and objective way, > please. Is Java "dramatically" slower than C++/D here? > > Bye, > bearophil

Re: dereferencing null

2012-03-03 Thread Tove
On Saturday, 3 March 2012 at 10:13:34 UTC, bearophile wrote: Walter: Adding in software checks for null pointers will dramatically slow things down. Define this use of "dramatically" in a more quantitative and objective way, please. Is Java "dramatically" slower than C++/D here? Bye, bear

Re: Review of Jose Armando Garcia Sancio's std.log

2012-03-03 Thread Sönke Ludwig
Am 17.02.2012 21:48, schrieb Andrei Alexandrescu: On 2/17/12 12:06 PM, Jose Armando Garcia wrote: info("%s message", Severity.info); I think defaulting to formatted stuff may be confusing. Andrei Do you often log static messages? In my experience the majority of logging calls contains dyna

Re: AssociativeArray.opIndex

2012-03-03 Thread Daniel Murphy
"H. S. Teoh" wrote in message news:mailman.341.1330753339.24984.digitalmar...@puremagic.com... > Value opIndex(Key key, int file=__FILE__, int line=__LINE__) The AssociateArray stuct has semantic run on it with errors gagged. Spot the error in the line above! If you're messing with dmd, try e

Re: Poll of the week: main OS and compiler

2012-03-03 Thread Daniel Murphy
"Bernard Helyer" wrote in message news:nlzougvwvlvnmjbuf...@forum.dlang.org... > > No one thinks that's a bad idea. The trouble is the amount of developers > that actually understand the backend enough to implement another object > format (which is what's needed to support the VisualC linker) i

Re: Whats up with the domains?

2012-03-03 Thread Kevin Cox
On Mar 3, 2012 5:26 AM, "David Nadlinger" wrote: > > On Saturday, 3 March 2012 at 05:12:31 UTC, Kevin wrote: >> >> AFAIK they are mirrors of each other, would it be best to make one a redirect (smart, on a per-page level). > > > This already happened after the discussion at https://github.com/D-Pr

Re: Mac Installer - Can't find druntime/import and phobos/src after install

2012-03-03 Thread Jacob Carlborg
On Friday, 2 March 2012 at 21:59:15 UTC, bryan costanich wrote: Jacob: the compiler is installed in usr/local/bin. but that doesn't matter, that's not what i need to locate. :) If no one has changed the installer since I created it, it's only a symlink in /usr/local/bin and the actual compiler

Re: Whats up with the domains?

2012-03-03 Thread David Nadlinger
On Saturday, 3 March 2012 at 05:12:31 UTC, Kevin wrote: AFAIK they are mirrors of each other, would it be best to make one a redirect (smart, on a per-page level). This already happened after the discussion at https://github.com/D-Programming-Language/d-programming-language.org/pull/80#issueco

Re: dereferencing null

2012-03-03 Thread bearophile
Walter: > Adding in software checks for null pointers will dramatically slow things > down. Define this use of "dramatically" in a more quantitative and objective way, please. Is Java "dramatically" slower than C++/D here? Bye, bearophile

Re: Poll of the week: main OS and compiler

2012-03-03 Thread Manu
On 2 March 2012 23:16, Bernard Helyer wrote: > On Friday, 2 March 2012 at 11:53:56 UTC, Manu wrote: > >> Personally, I just want to be able to link like a normal windows >> developer. >> My code is C/C++, built with VC, and I want to link my D app against those >> libs using the VC linker, and de

Re: AssociativeArray.opIndex

2012-03-03 Thread David Nadlinger
On Saturday, 3 March 2012 at 05:42:19 UTC, H. S. Teoh wrote: dmd: mtype.c:4411: StructDeclaration* TypeAArray::getImpl(): Assertion `impl' failed. […] src/core/thread.d(2835): Error: undefined identifier module thread.keys These two error messages indicate that the AssociativeArray template

Re: Whats up with the domains?

2012-03-03 Thread Brad Anderson
On Fri, Mar 2, 2012 at 10:10 PM, Kevin wrote: > I understand that this has been mentioned before but I think that it is > important so I am going to bring it up again. > > I have been looking at the docs on dlang and d-programming-language.organd > was wondering which is the "preferred" website.