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

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: 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: Two major problems with dub

2021-08-04 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 3 August 2021 at 00:54:56 UTC, Steven Schveighoffer wrote: Given the way D works, and often template-heavy coding styles, I think it's going to be hard to do this correctly, without careful attention and lots of `version(has_xxx)` conditionals. -Steve I don't think optional

Re: Registering-unregistering threads

2021-08-02 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 30 July 2021 at 23:48:41 UTC, solidstate1991 wrote: Info on it is quite scarce and a bit confusing. If I unregister from the RT, will that mean it'll be GC independent, or will have other consequences too? The consequence is that the stack memory of that thread isn't traced, so

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: 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 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: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-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

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: Trivial simple OpenGl working example

2021-07-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 8 July 2021 at 14:09:30 UTC, drug wrote: 08.07.2021 16:51, Виталий Фадеев пишет: Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL, GLFW, Derelict, etc. Can you help me ?

Re: How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

2021-05-24 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 24 May 2021 at 17:39:38 UTC, Gavin Ray wrote: On Sunday, 23 May 2021 at 21:08:06 UTC, Ola Fosheim Grostad wrote: On Sunday, 23 May 2021 at 21:02:31 UTC, Gavin Ray wrote: I don't really know anything at all about compilers or low-level code -- but is there any high-level notion of

Re: DUB doesn't seem to respect my config, am I doing something wrong?

2021-05-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 22 May 2021 at 20:28:56 UTC, rempas wrote: I'm compiling using `dub --config=development` and I'm getting the following line: `Performing "debug" build using /usr/bin/dmd for x86_64`. The same exactly happens when I'm trying to do the release config. If I disable the

Re: running a d compiler on the Mac Mini with an M1 chip

2021-03-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 26 March 2021 at 22:41:08 UTC, dan wrote: On Friday, 26 March 2021 at 21:54:20 UTC, rikki cattermole wrote: On 27/03/2021 10:51 AM, dan wrote: Are there any d compilers that run natively on the Mac Mini with an M1 chip? If so, does anybody here have any experience with them that

Re: How to delete dynamic array ?

2021-03-17 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 17 March 2021 at 10:54:10 UTC, jmh530 wrote: This is one of those things that is not explained well enough. Yes. I made this article to clear up that point: https://p0nce.github.io/d-idioms/#Slices-.capacity,-the-mysterious-property "That a slice own or not its memory is

Re: Is it possible to suppress standard lib and dlang symbols in dylib (macos)

2021-03-17 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 14 March 2021 at 11:33:00 UTC, David wrote: Anyone else done this? Pointers welcome. Sorry for delay. Just add "dflags-osx-ldc": ["-static"],

Re: Is it possible to suppress standard lib and dlang symbols in dylib (macos)

2021-03-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 11 March 2021 at 08:34:48 UTC, David wrote: I thought it would be fun to convert some old C++/C quant utils to D. I'm starting with a simple library that I call from vba in Excel on macos: module xlutils; import core.stdc.string : strlen, strcpy; //import std.conv : to;

Re: Can't I allocate at descontructor?

2021-03-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 5 March 2021 at 20:28:58 UTC, Ali Çehreli wrote: To my surprise, even though 'c' is not null below, the destructor is not executed multiple times. Hence why https://p0nce.github.io/d-idioms/#GC-proof-resource-class works as a detector of undeterminism.

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 6 March 2021 at 16:09:03 UTC, Imperatorn wrote: On Saturday, 6 March 2021 at 15:40:56 UTC, Rumbu wrote: On Saturday, 6 March 2021 at 12:15:43 UTC, Mike Parker wrote: [...] Where exactly is documented the extern(D) x86-64 calling convention? Because currently seems like a mess

Re: DMD support for Apples new silicon

