Re: std library hooks

2012-04-14 Thread Bernard Helyer
On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote: On 4/13/2012 5:14 PM, Francois Chabot wrote: On Friday, 13 April 2012 at 21:29:37 UTC, Walter Bright wrote: On 4/13/2012 4:07 AM, Timon Gehr wrote: http://dlang.org/phobos/core_exception.html deprecated void setAssertHandler(erro

Re: std library hooks

2012-04-14 Thread Vladimir Panteleev
On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote: all assert(exp) does when it trips is call a function in the library. If you provide your own version of that function, the one in the library won't be linked in. This indeed works, but how exactly? In what case does the linker

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 1:01 AM, Vladimir Panteleev wrote: On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote: all assert(exp) does when it trips is call a function in the library. If you provide your own version of that function, the one in the library won't be linked in. This indeed works,

Re: std library hooks

2012-04-14 Thread Mehrdad
lmao "Bernard Helyer" wrote in message news:dyuzdgjnjysfreewf...@forum.dlang.org... On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote: On 4/13/2012 5:14 PM, Francois Chabot wrote: All I want, and I can guarantee that this is what Manu wants as well, is the ability to squeeze a

Re: std library hooks

2012-04-14 Thread Vladimir Panteleev
On Saturday, 14 April 2012 at 08:37:36 UTC, Walter Bright wrote: On 4/14/2012 1:01 AM, Vladimir Panteleev wrote: On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote: all assert(exp) does when it trips is call a function in the library. If you provide your own version of that functio

Re: Precise GC

2012-04-14 Thread Manu
On 13 April 2012 17:25, Kagamin wrote: > > once you prefetched the function, it will remain in the icache and be > reused from there the next time. > All depends how much you love object orientation. If you follow the C++ book and make loads of classes for everything, you'll thrash the hell out o

Re: D Compiler as a Library

2012-04-14 Thread Manu
On 13 April 2012 18:25, Jakob Ovrum wrote: > On Friday, 13 April 2012 at 13:08:51 UTC, deadalnix wrote: > >> SDC have a lot of theses, and I proposed a similar stuff for its >> evolution. I think it is easier for SDC than it is for dmd considering the >> codebase of both. >> > > I think we've got

Re: std library hooks

2012-04-14 Thread Manu
On 14 April 2012 00:30, Walter Bright wrote: > On 4/13/2012 6:07 AM, Manu wrote: > >> Awesome, I missed that. Although it sucks it's deprecated, what's the >> intended >> alternative? >> >> Now if I could only have more of those for malloc/free, and >> fopen/close/read/write/seek etc. >> > > For

Re: std library hooks

2012-04-14 Thread Manu
On 14 April 2012 00:16, Sean Kelly wrote: > On Apr 13, 2012, at 12:28 PM, Jacob Carlborg wrote: > > > On 2012-04-13 17:26, Sean Kelly wrote: > >> Because no one used it. Sounds like I may need to un-deprecate it for > 2.060. > > > > Yes, please. There are now several people that want to use it.

Re: std library hooks

2012-04-14 Thread Manu
On 14 April 2012 03:14, Francois Chabot wrote: > On Friday, 13 April 2012 at 21:29:37 UTC, Walter Bright wrote: > >> On 4/13/2012 4:07 AM, Timon Gehr wrote: >> >>> http://dlang.org/phobos/core_**exception.html >>> deprecated void setAssertHandler(**erro

Re: std library hooks

2012-04-14 Thread Manu
On 14 April 2012 11:36, Walter Bright wrote: > On 4/14/2012 1:01 AM, Vladimir Panteleev wrote: > >> On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote: >> >>> all assert(exp) does when it trips is call a function in the library. If >>> you >>> provide your own version of that functio

Re: std library hooks

2012-04-14 Thread Jacob Carlborg
On 2012-04-13 23:16, Sean Kelly wrote: On Apr 13, 2012, at 12:28 PM, Jacob Carlborg wrote: On 2012-04-13 17:26, Sean Kelly wrote: Because no one used it. Sounds like I may need to un-deprecate it for 2.060. Yes, please. There are now several people that want to use it. But does the compile

Re: D Compiler as a Library

2012-04-14 Thread Jacob Carlborg
On 2012-04-14 12:35, Manu wrote: On 13 April 2012 18:25, Jakob Ovrum I don't know what Jakob means with "codegen" in this case but SDC depends on LLVM. Have a look at the bottom of: https://github.com/bhelyer/SDC -- /Jacob Carlborg

