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

Re: Static if on release build

2017-10-21 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 20 October 2017 at 02:36:37 UTC, Fra Mecca wrote: I can't find any documentation regarding conditional compilation in release and debug mode. I have read the page regarding the topicon dlang.org but adding the snippet below makes no difference when compiling with dub -b release {

Re: Dub use local fork

2017-09-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 23 September 2017 at 03:16:30 UTC, rikki cattermole wrote: Alternatively you can alter the package that dub already knows about. Does the trick more easily ;) +1 That's the dirty trick I'm using too

Re: WebCam or Video in D

2017-08-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 14 August 2017 at 04:41:24 UTC, brian wrote: Howdy folks. Has anyone gotten an example of using D as mechanism to read in video files, specifically from a webcam? I don't see any OpenCV libraries, and the example in the DCV library that uses FFMPEG, I can't get to work (I've

Re: dub and hierarchies of packages

2017-07-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 14:05:09 UTC, Jean-Louis Leroy wrote: I have a package hierarchy (here https://github.com/jll63/openmethods.d/blob/master/dub.sdl) and I would like to 'dub run' or 'dub test' everything. Is there a recursive mode that I've missed? I don't think there is one. But

Re: Profiling Windows App and DLL

2017-07-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 17 July 2017 at 20:36:58 UTC, Igor wrote: I also tried "Very Sleepy" profiler but it only shows symbols for main application and not for the DLL that it loads which is also built with debug info. Something that works very well is CPU profiling with CodeXL. It used to be an

Is align(16) respected for globals?

2017-07-23 Thread Guillaume Piolat via Digitalmars-d-learn
I rely a lot on such constants for SSE: align(16) static immutable short[8] A = [ 1, 1, 1, 1, 3, 3, 3, 3 ]; Does such alignment actually work on all OS, at all times? Word on the street says align() doesn't work with globals.

Re: Adding flags to dub build

2017-07-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 19:49:35 UTC, Jean-Louis Leroy wrote: Hi, I want to add a few flags while building with dub. I tried: DFLAGS='-d-version=explain' dub test ... ...but DFLAGS does not seem to be honored. In fact I wouldn't mind adding a builtType to my dub.sdl (but then will it

Re: Foreign threads in D code.

2017-07-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 11 July 2017 at 22:59:42 UTC, Igor Shirkalin wrote: On Tuesday, 11 July 2017 at 06:18:44 UTC, Biotronic wrote: On Monday, 10 July 2017 at 20:03:32 UTC, Igor Shirkalin wrote: [...] If DRuntime is not made aware of the thread's existence, the thread will not be stopped by the GC,

Re: Need simple sound

2017-07-03 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 3 July 2017 at 08:55:20 UTC, Martin Tschierschke wrote: Hello for a simple game I would like to add some very simple sound, not much different than the beeps of "PAC Man". Is there anything I can use for this? DerelictSDL supports the loading of SDL_mixer, which makes it very

Re: D, Game Development, GLSL, Math

2017-07-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 1 July 2017 at 19:23:57 UTC, Void-995 wrote: Looking good, but I'm thinking more about 1:1 GLSL syntax (main reason - rapid prototype of GLSL/HLSL/OpenCL in D and code portability back and forward basing on usage) and heavy depending on SIMD. Just math and nothing else. Also may

Re: D, Game Development, GLSL, Math

2017-07-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 1 July 2017 at 19:07:48 UTC, Void-995 wrote: can i use simd as base to extend it's syntax for making something like GLM for C++? You can use simd to implement something like GLM, but extending the syntax of SIMD will prove more difficult. vector types are a bit different in LDC

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 13:02:04 UTC, Mike Parker wrote: On Wednesday, 28 June 2017 at 09:16:22 UTC, Guillaume Piolat wrote: So far everyone is ignoring my example when A needs B to be destroyed. This happens as soon as you use DerelictUtil for example. What's the issue with

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 11:34:17 UTC, Moritz Maxeiner wrote: Requirement: Do not allocate using the GC Option 1) Use structs with `@disable this`, `@disable this(this)`, and a destructor that checks whether the resource reference is != invalid resource reference before trying to

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 11:21:07 UTC, Moritz Maxeiner wrote: On Wednesday, 28 June 2017 at 09:16:22 UTC, Guillaume Piolat wrote: So far everyone is ignoring my example when A needs B to be destroyed. This happens as soon as you use DerelictUtil for example. I thought I had

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 09:16:22 UTC, Guillaume Piolat wrote: On Wednesday, 28 June 2017 at 02:13:10 UTC, Jonathan M Davis wrote: There are definitely cases where finalizers make sense. Case in point: if you have a socket class, it makes perfect sense for it to have a finalizer. Yes,

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 02:13:10 UTC, Jonathan M Davis wrote: There are definitely cases where finalizers make sense. Case in point: if you have a socket class, it makes perfect sense for it to have a finalizer. Yes, it's better to close it manually, but it will work just fine for the GC

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 23:54:50 UTC, Moritz Maxeiner wrote: Do you mean destructors? Yes. - Replace calls by the GC to `~this` with calls to `finalize` (or invent some cool other shortened name for the latter) My point is that in such a "finalize()" function the only sane things to

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 18:04:36 UTC, Moritz Maxeiner wrote: Well, technically speaking the `~this` for D classes *is* a finalizer that you may optionally manually call (e.g. via destroy). It would be nice, though, to change class `~this` into a destructor and move the finalization into

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 15:24:00 UTC, Steven Schveighoffer wrote: The GC still needs to call something to clean up non-memory resources, Well, I'd much prefer if the GC would simply not call destructors. Yes, destructor can work for _some_ resources, but because of ordering it also

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 13:11:10 UTC, Steven Schveighoffer wrote: But I would use a close method, and not destroy(obj). The reason is because often times, you have wrapper types around your socket type, and just one extra level of indirection means the destructor cannot be used to clean up

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-27 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 27 June 2017 at 09:54:19 UTC, John Burton wrote: I assume that I do need to explicitly call close on the socket as there is no deterministic destructor for class objects. Yes. I further assume that the runtime will garbage collect any memory allocated to the socket object at a

Re: Zero-cost version-dependent function call at -O0.

2017-06-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 25 June 2017 at 15:58:48 UTC, Johan Engelen wrote: In C, you could do something like: ``` #if X void foo() {..} #else #define foo() #endif ``` Curious no one has mentionned it. Just use alias. version(X) alias myFunc = impl1; else alias myFunc = impl2; I do it a

Re: D, shared objects and MacOS

2017-06-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 11 June 2017 at 09:53:09 UTC, Russel Winder wrote: Is the creation of shared objects still not possible on MacOS with: 1. DMD; 2. LDC2; 3. GDC. ? DMD: - possible with runtime disabled, all versions - or -betterC approach LDC: - possible with shared runtime dynlib IIRC

Re: Out of memory error (even when using destroy())

2017-05-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 26 May 2017 at 08:15:49 UTC, realhet wrote: 64bit is not a solution because I need to produce a 32bit dll, and I also wanna use 32bit asm objs. The total 2GB amount of memory is more than enough for the problem. My program have to produce 300..500 MB of continuous data frequently.

Re: Why would an initialised struct pointer field be null in the struct's destructor?

2017-05-21 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 21 May 2017 at 12:48:10 UTC, Adam D. Ruppe wrote: Any struct should be able to have its destructor called Does this rule also applies to class objects?

Re: Dub, Git, Mercurial, Bazaar

2017-04-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 11 April 2017 at 04:59:27 UTC, Russel Winder wrote: Go only uses Git, Mercurial, or Bazaar for dependency handling. Rust (via Cargo) allows for a central repository, and Git (, and Mercurial ?) repositories. Dub appears only to allow for central repository, or have I missed it's

Re: Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled?

2017-03-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 12:28:13 UTC, Jacob Carlborg wrote: On 2017-03-08 12:59, Guillaume Piolat wrote: Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled? I had a quick look through the imports, I could not find anything that I know

Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled?

2017-03-08 Thread Guillaume Piolat via Digitalmars-d-learn
Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled? It would be ideal for allocating audio buffers in the audio thread. malloc is tolerated but using a pre-allocated area with a fallback on malloc would be way better and faster too.

Re: Hello, folks! Newbie to D, have some questions!

2017-02-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote: My rudimentary knowledge of the D ecosystem tells me that there is a GC in D, but that can be turned off. Is this correct? Also, some threads online mention that if we do turn off GC, some of the core std libraries may not fully

Re: Mixin in Inline Assembly

2017-01-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 11 January 2017 at 06:14:35 UTC, Era Scarecrow wrote: Suddenly reminds me some of the speedup assembly I was writing for wideint, but seems I lost my code. too bad, the 128bit multiply had sped up and the division needed some work. I'm a taker if you have some algorithm to

Re: Mixin in Inline Assembly

2017-01-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 10 January 2017 at 13:13:17 UTC, Basile B. wrote: On Tuesday, 10 January 2017 at 11:38:43 UTC, Guillaume Piolat wrote: On Tuesday, 10 January 2017 at 10:41:54 UTC, Basile B. wrote: don't forget to flag asm pure nothrow {} otherwise it's slow. Why? It's an empirical

Re: Mixin in Inline Assembly

2017-01-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 10 January 2017 at 10:41:54 UTC, Basile B. wrote: don't forget to flag asm pure nothrow {} otherwise it's slow. Why?

Re: Is it possbile to specify a remote git repo as dub dependency?

2016-12-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 19 December 2016 at 14:45:07 UTC, biocyberman wrote: I see, it is both a good thing and a bad thing. Good thing is to encourage developers to submit packages to central dub registry. Bad thing is, when that does not happen soon enough, other developers who use the package will

Re: Dynamically Loading a D DLL From a D Program

2016-12-15 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 14 December 2016 at 21:38:27 UTC, Benjiro wrote: It also seems that the core runtime is incomplete with basic loading but no handling of dlsym, so your still forced to use the basic c conversion casting. int function() fn = cast(int function())dlsym(lib, libFunction); fn();

Re: [Semi-OT] I don't want to leave this language!

2016-12-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 8 December 2016 at 11:32:56 UTC, Paolo Invernizzi wrote: On Thursday, 8 December 2016 at 11:09:12 UTC, ketmar wrote: what can be done, tho, is article (or series of articles) describing what exactly druntime is, how it is compared to libc and libc++, why it doesn't hurt at all,

Re: [Semi-OT] I don't want to leave this language!

2016-12-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 7 December 2016 at 12:12:56 UTC, Ilya Yaroshenko wrote: R, Matlab, Python, Mathematica, Gauss, and Julia use C libs. --Ilya As a C lib, you have the possibility of not initializing the runtime, which leaves usable a part of phobos+druntime and it's only a matter of avoiding

<    1   2   3   >