Re: Is D painted into a corner?

2025-08-28 Thread Sergey via Digitalmars-d-learn
On Friday, 29 August 2025 at 02:48:21 UTC, H. S. Teoh wrote: Interesting how opinions differ on this. :-D I couldn't live without templates. I might be tempted to quit D if I couldn't use templates... ;-) but OTOH there are times when templates You probably gonna like comptime in Zig I th

Re: Debug help - static foreach - module scope - Programming in D page 603

2025-08-28 Thread Sergey via Digitalmars-d-learn
On Thursday, 28 August 2025 at 13:33:09 UTC, Brother Bill wrote: On Thursday, 28 August 2025 at 13:16:26 UTC, Andy Valencia wrote: Output to console: Why does static foreach run 'twice'? run.dlang.org run only once

Re: Is D painted into a corner?

2025-08-28 Thread Sergey via Digitalmars-d-learn
On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote: It seems like 'templates' are the 'Achilles heel' of D. Without starting a flame war, has D gotten to the point where ordinary mortals have difficulty coding in D with 'templates' such as 'cycle' requiring rewrites into 'myCycle'

Re: Template instance does not match template declaration

2025-08-15 Thread Sergey via Digitalmars-d-learn
On Friday, 15 August 2025 at 12:02:19 UTC, Marc wrote: Hello, I'm trying to declare a templated member function that takes a value of size_t N. A simple example to reproduce what Im trying to do is the following: ```d import std.stdio; void getCol(N: size_t)() { return N; } void main() {

Re: How to use D on M2 macOS?

2025-07-21 Thread Sergey via Digitalmars-d-learn
On Monday, 21 July 2025 at 17:21:58 UTC, Albert wrote: On Monday, 21 July 2025 at 17:08:17 UTC, Albert wrote: How do I build & run the executable though? Anyway with some perseverance I managed to build & run hello world app. Thank you guys for your help. Though I do think D could do so muc

Re: Multiply a string?

