Re: core.stdc and betterC

2018-04-29 Thread Patrick Schluter via Digitalmars-d
On Sunday, 29 April 2018 at 15:40:20 UTC, Jacob Carlborg wrote: On 2018-04-29 16:42, dd886k wrote: [...] Looks like "putchar" is inlined [1]. That means the "putchar" you're referencing is not the one in the C standard library but it's implemented in druntime. That means you need to link wit

Re: Is there some fast and @nogc capable binary search tree for D?

2018-04-29 Thread solidstate1991 via Digitalmars-d
On Monday, 30 April 2018 at 02:43:44 UTC, 12345swordy wrote: If the data involved classes then the answer is no, as there is a bug regarding destroy as it involved external finalized c function. I'm writing a DIP draft that address this. I think I can get around that by storing the data in d

Re: Is there some fast and @nogc capable binary search tree for D?

2018-04-29 Thread Neia Neutuladh via Digitalmars-d
On Monday, 30 April 2018 at 02:21:37 UTC, solidstate1991 wrote: Some components of my game engine would benefit from lookup trees. I tried to port one from Go, but either I messed up something bit that certain parts of the codes just won't execute for some reason, or the algorithm was poorly d

Re: Is there some fast and @nogc capable binary search tree for D?

2018-04-29 Thread 12345swordy via Digitalmars-d
On Monday, 30 April 2018 at 02:21:37 UTC, solidstate1991 wrote: Some components of my game engine would benefit from lookup trees. I tried to port one from Go, but either I messed up something bit that certain parts of the codes just won't execute for some reason, or the algorithm was poorly d

Is there some fast and @nogc capable binary search tree for D?

2018-04-29 Thread solidstate1991 via Digitalmars-d
Some components of my game engine would benefit from lookup trees. I tried to port one from Go, but either I messed up something bit that certain parts of the codes just won't execute for some reason, or the algorithm was poorly documented, and it will only optimize on one end of the binary sea

Re: Whats wrong with the forum.dlang.org???

