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

2022-05-13 Thread zjh via Digitalmars-d-learn
On Saturday, 14 May 2022 at 04:31:48 UTC, zjh wrote: Likewise, each post could add something like `votes` , Or something like all kinds of `tags` such as `range/fiber/commandline/auto ref/in/...`. Making `good use` of the `existing answers` in the forum will be very beneficial for `D`

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

2022-05-13 Thread zjh via Digitalmars-d-learn
On Saturday, 14 May 2022 at 04:09:00 UTC, Ali Çehreli wrote: stopped by a spam filter. Right. D forum should add a "`author delete`" function. Likewise, each post could add something like `votes` , good posts will naturally `come out` and be collected together. It's really convenient for

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

2022-05-13 Thread Ali Çehreli via Digitalmars-d-learn
On 5/13/22 21:07, zjh wrote: On Friday, 13 May 2022 at 21:54:04 UTC, max haughton wrote: Can `D` support error messages in `multiple languages`? Such as `Chinese/German/Russian/Turkey`. OT: It is unlikely but possible that posts are sometimes stopped by a spam filter. That must be why zjh

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

2022-05-13 Thread zjh via Digitalmars-d-learn
On Friday, 13 May 2022 at 21:54:04 UTC, max haughton wrote: Can `D` support error messages in `multiple languages`? Such as `Chinese/German/Russian/Turkey`.

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

2022-05-13 Thread zjh via Digitalmars-d-learn
On Friday, 13 May 2022 at 21:54:04 UTC, max haughton wrote: I have a PR which alters the error message you get if you do ```d void main() { func() == 43; } ``` This is an example of an error message which could be counterintuitive to a new D programmer, Can `D` support error messages in

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread zjh via Digitalmars-d-learn
On Friday, 13 May 2022 at 13:06:32 UTC, vit wrote: On Friday, 13 May 2022 at 11:58:15 UTC, zjh wrote: Thank you for your detail explain.

Re: Back to Basics at DConf?

2022-05-13 Thread forkit via Digitalmars-d-learn
On Friday, 13 May 2022 at 15:56:31 UTC, H. S. Teoh wrote: My mental image of this is Ali presenting some simple common task, then at 3/4 of the presentation there's an amazing trick that lets you write it in D in 5 times less code than in other languages, and my mind is blown and I remember

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

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

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

2022-05-13 Thread max haughton via Digitalmars-d-learn
On Friday, 13 May 2022 at 21:07:12 UTC, Christopher Katko wrote: Is there any way we can get numbered errors like C++ / Microsoft have? E2040 Declaration terminated incorrectly Because then we could easily have a wiki for common error cases with code snippets of it occurring, and a fix for

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

2022-05-13 Thread Christopher Katko via Digitalmars-d-learn
Is there any way we can get numbered errors like C++ / Microsoft have? E2040 Declaration terminated incorrectly Because then we could easily have a wiki for common error cases with code snippets of it occurring, and a fix for it. Common triggers of this error vs the proper code. And a

Re: Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread zoujiaqing via Digitalmars-d-learn
On Friday, 13 May 2022 at 19:48:04 UTC, Steven Schveighoffer wrote: On 5/13/22 3:46 PM, Steven Schveighoffer wrote: What writeln? Your compile trace is missing the original call line, and I would say probably more. Looking at your last commit, I figured it out:

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread Ali Çehreli via Digitalmars-d-learn
On 5/13/22 00:32, Chris Katko wrote: > Luckily, because I'm painting them to the screen, the > buffers only really need to be float even if they started as a boolean, > int, or double. However, if I'm keeping a list of pointers to things I > want to snoop when I call onTick(), I can't think of a

Re: Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/22 3:46 PM, Steven Schveighoffer wrote: What writeln? Your compile trace is missing the original call line, and I would say probably more. Looking at your last commit, I figured it out:

Re: Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/22 3:39 PM, zoujiaqing wrote: ```bash % git clone https://github.com/kerisy/archttp.git % cd archttp/ % dub build --compiler=dmd Performing "debug" build using dmd for x86_64. archttp 0.0.1+commit.3.g70d44ef: building configuration "library"...

Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread zoujiaqing via Digitalmars-d-learn
```bash % git clone https://github.com/kerisy/archttp.git % cd archttp/ % dub build --compiler=dmd Performing "debug" build using dmd for x86_64. archttp 0.0.1+commit.3.g70d44ef: building configuration "library"... ../../.dub/packages/nbuff-0.1.14/nbuff/source/nbuff/buffer.d(74,25):

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