2025-06-07 Thread Sergey via Digitalmars-d-learn
On Saturday, 7 June 2025 at 16:13:06 UTC, Andy Valencia wrote: Which is to say, build a string by concatenating " " ddepth times. Is there a comparable idiom in dlang or Phobos? Thanks! Andy I think there are many ways to do it The simplest that comes to my mind: ```d void main() { strin

Re: What previews should I enable?

2025-05-29 Thread Sergey via Digitalmars-d-learn
On Friday, 30 May 2025 at 00:31:56 UTC, luafyn wrote: Hi everyone, so dmd includes several -preview flags and I was wondering if there were any that are recommended to enable? I think no I like using the most up to date stuff possible so I've actually been using -preview=all and it seems to w

Re: Looking for Feedback (3D engine)

2025-05-15 Thread Sergey via Digitalmars-d-learn
On Thursday, 15 May 2025 at 09:18:37 UTC, Danny Arends wrote: Thanks, I added a screenshot to the readme. What do you mean by example folder ? Currently the engine has a single scene.d file, which loads all objects in one go. Do you mean having multiple dub.json files each loading / setting up

Re: Looking for Feedback (3D engine)

2025-05-15 Thread Sergey via Digitalmars-d-learn
On Thursday, 15 May 2025 at 08:29:52 UTC, Danny Arends wrote: Hey all, I am developing a next iteration of my GFX engine (previously called CalderaD) and I am looking for help from the community to get some feedback on compilation instructions (any other feedback is very welcome as well as we

Re: D Garbage Collector reference

2025-04-04 Thread Sergey via Digitalmars-d-learn
On Tuesday, 25 March 2025 at 17:46:22 UTC, Ian wrote: Hi, I am curious about the low level details of D's garbage collector. Is there a good reference in this regard? I have many questions... Cheers, Ian Hi there This is from my list: - https://dlang.org/blog/the-gc-series/ - https:

Re: Update to MacOS Sequoia Version 15.4 (24E248) broke dmd and ldmd2 for me

2025-04-02 Thread Sergey via Digitalmars-d-learn
On Wednesday, 2 April 2025 at 20:44:21 UTC, Christian Köstlin wrote: Hi, I just updated to said version on Apple silicon and neither dmd nor ldmd2 work anymore for me (as installed by the dlang install script https://dlang.org/install.html, which in turn used dmd.2.111.0.osx.tar.xz and ldc2-1

Re: Deserialising JSON with asdf when a field is unexpectedly null

2025-04-02 Thread Sergey via Digitalmars-d-learn
On Wednesday, 2 April 2025 at 15:37:46 UTC, Anonymouse wrote: I'm trying to replace my use of `std.json` with `asdf`. What should I do? I don't want to just catch the exception but so far that's the best solution I have. ```d struct S { static struct Inner { string s = "foo";

Re: sqlite3 library which can read class instances (not structs)?

2025-03-10 Thread Sergey via Digitalmars-d-learn
On Thursday, 6 March 2025 at 23:45:01 UTC, Andy Valencia wrote: Is there a sqlite3 interface library which can correctly read into instances? sqlite3-d will let me compile with a class, but it segv's when run. ddbc seems to support only structs, and I can use it to punch in one value at a tim

Re: Issue with struct invariants

2025-03-05 Thread Sergey via Digitalmars-d-learn
On Wednesday, 5 March 2025 at 16:58:18 UTC, Kirill Kryukov wrote: Hi all, Is this a bug, or am I misunderstanding something? Compiled with "gdc -Og -o repro repro.d", using gdc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3), on Linux. Thanks. It seems working with dmd and ldc. Maybe GDC specific

Re: Weird LDC error on mac

2025-03-03 Thread Sergey via Digitalmars-d-learn
On Monday, 3 March 2025 at 21:33:17 UTC, Bogdan wrote: I managed to get a stack trace from my error: I would suggest to post it either to LDC group or to LDC github issue, so Kinke and other LDC team can check it

Re: Gtkd questions

2025-02-20 Thread Sergey via Digitalmars-d-learn
On Sunday, 22 September 2024 at 15:44:17 UTC, Ian wrote: Hi, I have started using Gtkd for my first D app. (Many thanks to Ron Tarrant for gtkcoding.com by the way!) Is there a place where I can ask specific Gtkd questions? I came across some post at some point mentioning they may have anothe

Re: help with prime pairs code

2025-02-19 Thread Sergey via Digitalmars-d-learn
On Wednesday, 19 February 2025 at 02:25:03 UTC, Salih Dincer wrote: have much time right now, I only saw 1 improvement. Below the GCD filter will give the same list (lhr[]). SDB@79 It is giving different result

Re: Simple string membership test

2025-02-15 Thread Sergey via Digitalmars-d-learn
On Saturday, 15 February 2025 at 17:58:44 UTC, Ian wrote: Hi, What's the best (idiomatic) way of checking if a string is in a list of strings: ```d string v = "tofind"; if (v ismemberof ["abc", "def","tofind"]) etc(); ``` Thanks, ian canFind or countUntil https://dlang.org/phobos/std_a

Re: Vibe.d Password Verification

2025-02-05 Thread Sergey via Digitalmars-d-learn
On Wednesday, 5 February 2025 at 15:16:10 UTC, seany wrote: Any help would be appreciated. My password is being sent as string over a secure https connection. The hash is stored as another string. There are also these 2: https://code.dlang.org/packages/dauth https://code.dlang.org/packages/a

Re: help with prime pairs code

2025-02-02 Thread Sergey via Digitalmars-d-learn
On Sunday, 2 February 2025 at 22:40:41 UTC, Jabari Zakiya wrote: I am really impressed! D is phenomenally memory efficient with this code. I just ran the D code for some really large n values. On my older Lenovo Legion 5, using Linux (June 2024) w/16GB I was able to go up to n = 1,000,000, a

Re: help with prime pairs code

2025-02-02 Thread Sergey via Digitalmars-d-learn
On Sunday, 2 February 2025 at 03:22:00 UTC, Jabari Zakiya wrote: The D version is way slower, because of the array operations. For an input of 100 (1M): D: 12+ secs; Crystal: 0.036 secs. First of fall make sure you are using LDC or GDC compiler. Second step is to add proper flags for optim

Re: Why 'in' works only for assoc arrays?

2024-12-28 Thread Sergey via Digitalmars-d-learn
On Friday, 27 December 2024 at 19:17:13 UTC, JN wrote: Why not make 'in' work for arrays (and strings also)? ``` int[string] phonebook; if ("John" in phonebook) // works int[] numbers; if (3 in numbers) // doesn't work, compiler recommends std.algorithm.find string buildLog; if ("build error

Re: Kotlin Meta and CT programming vs D

2024-12-22 Thread Sergey via Digitalmars-d-learn
On Thursday, 19 December 2024 at 06:04:33 UTC, Jo Blow wrote: In any case, it was a great experience for the first month or so but then when I started looking for more complicated "D like" features such as CT/meta programming they don't seem to actually exist... at least not in the way one thin

Re: Recommendations on porting Python to D

2024-12-20 Thread Sergey via Digitalmars-d-learn
On Friday, 20 December 2024 at 00:53:30 UTC, Chris Piker wrote: On Tuesday, 3 December 2024 at 12:36:22 UTC, johnwalker wrote: You might want to check out [Mojo](https://syntaxscenarios.com/mojo). It’s great for modernizing Python code and offers high performance with Python interoperability

Re: D Tutorial

2024-12-20 Thread Sergey via Digitalmars-d-learn
On Friday, 20 December 2024 at 16:10:05 UTC, Duke wrote: Just installed D. Need to work through an online tutorial for the language. Recommendations please. TIA .. D tour, Ali’s book, chatGPT Then Google more to find more tutorials (like this one https://exercism.org/tracks/d) Join Discord -

Re: Plot one pixel in blue on a canvas

2024-11-29 Thread Sergey via Digitalmars-d-learn
On Friday, 29 November 2024 at 14:02:38 UTC, Alain De Vos wrote: I want to plot a pixel in blue at coordinates (100,100) on a canvas of size (200,200) Check this lib from p0nce maybe https://code.dlang.org/packages/canvasity. So steps should be like: ```bash dub init dub add canvasity ``` Co

Re: Using sets in associative arrays

2024-11-11 Thread Sergey via Digitalmars-d-learn
On Tuesday, 12 November 2024 at 00:42:41 UTC, Ralph wrote: Hi there, I know it is possible to declare an associative array which takes arrays as values, i.e. **int[][int] arr;** A sample of this could be **arr[2] = [2, 3, 2, 4, 5];** I was wondering if there was a way to have this with sets

Re: newbie question

2024-10-31 Thread Sergey via Digitalmars-d-learn
On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote: since i am converting from c# to d : 2. how to make built in array , std.container.slist, container.HashMap (emsi_containers) a range c# code void a(IEnumerable\ a) {} dcode void a(InputRange!string a) {} // notworking : i slice it to

Re: newbie question

2024-10-31 Thread Sergey via Digitalmars-d-learn
On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote: 3. known OAuth / OIDC Api Sdk in D. there is only Jwt stuff when search code.dlang.org. https://code.dlang.org/packages/oauth https://code.dlang.org/packages/vibe-auth

Re: Error when compiling with C libs

2024-10-13 Thread Sergey via Digitalmars-d-learn
On Sunday, 13 October 2024 at 20:06:44 UTC, barbosso wrote: error in line ```typedef float _Float32;``` clang can compile that line, but dmd or ldc can not! This is definatly compiler error! It is not an error.. This is just lack in the implementation. https://github.com/dlang/dmd/blob/f5fa64a

Re: Error when compiling with C libs

2024-10-13 Thread Sergey via Digitalmars-d-learn
On Sunday, 13 October 2024 at 13:49:49 UTC, barbosso wrote: I can compile tilengine examples with clang, but with ldc I get this error. Did you try this bindings? https://github.com/thechampagne/dtilengine

Re: LDC cant find lld-link when crosscompiling

2024-10-09 Thread Sergey via Digitalmars-d-learn
On Wednesday, 9 October 2024 at 16:07:29 UTC, AzuraAkumore wrote: Where have i messed up or am I even on the right track? It seems fine.. the only thing I can think about is misuse of 32/64 bit libs.. I have this notes: 1) Download Windows multilib 2) Install ldc on linux to LDC_PATH/ldc 3)

Re: Why is this not allowed?

2024-10-08 Thread Sergey via Digitalmars-d-learn
On Tuesday, 8 October 2024 at 07:07:44 UTC, ryuukk_ wrote: On Monday, 7 October 2024 at 19:34:00 UTC, Sergey wrote: On Saturday, 5 October 2024 at 06:35:57 UTC, ryuukk_ wrote: all other C like languages allow me to be concise Which one btw? Except C++ C#, Go and Zig seems against this functi

Re: Why is this not allowed?

2024-10-07 Thread Sergey via Digitalmars-d-learn
On Saturday, 5 October 2024 at 06:35:57 UTC, ryuukk_ wrote: all other C like languages allow me to be concise Which one btw? Except C++ C#, Go and Zig seems against this functionality..

Re: Precision Error?

2024-10-06 Thread Sergey via Digitalmars-d-learn
On Sunday, 6 October 2024 at 21:09:22 UTC, WhatMeWorry` wrote: float computeToFitInWindow(uint rows, uint cols) { // code removed ... writeln(hexWidth); return hexWidth; } unittest { assert(computeToFitInWindow(1, 1) == 2.0f, "This assert fai

Re: Why is this not allowed?

2024-10-05 Thread Sergey via Digitalmars-d-learn
On Saturday, 5 October 2024 at 10:35:30 UTC, ryuukk_ wrote: On Saturday, 5 October 2024 at 06:43:00 UTC, Richard (Rikki) Andrew Cattermole wrote: I don't know why it isn't supported. Its very useful with bindings to C. The parser should be able to swap it to a named instance with a generated

Re: mod of negative number

2024-09-24 Thread Sergey via Digitalmars-d-learn
On Monday, 23 September 2024 at 19:52:02 UTC, Craig Dillabaugh wrote: Why does the following program: \ import std.stdio; int main(string[] args) { uint Q = 7681; writeln("Val = ", -1 % Q); return 0; } \ Print Val

Re: Tuple List

2024-09-04 Thread Sergey via Digitalmars-d-learn
On Wednesday, 4 September 2024 at 08:45:04 UTC, Salih Dincer wrote: On Wednesday, 4 September 2024 at 08:04:58 UTC, drug007 wrote: Thank you, it's my mistake. We confused HOF, which has the same first letter. So, if we turn the question towards the associative array, can a similar one be done w

Re: How do I compile D code for WASM? Any alternative runtime recommendations?

2024-08-28 Thread Sergey via Digitalmars-d-learn
On Wednesday, 28 August 2024 at 19:29:39 UTC, monkyyy wrote: On Wednesday, 28 August 2024 at 19:08:58 UTC, Sergey wrote: In Discord we are collecting all links about different topics. We already have D & Wasm topic with most of the relevant links. airnt all the wasm projects by people not on

Re: How do I compile D code for WASM? Any alternative runtime recommendations?

2024-08-28 Thread Sergey via Digitalmars-d-learn
On Wednesday, 28 August 2024 at 18:26:21 UTC, solidstate1991 wrote: I don't really see any readily available tutorials for it quickly, but I'm willing to add one to the official Wiki. Official Wiki is busted :P In Discord we are collecting all links about different topics. We already have D &

Re: Getting started

2024-08-10 Thread Sergey via Digitalmars-d-learn
On Saturday, 10 August 2024 at 16:50:11 UTC, Ian wrote: How do I get started with Windows desktop programming in D? Any recommended IDEs? (I have decent experience with C/C++) Hi Ian. Many people who previously worked with Visual Studio like VisualD. For others one of the best support is in Vi

Re: Recommendations on porting Python to D

2024-08-08 Thread Sergey via Digitalmars-d-learn
On Thursday, 8 August 2024 at 20:20:11 UTC, Chris Piker wrote: (the rest is D). D in space when? :)

Re: How to build a statically linked executable, before i loose my mind

2024-07-13 Thread Sergey via Digitalmars-d-learn
On Saturday, 13 July 2024 at 14:53:41 UTC, ryuukk_ wrote: Why does it complain about SHARED when passing STATIC? It depends on the OS and if Linux - distribution.

Re: Being reading a lot about betterC, but still have some questions

2024-07-09 Thread Sergey via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 09:27:30 UTC, kiboshimo wrote: That's betterC targeting native. What about WASM? Does LDC -> WASM pipeline supports functionality one needs in a C-level language? If not, aside from atomics, one should be able to use C libraries to supplant any other purpose, right? S

Re: Vibe.d v0.9.0, v0.10.0: ` dub init hello -t vibe.d` fails to build on MacOS

2024-07-07 Thread Sergey via Digitalmars-d-learn
On Sunday, 7 July 2024 at 14:15:02 UTC, Ki Rill wrote: It worked, thank you! But what does it do; disables TLS? Thread Local Storage? It disabling transport layer security IMUC you won't be able to have "https" but only "http". So in case you need that, you can make another SubConfiguration

Re: Vibe.d v0.9.0, v0.10.0: ` dub init hello -t vibe.d` fails to build on MacOS

2024-07-07 Thread Sergey via Digitalmars-d-learn
On Sunday, 7 July 2024 at 10:55:21 UTC, Ki Rill wrote: Machine: ``` MacBook Pro (Retina, 15-inch, Late 2013), macOS Big Sur version 11.7.10 ``` How should I solve this? It mentions undefined symbols from openssl, but I have it installed. Vibe.d should link it automatically, right? You can

Re: Why is this happening to my software? An illegal instruction error.

2024-06-26 Thread Sergey via Digitalmars-d-learn
On Tuesday, 18 June 2024 at 23:07:47 UTC, Murilo wrote: I've created a software which performs the Fermat's Primality Test, however if I input a very big number it causes an error saying "Illegal instruction (core dumped)". Does anyone know why? I've used GDB and here is the message: Program

Re: Google Auth API

2024-06-19 Thread Sergey via Digitalmars-d-learn
On Tuesday, 18 June 2024 at 01:38:04 UTC, Vahid wrote: Hi, Has anyone here had experience implementing the Google Auth Library in DLang? Specifically, I am looking for guidance on handling OAuth 2.0 using JWT. Are there any current libraries available for this purpose? Oh a pain-point of D

Re: How to use D without the GC ?

2024-06-12 Thread Sergey via Digitalmars-d-learn
On Tuesday, 11 June 2024 at 17:15:07 UTC, Vinod K Chandran wrote: On Tuesday, 11 June 2024 at 16:54:44 UTC, Steven Schveighoffer wrote: Two reasons. 1. I am writting a dll to use in Python. So I am assuming that Btw are you going to use PyD or doing everything manually from scratch?

Re: Challenge Tuples

2024-04-27 Thread Sergey via Digitalmars-d-learn
On Friday, 26 April 2024 at 13:25:34 UTC, Salih Dincer wrote: You have a 5-item data tuples as Tuple(1, 2, 3, [1, 3], 5) and implement the sum (total = 15) with the least codes using the sum() function of the language you are coding... Let's start with D: ```d import std.typecons : tuple; im

Re: Recommendations on porting Python to D

2024-04-25 Thread Sergey via Digitalmars-d-learn
On Wednesday, 24 April 2024 at 22:07:41 UTC, Chris Piker wrote: Python-AST to D source converter may already exist? Another possible way maybe is using C :) Python -> C -> D https://wiki.python.org/moin/PythonImplementations#Compilers

