Re: Loading assimp

2021-09-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 28 September 2021 at 16:30:09 UTC, Eric_DD wrote: I am trying to use a newer version of Assimp. I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to assimp.dll When running my executable it throws a derelict.util.exception.SharedLibLoadException: "Failed to load one

Re: Rather Bizarre slow downs using Complex!float with avx (ldc).

2021-10-02 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 1 October 2021 at 08:32:14 UTC, james.p.leblanc wrote: Does anyone have insight to what is happening? Thanks, James Maybe something related to: https://gist.github.com/rygorous/32bc3ea8301dba09358fd2c64e02d774 ? AVX is not always a clear win in terms of performance. Processing

Re: How to deploy single exe application (?)

2021-12-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 1 December 2021 at 09:49:56 UTC, Guillaume Piolat wrote: Huh, I never intended for someone to actually use this :| Such a thing will never work on macOS for example. You can create an installer rather easily with InnoSetup instead.

Re: How to deploy single exe application (?)

2021-12-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 1 December 2021 at 07:45:21 UTC, bauss wrote: On Monday, 29 November 2021 at 14:58:07 UTC, Willem wrote: Thanks again for all the responses. For now -- I am simply adding the DLL to the EXE and writing it out to the working directory. Not elegant - but it does work. If

Re: Is DMD still not inlining "inline asm"?

2021-11-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 12 November 2021 at 00:46:05 UTC, Elronnd wrote: On Thursday, 11 November 2021 at 13:22:15 UTC, Basile B. wrote: As for now, I know no compiler that can do that. GCC can do it. Somewhat notoriously, LTO can lead to bugs from underspecified asm constraints following cross-TU

LLVM asm with constraints, and 2 operands

2021-07-18 Thread Guillaume Piolat via Digitalmars-d-learn
Is anyone versed in LLVM inline asm? I know how to generate SIMD unary op with: return __asm!int4("pmovsxwd $1,$0","=x,x",a); but I struggle to generate 2-operands SIMD ops like: return __asm!int4("paddd $1,$0","=x,x",a, b); If you know how to do it =>

Re: LLVM asm with constraints, and 2 operands

2021-07-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 18 July 2021 at 18:48:47 UTC, Basile B. wrote: On Sunday, 18 July 2021 at 18:47:50 UTC, Basile B. wrote: On Sunday, 18 July 2021 at 17:45:05 UTC, Guillaume Piolat wrote: On Sunday, 18 July 2021 at 16:32:46 UTC, Basile B. wrote: [...] Thanks. Indeed that seems to work even when

Re: LLVM asm with constraints, and 2 operands

2021-07-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 18 July 2021 at 16:32:46 UTC, Basile B. wrote: Yeah I can confirm it's aweful. Took me hours to understand how to use it a bit (my PL has [an interface](https://styx-lang.gitlab.io/styx/primary_expressions.html#asmexpression) for LLVM asm) You need to add a "x" to the constraint

Re: LLVM asm with constraints, and 2 operands

2021-07-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 19 July 2021 at 10:21:58 UTC, kinke wrote: What works reliably is a manual mov: OK that's what I feared. It's very easy to get that wrong. Thankfully I haven't used __asm a lot.

Re: LLVM asm with constraints, and 2 operands

2021-07-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 19 July 2021 at 16:05:57 UTC, kinke wrote: Is LDC still compatible with GDC/GCC inline asm? I remember Johan saying they will break compatibilty in the near future... I'm not aware of any of that; who'd be 'they'? GCC breaking their syntax is IMO unimaginable. LDC supporting it

Re: LLVM asm with constraints, and 2 operands

2021-07-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 19 July 2021 at 10:49:56 UTC, kinke wrote: This workaround is actually missing the clobber constraint for `%2`, which might be problematic after inlining. An unrelated other issue with asm/__asm is that it doesn't follow consistent VEX encoding compared to normal compiler output.

Re: LLVM asm with constraints, and 2 operands