Re: Is anyone hacking on druntime in a widespread fashion at the moment?

2012-04-14 Thread deadalnix
Le 11/04/2012 22:41, Jonathan M Davis a écrit : On Wednesday, April 11, 2012 22:01:36 deadalnix wrote: Le 11/04/2012 00:10, Alex Rønne Petersen a écrit : I'm planning to go over druntime and add nothrow/pure everywhere I can, but I don't want to disturb anyone else who's currently working on pa

Re: Provide @immutable attribute for first-class citizens and namespaces?

2012-04-14 Thread deadalnix
Le 14/04/2012 08:56, Daniel Fitzpatrick a écrit : A few languages out there provide immutability by default. I'm on board with D not providing it by default, but would it be useful or worth the effort to add an @immutable attribute to first class citizens and namespaces eg // All members & fn re

Re: D Compiler as a Library

2012-04-14 Thread deadalnix
Le 13/04/2012 22:31, Trass3r a écrit : I think we've got the lexer and parser completely separate from most of the rest of the codebase (like the codegen), due to repeated requests from people who wanted to use these parts for IDEs and other tools. Still some things to learn from Clang though.

Re: D Compiler as a Library

2012-04-14 Thread deadalnix
Le 14/04/2012 12:35, Manu a écrit : On 13 April 2012 18:25, Jakob Ovrum mailto:jakobov...@gmail.com>> wrote: On Friday, 13 April 2012 at 13:08:51 UTC, deadalnix wrote: SDC have a lot of theses, and I proposed a similar stuff for its evolution. I think it is easier for SDC th

Re: Shared library in D on Linux

2012-04-14 Thread Martin Nowak
With gdc I get different errors, but it seems even more difficult to get it working. Does anyone know what is missing to get proper shared library support working on Linux? Most prerequisites are merged now but there are still some smaller things I need to do. https://github.com/dawgf

Re: std.benchmark ready for review. Manager sought after

2012-04-14 Thread Andrei Alexandrescu
(Resuming a few past discussions about std.benchmark.) On 4/9/12 1:26 PM, Manfred Nowak wrote: Andrei Alexandrescu wrote: I disagree with running two benchmarks in parallel because that exposes them to even more noise (scheduling, CPU count, current machine load etc). I did not mean to run tw

Re: Shared library in D on Linux

2012-04-14 Thread Timo Westkämper
On Saturday, 14 April 2012 at 14:48:47 UTC, Martin Nowak wrote: With gdc I get different errors, but it seems even more difficult to get it working. Does anyone know what is missing to get proper shared library support working on Linux? Most prerequisites are merged now but there are still

Re: Definitive list of storage classes

2012-04-14 Thread Daniel Murphy
"Jonathan M Davis" wrote in message news:mailman.1707.1334377994.4860.digitalmar...@puremagic.com... > I'd like to know which modifiers are considered to be storage classes. The > term > seems to be used on a lot more than actually qualifies (including using > the > term for the type qualfiers:

Re: std library hooks

2012-04-14 Thread Daniel Murphy
"Bernard Helyer" wrote in message news:dyuzdgjnjysfreewf...@forum.dlang.org... > On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote: >> [...] >> all assert(exp) does when it trips is call a function in the library. If >> you provide your own version of that function, the one in the

Re: D Compiler as a Library

2012-04-14 Thread Manu
On 14 April 2012 16:51, deadalnix wrote: > Le 14/04/2012 12:35, Manu a écrit : > >> On 13 April 2012 18:25, Jakob Ovrum > > wrote: >> >>On Friday, 13 April 2012 at 13:08:51 UTC, deadalnix wrote: >> >>SDC have a lot of theses, and I proposed a similar stuff

Re: D Compiler as a Library

2012-04-14 Thread Trass3r
Still some things to learn from Clang though. e.g. it still directly builds an AST instead of using some kind of interface. I'm very interested in what you mean here. Do you have a link or can you write an explaination ? Clang decouples the parser from AST construction by letting the parser

Re: Precise GC

2012-04-14 Thread Robert Jacques
On Sat, 14 Apr 2012 05:21:08 -0500, Manu wrote: On 13 April 2012 17:25, Kagamin wrote: once you prefetched the function, it will remain in the icache and be reused from there the next time. All depends how much you love object orientation. If you follow the C++ book and make loads of clas

Re: std.benchmark ready for review. Manager sought after

2012-04-14 Thread Andrei Alexandrescu
On 4/10/12 5:40 AM, Jens Mueller wrote: How come that the times based relative report and the percentage based relative report are mixed in one result? And how do I choose which one I'd like to see in the output. It's in the names. If the name of a benchmark starts with benchmark_relative_, th

