Re: Using DUB packages with Meson

2023-04-28 Thread Denis Feklushkin via Digitalmars-d-learn
On Thursday, 27 April 2023 at 20:48:45 UTC, Richard (Rikki) Andrew Cattermole wrote: On 28/04/2023 1:43 AM, Denis Feklushkin wrote: On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky wrote: And I did fetch & build What are possible ways to automate such download? Meson knows

Re: Using DUB packages with Meson

2023-04-27 Thread Denis Feklushkin via Digitalmars-d-learn
On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky wrote: And I did fetch & build What are possible ways to automate such download? Meson knows exactly which versions of packages suit to build. Is it possible, for example, to get somehow packages list and then download using dub

Re: This is bug or not? (immutable class containing struct with dtor)

2021-12-18 Thread Denis Feklushkin via Digitalmars-d-learn
On Saturday, 18 December 2021 at 12:50:17 UTC, Tejas wrote: As Ali said, this is an implementation issue. So I guess the answer to your question is that this is a bug. Please file a report at [issues.dlang.org](issues.dlang.org) Looks like this is same case:

Re: This is bug or not? (immutable class containing struct with dtor)

2021-12-18 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 17 December 2021 at 19:03:05 UTC, Tejas wrote: Well, I got completely mislead by my experiment  ```d struct S { ~this() immutable {} } ``` Interesting what discussed behaviour isn't affects method what implements same functionality as dtor and called explictly at each

Re: This is bug or not? (immutable class containing struct with dtor)