2022-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/22 2:29 PM, Adam D Ruppe wrote: On Friday, 13 May 2022 at 18:23:58 UTC, H. S. Teoh wrote: On Thu, May 12, 2022 at 11:45:47PM +, Guillaume Piolat via It's a problem because it goes from solving "no accidental race condition" and you get "people forget to add shared or __gshared and

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

2022-05-13 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, May 13, 2022 at 06:29:54PM +, Adam D Ruppe via Digitalmars-d-learn wrote: [...] > Yeah, I used to be pro-TLS by default, then got bit by it several > times and moved to the fence, and now I'm anti. > > Data races aren't actually prevented by it (maybe forcing you to > specify shared

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

2022-05-13 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 13 May 2022 at 18:23:58 UTC, H. S. Teoh wrote: On Thu, May 12, 2022 at 11:45:47PM +, Guillaume Piolat via It's a problem because it goes from solving "no accidental race condition" and you get "people forget to add shared or __gshared and their shared library silently fail"

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

2022-05-13 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 12, 2022 at 11:45:47PM +, Guillaume Piolat via Digitalmars-d-learn wrote: > On Thursday, 12 May 2022 at 17:34:30 UTC, H. S. Teoh wrote: > > > > Why is TLS by default a problem? > > > > It's not really for optimization, AIUI, it's more for thread safety: > > module-global state

Re: Language server

2022-05-13 Thread Alain De Vos via Digitalmars-d-learn
I have now a language server running for dlang and ocaml on the neovim editor. I'll post here the config init.vim for someone who might be interested. ``` call plug#begin() Plug 'https://github.com/vim-airline/vim-airline.git' Plug 'https://github.com/preservim/nerdtree.git' Plug

Re: Best Practice to manage large projects with dub?

2022-05-13 Thread max haughton via Digitalmars-d-learn
On Friday, 13 May 2022 at 17:51:55 UTC, Ozan Süel wrote: Hi My situation: I'm working on and with many projects based on many libraries. I know how to handle these in Git, GitHub and Dub. But what would be the Best Practice in current dub? Let's say, we have many apps (1 app = 1 package),

Best Practice to manage large projects with dub?

2022-05-13 Thread Ozan Süel via Digitalmars-d-learn
Hi My situation: I'm working on and with many projects based on many libraries. I know how to handle these in Git, GitHub and Dub. But what would be the Best Practice in current dub? Let's say, we have many apps (1 app = 1 package), which use several libs (Every app has his own set of used

Re: What exact debugging information is added to the binary and how to parse it all?

2022-05-13 Thread Basile B. via Digitalmars-d-learn
On Friday, 13 May 2022 at 16:11:14 UTC, BoQsc wrote: Haven't used debuggers or debugged a lot just yet, but I've had this question in my mind and I'd like to inspect some debugging information manually. Are there some kind of documentation or specification and are there a lot of information

What exact debugging information is added to the binary and how to parse it all?

2022-05-13 Thread BoQsc via Digitalmars-d-learn
Haven't used debuggers or debugged a lot just yet, but I've had this question in my mind and I'd like to inspect some debugging information manually. Are there some kind of documentation or specification and are there a lot of information that is hidden in a an average "debuggable" binary?

Re: Back to Basics at DConf?

2022-05-13 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, May 13, 2022 at 03:43:09PM +, Johan via Digitalmars-d-learn wrote: > On Thursday, 12 May 2022 at 21:58:33 UTC, Ali Çehreli wrote: > > I am considering proposing a presentation for DConf 2022. > > > > Would a "Back to Basics" style presentation be interesting? If, so > > what exact

Re: Back to Basics at DConf?

2022-05-13 Thread Johan via Digitalmars-d-learn
On Thursday, 12 May 2022 at 21:58:33 UTC, Ali Çehreli wrote: I am considering proposing a presentation for DConf 2022. Would a "Back to Basics" style presentation be interesting? If, so what exact topic would you like to see? Hey Ali, When I read "Back to basics" on a program language

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread frame via Digitalmars-d-learn
On Friday, 13 May 2022 at 07:32:16 UTC, Chris Katko wrote: This is a kinda "dynamic language" feature but it feels like this information is theoretically, knowable at static, compile-time. I know what the variable types will be at compile-time, but I don't know how to put them all in one

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread vit via Digitalmars-d-learn
On Friday, 13 May 2022 at 11:58:15 UTC, zjh wrote: On Friday, 13 May 2022 at 08:28:56 UTC, vit wrote: ... ```d ... this(DataSources dataSources){ this.dataSources = dataSources; } ... return new MultiGraph!(staticMap!(PointerTarget, Ts))(ts);//ts ``` How is `ts` convert to

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread zjh via Digitalmars-d-learn
On Friday, 13 May 2022 at 08:28:56 UTC, vit wrote: ... ```d ... this(DataSources dataSources){ this.dataSources = dataSources; } ... return new MultiGraph!(staticMap!(PointerTarget, Ts))(ts);//ts ``` How is `ts` convert to `DataSources`?

Re: Back to Basics at DConf?

2022-05-13 Thread zjh via Digitalmars-d-learn
On Thursday, 12 May 2022 at 21:58:33 UTC, Ali Çehreli wrote: so what exact topic would you like to see? May be you can talk about how to link `d` to`C++`. There are too few examples. Or `D` how to link to `Rust`,etc. I don't even read the `basics` of C++, which is boring. And interested

Re: Back to Basics at DConf?

2022-05-13 Thread forkit via Digitalmars-d-learn
On Friday, 13 May 2022 at 03:31:53 UTC, Ali Çehreli wrote: On 5/12/22 18:56, forkit wrote: > So...you want to do a talk that challenges D's complexity, by getting > back to basics? I wasn't thinking about challenging complexity but it gives me ideas. I am looking for concrete topics like

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread vit via Digitalmars-d-learn
On Friday, 13 May 2022 at 07:32:16 UTC, Chris Katko wrote: On Friday, 13 May 2022 at 07:05:36 UTC, vit wrote: On Friday, 13 May 2022 at 06:43:39 UTC, Chris Katko wrote: I have an intrinsicGraph(T) class that is given a pointer to a T dataSource and automatically polls that variable every

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread Chris Katko via Digitalmars-d-learn
On Friday, 13 May 2022 at 07:05:36 UTC, vit wrote: On Friday, 13 May 2022 at 06:43:39 UTC, Chris Katko wrote: I have an intrinsicGraph(T) class that is given a pointer to a T dataSource and automatically polls that variable every frame to add it to the graph, whether it's a float, double,

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
On 13/05/2022 7:03 PM, MichaelBi wrote: On Friday, 13 May 2022 at 06:43:30 UTC, rikki cattermole wrote: On 13/05/2022 6:23 PM, MichaelBi wrote: render!("index.dt", showData()); There ya go, template arguments are run at compile time. Unh, then how to dynamically generate pages

Re: Template shenannigans with multiple datatypes

2022-05-13 Thread vit via Digitalmars-d-learn
On Friday, 13 May 2022 at 06:43:39 UTC, Chris Katko wrote: I have an intrinsicGraph(T) class that is given a pointer to a T dataSource and automatically polls that variable every frame to add it to the graph, whether it's a float, double, integer, and maybe bool. [...] I dont understand

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread MichaelBi via Digitalmars-d-learn
On Friday, 13 May 2022 at 06:43:30 UTC, rikki cattermole wrote: On 13/05/2022 6:23 PM, MichaelBi wrote:     render!("index.dt", showData()); There ya go, template arguments are run at compile time. Unh, then how to dynamically generate pages by using vibe.d

Template shenannigans with multiple datatypes

2022-05-13 Thread Chris Katko via Digitalmars-d-learn
I have an intrinsicGraph(T) class that is given a pointer to a T dataSource and automatically polls that variable every frame to add it to the graph, whether it's a float, double, integer, and maybe bool. This all works fine if you have a single template type. But what if I want ... multiple

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
On 13/05/2022 6:23 PM, MichaelBi wrote:     render!("index.dt", showData()); There ya go, template arguments are run at compile time.

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread MichaelBi via Digitalmars-d-learn
On Friday, 13 May 2022 at 06:12:01 UTC, rikki cattermole wrote: Okay that is fine, now we need to see where showData is being called. thanks, here's the code: import vibe.vibe; import std.process; import std.conv : to; void main() { auto settings = new HTTPServerSettings;

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
Okay that is fine, now we need to see where showData is being called.

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread MichaelBi via Digitalmars-d-learn
On Friday, 13 May 2022 at 06:01:29 UTC, rikki cattermole wrote: On 13/05/2022 5:52 PM, MichaelBi wrote: struct Camera{ @name("_id") BsonObjectID id; // represented as "_id" in the database string brand; string model; } the structure is mapping of database field structure. how

Re: Help, in vibe.d, how to get configure var of mongodb in heroku?

2022-05-13 Thread rikki cattermole via Digitalmars-d-learn
On 13/05/2022 5:52 PM, MichaelBi wrote: struct Camera{ @name("_id") BsonObjectID id; // represented as "_id" in the database string brand; string model; } the structure is mapping of database field structure. how to resolve? That code isn't the cause of your issue (its fine,