Re: D Compiler as a Library

2012-04-14 Thread deadalnix
Le 14/04/2012 18:26, Trass3r a écrit : Still some things to learn from Clang though. e.g. it still directly builds an AST instead of using some kind of interface. I'm very interested in what you mean here. Do you have a link or can you write an explaination ? Clang decouples the parser from

Re: Precise GC

2012-04-14 Thread Antti-Ville Tuunainen
On Sunday, 8 April 2012 at 02:49:34 UTC, Andrei Alexandrescu wrote: Maybe we can get a GSoC project on that. We already have a related proposal (lock-free GC). That would be me. Just though I should wave and say hello. Are there other GSoC proposals in the GC area?

Re: Definitive list of storage classes

2012-04-14 Thread Jonathan M Davis
On Sunday, April 15, 2012 01:49:09 Daniel Murphy wrote: > "Jonathan M Davis" wrote in message > news:mailman.1707.1334377994.4860.digitalmar...@puremagic.com... > > > I'd like to know which modifiers are considered to be storage classes. The > > term > > seems to be used on a lot more than actual

Re: Provide @immutable attribute for first-class citizens and namespaces?

2012-04-14 Thread Daniel Fitzpatrick
« immutable: » can't do the trick ? Do you mean to extend the immutable keyword instead of adding an attribute, or that the immutable keyword, as is, is enough? I'm fine with the former. The latter is problematic. Think turnabout - would you enjoy having to mark all of your variables 'mut

Re: Is anyone hacking on druntime in a widespread fashion at the moment?

2012-04-14 Thread Jonathan M Davis
On Saturday, April 14, 2012 15:24:14 deadalnix wrote: > Le 11/04/2012 22:41, Jonathan M Davis a écrit : > > On Wednesday, April 11, 2012 22:01:36 deadalnix wrote: > >> Le 11/04/2012 00:10, Alex Rønne Petersen a écrit : > >>> I'm planning to go over druntime and add nothrow/pure everywhere I can, >

Re: Provide @immutable attribute for first-class citizens and namespaces?

2012-04-14 Thread Daniel Fitzpatrick
On Saturday, 14 April 2012 at 17:50:01 UTC, Daniel Fitzpatrick wrote: « immutable: » can't do the trick ? Do you mean to extend the immutable keyword instead of adding an attribute, or that the immutable keyword, as is, is enough? I'm fine with the former. The latter is problematic. Think

Re: Provide @immutable attribute for first-class citizens and namespaces?

2012-04-14 Thread Daniel Fitzpatrick
http://dlang.org/attribute.html is what I'm referencing. Okay...yes. I hadn't thought about using attributes in that way. Maybe this is a nonissue. :)

Re: std library hooks

2012-04-14 Thread Sean Kelly
On Apr 14, 2012, at 3:57 AM, Jacob Carlborg wrote: > On 2012-04-13 23:16, Sean Kelly wrote: >> On Apr 13, 2012, at 12:28 PM, Jacob Carlborg wrote: >> >>> On 2012-04-13 17:26, Sean Kelly wrote: Because no one used it. Sounds like I may need to un-deprecate it for 2.060. >>> >>> Yes,

Re: std library hooks

2012-04-14 Thread Jacob Carlborg
On 2012-04-14 20:29, Sean Kelly wrote: On Apr 14, 2012, at 3:57 AM, Jacob Carlborg wrote: On 2012-04-13 23:16, Sean Kelly wrote: On Apr 13, 2012, at 12:28 PM, Jacob Carlborg wrote: On 2012-04-13 17:26, Sean Kelly wrote: Because no one used it. Sounds like I may need to un-deprecate it fo

Re: Precise GC

2012-04-14 Thread Jacob Carlborg
On 2012-04-14 19:46, Antti-Ville Tuunainen wrote: On Sunday, 8 April 2012 at 02:49:34 UTC, Andrei Alexandrescu wrote: Maybe we can get a GSoC project on that. We already have a related proposal (lock-free GC). That would be me. Just though I should wave and say hello. Are there other GSoC pro

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 2:40 AM, Vladimir Panteleev wrote: So object files take priority over library files? Yes, because object files are NOT searched. They are incorporated. Libraries get recursively searched for unresolved symbols.

Re: Shared library in D on Linux