2021-07-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 19 July 2021 at 17:20:21 UTC, kinke wrote: You know that asm is to be avoided whenever possible, but unfortunately, AFAIK intel-intrinsics doesn't fit the usual 'don't worry, simply compile all your code with an appropriate -mattr/-mcpu option' recommendation, as it employs

Re: Colors in Raylib

2022-02-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 28 February 2022 at 11:48:59 UTC, Salih Dincer wrote: Is there a namespace I should implement in Raylib? For example, I cannot compile without writing Colors at the beginning of the colors: ```Colors.GRAY``` When writing C bindings, you may refer to this:

Re: I like dlang but i don't like dub

2022-03-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 18 March 2022 at 04:13:36 UTC, Alain De Vos wrote: Dlang includes some good ideas. But dub pulls in so much stuff. Too much for me. I like things which are clean,lean,little,small. But when i use dub it links with so many libraries. Are they really needed ? And how do you compare to

Re: Looking for a workaround

2022-04-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 7 April 2022 at 12:56:05 UTC, MoonlightSentinel wrote: On Wednesday, 6 April 2022 at 18:10:32 UTC, Guillaume Piolat wrote: Any idea how to workaround that? I really need the same UDA in parent and child class. Use a frontend >= dmd 2.099, it works according to run.dlang.io.

Re: Looking for a workaround

2022-04-06 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 6 April 2022 at 18:21:11 UTC, Adam D Ruppe wrote: On Wednesday, 6 April 2022 at 18:10:32 UTC, Guillaume Piolat wrote: Any idea how to workaround that? Works fine if you just use the language instead of the buggy phobos wrappers: --- struct MyUDA { } class A

Looking for a workaround

2022-04-06 Thread Guillaume Piolat via Digitalmars-d-learn
This program fails to build: import std.traits: getSymbolsByUDA; struct MyUDA { } class A { @MyUDA int a; } class B : A { @MyUDA int b; } void main() { alias G = getSymbolsByUDA!(B, MyUDA); } Output:

Re: D DLL crashes if not run on the main thread

2023-09-05 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 5 September 2023 at 22:45:28 UTC, raven09 wrote: I *assume* that this has something to do with D's GC? But I tried calling GC.disable() and nothing changed. Any help or insight would be appreciated. Thanks in advance If you want to have a D DLL called from elsewhere, and don't

Re: performance issues with SIMD function

2023-11-04 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 3 November 2023 at 15:11:31 UTC, Bogdan wrote: Can anyone help me to understand what I am missing? Your loop is likely dominated by sin() calls, And the rest of the loop isn't complicated enough to outperform the compiler. What you could do is use the intrinsics to implement a

Re: Spec for the ‘locality’ parameter to the LDC and GDC builtin magic functions for accessing special CPU prefetch instructions

2023-08-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 19 August 2023 at 19:23:38 UTC, Cecil Ward wrote: I’m trying to write a cross-platform function that gives access to the CPU’s prefetch instructions such as x86 prefetch0/1/2/prefetchnta and AAarch64 too. I’ve found that the GDC and LDC compilers provide builtin magic functions

Cool pattern or tragic?