2021-12-17 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 17 December 2021 at 18:02:52 UTC, Tejas wrote: I improved your sample: ```d immutable struct S { ~this() {} } immutable struct S2 { S sss; ~this() {} } void main() { S2 s = S2(); } ``` ``` Error: `immutable` method `serializer_bug.S.~this` is not callable using a

Re: This is bug or not? (immutable class containing struct with dtor)

2021-12-17 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 17 December 2021 at 18:01:03 UTC, Tejas wrote: I think since `immutable` objects are kept in Read Only Storage Some of them can be stored in ROM in some cases, but actually "immutable" keyword means "not mutable for whole its lifetime"

Re: This is bug or not? (immutable class containing struct with dtor)

2021-12-17 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 17 December 2021 at 17:27:53 UTC, Denis Feklushkin wrote: ~this() {} // Comment out this to fix this compilation error: // Error: `immutable` method `serializer_bug.Imm.~this` is ("serializer_bug" is just name of my local .d file)

This is bug or not? (immutable class containing struct with dtor)

2021-12-17 Thread Denis Feklushkin via Digitalmars-d-learn
```d /+ dub.json: { "name": "test", "dependencies": { } } +/ struct S { ~this() {} } immutable class Imm { S s; // this is immutable value because whole class is immutable this() { s = S(); } ~this() {} // Comment out this to fix this compilation

Re: Two major problems with dub

2021-08-04 Thread Denis Feklushkin via Digitalmars-d-learn
On Sunday, 1 August 2021 at 17:18:39 UTC, Alain De Vos wrote: A simple and small wrapper around for instance the C-library Really, dpq2 is that wrapper

Re: Two major problems with dub

2021-08-04 Thread Denis Feklushkin via Digitalmars-d-learn
On Sunday, 1 August 2021 at 17:37:01 UTC, evilrat wrote: vibe-d - probably because it handles DB connection and/or keep things async way, sure you probably can do it with Phobos but it will be much more PITA and less performant It is because Postgres provides JSON types

Re: Performance issue with fiber

2021-07-27 Thread Denis Feklushkin via Digitalmars-d-learn
On Monday, 26 July 2021 at 12:09:07 UTC, hanabi1224 wrote: Thank you for your response! I've got some questions tho. On Saturday, 24 July 2021 at 09:17:47 UTC, Stefan Koch wrote: It will not use a fiber pool. Why fiber pool? Isn't fiber a lightweight logical thread which is already

Re: Druntime without pthreads?

2020-10-21 Thread Denis Feklushkin via Digitalmars-d-learn
On Wednesday, 21 October 2020 at 16:04:20 UTC, Denis Feklushkin wrote: On Tuesday, 20 October 2020 at 16:58:12 UTC, Severin Teona wrote: My curiosity is what would change if I removed from the druntime everything that has to do with mutexes As I remember, your plan is to use some type of

Re: Druntime without pthreads?

2020-10-21 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 20 October 2020 at 16:58:12 UTC, Severin Teona wrote: My curiosity is what would change if I removed from the druntime everything that has to do with mutexes or threads. Nothing if you don't plan to use multithreading. I temporary disabled threading and appropriate unittests from

Re: Undefined references in Druntime for microcontrollers

2020-10-19 Thread Denis Feklushkin via Digitalmars-d-learn
On Monday, 19 October 2020 at 06:25:17 UTC, Severin Teona wrote: Could you help me by telling me what libraries (and how) should I statically compile and link to the druntime? The microcontroller's CPU is an ARM Cortex-M4, and the libraries should be able to be compiled for this architecture.

Re: question on dub and postgresql

2020-10-05 Thread Denis Feklushkin via Digitalmars-d-learn
On Monday, 5 October 2020 at 15:08:54 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 14:57:53 UTC, Alaindevos wrote: answer[0][0].as!PGtext contains good data I found an answer. foreach(rownumber; answer.length.iota){ auto arow=answer[rownumber]; writeln(arow); } Yet it would be nice

Re: vibe.d / experience / feedback

2020-10-02 Thread Denis Feklushkin via Digitalmars-d-learn
On Thursday, 1 October 2020 at 06:32:23 UTC, Robert M. Münch wrote: 4. Vide uses an own JSON type, not the standard one. We don't understand why, this just makes things much more complicated and one has to mess around with this. Because standard implementation worse? 5. One can't access

Re: protobuf-d

2020-09-29 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 15:38:43 UTC, Robert Aron wrote: Hello! I am currently working on "D Language Client Libraries for Google APIs" project[0][1]. The first step was to familiarize myself with protobuf and to generate client library for cloud/vision using python plugin with

Re: I need "windowsx.d" Someone can send It to me?

2020-09-27 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to me? I don't know convert windowsx.h to windowsx.d Maybe it is already available on code.dlang.org?

Re: I need "windowsx.d" Someone can send It to me?

2020-09-25 Thread Denis Feklushkin via Digitalmars-d-learn
On Saturday, 26 September 2020 at 00:40:21 UTC, Marcone wrote: On Friday, 25 September 2020 at 17:00:04 UTC, Denis Feklushkin wrote: On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to

Re: I need "windowsx.d" Someone can send It to me?

2020-09-25 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote: I need windowsx.d but for I don't know the reason is not in dmd. Someone that have it can send to me? I don't know convert windowsx.h to windowsx.d Try to convert C header into D file by dpp tool.

Re: How to implement fastcall ?

2020-09-23 Thread Denis Feklushkin via Digitalmars-d-learn
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев wrote: How to implement fastcall ? ( stdcall is calling convention for pass function arguments via registers ) Hypothesis: it is possible what LLVM + Link Time Optimization does by this way.

Re: Building LDC runtime for a microcontroller

2020-09-23 Thread Denis Feklushkin via Digitalmars-d-learn
Wow, I have just received a link to this topic from my colleague. Here is also another thread about druntime for MCUs: https://forum.dlang.org/post/cwtkntyjhrwvpahfk...@forum.dlang.org

Re: There is Dlang Telegram Bot based on the official Telegram Bot API?

2020-04-05 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 3 April 2020 at 16:10:55 UTC, Baby Beaker wrote: I create Bots for Telegram using Python or PHP. But I love Dlang and would like to create my Bots in Dlang. Is there any support for Dlang to create Telegram Bots? My bots use https://code.dlang.org/packages/telega without any

Re: Best way to learn 2d games with D?

2020-03-16 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 17 March 2020 at 04:17:41 UTC, Denis Feklushkin wrote: Years ago I wrote this unfinished 2D platformer engine on D: https://github.com/denizzzka/Platformer It ises SFML (graphics and sound), Spine (animation engine) and dchip (2d physics engine) Physics engine used only for

Re: Best way to learn 2d games with D?

2020-03-16 Thread Denis Feklushkin via Digitalmars-d-learn
On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer wrote: I want to try and learn how to write 2d games. I'd prefer to do it with D. I've found a ton of tutorials on learning 2d gaming with other languages. Is there a place to look that uses D for learning? Should I just start

Re: Porting D to custom OS

2020-02-23 Thread Denis Feklushkin via Digitalmars-d-learn
On Saturday, 22 February 2020 at 13:20:40 UTC, IGotD- wrote: I'm trying to find information how to port D, especially the D runtime to a proprietary OS. Here is my "Frankenstein" MCU project: https://github.com/denizzzka/d_c_arm_test Maybe this will help you somehow. It is forced to use

How to use d++ (dpp) with Meson build system?

2020-01-25 Thread Denis Feklushkin via Digitalmars-d-learn
Hi! Has anyone already have success with this? Is there any kind of idiomatic way?

Re: LDC2 and classic profiling

2019-05-13 Thread Denis Feklushkin via Digitalmars-d-learn
On Sunday, 12 May 2019 at 17:24:24 UTC, Johan Engelen wrote: Excellent. I think dub -v will output the exact commands that dub is executing. Looks like some parts are not compiled with the compile flag, and some other parts are? Got it! -v displays only one ldc2 execution with

Re: LDC2 and classic profiling

2019-05-12 Thread Denis Feklushkin via Digitalmars-d-learn
On Saturday, 11 May 2019 at 11:38:17 UTC, Denis Feklushkin wrote: Maybe DUB caches binaries and linker links previous non-instrumented object files? I tried "dub clean" and "dub clean-caches" but maybe it is need remove someting else? Checked with "dub -f" and nothing changed.

Re: LDC2 and classic profiling

2019-05-11 Thread Denis Feklushkin via Digitalmars-d-learn
On Saturday, 11 May 2019 at 09:12:24 UTC, Johan Engelen wrote: Those calls are to templated functions I presume? No instantiated in your program and hence instrumented) Also I changed flags to "dflags-ldc": ["-fprofile-instr-generate", "-O0"] - second flag disables optimisation (I

Re: LDC2 and classic profiling

2019-05-11 Thread Denis Feklushkin via Digitalmars-d-learn
On Saturday, 11 May 2019 at 05:46:29 UTC, Denis Feklushkin wrote: All another calls is made inside of this lambda - maybe lambdas is not traced by profiler? Tried to remove lambda with same result. Command: llvm-profdata show -all-functions -topn=10 default.profdata returns huge amount

Re: LDC2 and classic profiling

2019-05-10 Thread Denis Feklushkin via Digitalmars-d-learn
On Friday, 10 May 2019 at 18:09:28 UTC, Johan Engelen wrote: You only need `-fprofile-instr-generate` for generating default.profraw. Yep, it is because I also tried to use uftrace and xray contains only calls to external libraries That's impossible, because those are exactly _not_

LDC2 and classic profiling

2019-05-10 Thread Denis Feklushkin via Digitalmars-d-learn
Build with dub some package. Profiling are enabled by dub.json: "dflags-ldc": ["-fprofile-instr-generate", "-finstrument-functions", "-cov"], Resulting default.profraw (and generated default.profdata) contains only calls to external libraries, but not my internal functions calls. Why?

Re: File.lockingBinaryWriter is not output range?

2019-03-19 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 13:20:37 UTC, Vladimir Panteleev wrote: On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote: /+ dub.sdl: name "hello_world" +/ This doesn't seem necessary :) I add it ~everywhere for faster reproducing of cases. static

Re: File.lockingBinaryWriter is not output range?

2019-03-19 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote: stdout.lockingBinaryWriter.put(cast(byte) 123); // works // But this assert is false: static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter), byte)); } Looks like isOutputRange is not checks "put"

File.lockingBinaryWriter is not output range?

2019-03-19 Thread Denis Feklushkin via Digitalmars-d-learn
/+ dub.sdl: name "hello_world" +/ import std.algorithm, std.range, std.stdio; void main() { // lockingBinaryWriter: Returns an output range that locks the file and allows fast writing to it. // https://dlang.org/library/std/stdio/file.locking_binary_writer.html

Re: Returning reference: why this works?

2019-03-13 Thread Denis Feklushkin via Digitalmars-d-learn
On Wednesday, 13 March 2019 at 21:04:01 UTC, Johan Engelen wrote: On Wednesday, 13 March 2019 at 20:57:13 UTC, Denis Feklushkin wrote: import std.stdio; struct S { int x; } ref S func1(ref S i) // i is reference { return i; } ref S func2(S i) // i is not reference { return func1(i); //

Returning reference: why this works?

2019-03-13 Thread Denis Feklushkin via Digitalmars-d-learn
import std.stdio; struct S { int x; } ref S func1(ref S i) // i is reference { return i; } ref S func2(S i) // i is not reference { return func1(i); // Works! Possibility to return reference to local object i? //return i; // Error: returning i escapes a reference to parameter i }

is(ElementType!(char[2]) == dchar - why?

2018-12-11 Thread Denis Feklushkin via Digitalmars-d-learn
import std.stdio; import std.range.primitives; void main() { writeln( typeid(ElementType!(char[2])) ); static assert(is(ElementType!(char[2]) == dchar)); // why? } ? https://run.dlang.io/is/Q74yHm

Vibe.d Future.getResult blocks others tasks?

2018-05-22 Thread Denis Feklushkin via Digitalmars-d-learn
Hi! Simple question to understand logic of quazi-multithreading: Is Future.getResult blocks other tasks for end of "futured" task? Or, another words, task.getResult causes task to ignore `yeilds` inside of this task?

Re: Tools to help me find memory leaks?

2018-03-10 Thread Denis Feklushkin via Digitalmars-d-learn
On Wednesday, 23 August 2017 at 20:52:17 UTC, Stefan Koch wrote: On Wednesday, 23 August 2017 at 17:30:40 UTC, Drake44 wrote: I'm on a Windows 7 machine and I'm using VisualD as my IDE. I'm trying to work out what's chewing up all the RAM in a program I'm writing... is there a tool that I can