How to debug and watch globals in windows debugger?

2023-03-26 Thread ryuukk_ via Digitalmars-d-learn
I tried to look around, what ever i try, nothing works There is a mention of "fully qualified" here: https://forum.dlang.org/post/peb1jj$tr$1...@digitalmars.com But what does that mean? I tried this: ![screenshot](https://i.imgur.com/JZooIic.pngg) But it doesn't work

Re: Step by step tutorials for using bindings in D

2023-03-26 Thread Salih Dincer via Digitalmars-d-learn
On Monday, 27 March 2023 at 00:06:36 UTC, Inkrementator wrote: PS: To really understand what is happening, you might want to try manually compiling a hello world program that depends on a library instead of using dub. Some pointers: `dub build -v` will print out the compiler and linkflags

Re: Step by step tutorials for using bindings in D

2023-03-26 Thread Inkrementator via Digitalmars-d-learn
On Sunday, 26 March 2023 at 18:49:57 UTC, eXodiquas wrote: On Sunday, 26 March 2023 at 14:09:19 UTC, Inkrementator wrote: But you said static bindings are the main portion of bindings we use. So I tried to get static Lua bindings going. Static Binding != Static Linking. Like I said, the

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread ryuukk_ via Digitalmars-d-learn
On Sunday, 26 March 2023 at 19:08:32 UTC, Steven Schveighoffer wrote: On 3/26/23 2:07 PM, ryuukk_ wrote: Hi, It's common knowledge that accessing tls global is slow http://david-grs.github.io/tls_performance_overhead_cost_linux/ What i do not understand is the reasoning behind choosing tls

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread ryuukk_ via Digitalmars-d-learn
On Sunday, 26 March 2023 at 18:25:54 UTC, Richard (Rikki) Andrew Cattermole wrote: Having TLS by default is actually quite desirable if you like your code to be safe without having to do anything extra. As soon as you go into global to the process memory, you are responsible for

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread ryuukk_ via Digitalmars-d-learn
On Sunday, 26 March 2023 at 18:29:17 UTC, Nick Treleaven wrote: On Sunday, 26 March 2023 at 18:07:03 UTC, ryuukk_ wrote: What i find even more weird is writing fast code is ugly in D Look at this ugly code ```D __gshared int fast_code_ugly; ``` Because it should be rare that __gshared is

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/26/23 2:07 PM, ryuukk_ wrote: Hi, It's common knowledge that accessing tls global is slow http://david-grs.github.io/tls_performance_overhead_cost_linux/ What i do not understand is the reasoning behind choosing tls global by default in D If you know a variable is not `shared`, then

Re: Step by step tutorials for using bindings in D

2023-03-26 Thread eXodiquas via Digitalmars-d-learn
On Sunday, 26 March 2023 at 14:09:19 UTC, Inkrementator wrote: # Practical Walkthrough Two ways to go about this: 1. Get SFML dynamic library somewhere 2. Create a project called sfmltest 3. Add BindBC-SFML dependency via dub 4. Put SFML dynamic library files into the directory where you will

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread Nick Treleaven via Digitalmars-d-learn
On Sunday, 26 March 2023 at 18:07:03 UTC, ryuukk_ wrote: What i find even more weird is writing fast code is ugly in D Look at this ugly code ```D __gshared int fast_code_ugly; ``` Because it should be rare that __gshared is used. And if you need it, you won't be worried about how the

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread ryuukk_ via Digitalmars-d-learn
With -betterC it's broken for 3 years btw: https://issues.dlang.org/show_bug.cgi?id=20737

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Having TLS by default is actually quite desirable if you like your code to be safe without having to do anything extra. As soon as you go into global to the process memory, you are responsible for synchronization. Ensuring that the state is what you want it to be. Keep in mind that threads

Re: Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread ryuukk_ via Digitalmars-d-learn
Perhaps in ``-betterC`` tls vars should be annotated with ``@tls``, and the default is not tls just like in C?

Why are globals set to tls by default? and why is fast code ugly by default?

2023-03-26 Thread ryuukk_ via Digitalmars-d-learn
Hi, It's common knowledge that accessing tls global is slow http://david-grs.github.io/tls_performance_overhead_cost_linux/ What i do not understand is the reasoning behind choosing tls global by default in D What i find even more weird is writing fast code is ugly in D Look at this ugly

Re: Calling assumeSorted on const(std.container.Array)

2023-03-26 Thread Olivier Prat via Digitalmars-d-learn
On Sunday, 26 March 2023 at 02:16:15 UTC, Steven Schveighoffer wrote: On 3/25/23 9:45 AM, Olivier Prat wrote: [...] It's because a Range keeps a copy of the array (Array is a reference counted type). Since that is labeled `const`, then editing the Range is forbidden. Inside SortedRange,

Re: Step by step tutorials for using bindings in D

2023-03-26 Thread Inkrementator via Digitalmars-d-learn
On Friday, 24 March 2023 at 23:45:15 UTC, eXodiquas wrote: Hello everyone, once again, I am here for your help. My last questions were answered really competently so I try again. :P So, maybe this is a stupid question, but I have read a lot about Bindings to C and C++ libraries for D. For