2023-08-25 Thread Guillaume Piolat via Digitalmars-d-learn
The idea is to deliberately mark @system functions that need special scrutiny to use, regardless of their memory-safety. Function that would typically be named `assumeXXX`. ```d class MyEncodedThing { Encoding encoding; /// Unsafe cast of encoding. void assumeEncoding (Encoding

Re: How to use Vector Extensions in an opBinary

2022-04-21 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 17 April 2022 at 11:16:25 UTC, HuskyNator wrote: As a small disclaimer; I don't know to what extent the compiler already automates these kind of operations, and mostly want to use this as a learning experience. For your particular case, it is very likely LDC and GDC will be able

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 17:22:54 UTC, Alexander Zhirov wrote: It is necessary to write a utility that will insert (x,y) text on the image. It is desirable that the utility does not depend on large libraries, since a minimum utility size is required. I'm looking for something similar in

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 22:16:15 UTC, rikki cattermole wrote: Of course I still don't think that code is right and should have the casts. Absolutely. I'm a bit anxious about "accidental VRP" now, not sure if the checks fluctuate from version to version, or worse, depends upon the

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 20:45:16 UTC, Alexander Zhirov wrote: On Tuesday, 26 April 2022 at 20:37:28 UTC, Guillaume Piolat wrote: Curious as to what DMD you are using on what OS? It builds with 2.095.1 to 2.100-b1 here. DMD64 D Compiler v2.098.0 OS Solus Linux Well I cannot reproduce

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 21:44:56 UTC, rikki cattermole wrote: On 27/04/2022 9:39 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit better. No success in reproducing the bug here.

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 20:26:42 UTC, Alexander Zhirov wrote: build error Curious as to what DMD you are using on what OS? It builds with 2.095.1 to 2.100-b1 here.

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit better. No success in reproducing the bug here.

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 21:59:39 UTC, rikki cattermole wrote: Putting an int into a ubyte absolutely should error, that is a lossy conversion and should not be automatic. It's just VRP, here it works in 2.094 https://d.godbolt.org/z/vjq7xsMdn because the compiler wasn't complaining I

Re: Why are structs and classes so different?

2022-05-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 15 May 2022 at 15:26:40 UTC, Kevin Bailey wrote: I'm trying to understand why it is this way. I assume that there's some benefit for designing it this way. I'm hoping that it's not simply accidental, historical or easier for the compiler writer. Perhaps someone more informed will

Re: What are (were) the most difficult parts of D?

2022-05-13 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 13 May 2022 at 19:16:59 UTC, Steven Schveighoffer wrote: But we also have this confusing dynamic: |scope |no attribute| shared |static | ||||---| |module |TLS |global |TLS (no-op)| |function|local |local! |TLS|

Re: What are (were) the most difficult parts of D?

2022-05-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 12 May 2022 at 16:24:26 UTC, Ali Çehreli wrote: Cool trick but "parent" confused me there. I think you mean "base". :) https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming mentions "base class" as much as "parent class"

Re: What are (were) the most difficult parts of D?

2022-05-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote: - Certain variant forms of the `is` Expression are not obvious (not intuitive), I'm pretty sure I still cant use them without a quick look to the specs. That one was a trouble to hear about =>

Re: What are (were) the most difficult parts of D?

2022-05-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 12 May 2022 at 17:34:30 UTC, H. S. Teoh wrote: Why is TLS by default a problem? It's not really for optimization, AIUI, it's more for thread safety: module-global state is TLS by default, so you don't accidentally introduce race conditions. What you accidentally have instead

Re: Fetching licensing info for all dependencies of a DUB project

2022-06-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 27 June 2022 at 21:36:31 UTC, Christian Köstlin wrote: I played around with the idea and came up with a small dub package, that is not (yet) uploaded to the dub registry. Source is available at https://github.com/gizmomogwai/packageinfo, feedback very welcome. I've done

Re: want to confirm: gc will not free a non-gc-allocated field of a gc-allocated object?

2022-06-06 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 6 June 2022 at 22:18:08 UTC, mw wrote: So when `obj` is cleanup by the GC, obj.data won't be freed by the GC: because the `data` is non-gc-allocated (and it's allocated on the non-gc heap), the GC scanner will just skip that field during a collection scan. Is this understanding

Re: want to confirm: gc will not free a non-gc-allocated field of a gc-allocated object?

2022-06-06 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 6 June 2022 at 22:24:45 UTC, Guillaume Piolat wrote: My understanding is that while scanning, the GC will see the data.ptr pointer, but will not scan the area it points to since it's not in a GC range (the runtime can distinguish managed pointer and other pointers). After

Re: Consuming D libraries from other languages

2022-06-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 15 June 2022 at 19:36:34 UTC, Guillaume Piolat wrote: BindBC bindings are multi-platform and can be both static and dynamic linking. My bad I understood the reverse, consuming C libraries from D. I think what you are seeking is described in the D blog.

Re: Consuming D libraries from other languages

2022-06-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 15 June 2022 at 17:37:32 UTC, Templated Person wrote: It there any resources on how to build D static (`.lib` / `.a`) and dynamic libraries (`.dll` / `.so`), and then use them from C? Do I need to link and initialize phobos somehow? What if I don't want to use the D runtime?

Re: How to map machine instctions in memory and execute them? (Aka, how to create a loader)

2022-06-06 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 6 June 2022 at 15:13:45 UTC, rempas wrote: Any ideas? See: https://github.com/GhostRain0/xbyak https://github.com/MrSmith33/vox/blob/master/source/vox/utils/mem.d

Re: What are (were) the most difficult parts of D?

2022-05-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. - How to do deterministic destruction with programs that use everything (struct / class / dynamic dispatch / GC / manual / etc). This requires to

Re: how to install the new dmd on Mac M1?

2022-08-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 25 August 2022 at 14:19:47 UTC, MichaelBi wrote: I downloaded the new dmd 2.1 on Mac, but with fail message of "unsupported Arch arm64". how can I do? thanks. ## Step 1 Get LDC here: https://github.com/ldc-developers/ldc/releases - If you are running on Apple Silicon, be sure

Is it possible? branching on debug info

2022-10-16 Thread Guillaume Piolat via Digitalmars-d-learn
I'd like to have: version (D_DebugInfo) {} else { version = enableFeatureThatIsAnnoyingWhenDebugging; } Is there a way to know if debug info is being emitted when compiling? "debug is not cutting it because sometimes you really need to

Re: parallel is slower than serial

2022-10-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 18 October 2022 at 11:56:30 UTC, Yura wrote: What I am doing wrong? The size of your task are way too small. To win something with OS threads, you must think of tasks that takes on the order of milliseconds rather than less than 0.1ms. Else you will just pay extra in

Re: How do I correctly install packages for use with Visual Studio?

2022-10-17 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 16 October 2022 at 11:09:31 UTC, Decabytes wrote: I'm trying to set up Visual Studio 2022 with Visual D, and I'm running into issues trying to get my project to build correctly. Some recommendation to use Visual Studio: - tutorial for installation here:

Re: Idiomatic D using GC as a library writer

2022-12-05 Thread Guillaume Piolat via Digitalmars-d-learn
There are legitimate uses cases when you can't afford the runtime machinery (attach/detach every incoming thread in a shared library), more than not being able to afford the GC from a performance point of view. GC gives you higher productivity and better performance with the time gained.

Re: Idiomatic D using GC as a library writer

2022-12-05 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 4 December 2022 at 21:55:52 UTC, Siarhei Siamashka wrote: Is it possible to filter packages in this list by @nogc or @safe compatibility? You can list DUB packages for "@nogc usage" https://code.dlang.org/?sort=score=20=library.nogc

Re: Which TOML package, or SDLang?

2023-01-30 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 30 January 2023 at 06:38:46 UTC, Daren Scot Wilson wrote: I just realized - it's been ages since I've dealt with config files, beyond editing them as an end user. I work on existing software where someone else made the choiced and wrote the code, or it's a small specialized project

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 4 November 2022 at 19:53:01 UTC, Adam D Ruppe wrote: This isn't that hard; in the old days you'd have `pkg.foo` then `import pkg.all` instead of `import pkg;`. It was worse, you would do import mylib.all; and now it's just: import mylib; Also the "all" concept is bad, it

Re: Makefiles and dub

2022-11-05 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 5 November 2022 at 12:17:14 UTC, rikki cattermole wrote: But yes, it has two others (although idk how much they get used, or how complete). Using the first two all the time. IIRC VisualD projects respect --combined

Re: Can nice D code get a bit slow?

2023-03-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 8 March 2023 at 10:49:32 UTC, Markus wrote: Uh, hope you understand my vague question, sorry about that. I found D to be the right place because it's not missing any essential feature I know of. Well, bounds check often cost a few percent, and you can disable it or use .ptr

Re: better video rendering in d

2023-03-24 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 21 March 2023 at 16:57:49 UTC, monkyyy wrote: My current method of making videos of using raylib to generate screenshots, throwing those screenshots into a folder and calling a magic ffmpeg command is ... slow. Does anyone have a demo or a project that does something smarter (or

Re: better video rendering in d

2023-03-24 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 24 March 2023 at 15:41:36 UTC, Guillaume Piolat wrote: Hi, The idea to pipe stdout to ffmpeg is sound. In the following dead repo: https://github.com/p0nce/y4m-tools you will find a tool that capture a shader, format it into Y4M and output on stdout. Y4M output is useful because

Re: Debugging memory leaks

2023-02-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 18:21:34 UTC, Hipreme wrote: I want to know if there is some way to debug memory leaks in runtime. I have been dealing with that by using a profiler and checking D runtime function calls. Usually those which allocates has high cpu usage so it can be easy for

Big struct/class and T.init

2023-02-19 Thread Guillaume Piolat via Digitalmars-d-learn
If my understanding is correct, the mere fact of having a: struct S { char[16384] array; } And then using it anywhere, will necessarily lead to a S.init being created and linked, leading to a binary size inflation of 16kb. This is not a super high concern, but can inform

Re: Big struct/class and T.init

2023-02-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 19 February 2023 at 18:29:05 UTC, Steven Schveighoffer wrote: On 2/19/23 1:26 PM, Steven Schveighoffer wrote: Testing with run.dlang.io, switching between `char` and `int` changes the ASM output to show whether it's stored or not. And BTW, you can override this by assigning a zero

Re: compile x64 .dll and .so without dependencies

2023-03-05 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 5 March 2023 at 06:36:05 UTC, novice2 wrote: It there any recipe to compile x64 .dll without dependencies? I mean it shoud be used without installing things like msvcr120.dll. Dependencies on system dll (advapi32.dll, kerner32.dll) is ok. I don't experiment on linux yet. But

Re: Memory leak issue between extern (c) and D function

2023-04-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 14 April 2023 at 11:15:59 UTC, Guillaume Piolat wrote: OP could add another extern(C) D function to free the allocated object. Or another extern(C) D function to call GC.addRoot Or simpler, add that object to a list of object in D DLL __gshared list, then clear the list (or set

Re: Memory leak issue between extern (c) and D function

2023-04-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 14 April 2023 at 04:43:39 UTC, Paul Backus wrote: If you want the GC to clean up your memory, use `new` to allocate it instead of `malloc`. Like this: ```d mystruct* getmystruct() { return new mystruct; } ``` That won't work because the C++ programm calling the D dynlib

Re: A Programmer's Dilema: juggling with C, BetterC, D, Macros and Cross Compiling, etc.

2023-04-30 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 30 April 2023 at 17:51:15 UTC, Eric P626 wrote: So what language do you recommend: * Keep everything in plain C * Use C patched with macros to gain some language features like Foreach * Use BetterC for everything * Use D for the games, and better C or C for the libraries(To keep

Re: Memory leak issue between extern (c) and D function

2023-04-16 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 14 April 2023 at 17:31:02 UTC, backtrack wrote: however the memory is not releasing. With the D GC, your object can have three state: - reachable by GC. If D code can see the reference, then it's "alive", kept alive by GC scanning. The GC finds the reference and doesn't touch

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

2023-04-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 1 April 2023 at 08:47:54 UTC, IGotD- wrote: TLS by default is mistake in my opinion and it doesn't really help. TLS should be discouraged as much as possible as it is complicated and slows down thread creation. It looks like a mistake if we consider none of the D-inspired

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

2023-04-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 31 March 2023 at 19:43:42 UTC, bachmeier wrote: Those of us that have been scarred by reading FORTRAN 77 code would disagree. I use global mutables myself (and even the occasional goto), but if anything, it should be `__GLOBAL_MUTABLE_VARIABLE` to increase the pain of using them.

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

2023-03-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 26 March 2023 at 18:07:03 UTC, ryuukk_ wrote: Even C does it better: https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html Honestly I find TLS-by-default to be a bad idea, it has become a trap to be avoided, and TLS does occasionally speed up things but it should be opt-in.

Re: What do you think about using Chat GPT to create functions in D?

2023-04-04 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 3 April 2023 at 23:38:52 UTC, Marcone wrote: What do you think about using Chat GPT to create functions in D? Well you can use GitHub Copilot in VSCode, and it is kind of interesting but at the current time seems like a distracting waste of time. It will probably get more useful

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-09 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 8 February 2023 at 12:10:59 UTC, zjh wrote: On Wednesday, 8 February 2023 at 12:07:35 UTC, zjh wrote: they are always unwilling to add facilities useful to others, `D`'s community is small, this is the reason! yeah right let's implement everything that people propose

Re: ImportC "no include path set"

2023-02-09 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 8 February 2023 at 14:08:47 UTC, bachmeier wrote: this looks like one of those "death by paper cut" things. It has the smell of a rough edge that needs fixing. It's the one reason I haven't even tried ImportC. I still wonder why I need to provide those headers while for linking

Re: Best way to use C library

2023-05-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 19 May 2023 at 18:31:45 UTC, Maximilian Naderer wrote: Hello guys, So what’s currently the best way to use a big C library? Let’s assume something like cglm assimp glfw - Some big libraries are translated, for example https://code.dlang.org/packages/glfw-d was created with both

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 24 July 2023 at 09:20:05 UTC, BoQsc wrote: There are three compilers present in the Dlang website: DMD GDC and LDC DMD can build much faster than LDC. In some cases it is quite extreme, for example the product I work on has a 3.6x faster debug build time with DMD (well, only with

Re: Is it possible to make an Linux Executable Binary using a Windows Operating System? [compiling and linking]

2023-07-25 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 24 July 2023 at 11:57:11 UTC, 4 wrote: Could someone share a step by step way to compile and link a x86-64 Linux Binary using Windows 10? (Without virtual machine or "Linux Subsystem for Windows") I want to compile and link a Hello World program for both Linux and Windows.

Re: Running LDC on a recent MacOS

2023-06-17 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 16 June 2023 at 15:56:30 UTC, Dmitry Olshansky wrote: So I've got my hands on one of 'em MacPros. Great machine, nice build quality. Next order of business is to run D on the box, so I've downloaded universal binaries off ldc's release page. When I try to run any of the binaries

Re: SIMD c = a op b

2023-06-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 18 June 2023 at 05:01:16 UTC, Cecil Ward wrote: On Sunday, 18 June 2023 at 04:54:08 UTC, Cecil Ward wrote: Is it true that this doesn’t always work (in either branch)? float4 a,b; static if (__traits(compiles, a/b)) c = a / b; else c[] = a[] / b[]; It's because SIMD stuff

Re: std.experimental.allocator

2023-08-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 13 August 2023 at 16:10:32 UTC, ryuukk_ wrote: Core API should subscribe to the premise: give memory allocation control (and therefore dealocation) back to the user I'm not sure about why RAII is an issue, but I fully agree with your stance about a simpler allocator, and one we

Re: macOS Sonoma Linker Issue

2023-12-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 21 December 2023 at 23:25:55 UTC, Renato wrote: ld: symbol(s) not found for architecture x86_64 Make sure you're using the "osx-universal" package in order to have both arch. https://github.com/ldc-developers/ldc/releases/tag/v1.35.0 That said, for consumer software it may be a

Re: macOS Sonoma Linker Issue

2023-12-21 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 21 December 2023 at 18:06:51 UTC, Renato wrote: Unless silly is completely broken, it seems like this is a linker issue again. Hello, why not use ldc instead of dmd for macOS? sudo ln -f -s /path/to/ldc/compiler/bin/ldc2 /usr/local/bin/ldc2 sudo ln -f -s

Re: What parser generator can let me run arbitrary code in its match rules?

2023-11-20 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 20 November 2023 at 23:56:36 UTC, Dmitry Ponyatov wrote: Or maybe someone advice me some set of books deeply targets for learning of binary and symmetric parsing (such as binpac), DCG in C or using generators in D, etc to let me write my own lib. 'Crafting Interpreters' book

<    1   2   3