2012-04-14 Thread GreatEmerald
On Sunday, 8 April 2012 at 08:45:46 UTC, Timo Westkämper wrote: dmd -g -c test.d -fPIC ld -shared -o libtest.so test.o -lrt -lphobos2 -lpthread gcc -g main.c -ldl -lpthread Hmm, wouldn't using DMD directly for the first two compilation steps do the same thing, just fast

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 3:56 AM, Manu wrote: How do you define 'the' linker? Takes object files and builds an executable. Is this also how ld and link.exe works? It's how every linker I've ever used and heard of works. Keep in mind that an object file consists of blocks of BINARY data attached to s

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 3:51 AM, Manu wrote: On 14 April 2012 00:30, Walter Bright mailto:newshou...@digitalmars.com>> wrote: On 4/13/2012 6:07 AM, Manu wrote: Awesome, I missed that. Although it sucks it's deprecated, what's the intended alternative? Now if I could on

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 3:57 AM, Jacob Carlborg wrote: Can I throw anything? A catchable exception ? The compiler internally regards the assert function as "does not return". So do whatever you want in it, as long as you do not return normally from it. That means exit the program or throw something.

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 3:49 AM, Manu wrote: I have a D DLL, loaded into a C app, if D throws, C doesn't seem to be able to catch it and it just crashes without any useful messages. Maybe I'm doing it wrong? C has no exception handlers in it. C knows nothing about exceptions. I recommend that all your A

Random sampling in Phobos

2012-04-14 Thread Joseph Rushton Wakeling
Hello all, This is a follow-up to a discussion on the d-learn mailing list: http://forum.dlang.org/thread/mailman.1652.1334241994.4860.digitalmars-d-le...@puremagic.com In short, I've been implementing some random sampling algorithms in D to help teach myself how to use the language effectively

Re: std library hooks

2012-04-14 Thread Manu
On 14 April 2012 22:51, Walter Bright wrote: > On 4/14/2012 3:49 AM, Manu wrote: > >> I have a D DLL, loaded into a C app, if D throws, C doesn't seem to be >> able to >> catch it and it just crashes without any useful messages. Maybe I'm doing >> it wrong? >> > > C has no exception handlers in i

Re: std library hooks

2012-04-14 Thread Manu
On 14 April 2012 22:40, Walter Bright wrote: > On 4/14/2012 2:40 AM, Vladimir Panteleev wrote: > >> So object files take priority over library files? >> > > Yes, because object files are NOT searched. They are incorporated. > Libraries get recursively searched for unresolved symbols. > I was und

Re: Precise GC

2012-04-14 Thread Antti-Ville Tuunainen
On Saturday, 14 April 2012 at 19:17:02 UTC, Jacob Carlborg wrote: There is: http://prowiki.org/wiki4d/wiki.cgi?GSOC_2012_Ideas That's the ideas list for proposals. I was asking if anyone else applied for GSoC using one of those.

Re: D Compiler as a Library

2012-04-14 Thread Nick Sabalausky
"Jacob Carlborg" wrote in message news:jm9ulg$ui3$1...@digitalmars.com... > > * Refactoring > * Make DustMite even more awesomer by attempting to factor out functions, etc.

Re: std.benchmark ready for review. Manager sought after

2012-04-14 Thread Andrei Alexandrescu
There have been quite a few good comments, but no review manager offer. Could someone please take this role? Again, it would be great to get std.benchmark in sooner rather than later because it can be used by subsequent submissions (many of which allege efficiency as a major advantage) to show

Why is complex being deprecated again?

2012-04-14 Thread Mehrdad
Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.html

Re: Why is complex being deprecated again?

2012-04-14 Thread Caligo
On Sat, Apr 14, 2012 at 10:10 PM, Mehrdad wrote: > Why is complex being phased out? > What happened to all this? http://dlang.org/cppcomplex.html Where does it say it's being phased out?

Re: Why is complex being deprecated again?

2012-04-14 Thread Kapps
On Sunday, 15 April 2012 at 03:10:25 UTC, Mehrdad wrote: Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.html It's being replaced with a library implementation of it. I doubt it will be deprecated before the library implementation is ready.

Re: Why is complex being deprecated again?

2012-04-14 Thread Jonathan M Davis
On Saturday, April 14, 2012 22:27:19 Caligo wrote: > On Sat, Apr 14, 2012 at 10:10 PM, Mehrdad wrote: > > Why is complex being phased out? > > What happened to all this? http://dlang.org/cppcomplex.html > > Where does it say it's being phased out? It says so here: http://prowiki.org/wiki4d/wiki.

Re: Why is complex being deprecated again?