2018-04-29 Thread notna via Digitalmars-d
On Sunday, 29 April 2018 at 14:13:01 UTC, Vladimir Panteleev wrote: On Sunday, 29 April 2018 at 13:14:35 UTC, Steven Schveighoffer wrote: In the newsgroups, there was a post in March on "ost to pst convertes", which looks like it could have been flagged with spam (it no longer appears on the fo

Re: core.stdc and betterC

2018-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2018 8:40 AM, Jacob Carlborg wrote: Looks like "putchar" is inlined [1]. That means the "putchar" you're referencing is not the one in the C standard library but it's implemented in druntime. That means you need to link with druntime/phobos, it's not enough to link with the C standard lib

Re: core.stdc and betterC

2018-04-29 Thread Kagamin via Digitalmars-d
On Sunday, 29 April 2018 at 15:40:20 UTC, Jacob Carlborg wrote: I don't know why it was done this way. Perhaps it's just a macro on some platforms. At least ms, glibc and freebsd provide it as a function.

Re: core.stdc and betterC

2018-04-29 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 29 April 2018 at 15:52:11 UTC, dd86k wrote: It's all fine now. I'll type away my own bindings in a separate source file (stdc.d). You can also just do it in the usage module, for the individual functions you need. I do this a lot for various C libraries (and used to for the Win32 f

Re: core.stdc and betterC

2018-04-29 Thread dd86k via Digitalmars-d
On Sunday, 29 April 2018 at 15:14:25 UTC, rikki cattermole wrote: This issue has nothing to do with -betterC or extern(D). You can get this same issue without it added if you don't link against phobos/druntime. Oh heh I think you're right. It is only an issue when linking and by default it do

Re: core.stdc and betterC

2018-04-29 Thread dd86k via Digitalmars-d
On Sunday, 29 April 2018 at 15:40:20 UTC, Jacob Carlborg wrote: I don't know why it was done this way. Perhaps it's just a macro on some platforms. I think it's to better integrate with normal D code (thread safety, which explains the stdin is tagged with shared (TLS)). It's all fine now.

Re: core.stdc and betterC

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-29 16:42, dd886k wrote: Hello! This is my first time posting, so do feel free to correct me and this post. I started writing in D around Q2 2017 and recently been re-writing some of my projects as betterC (entirely!). I noticed something weird. It started with DMD 2.074.0 and it's

Re: core.stdc and betterC

2018-04-29 Thread rikki cattermole via Digitalmars-d
On 30/04/2018 3:05 AM, dd86k wrote: On Sunday, 29 April 2018 at 14:55:06 UTC, rikki cattermole wrote: I just checked, extern(D) isn't at fault. You actually do want name mangling for wrapper functions like that. Re-externing what I need as C is wasted productivity, IMO. Did you only -I the fi

Re: core.stdc and betterC

2018-04-29 Thread dd86k via Digitalmars-d
On Sunday, 29 April 2018 at 14:55:06 UTC, rikki cattermole wrote: I just checked, extern(D) isn't at fault. You actually do want name mangling for wrapper functions like that. Re-externing what I need as C is wasted productivity, IMO. Did you only -I the file? If you compile it in normally, it

Re: core.stdc and betterC

2018-04-29 Thread rikki cattermole via Digitalmars-d
On 30/04/2018 2:42 AM, dd886k wrote: Hello! This is my first time posting, so do feel free to correct me and this post. I started writing in D around Q2 2017 and recently been re-writing some of my projects as betterC (entirely!). I noticed something weird. It started with DMD 2.074.0 and it

Re: core.stdc and betterC

2018-04-29 Thread dd86k via Digitalmars-d
On Sunday, 29 April 2018 at 14:42:39 UTC, dd886k wrote: Hello! Embarrassingly enough, I just noticed I made a typo to my usual username.

core.stdc and betterC

2018-04-29 Thread dd886k via Digitalmars-d
Hello! This is my first time posting, so do feel free to correct me and this post. I started writing in D around Q2 2017 and recently been re-writing some of my projects as betterC (entirely!). I noticed something weird. It started with DMD 2.074.0 and it's still an issue for me in DMD 2.0

Re: Whats wrong with the forum.dlang.org???

2018-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Sunday, 29 April 2018 at 13:14:35 UTC, Steven Schveighoffer wrote: In the newsgroups, there was a post in March on "ost to pst convertes", which looks like it could have been flagged with spam (it no longer appears on the forum), with two "ad-like" responses, and a third is from notna, which

Re: Favorite GUI library?

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-28 19:39, User wrote: Dwt is nice, but no glade like gui editor.  when using dwt, I build gui manually. You might be able to use WindowBuilder [1] and port the Java code to D. [1] https://www.eclipse.org/windowbuilder/ -- /Jacob Carlborg

Re: What stops DMD from cross-compiling?

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-28 12:02, Vladimir Panteleev wrote: Probably the closest thing to cross-platform building would be through LDC, as LLVM already includes everything for C cross compilation. Except for a C standard library. -- /Jacob Carlborg

Re: What stops DMD from cross-compiling?

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-28 10:49, Rel wrote: Something like memcpy and similar stuff is easy to implement. If we are talking about Linux stuff like open, malloc and etc can be implemented either by using syscalls or by generating the binding to the libc.so of some minimal version that we decide to support (l

Re: Whats wrong with the forum.dlang.org???

2018-04-29 Thread Steven Schveighoffer via Digitalmars-d
On 4/29/18 8:58 AM, Vladimir Panteleev wrote: On Sunday, 29 April 2018 at 10:45:56 UTC, notna wrote: Hi folks. I'm wondering... is no one else using it or did I miss that someone already raised the same question... Since days I get a """ 403(Forbidden) You have tried to access a restricted

Re: Whats wrong with the forum.dlang.org???

2018-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Sunday, 29 April 2018 at 10:45:56 UTC, notna wrote: Hi folks. I'm wondering... is no one else using it or did I miss that someone already raised the same question... Since days I get a """ 403(Forbidden) You have tried to access a restricted or unavailable resource, or attempted to circ

Whats wrong with the forum.dlang.org???

2018-04-29 Thread notna via Digitalmars-d
Hi folks. I'm wondering... is no one else using it or did I miss that someone already raised the same question... Since days I get a """ 403(Forbidden) You have tried to access a restricted or unavailable resource, or attempted to circumvent server security. Error details: You're banned!