2021-03-02 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 2 March 2021 at 08:01:41 UTC, tastyminerals wrote: On Sunday, 10 January 2021 at 14:50:44 UTC, Guillaume Piolat wrote: On Sunday, 10 January 2021 at 14:22:25 UTC, Christian Köstlin wrote: [...] Hello Christian, [...] I see that there is a ldc2-1.25.1-osx-arm64.tar.xz already

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-02-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 25 February 2021 at 14:28:40 UTC, Guillaume Piolat wrote: On Thursday, 25 February 2021 at 11:28:14 UTC, z wrote: How does one optimize code to make full use of the CPU's SIMD capabilities? Is there any way to guarantee that "packed" versions of SIMD instructions will be

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-02-25 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 25 February 2021 at 11:28:14 UTC, z wrote: How does one optimize code to make full use of the CPU's SIMD capabilities? Is there any way to guarantee that "packed" versions of SIMD instructions will be used?(e.g. vmulps, vsqrtps, etc...)

Re: Profiling

2021-02-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: Thanks for the suggestions. However, I would prefer not to spend time trying to debug d-profile-viewer at the moment. As a follow up question I would like to know what tool people use to profile d programs? Here is what I use for

Re: D meets GPU: recommendations?

2021-01-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 29 January 2021 at 16:34:25 UTC, Bruce Carneal wrote: The project I've been working on for the last few months has a compute backend that is currently written MT+SIMD. I would like to bring up a GPU variant. What you could do is ressurect DerelictCL, port it to BindBC, and write

Re: Why many programmers don't like GC?

2021-01-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 15 January 2021 at 19:49:34 UTC, Ola Fosheim Grøstad wrote: Many open source projects (and also some commercial ones) work ok for small datasets, but tank when you increase the dataset. So "match and mix" basically means use it for prototyping, but

Re: Why many programmers don't like GC?

2021-01-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 15 January 2021 at 18:55:27 UTC, Ola Fosheim Grøstad wrote: On Friday, 15 January 2021 at 18:43:44 UTC, Guillaume Piolat wrote: Calling collect() isn't very good, it's way better to ensure the GC heap is relatively small, hence easy to traverse. You can use -gc=profile for this

Re: Why many programmers don't like GC?

2021-01-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 15 January 2021 at 16:37:46 UTC, Ola Fosheim Grøstad wrote: But when do you call collect? Do you not create more and more long-lived objects? Calling collect() isn't very good, it's way better to ensure the GC heap is relatively small, hence easy to traverse. You can use

Re: Why many programmers don't like GC?

2021-01-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 15 January 2021 at 16:21:18 UTC, Ola Fosheim Grøstad wrote: What do you mean by "mix and match"? If it means shutting down the GC after initialization then it can easily backfire for more complicated software that accidentally calls code that relies on the GC. I mean: "using GC,

Re: Why many programmers don't like GC?

2021-01-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 15 January 2021 at 11:11:14 UTC, Mike Parker wrote: That's the whole point of being able to mix and match. Anyone avoiding the GC completely is missing it (unless they really, really, must be GC-less). +1 mix and match is a different style versus only having a GC, or only having

Re: Why many programmers don't like GC?

2021-01-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 13 January 2021 at 18:58:56 UTC, Marcone wrote: I've always heard programmers complain about Garbage Collector GC. But I never understood why they complain. What's bad about GC? Languages where the GC usage is unavoidable (Javascript and Java) have created a lot of situations

Re: writeln and write at CTFE

2021-01-13 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 13 January 2021 at 08:35:09 UTC, Andrey wrote: Hello all, Tell me please how can I "writeln" and "write" in function that is used in CTFE? At the moment I get this: import\std\stdio.d(4952,5): Error: variable impl cannot be modified at compile time Or may be exist some other

Re: DMD support for Apples new silicon

2021-01-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 10 January 2021 at 16:03:53 UTC, Christian Köstlin wrote: Good news! I was hoping for support in ldc, but dmds super fast compile times would be very welcome. I guess it's more work to put an ARM backend there. Kind regards, Christian It is indeed more work and up to the DMD

Re: DMD support for Apples new silicon

2021-01-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 10 January 2021 at 14:22:25 UTC, Christian Köstlin wrote: Hi all, are there any plans on supporting Apples new ARM silicon with DMD or would this be something for ldc? Kind regards, Christian Hello Christian, LDC since 1.24+ support cross-compiling to Apple Silicon. Here is how

Re: How to Install D on my new MacBook with M1 ARM computer