2012-04-14 Thread Jonathan M Davis
On Sunday, April 15, 2012 05:50:33 Kapps wrote: > On Sunday, 15 April 2012 at 03:10:25 UTC, Mehrdad wrote: > > Why is complex being phased out? > > What happened to all this? http://dlang.org/cppcomplex.html > > It's being replaced with a library implementation of it. I doubt > it will be deprecat

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 4:41 PM, Manu wrote: On 14 April 2012 22:51, Walter Bright mailto:newshou...@digitalmars.com>> wrote: On 4/14/2012 3:49 AM, Manu wrote: I have a D DLL, loaded into a C app, if D throws, C doesn't seem to be able to catch it and it just crashes without an

Re: std library hooks

2012-04-14 Thread Walter Bright
On 4/14/2012 4:54 PM, Manu wrote: On 14 April 2012 22:40, Walter Bright mailto:newshou...@digitalmars.com>> wrote: On 4/14/2012 2:40 AM, Vladimir Panteleev wrote: So object files take priority over library files? Yes, because object files are NOT searched. They are incorporate

Re: Why is complex being deprecated again?

2012-04-14 Thread Andrei Alexandrescu
On 4/14/12 10:54 PM, Jonathan M Davis wrote: On Saturday, April 14, 2012 22:27:19 Caligo wrote: On Sat, Apr 14, 2012 at 10:10 PM, Mehrdad wrote: Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.html Where does it say it's being phased out? It says so

Re: Why is complex being deprecated again?

2012-04-14 Thread Andrei Alexandrescu
On 4/14/12 10:10 PM, Mehrdad wrote: Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.html I don't think that page makes a compelling argument, but I'm not an expert. If Walter and Don agree, I'd remove the page. Andrei

Re: std library hooks

2012-04-14 Thread Vladimir Panteleev
On Saturday, 14 April 2012 at 19:41:22 UTC, Walter Bright wrote: On 4/14/2012 2:40 AM, Vladimir Panteleev wrote: So object files take priority over library files? Yes, because object files are NOT searched. They are incorporated. Libraries get recursively searched for unresolved symbols. R

Re: Definitive list of storage classes

2012-04-14 Thread Jakob Ovrum
On Saturday, 14 April 2012 at 17:50:39 UTC, Jonathan M Davis wrote: That's clearly not the list, since it includes const, immutable, and shared, which are type qualifiers rather than storage classes. It also has stuff like init in it, which isn't even vaguely a storage class. All of the storage

Re: std library hooks

2012-04-14 Thread Nick Sabalausky
"Walter Bright" wrote in message news:jmdhof$1v3v$1...@digitalmars.com... > On 4/14/2012 4:54 PM, Manu wrote: >> I just tried it, and I got the error I expected: >> >> LIBCMTD.lib(atox.obj) : error LNK2005: _atoi already defined in Unit.obj >> >> In C, I would always explicitly declare weak linka

Re: std library hooks

2012-04-14 Thread H. S. Teoh
On Sun, Apr 15, 2012 at 01:08:35AM -0400, Nick Sabalausky wrote: > "Walter Bright" wrote in message > news:jmdhof$1v3v$1...@digitalmars.com... > > On 4/14/2012 4:54 PM, Manu wrote: > >> I just tried it, and I got the error I expected: > >> > >> LIBCMTD.lib(atox.obj) : error LNK2005: _atoi already

Re: std library hooks

2012-04-14 Thread Nick Sabalausky
"Manu" wrote in message news:mailman.1717.1334400919.4860.digitalmar...@puremagic.com... > > Indeed, but I also want to produce some log output. A dialog box is nice > too, so artists can choose to 'ignore' and programmers can 'debug'. > I keep flip-flopping on this. At first, I was going to re

Re: std library hooks

2012-04-14 Thread H. S. Teoh
On Sat, Apr 14, 2012 at 10:26:55PM -0700, H. S. Teoh wrote: > On Sun, Apr 15, 2012 at 01:08:35AM -0400, Nick Sabalausky wrote: > > "Walter Bright" wrote in message > > news:jmdhof$1v3v$1...@digitalmars.com... > > > On 4/14/2012 4:54 PM, Manu wrote: > > >> I just tried it, and I got the error I ex

Re: std library hooks

2012-04-14 Thread Jérôme M. Berger
H. S. Teoh wrote: > I made a one-function library called mylib.a, that exports a single > function 'mylibfunc'. Then I wrote some code in aux.c that calls > 'mylibfunc', and then in main.c, I define a different version of > 'mylibfunc' along with main(). Here's the result of various orderings of >