LDC -noruntime

2012-07-05 Thread BLM768
I've been trying to write an OS kernel in D, and I'm having issues with the runtime. I'm trying to use LDC's -noruntime option, which is _supposed_ to prevent any runtime calls from being generated, but the linker keeps complaining about unresolved references to _d_assert_msg and other runtime

Re: Parser generator?

2012-07-05 Thread Philippe Sigaud
> > Yeah. It's pretty cool. It really shows up D's metaprogramming > > capabilities. > > It's a bit hell to debug it, though. But I finally managed to get a > working parser out of it. I received your suggestion of a full debug mode explaining what rules where activated and wich did not. > > Exce

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Timon Gehr
On 07/06/2012 03:40 AM, Wouter Verhelst wrote: Timon Gehr writes: On 07/06/2012 02:57 AM, Wouter Verhelst wrote: To be fair, there are a _few_ areas in which zero-terminated strings may possibly outperform zero-terminated strings (appending data in the case where you know the memory block is

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Jonathan M Davis
On Thursday, July 05, 2012 19:59:26 Wouter Verhelst wrote: > Well, really, strings in C are just a special case of arrays (as is true > in D as well), and arrays in C are just a special case of pointers > (which isn't true in D). That means the language is fairly compact, > which also means the com

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Wouter Verhelst
Jonathan M Davis writes: > On Thursday, July 05, 2012 18:57:05 Wouter Verhelst wrote: >> To be fair, there are a _few_ areas in which zero-terminated strings may >> possibly outperform zero-terminated strings (appending data in the case >> where you know the memory block is large enough, for inst

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Wouter Verhelst
Timon Gehr writes: > On 07/06/2012 02:57 AM, Wouter Verhelst wrote: >> To be fair, there are a _few_ areas in which zero-terminated strings may >> possibly outperform zero-terminated strings (appending data in the case >> where you know the memory block is large enough, for instance). > > It is i

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Jonathan M Davis
On Thursday, July 05, 2012 18:57:05 Wouter Verhelst wrote: > Jonathan M Davis writes: > > On Thursday, July 05, 2012 21:32:11 dcoder wrote: > >> Thanks for the thorough explanation, but it begs the question why > >> not make strings be array of chars that have \0 at the end of it? > >> > >> Sin

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Timon Gehr
On 07/06/2012 02:57 AM, Wouter Verhelst wrote: Jonathan M Davis writes: On Thursday, July 05, 2012 21:32:11 dcoder wrote: Thanks for the thorough explanation, but it begs the question why not make strings be array of chars that have \0 at the end of it? Since, lots of D programmers were/ar

Re: How to learn the D standard library?

2012-07-05 Thread Mike Parker
On Thursday, 5 July 2012 at 23:55:09 UTC, David Piepgrass wrote: Now that I'm done reading the D Programming Language book, I'm wondering what's the quickest way to become acquainted with Phobos? P.S. is it possible to sign up to receive emails/digests for updates on the forums here? This i

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Wouter Verhelst
Jonathan M Davis writes: > On Thursday, July 05, 2012 21:32:11 dcoder wrote: >> Thanks for the thorough explanation, but it begs the question why >> not make strings be array of chars that have \0 at the end of it? >> Since, lots of D programmers were/are probably C/C++ >> programmers, why shou

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Jonathan M Davis
On Thursday, July 05, 2012 21:32:11 dcoder wrote: > Thanks for the thorough explanation, but it begs the question why > not make strings be array of chars that have \0 at the end of it? > Since, lots of D programmers were/are probably C/C++ > programmers, why should D be different here? Wouldn't

Re: Winamp plugin

2012-07-05 Thread dnewbie
It works without error when compiled by GDC. Thanks.

Re: How to learn the D standard library?

2012-07-05 Thread H. S. Teoh
On Fri, Jul 06, 2012 at 01:55:08AM +0200, David Piepgrass wrote: > Now that I'm done reading the D Programming Language book, I'm > wondering what's the quickest way to become acquainted with Phobos? [...] http://dlang.org/phobos/index.html T -- Food and laptops don't mix.

Re: Parser generator?

2012-07-05 Thread Wouter Verhelst
Jonathan M Davis writes: > On Wednesday, July 04, 2012 15:32:16 Wouter Verhelst wrote: >> Jonathan M Davis writes: >> > On Wednesday, July 04, 2012 14:53:02 Wouter Verhelst wrote: >> >> Hi folks, >> >> >> >> Does someone know of a parser generator for D? >> >> >> >> If it doesn't exist, I can

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread Timon Gehr
On 07/05/2012 09:32 PM, dcoder wrote: Thanks for the thorough explanation, but it begs the question why not make strings be array of chars that have \0 at the end of it? Because that is inefficient. It disables string slicing and is completely redundant. BTW: String literals are guaranteed

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread dcoder
On Saturday, 30 June 2012 at 00:27:46 UTC, Jonathan M Davis wrote: On Saturday, June 30, 2012 02:12:22 mta`chrono wrote: does anyone know why string not implicit convertable to const(char*) ? --- import core.sys.posix.unistd; void main() { // ok unlink("foo.txt");

Re: Interfaces with structs...?

2012-07-05 Thread Adam D. Ruppe
On Thursday, 5 July 2012 at 18:36:06 UTC, Dmitry Olshansky wrote: And it adds another way to reuse static, thus Walter must love the idea *LOL* We can never have too much static! (and it actually does fit here...)

Re: Interfaces with structs...?

2012-07-05 Thread Era Scarecrow
On Thursday, 5 July 2012 at 18:30:51 UTC, Jonathan M Davis wrote: Aside from the problem that it looks like inheritance when it's not, declaring an interface for a struct would actually be too restrictive in many cases. If it were defined with an interface, how would you deal with the fact

Re: Interfaces with structs...?

2012-07-05 Thread Dmitry Olshansky
On 05-Jul-12 22:23, Adam D. Ruppe wrote: I just had a wild idea... struct A : static Interface {} the static means it checks for the functions but doesn't do any runtime polymorphism. Hm... sounds not bad. And it adds another way to reuse static, thus Walter must love the idea *LOL* -- Dmit

Re: Winamp plugin

2012-07-05 Thread Denis Shelomovskij
05.07.2012 18:13, dnewbie пишет: On Thursday, 5 July 2012 at 08:55:33 UTC, Denis Shelomovskij wrote: What's your OS? If Windows XP, than D DLL can't be unloaded because of non-perfect TLS fixing technique (I created a "perfect" one but I never managed to prepare such projects for release so nob

Re: Interfaces with structs...?

2012-07-05 Thread Jonathan M Davis
On Thursday, July 05, 2012 20:17:24 Era Scarecrow wrote: > Something that was coming to mind a while back was that classes > can include interfaces while structs cannot. I can understand > easily why this wouldn't work being much lower level compared to > how classes are (And the vast varying of

Re: Interfaces with structs...?

2012-07-05 Thread Adam D. Ruppe
I just had a wild idea... struct A : static Interface {} the static means it checks for the functions but doesn't do any runtime polymorphism.

Interfaces with structs...?

2012-07-05 Thread Era Scarecrow
Something that was coming to mind a while back was that classes can include interfaces while structs cannot. I can understand easily why this wouldn't work being much lower level compared to how classes are (And the vast varying of parameters and return types). But could the notation be all

Re: Winamp plugin

2012-07-05 Thread dnewbie
On Thursday, 5 July 2012 at 08:55:33 UTC, Denis Shelomovskij wrote: What's your OS? If Windows XP, than D DLL can't be unloaded because of non-perfect TLS fixing technique (I created a "perfect" one but I never managed to prepare such projects for release so nobody knows about them). And on

Re: Winamp plugin

2012-07-05 Thread Denis Shelomovskij
05.07.2012 8:37, dnewbie пишет: I'm writing a Winamp plugin in D. Winamp loads my plugin and everything is fine until I close Winamp. At this point, Winamp calls the Quit() function of my plugin and *after* that, Winamp crashes. Here is the code. D source http://dpaste.dzfl.pl/e2b2f886 myplug