2020-12-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 19:04:33 UTC, Dave Chapman wrote: Greetings, Apologies If I have double posted. I received a MacBook pro M1 for Christmas and I would like to install a D compiler on it. After looking at the downloads page I don't see how to install D on a new MacBook. I did

Re: How to resize an image ? 樂

2020-12-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 25 December 2020 at 20:59:03 UTC, vnr wrote: Hello  For a small "script" that generates printable files, I would need to change the size of an image (which is loaded into memory as an array of bytes) to shrink it to scale if it exceeds the A4 page size. To load the images into

Re: How to resize an image ? 樂

2020-12-25 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 25 December 2020 at 20:59:03 UTC, vnr wrote: Hello  For a small "script" that generates printable files, I would need to change the size of an image (which is loaded into memory as an array of bytes) to shrink it to scale if it exceeds the A4 page size. To load the images into

Re: C++ or D?

2020-11-09 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 10 November 2020 at 01:00:50 UTC, Mark wrote: Hi all, Anyone have any thoughts how C++ and D compare? C++ has a bit more mathematical feeling, everything has been sorted out in the spec, even if the rules are crazy difficult. D feels like it's up to _you_ to write the spec as

Re: Docs generation example

2020-10-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 10 October 2020 at 02:07:02 UTC, Виталий Фадеев wrote: Wanted! Docs generation example. I have dub project, sources/*.d. I want html-index with all classes/functions. Is exists simple, hi-level, one-line command line solution ? Alternatively: 1. Publish the 'blablah' package on

Re: Problem with gfm.math.matrix (some gamedevs out there ?)

2020-09-04 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 3 September 2020 at 12:36:35 UTC, Thomas wrote: - import std.stdio; int main() { import gfm.math.matrix; const int width = 800; const int height = 600; auto projectionMatrix = mat4!(float).identity(); Note that instead of `mat4!(float)` you

Re: Lack of asm volatile qualifier (explicitly) again.

2020-07-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 28 July 2020 at 06:57:36 UTC, Cecil Ward wrote: What do others think? If others agree, how could a very small DIP be set in motion ? Hello, LDC lets you do optimizable assembly with ldc.llvmasm.__asm Better yet, you can also create IR directly with ldc.llvmasm.__ir_pure This

Re: How DerelictCL works

2020-07-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 21 July 2020 at 12:00:03 UTC, bioinfornatics wrote: Dear, I would like to use OpenCL in D. Thus I try to use DerelictCL. But I fail to use it I encounter this error message: Hello, I don't have time at all at the moment for maintaining DerelictCL, can you provide a fully working

Re: Windows + LDC/DMD installation nightmare when changing VS versions

2020-06-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 12 June 2020 at 19:21:46 UTC, kinke wrote: On Friday, 12 June 2020 at 15:21:12 UTC, Guillaume Piolat wrote: Any idea what could be causing this? Mentioning at least the used LDC version would be helpful; especially since the MSVC detection was completely overhauled with the v1.22

Re: Windows + LDC/DMD installation nightmare when changing VS versions

2020-06-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 12 June 2020 at 16:16:18 UTC, mw wrote: --arch=x86_64 ? check where this config is set? you said it’s for 32 bit Indeed it's the other way around, it's with -a x86_64

Windows + LDC/DMD installation nightmare when changing VS versions

2020-06-12 Thread Guillaume Piolat via Digitalmars-d-learn
Originally I installed VisualD and LDC and DMD with the VisualD installer on top of VS2019 and life was good. Then because VS2019 is very slow, I uninstalled VS2019 and installed VS2015 instead. This broke both DMD+64-bit and LDC despite having LDC_VSDIR set at "invalid-path". Isn't it

Re: Objective C protocols

2020-05-17 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 16 May 2020 at 19:14:51 UTC, John Colvin wrote: What's the best way to implement an Objective C protocol in D? I see mention here https://dlang.org/changelog/2.085.0.html#4_deprecated_objc_interfaces but it's not clear where things are these days. I did it throught the Obj-C

Re: XMM Intrinsics

2020-05-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 8 May 2020 at 12:38:51 UTC, Marcio Martins wrote: How would I go about calling _mm_* functions in D in a way that is portable between D compilers? Hello, I've made this library for that exact purpose: https://github.com/AuburnSounds/intel-intrinsics Supports every intrinsic

Re: How to call 'shared static this()' code of a D shared library?

2020-01-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 18 January 2020 at 03:53:43 UTC, Adam D. Ruppe wrote: Did you already try rt_init? That should trigger it Indeed, this is done by runtime initialization.

Re: Help me decide D or C

2019-08-02 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 31 July 2019 at 18:38:02 UTC, Alexandre wrote: Should I go for C and then when I become a better programmer change to D? Should I start with D right now? D and C++ (and probably other languages) inherit features of C such as operator precendence, integer promotion, and a few

Re: accuracy of floating point calculations: d vs cpp

2019-07-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 22 July 2019 at 13:23:26 UTC, Guillaume Piolat wrote: On Monday, 22 July 2019 at 12:49:24 UTC, drug wrote: I have almost identical (I believe it at least) implementation (D and C++) of the same algorithm that uses Kalman filtering. These implementations though show different results

Re: accuracy of floating point calculations: d vs cpp

2019-07-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 22 July 2019 at 12:49:24 UTC, drug wrote: I have almost identical (I believe it at least) implementation (D and C++) of the same algorithm that uses Kalman filtering. These implementations though show different results (least significant digits). Before I start investigating I would

Re: OT - Git training Lon/HK and book recommendation on taste in programming

2019-05-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 1 May 2019 at 09:51:01 UTC, Laeeth Isharc wrote: Second question. Lots of people these days start to program to solve their problems at work but they may never have been shown the basic principles of design, structuring and maintenance of their code. If I could give them one

Re: Recommendations for best JSON lib?

2019-04-21 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 21 April 2019 at 02:09:29 UTC, evilrat wrote: On Saturday, 20 April 2019 at 20:44:22 UTC, Guillaume Piolat wrote: On Saturday, 20 April 2019 at 18:49:07 UTC, Nick Sabalausky (Abscissa) wrote: I only need to read arbitrary JSON data, no need for writing/(de)serialization. std.json

Re: Recommendations for best JSON lib?

2019-04-20 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 20 April 2019 at 18:49:07 UTC, Nick Sabalausky (Abscissa) wrote: I only need to read arbitrary JSON data, no need for writing/(de)serialization. std.json is simple as pie. import std.json: parseJSON; import std.file: read; JSONValue dubFile =

Re: How can I build dynamic library with ldc in termux?

2019-03-03 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 3 March 2019 at 01:51:49 UTC, Domain wrote: On Sunday, 3 March 2019 at 01:47:50 UTC, Domain wrote: /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find -lphobos2-ldc-shared /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: cannot find

Re: Handling big FP numbers

2019-02-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 9 February 2019 at 02:54:18 UTC, Adam D. Ruppe wrote: (The `real` thing in D was a massive mistake. It is slow and adds nothing but confusion.) We've had occasional problems with `real` being 80-bit on FPU giving more precision than asked, and effectively hiding 32-bit float

Re: Bitwise rotate of integral

2019-01-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 7 January 2019 at 14:39:07 UTC, Per Nordlöw wrote: What's the preferred way of doing bitwise rotate of an integral value in D? Are there intrinsics for bitwise rotation available in LDC? Turns out you don't need any: https://d.godbolt.org/z/C_Sk_- Generates ROL instruction.

Re: DirectXMath alternative

2018-12-05 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 11:43:46 UTC, evilrat wrote: Are you sure you don't confuse lines with columns? Here it says it is row major https://github.com/d-gamedev-team/gfm/blob/master/math/gfm/math/matrix.d#L17 Yes, sorry I made a mistake. It's indeed row-major in gfm:math. The

Re: DirectXMath alternative

2018-12-05 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 01:57:53 UTC, evilrat wrote: On Tuesday, 4 December 2018 at 20:41:54 UTC, Guillaume Piolat wrote: On Tuesday, 4 December 2018 at 20:33:07 UTC, John Burton wrote: What is the best alternative for D, assuming there is anything? (I want vector, matrix math for use

Re: DirectXMath alternative

2018-12-04 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 4 December 2018 at 20:33:07 UTC, John Burton wrote: What is the best alternative for D, assuming there is anything? (I want vector, matrix math for use in D3, things like inverting a matrix, getting perspective matrices etc) I can program something myself if necessary but I'd

Re: Small or big dub packages

2018-11-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 29 October 2018 at 11:31:55 UTC, Igor wrote: The way I see it the advantage of smaller packages is that users can pick and choose and and only have the code they really need in their project, but the con could become managing a lot of dependencies. Also I am not sure how compile

Re: Profiling with DUB?

2018-11-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 29 October 2018 at 10:14:23 UTC, Dukc wrote: I'm trying to profile my program, built like: dub build --build=profile When I run the program, where is the performance profile file supposed to appear? I can find nothing new in the program/project root directory. This happens

Re: Is there an efficient byte buffer queue?

2018-10-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: I would do much better to maintain a fixed size buffer and maintain read and write positions etc. Perhaps https://github.com/AuburnSounds/Dplug/blob/master/core/dplug/core/ringbuf.d#L16

Re: Is it possible to translate this API's C headers?

2018-09-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 17 September 2018 at 03:16:33 UTC, spikespaz wrote: Could one of you give me pointers about how to go about this? I have the dynamic link libraries, the static libraries, and the header includes. Every other language other than C++ will have the same problem as you interacting

Re: Manual delegates

2018-09-17 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 16 September 2018 at 14:45:08 UTC, Vladimir Panteleev wrote: On Sunday, 16 September 2018 at 14:12:27 UTC, Guillaume Piolat wrote: Anyone has any information about the ABI of delegates? In particular how to call them with a particular "this"/frame pointer? To solve a hairy

Re: Manual delegates

2018-09-16 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 16 September 2018 at 14:12:27 UTC, Guillaume Piolat wrote: In particular how to call them with a particular "this"/frame pointer? Related thread: https://forum.dlang.org/post/wjbhpztovxratexao...@forum.dlang.org

Manual delegates

2018-09-16 Thread Guillaume Piolat via Digitalmars-d-learn
Anyone has any information about the ABI of delegates? In particular how to call them with a particular "this"/frame pointer? To solve a hairy problem I need a delegate with a synthesized frame pointer. https://dpaste.dzfl.pl/cf44417c98f9 The problem is that delegate forwarding seems to

Re: C++ GLM(OpenGL Mathematics) D Equivalent.

2018-09-06 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 4 September 2018 at 19:23:16 UTC, SrMordred wrote: Most C++ game related projects uses GLM as they default math/vector lib (even if not using opengl). In D we have (that I found): gfm.math - https://github.com/d-gamedev-team/gfm dlib.math - https://github.com/gecko0307/dlib Gl3n

Re: Docs for subpackages?

2018-06-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 14 June 2018 at 04:39:16 UTC, 9il wrote: On Wednesday, 13 June 2018 at 14:56:10 UTC, 9il wrote: Hi, I am trying to build a large project that is split into dozen of sub-packages. How I can do it using dub without writing my own doc scripts? --combined does not help here. Best

Re: Static Array Idiom not working anymore.

2018-06-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 12 June 2018 at 15:35:42 UTC, Steven Schveighoffer wrote: No, that's not what I mean. What I mean is: int[] arr = [1,2,3].s; int[] arr2 = [4,5,6].s; Legally, the compiler is allowed to reuse the stack memory allocated for arr for arr2. The lifetime of the arr data is over.

Re: Static Array Idiom not working anymore.

2018-06-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 12 June 2018 at 14:44:12 UTC, Steven Schveighoffer wrote: What you are being told is that your memory is not being kept around. Essentially what you had originally was a memory corruption bug (yes, even before the deprecation happened). Don't do that anymore! And a reminder that

Re: Static Array Idiom not working anymore.

2018-06-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 12 June 2018 at 14:44:12 UTC, Steven Schveighoffer wrote: Note to ponce, please update your idioms, this is NOT safe, even within the same function. Just because it does work, doesn't mean it will always work. The language makes no guarantees once the lifetime is over. -Steve

Re: The case of -debug -O and: is breaking pure/@nogc/nothrow/@safe UB under -debug?

2018-04-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 18 April 2018 at 13:47:35 UTC, Jonathan M Davis wrote: Thanks for both your answers, Jonathan and Nicholas. To the extent that I'd like to explain this in a d-idioms post, here is a tentative synthesis of your answers (Jonathan M Davis and Nicholas Wilson): - breaking pure

The case of -debug -O and: is breaking pure/@nogc/nothrow/@safe UB under -debug?

2018-04-18 Thread Guillaume Piolat via Digitalmars-d-learn
The D specification says: "A ConditionalStatement that has a DebugCondition is called a DebugStatement. DebugStatements have relaxed semantic checks in that pure, @nogc, nothrow and @safe checks are not done. Neither do DebugStatements influence the inference of pure, @nogc, nothrow and

Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 7 April 2018 at 20:33:13 UTC, Arun Chandrasekaran wrote: On Saturday, 7 April 2018 at 19:14:27 UTC, Daniel Kozak wrote: or for ldc http://docs.algorithm.dlang.io/latest/mir_math_common.html On Sat, Apr 7, 2018 at 9:10 PM, Daniel Kozak wrote: can you try it

Re: Game and GC

2018-02-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 23 February 2018 at 01:54:07 UTC, Leonardo wrote: Hi, I'm new to language and games. Many people say that GC is bad and can slow down your project in some moments. What can happen if I create a game using D without worrying with memory management? (using full GC) From my

Re: How to proceed with learning to code Windows desktop applications?

2018-01-30 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 29 January 2018 at 22:55:12 UTC, I Lindström wrote: The other way I've been thinking is to do the thing browser-based, but for some reason that doesn't feel right. Ironically the trick for native programming is to depend on the OS as less as possible, with a small "API surface".

Re: How to test a DUB-based library during development?

2018-01-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 11 January 2018 at 14:22:50 UTC, DanielG wrote: If I manually override "libs-windows-x86-dmd" in the example's dub.json, it links despite the error, but if possible I would like users of my library to not have to concern themselves with linkage issues. vibe.d seems to do it

Re: How to test a DUB-based library during development?

2018-01-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 11 January 2018 at 12:27:27 UTC, DanielG wrote: Is there a simple example that shows how to test the library during development, before publishing (ie, before being able to add it as a dependency to another project)? I guess I'm just asking, what's the convention here? Do I

Re: Don't expect class destructors to be called at all by the GC

2017-12-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 22 December 2017 at 00:09:31 UTC, Mike Franklin wrote: What condition(s) would cause a destructor for an object that is managed by the GC to potentially not be called? Good question. It's true that barring an Error, they should be called by the GC at runtime termination.

Re: Don't expect class destructors to be called at all by the GC

2017-12-21 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 21 December 2017 at 06:50:44 UTC, Mike Parker wrote: That's what I've taken to doing manually, by implementing a `terminate` function in my classes that I either call directly or via a ref-counted templated struct called Terminator. I feel like I'm rambling but.. The problem with

Re: GUI program on Mac OS in D?

2017-12-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 7 December 2017 at 12:18:21 UTC, Guillaume Piolat wrote: You can easily make a DUB frontend to do that, for example https://github.com/AuburnSounds/Dplug/tree/master/tools/dplug-build And it might be cleaner to do this as a post-build step.

Re: GUI program on Mac OS in D?

2017-12-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 16:50:10 UTC, mrphobby wrote: Also, is there any support for creating macOS application bundles? [1] https://dlang.org/spec/objc_interface.html [2] https://wiki.dlang.org/DIP43 You can easily make a DUB frontend to do that, for example

Re: inout after function

2017-11-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 25 November 2017 at 21:51:41 UTC, Dave Jones wrote: What does the "inout" after front() do here... @property ref inout(T) front() inout { assert(_data.refCountedStore.isInitialized); return _data._payload[0]; } Cant seem to find an explanation in the docs or forums :(

Re: GUI program on Mac OS in D?

2017-11-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 23 November 2017 at 16:06:28 UTC, Adam D. Ruppe wrote: I know we have the extern(Objective-C) stuff from https://wiki.dlang.org/DIP43 now, but do we have existing bindings anywhere along the lines of the win32 ones we can just import and start calling the operating system

Re: Call thread_attachThis() from your D shared library

2017-11-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 18 November 2017 at 00:23:31 UTC, Ali Çehreli wrote: We had an issue today calling a D shared library from our Java code where we were getting segfaults during GC collection cycles. Of course we were being careful and calling Runtime.initialize() inside our initialization

Re: Best practices for multithread global flags

2017-11-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 15 November 2017 at 11:57:25 UTC, Vladimirs Nordholm wrote: Hello people from D-land. To summarise my problem: I have a program in the terminal (Posix) with two threads: one which my main program is run on, and a second one which polls input via `poll(...)` and `read(...)`.

Re: Inline assembly question

2017-11-13 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 12 November 2017 at 22:20:46 UTC, Dibyendu Majumdar no in naked mode you have to save and restore by hand. Note that in Win64 even if not naked, you'll have to save/restore some registers like XMMx with x >= 6. Another question - how can I tell DMD to no generate the frame

Re: Inline assembly question

2017-11-13 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 13 November 2017 at 18:40:42 UTC, Basile B. wrote: TBH I wonder if this is not worth a enhancement (or even a DIP) to have in asm blocks a special alias syntax... { asm { version(...) { alias First = RDI; alias Second = RSI; //

Re: convert string to ubyte[]

2017-11-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 11 November 2017 at 15:38:18 UTC, aki wrote: Hello, This will be trivial question but I cannot figure out what's wrong. I want to convert string to an array of ubyte. import std.conv; void main() { auto s = "hello"; ubyte[] b = to!(ubyte[])(s); } It compiles but

Re: How you guys go about -BetterC Multithreading?

2017-11-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 9 November 2017 at 16:00:36 UTC, Petar Kirov [ZombineDev] wrote: In short, the cost / benefit of going all the way version(D_BetterC) is incredibly poor for regular applications, as you end up a bit more limited than with modern C++ (> 11) for prototyping. For example, even

Re: COM/OLE advanced questions

2017-11-03 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 3 November 2017 at 12:24:43 UTC, Guillaume Piolat wrote: On Friday, 3 November 2017 at 10:50:27 UTC, Kagamin wrote: It only looks at the name. I'll test if that name needs to be "IUnknown" or the exact "core.sys.windows.unknwn.IUnknown", since I'm in @nogc and not necessarily

Re: COM/OLE advanced questions

2017-11-03 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 3 November 2017 at 12:20:43 UTC, Guillaume Piolat wrote: On Friday, 3 November 2017 at 02:30:59 UTC, evilrat wrote: My guess it will work fine when derive from any extern(Windows) interface(that's right, not class) that has base 3 methods(AddRef, Release, QueryInterface) I'll test

Re: COM/OLE advanced questions

2017-11-03 Thread Guillaume Piolat via Digitalmars-d-learn
Answering my own questions: On Thursday, 2 November 2017 at 14:22:56 UTC, Guillaume Piolat wrote: Question 1. Is it mandatory to inherit from core.sys.windows.unknwn.IUnknown, or just having an interface named "IUnknown" validate it for being a COM interface? Deriving from an interface

Re: COM/OLE advanced questions

2017-11-03 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 3 November 2017 at 10:50:27 UTC, Kagamin wrote: It only looks at the name. I'll test if that name needs to be "IUnknown" or the exact "core.sys.windows.unknwn.IUnknown", since I'm in @nogc and not necessarily on Windows, so I can't inherit from core.sys.windows.unknwn.IUnknown

Re: COM/OLE advanced questions

2017-11-03 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 3 November 2017 at 02:30:59 UTC, evilrat wrote: You can't(or maybe you can but that is not a true COM). COM is Windows tech. It is backed up by OLE or whatever server it is. What happens is that I translate a SDK which provides "COM-like" objects, on Windows and Mac (claiming ABI

COM/OLE advanced questions

2017-11-02 Thread Guillaume Piolat via Digitalmars-d-learn
I wonder if anyone has used COM in dlang extensively. Context: I must use COM FFI interfacing on systems that aren't necessarily Windows. It is essential that the layout of interfaces and classes are the same than in equivalent C++ objects. Question 1. Is it mandatory to inherit from

  1   2   3   >