Re: Recommendations on porting Python to D

2024-04-24 Thread Sergey via Digitalmars-d-learn
On Wednesday, 24 April 2024 at 19:50:45 UTC, Chris Piker wrote: Hi D I have a somewhat extensive CGI based web service written in There is also https://code.dlang.org/packages/arsd-official%3Acgi

Re: Why is this code slow?

2024-03-28 Thread Sergey via Digitalmars-d-learn
On Thursday, 28 March 2024 at 20:18:10 UTC, rkompass wrote: D advantage is gone here, I would say. It's hard to compare actually. Std.parallelism has a bit different mechanics, and I think easier to use. The syntax is nicer. OpenMP is an well-known and highly adopted tool, which is also qui

Re: Why is this code slow?

2024-03-24 Thread Sergey via Digitalmars-d-learn
On Sunday, 24 March 2024 at 22:16:06 UTC, rkompass wrote: Are there some simple switches / settings to get a smaller binary? 1) If possible you can use "betterC" - to disable runtime 2) otherwise ```bash --release --O3 --flto=full -fvisibility=hidden -defaultlib=phobos2-ldc-lto,druntime-ldc-lt

Re: Why is this code slow?

2024-03-24 Thread Sergey via Digitalmars-d-learn
On Sunday, 24 March 2024 at 19:31:19 UTC, Csaba wrote: As you can see the function that does the job is exactly the same in C and D. Not really.. The speed of Leibniz algo is mostly the same. You can check the code in this benchmark for example: https://github.com/niklas-heer/speed-comparison

Re: The std.file rename method fails in the docker environment.

2024-03-13 Thread Sergey via Digitalmars-d-learn
On Wednesday, 13 March 2024 at 21:49:55 UTC, zoujiaqing wrote: this is bug in D. It seems like a bug in Hunt-framework. And Hunt - is an abandoned project.

Re: Recommendation about templating engine library

2024-03-11 Thread Sergey via Digitalmars-d-learn
On Monday, 11 March 2024 at 15:34:11 UTC, Andrea wrote: There is also diet : https://code.dlang.org/packages/diet-ng Is'nt `diet` specific for HTML / XML structured text ? right. Just mentioned Go library also mostly for HTML generation.

Re: Recommendation about templating engine library

2024-03-11 Thread Sergey via Digitalmars-d-learn
On Monday, 11 March 2024 at 14:26:01 UTC, Andrea wrote: Opinions ? Many thanks There is also diet : https://code.dlang.org/packages/diet-ng

Re: vibe.d still does not work on FreeBSD.

2024-02-18 Thread Sergey via Digitalmars-d-learn
On Sunday, 18 February 2024 at 13:23:53 UTC, Alain De Vos wrote: DEFAULT_VERSIONS+= ssl=openssl111 Maybe also could be helpful to share your dub.json, compiler version and OS version as well.

Re: length's type.

2024-02-09 Thread Sergey via Digitalmars-d-learn
On Friday, 9 February 2024 at 08:04:56 UTC, Danilo wrote: Rust, Nim, Zig, Odin…? Here is the Forum for D(lang). ;) But it is fine to see what others have.. Teach on their experience is useful This is how research is going

Re: How to unpack a tuple into multiple variables?

2024-02-05 Thread Sergey via Digitalmars-d-learn
On Monday, 5 February 2024 at 21:12:58 UTC, Gary Chike wrote: I hope all is well with everyone. I have come to an impasse. What is the best way to unpack a tuple into multiple variables in D similar to this Python code? Thank you! ### TL;DR The direct implementation still not presented. But th

Re: Accessing array elements with a pointer-to-array

2024-01-26 Thread Sergey via Digitalmars-d-learn
On Friday, 26 January 2024 at 11:38:39 UTC, Stephen Tashiro wrote: On Thursday, 25 January 2024 at 20:36:49 UTC, Kagamin wrote: On Thursday, 25 January 2024 at 20:11:05 UTC, Stephen Tashiro wrote: void main() { ulong [3][2] static_array = [ [0,1,2],[3,4,5] ]; static_array[

Re: Accessing array elements with a pointer-to-array

2024-01-25 Thread Sergey via Digitalmars-d-learn
On Thursday, 25 January 2024 at 20:11:05 UTC, Stephen Tashiro wrote: Can the elements of an array be accessed with a pointer using the usual indexing notation (e.g."[2][0]") for array elements? - or must we treat the elements associated with the pointer as 1-dimensional list and use pointer ari

Re: Help optimize D solution to phone encoding problem: extremely slow performace.

2024-01-14 Thread Sergey via Digitalmars-d-learn
On Sunday, 14 January 2024 at 17:11:27 UTC, Renato wrote: If anyone can find any flaw in my methodology or optmise my code so that it can still get a couple of times faster, approaching Rust's performance, I would greatly appreciate that! But for now, my understanding is that the most promising

Re: The One Billion Row Challenge

2024-01-13 Thread Sergey via Digitalmars-d-learn
On Saturday, 13 January 2024 at 23:25:07 UTC, monkyyy wrote: On Thursday, 11 January 2024 at 11:21:39 UTC, Sergey wrote: On Thursday, 11 January 2024 at 08:57:43 UTC, Christian Köstlin wrote: Did someone already try to do this in dlang? I guess it will be very hard to beat the java solutions r

Re: Help optimize D solution to phone encoding problem: extremely slow performace.

2024-01-13 Thread Sergey via Digitalmars-d-learn
On Saturday, 13 January 2024 at 19:35:57 UTC, Renato wrote: On Saturday, 13 January 2024 at 17:00:58 UTC, Anonymouse wrote: On Saturday, 13 January 2024 at 12:55:27 UTC, Renato wrote: [...] I will have to try it... I thought that `BigInt` was to blame for the slowness (from what I could read f

Re: How to use ImportC to import WebGPU header

2024-01-12 Thread Sergey via Digitalmars-d-learn
On Friday, 12 January 2024 at 11:06:39 UTC, Bkoie wrote: On Thursday, 11 January 2024 at 15:18:08 UTC, Sergey wrote: On Wednesday, 10 January 2024 at 23:36:33 UTC, JN wrote: I would like to use ImportC to automatically import a C header into my D project. It was already done. Use it https://

Re: How to use ImportC to import WebGPU header

2024-01-11 Thread Sergey via Digitalmars-d-learn
On Wednesday, 10 January 2024 at 23:36:33 UTC, JN wrote: I would like to use ImportC to automatically import a C header into my D project. It was already done. Use it https://code.dlang.org/packages/wgpu-d Don't reinvent the wheel :)

Re: The One Billion Row Challenge

2024-01-11 Thread Sergey via Digitalmars-d-learn
On Thursday, 11 January 2024 at 08:57:43 UTC, Christian Köstlin wrote: Did someone already try to do this in dlang? I guess it will be very hard to beat the java solutions running with graalvm! https://news.ycombinator.com/item?id=38851337 Kind regards, Christian I think C++ people already

Re: dlang.org/Learn "hello_world".sort.chain ...

2023-12-26 Thread Sergey via Digitalmars-d-learn
On Tuesday, 26 December 2023 at 13:58:54 UTC, tony wrote: On Tuesday, 26 December 2023 at 11:19:29 UTC, Sergey wrote: Use typeid, instead of typeof Thanks! Got quite a type but I will worry about that later: std.range.SortedRange!(Result, "a < b").SortedRange Yes, because sort is returnin

Re: dlang.org/Learn "hello_world".sort.chain ...

2023-12-26 Thread Sergey via Digitalmars-d-learn
On Tuesday, 26 December 2023 at 10:53:10 UTC, Tony wrote: I just typed in the program that is on the first page of Learn. It has this line: sort(chain(arr1, arr2, arr3)); I assigned that to a variable: arr4 = sort(chain(arr1, arr2, arr3)); then printed it out writefln("%s",arr4); // works

Re: macOS Sonoma Linker Issue

2023-12-22 Thread Sergey via Digitalmars-d-learn
On Friday, 22 December 2023 at 17:45:27 UTC, Renato wrote: I'm afraid I've lost interest to make it work at this point :( Did you add "-L-ld_classic"?

Re: D is a great language, but I've had a bad experience getting started

2023-12-14 Thread Sergey via Digitalmars-d-learn
On Thursday, 14 December 2023 at 13:27:29 UTC, Renato wrote: On Thursday, 14 December 2023 at 13:12:06 UTC, Richard (Rikki) My build options are currently: ``` "dflags-dmd": [ "-v"], "lflags": ["-ld_classic"] ``` I tried some variations but nothing worked. Previously for macOS it was

Re: How to hash SHA256 from string?

2023-12-02 Thread Sergey via Digitalmars-d-learn
On Saturday, 2 December 2023 at 15:30:39 UTC, zoujiaqing wrote: SHA Sorry for OT, but don’t know different place to reach you out. What is the status of Archttp? Is it discontinued/abandoned?

Re: Advent of Code 2023

2023-12-02 Thread Sergey via Digitalmars-d-learn
On Saturday, 2 December 2023 at 13:33:33 UTC, Johannes Miesenhardt wrote: Day 1 solution here, since I swap them out based on a runtime argument. In the Discord server we also have a topic about AoC2023. So feel free to join it as well. Some other solutions that could be worth to check: h

Re: Advent of Code 2023

2023-12-01 Thread Sergey via Digitalmars-d-learn
On Friday, 1 December 2023 at 01:01:31 UTC, Siarhei Siamashka wrote: Advent of Code 2023 starts in a few hours from now. I suggest to discuss D language solutions here. But to avoid spoilers, it's best to do this with a 24h delay after each puzzle is published. Hi Siarhei. Nice to see that you

Re: How do I install a package globally?

2023-11-11 Thread Sergey via Digitalmars-d-learn
On Saturday, 11 November 2023 at 01:50:54 UTC, Trevor wrote: I'm just getting in to D , coming from a C and Python background. I've had a play with DUB and adding packages to my project, but it seems like there should be a way to install packages so they can be used in any D program I compile w

Re: performance issues with SIMD function

2023-11-03 Thread Sergey via Digitalmars-d-learn
On Friday, 3 November 2023 at 15:11:31 UTC, Bogdan wrote: Hi everyone, I was playing around with the intel-intrinsics library, trying to improve the speed of a simple area function. I could not see any performance improvements from the non-SIMD implementation. The SIMD version is a little bit

Re: What are the best available D (not C) File input/output options?

2023-11-02 Thread Sergey via Digitalmars-d-learn
On Thursday, 2 November 2023 at 15:46:23 UTC, confuzzled wrote: I've ported a small script from C to D. The original C version takes roughly 6.5 minutes to parse a 12G file while the port originally took about 48 minutes. In my experience I/O in D is quite slow. But you can try to improve it:

Re: Question regarding mir.csv.

2023-11-01 Thread Sergey via Digitalmars-d-learn
On Wednesday, 1 November 2023 at 20:49:16 UTC, Zz wrote: Hi, Currently using std.csv and would like to do the following using mir.csv. auto data = std.csv.csvReader!Layout(input).array; Are there any examples out there on using mir.csv? Regards, Zz you can find some examples in source cod

Re: Symbolic computations in D

2023-10-30 Thread Sergey via Digitalmars-d-learn
On Monday, 30 October 2023 at 13:13:47 UTC, jmh530 wrote: On Sunday, 29 October 2023 at 10:44:03 UTC, ryuukk_ wrote: Julia is more an alternative to R, Matlab, Python than C++. Not really. Many especially popular and widely used (NumPy, PyTorch, data.table) libraries for R and Python implemen

Re: how to assign multiple variables at once by unpacking array?

2023-10-07 Thread Sergey via Digitalmars-d-learn
On Saturday, 7 October 2023 at 16:12:47 UTC, mw wrote: Interesting: in terms of easy of coding, clarity and future maintenance, which one is superior? There is no superior languages. They can successfully co-exist and play in different areas. The one liner in Python, or your "solution" with

Re: D web browser?

2023-09-08 Thread Sergey via Digitalmars-d-learn
On Friday, 8 September 2023 at 06:42:13 UTC, Joe wrote: Is there a D library that lets one access the web through a browser like interface? I need to access some URLS as if I was browsing them(it needs to run scripts in the page). E.g., C# has WebBrowser that lets one programmatically control

Re: aarch64 plans for D lang ?

2023-08-28 Thread Sergey via Digitalmars-d-learn
On Monday, 28 August 2023 at 15:14:52 UTC, BrianLinuxing wrote: On Monday, 28 August 2023 at 15:04:25 UTC, Sergey wrote: On Monday, 28 August 2023 at 14:38:36 UTC, BrianLinuxing wrote: Afternoon all, I think D Lang has such potential :) Both GDC and LDC should support Linux aarch64. LDC even

Re: aarch64 plans for D lang ?

2023-08-28 Thread Sergey via Digitalmars-d-learn
On Monday, 28 August 2023 at 14:38:36 UTC, BrianLinuxing wrote: Afternoon all, I think D Lang has such potential :) Both GDC and LDC should support Linux aarch64. LDC even has file in Releases https://github.com/ldc-developers/ldc/releases/tag/v1.34.0

Re: parallel threads stalls until all thread batches are finished.

2023-08-23 Thread Sergey via Digitalmars-d-learn
On Wednesday, 23 August 2023 at 13:03:36 UTC, Joe wrote: I use foreach(s; taskPool.parallel(files, numParallel)) { L(s); } // L(s) represents the work to be done. If you make for example that L function return “ok” in case file successfully downloaded, you can try to use TaskPool.amap. The

Mach status support

2023-08-21 Thread Sergey via Digitalmars-d-learn
When I worked with one C code translation, I found that command clock_gettime, that available in POSIX systems is not implemented in MacOS. This SO thread https://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x suggested some workaround implementations, which using so

Re: dub does not correctly link on Macbook Pro 2019 (intel)

2023-08-19 Thread Sergey via Digitalmars-d-learn
On Saturday, 19 August 2023 at 21:35:25 UTC, Alexander wrote: Completely new to D, and when trying to setup the toolchain, Could you please specify the versions of macOS and DMD? Probably DMD is broken for macOS - could you try to use LDC? Maybe this thread is relative to the problem: https:/

Re: How can I execute C++ functions from Dlang?

2023-08-14 Thread Sergey via Digitalmars-d-learn
On Monday, 14 August 2023 at 06:40:04 UTC, thePengüin wrote: hola a todos quisiera ejecutar este codigo de c++ Error: linker exited with status 1 Hola. On the page https://dlang.org/spec/cpp_interface.html commands to run also have different flags. Did you try them? g++ -c foo.cpp dmd bar.d fo

Re: Garbage Collectors

2023-07-19 Thread Sergey via Digitalmars-d-learn
On Wednesday, 19 July 2023 at 07:24:06 UTC, IchorDev wrote: So, D’s default garbage collector is the one named “conservative” in DRuntime… I see there’s also “manual” which doesn’t actually function as a GC, which is interesting. Nothing says what ProtoGC is… so I guess it’s useless. Has anyone

Re: Installing GDC / Linux / x86-64 when apt-get doesn’t work

2023-07-10 Thread Sergey via Digitalmars-d-learn
On Tuesday, 11 July 2023 at 04:11:38 UTC, Cecil Ward wrote: I’m trying to install GDC on a new Linux box and I don’t know what I’m doing. Background: I have installed LDC successfully and have installed GDC on a Raspberry Pi using 32-bit ARM. For some reason the apt-get command doesn’t work on

Re: Options for Cross-Platform 3D Game Development

2023-07-06 Thread Sergey via Digitalmars-d-learn
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote: So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. Are there any other rec

Re: Graphing

2023-07-01 Thread Sergey via Digitalmars-d-learn
On Saturday, 1 July 2023 at 01:00:46 UTC, anonymouse wrote: How would I go about graphing time series data (specifically, candles, moving averages, etc) in D and dynamically updating such charts? Thanks, --anonymouse For TS you can use http://mir-algorithm.libmir.org/mir_series.html For plot

Re: Lockstep iteration in parallel: Error: cannot have parameter of type `void`

2023-05-20 Thread Sergey via Digitalmars-d-learn
On Saturday, 20 May 2023 at 18:27:47 UTC, Ali Çehreli wrote: On 5/20/23 04:21, kdevel wrote: And I've just discovered something. Which one of the following is the expected documentation? https://dlang.org/library/std/parallelism.html https://dlang.org/phobos/std_parallelism.html What pat

Re: How does the function 'iota' get its name?

2023-02-12 Thread Sergey via Digitalmars-d-learn
On Sunday, 12 February 2023 at 19:39:49 UTC, Steven Schveighoffer wrote: On 2/12/23 2:17 PM, ccmywish wrote: Hi, everyone! I'm very new to D. I see a function called [iota](https://dlang.org/library/std/range/iota.html) `Iota` seems a [Greek letter](https://en.wikipedia.org/wiki/Iota). Why

Re: Tab completion using neovim

2023-01-21 Thread Sergey via Digitalmars-d-learn
On Saturday, 21 January 2023 at 13:17:44 UTC, Alain De Vos wrote: Let's say i write "write" press tab in neovim i want it to guess "writeln". How to configure neovim for this. [ Note "ncm2" lets my neovim crash. But maybe there are alternatives ] [ vscode is not an option as compiling electron

Re: Pyd examples or resources for Python 3.x

2023-01-19 Thread Sergey via Digitalmars-d-learn
On Friday, 20 January 2023 at 00:39:47 UTC, Seamus wrote: Howdy folks Honestly in my opinion PyD looks kinda abounded. I don’t know how much effort you need to spend to run spaCy. Just to be sure that you’ve seen this documentation https://pyd.readthedocs.io/en/latest/index.html Also probab

Re: Solving optimization problems with D

2023-01-03 Thread Sergey via Digitalmars-d-learn
On Sunday, 1 January 2023 at 21:11:06 UTC, Ogi wrote: I’ve read this [series if articles](https://www.gamedeveloper.com/design/decision-modeling-and-optimization-in-game-design-part-1-introduction) about using Excel Solver for all kinds of optimization problems. This is very neat, but of course,

Re: Float rounding (in JSON)

2022-12-30 Thread Sergey via Digitalmars-d-learn
On Thursday, 13 October 2022 at 19:00:30 UTC, Sergey wrote: I'm not a professional of IEEE 754, but just found this behavior at rounding in comparison with other languages. I supose it happened because in D float numbers parsed as double and have a full length of double while rounding. But this

Re: How to create a API server?

2022-12-18 Thread Sergey via Digitalmars-d-learn
On Friday, 16 December 2022 at 20:57:30 UTC, Dariu Drew wrote: Hi! i need help in can i create a serve API, what library i should use? what documentation i should read? Check the bench: https://github.com/tchaloupka/httpbench there are a lot of web servers in D. You can find one that fits your

  1   2   >