Re: @nogc and Phobos

2023-04-12 Thread rempas via Digitalmars-d-learn
On Tuesday, 14 March 2023 at 20:40:39 UTC, bomat wrote: Sounds intriguing. Anything I can look at yet? Or still all top secret? :) Oh, amazing! I let you on waiting for almost a month and I wouldn't had see it if I didn't came to post another question. I'm so so sorry for the waiting,

Re: @nogc and Phobos

2023-03-14 Thread bomat via Digitalmars-d-learn
On Saturday, 11 March 2023 at 22:14:36 UTC, rempas wrote: The `foreach` will cover your needs like you said but ironically enough, I like and use the original `for` loop. Thanks for your reply as well, rempas... I guess I covered most things in my earlier reply, but on the `for` loop: Coming

Re: @nogc and Phobos

2023-03-14 Thread bomat via Digitalmars-d-learn
Thanks a lot for taking the time and replying in that much detail! On Saturday, 11 March 2023 at 21:07:18 UTC, H. S. Teoh wrote: I also came from a C/C++ background. The GC turned me off D for a long time, until one day I decided to just give it a try to see if it was all as bad as people

Re: @nogc and Phobos

2023-03-11 Thread rempas via Digitalmars-d-learn
On Saturday, 11 March 2023 at 16:21:40 UTC, bomat wrote: first: I didn't want to sound aggressive or like I was trying to bash D, sorry if it came across like that. Oh don't worry! People have openly criticized (and still doing) the language before. It's nothing to worry, criticism help us

Re: @nogc and Phobos

2023-03-11 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Mar 11, 2023 at 04:21:40PM +, bomat via Digitalmars-d-learn wrote: [...] > Although I come from a C++ background, I'm not exactly a fanboy of > that language (you can probably tell, otherwise I wouldn't be here). > But after hearing praise for D for being a cleaner and better version >

Re: @nogc and Phobos

2023-03-11 Thread bomat via Digitalmars-d-learn
On Saturday, 11 March 2023 at 13:18:13 UTC, rempas wrote: Even if the first was the case (which again, only things that need the GC will not be able to be used), D is far from been "useless". You can use `betterC` and use C's libraries. Personally, that's what I'm doing anyway. Even if there

Re: @nogc and Phobos

2023-03-11 Thread bomat via Digitalmars-d-learn
Thanks for the responses everyone, that was all very helpful and got me on the right track. Especially this: On Saturday, 11 March 2023 at 14:41:01 UTC, Steven Schveighoffer wrote: I think it is an error to mark a library which centers on callbacks with always being @nogc. You can work around

Re: @nogc and Phobos

2023-03-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/11/23 7:04 AM, bomat wrote: Hi all, I am a C++ programmer in my "day job" and was playing around with D to maybe use it in a personal project. I'm using Dear ImGui for the graphical user interface, for which I use this port: https://github.com/KytoDragon/imgui/ It works fairly well

Re: @nogc and Phobos

2023-03-11 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 11 March 2023 at 12:04:25 UTC, bomat wrote: So my question is: Is Phobos essentially incompatible to `@nogc`? Or is there a trick for mixing GC code with non-GC code that I don't know? I'm assuming the second, for if the first was true I'd say that D would be pretty much

Re: @nogc and Phobos

2023-03-11 Thread rempas via Digitalmars-d-learn
On Saturday, 11 March 2023 at 12:04:25 UTC, bomat wrote: Hello! First of all, let's start by making clear of what `@nogc` means. It it an attribute that is used one function signatures and it annotates that the garbage collector will not be used inside this function. However, in the scenario

@nogc and Phobos

2023-03-11 Thread bomat via Digitalmars-d-learn
Hi all, I am a C++ programmer in my "day job" and was playing around with D to maybe use it in a personal project. I'm using Dear ImGui for the graphical user interface, for which I use this port: https://github.com/KytoDragon/imgui/ It works fairly well so far, just one problem: Dear