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

2022-05-22 Thread max haughton via Digitalmars-d-learn
On Sunday, 22 May 2022 at 20:05:33 UTC, Chris Piker wrote: On Sunday, 22 May 2022 at 19:33:21 UTC, rikki cattermole wrote: I should probably jump back to another thread, but maybe one more reply isn't too much off topic discussion... [...] https://github.com/gcc-mirror/gcc/tree/master/gcc/t

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

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 8:22 AM, Chris Piker wrote: Hey thanks!  I bet LDC is pretty cool, have to look into it sometime. For now at my site just introducing D is a bit radical, don't want to capsize the boat by leaving the gcc toolchain altogether.  I'm willing to help out with GDC work were I can, a

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

2022-05-22 Thread Chris Piker via Digitalmars-d-learn
On Sunday, 22 May 2022 at 20:11:12 UTC, rikki cattermole wrote: On 23/05/2022 8:05 AM, Chris Piker wrote: Vibe.d is well tested against the frontend. Its part of dmd's test suite. See: https://buildkite.com/dlang/dmd/builds/26775 Thanks, that's handy.  Do you know where the equivalent test s

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

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 8:05 AM, Chris Piker wrote: Vibe.d is well tested against the frontend. Its part of dmd's test suite. See: https://buildkite.com/dlang/dmd/builds/26775 Thanks, that's handy.  Do you know where the equivalent test suite is for gdc? No idea. I've pinged Iain, because you are c

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

2022-05-22 Thread Chris Piker via Digitalmars-d-learn
On Sunday, 22 May 2022 at 19:33:21 UTC, rikki cattermole wrote: I should probably jump back to another thread, but maybe one more reply isn't too much off topic discussion... DMD and LDC would have produced the same set of issues, because its the same frontend. Oh, the compile stage works o

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

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 7:24 AM, Chris Piker wrote:    2. Testing common packages against gdc Why? Mostly because I've put in about 15 hours effort so far trying to get a vibe.d based project to build using gdc, with no success. I'm about to give up and declare either gdc or vibe.d unsuitable for u

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

2022-05-22 Thread Chris Piker via Digitalmars-d-learn
On Sunday, 22 May 2022 at 19:01:41 UTC, rikki cattermole wrote: On 23/05/2022 6:06 AM, Chris Piker wrote: Iain's workload should be decreasing now that it is using the up to date frontend. Rather than the older C++ version with backports that he has been maintaining. Hats off to Iain for sur

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

2022-05-22 Thread rikki cattermole via Digitalmars-d-learn
On 23/05/2022 6:06 AM, Chris Piker wrote:   1. Supporting gdc development and distribution. Iain's workload should be decreasing now that it is using the up to date frontend. Rather than the older C++ version with backports that he has been maintaining. My understanding is that he is fin

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

2022-05-22 Thread Chris Piker via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali Hi Ali, thanks for asking. Coming from C background I had problems wi

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

2022-05-21 Thread max haughton via Digitalmars-d-learn
On Saturday, 21 May 2022 at 19:00:04 UTC, Johan wrote: On Tuesday, 17 May 2022 at 06:28:10 UTC, cc wrote: On Monday, 16 May 2022 at 15:08:15 UTC, H. S. Teoh wrote: [...] According to the dlang.org wiki entry for LDC: [...] So I'm not touching it for now. Lol, what? Don't misquote the wi

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

2022-05-21 Thread Johan via Digitalmars-d-learn
On Tuesday, 17 May 2022 at 06:28:10 UTC, cc wrote: On Monday, 16 May 2022 at 15:08:15 UTC, H. S. Teoh wrote: For anything performance-related, I don't even look at dmd, I use LDC all the way. DMD is only useful for fast compile-run-debug cycle, I don't even look at performance numbers for DMD-

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

2022-05-21 Thread eugene via Digitalmars-d-learn
On Tuesday, 17 May 2022 at 11:59:10 UTC, bauss wrote: The problem with GC is that the lifetime sometimes exceed what's expected. I am not sure if I get the sentence right, but I've had program crash because GC in some circumstances collects objects which where supposed to have 'infinite' lifeti

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

2022-05-21 Thread eugene via Digitalmars-d-learn
On Tuesday, 17 May 2022 at 11:50:30 UTC, zjh wrote: On Tuesday, 17 May 2022 at 06:28:10 UTC, cc wrote: Far better to just keep your house clean every day than let the trash pile up and wait for the maid to come, IMO. Right,GC is a bad idea! As I've already mentioned I think the origin of GC

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

2022-05-17 Thread Dom Disc via Digitalmars-d-learn
On Tuesday, 17 May 2022 at 06:28:10 UTC, cc wrote: having had this leave a pretty bad taste in my mouth, I now avoid the GC whenever possible, even when I don't have to. Bad idea. You should only avoid GC if your profiling shows that it is bad in a specific piece of code (e.g. some inner loop

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

2022-05-17 Thread bauss via Digitalmars-d-learn
On Tuesday, 17 May 2022 at 11:53:40 UTC, zjh wrote: On Tuesday, 17 May 2022 at 11:50:30 UTC, zjh wrote: Right,GC is a bad idea! Endless use of memory without freeing. It's totally unreasonable waste. It's not really endless use of memory and it does free. Depending on the strategy then it

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

2022-05-17 Thread zjh via Digitalmars-d-learn
On Tuesday, 17 May 2022 at 11:50:30 UTC, zjh wrote: Right,GC is a bad idea! Endless use of memory without freeing. It's totally unreasonable waste.

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

2022-05-17 Thread zjh via Digitalmars-d-learn
On Tuesday, 17 May 2022 at 06:28:10 UTC, cc wrote: Far better to just keep your house clean every day than let the trash pile up and wait for the maid to come, IMO. Right,GC is a bad idea!

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

2022-05-16 Thread cc via Digitalmars-d-learn
On Monday, 16 May 2022 at 15:08:15 UTC, H. S. Teoh wrote: If you find yourself having to cast to/from immutable, you're using it wrong. I clearly was, which is why I'm not using it anymore. The question was "What are you stuck at? What was the most difficult features to understand? etc.", so I

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

2022-05-16 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, May 16, 2022 at 04:00:12AM +, cc via Digitalmars-d-learn wrote: > On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: > > What are you stuck at? What was the most difficult features to > > understand? etc. > > > > To make it more meaningful, what is your experience with other

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

2022-05-15 Thread max haughton via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali Learning D is almost a complete blur in my memory but I distinctly re

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

2022-05-15 Thread cc via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali Immutability. Ended up having to do so many hundreds of casts to and

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

2022-05-14 Thread eugene via Digitalmars-d-learn
On Saturday, 14 May 2022 at 16:08:34 UTC, rikki cattermole wrote: On 15/05/2022 4:00 AM, eugene wrote: The more I have studied memory allocators & management strategies memory allocators and GC are different things i've had at some point 'free list' based allocator and it worked ~3 times fast

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

2022-05-14 Thread rikki cattermole via Digitalmars-d-learn
On 15/05/2022 4:00 AM, eugene wrote: The more I have studied memory allocators & management strategies memory allocators and GC are different things i've had at some point 'free list' based allocator and it worked ~3 times faster than malloc/free when used for classical linked list implementa

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

2022-05-14 Thread eugene via Digitalmars-d-learn
On Saturday, 14 May 2022 at 15:04:55 UTC, rikki cattermole wrote: Garbage Collectors solve some really hard problems in regards to memory management. i've *never* encountered "really hard problems" with manual memory management in C. It is a very good base line for memory management when you

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

2022-05-14 Thread rikki cattermole via Digitalmars-d-learn
On 15/05/2022 2:51 AM, eugene wrote: On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. Garbage collection. I am not programming languages theorist at at, but my imression is: * GC came from purely f

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

2022-05-14 Thread eugene via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. Garbage collection. I am not programming languages theorist at at, but my imression is: * GC came from purely functional languages where everything i

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

2022-05-14 Thread zjh via Digitalmars-d-learn
On Saturday, 14 May 2022 at 12:46:45 UTC, frame wrote: Every larger app with a news feed also has possibility to categorize/filter it. I think we can set up a special `web page` to collect `good posts` and classify them according to `'author/category/label'`, and its content can be extracted

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

2022-05-14 Thread zjh via Digitalmars-d-learn
On Saturday, 14 May 2022 at 08:51:24 UTC, H. S. Teoh wrote: The D wiki could be used for this purpose. Many of your posts are very good. I like them very much. Thank you. I haven't played with `wiki`. However, Maybe we can `organize and display` good posts according to `"author/category/la

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

2022-05-14 Thread frame via Digitalmars-d-learn
On Saturday, 14 May 2022 at 04:31:48 UTC, zjh wrote: 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 beginners of `d`. This way, the similar answe

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

2022-05-14 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 14, 2022 at 04:39:33AM +, zjh via Digitalmars-d-learn wrote: > 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/...`. > > Maki

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` begi

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 b

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 tr

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

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 i

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 neat

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 o

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" situa

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 is

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

2022-05-12 Thread zjh via Digitalmars-d-learn
On Thursday, 12 May 2022 at 20:49:08 UTC, Chris Katko wrote: In D, I can do the module based method, but nothing short of renaming variables gives me a list of violations and, that also makes all the correct internal accesses wrong. Because private doesn't work. Call it whatever keyword you

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

2022-05-12 Thread Salih Dincer via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. The concept of traits (std.traits) confuses me enough. Actually the problem is that the interface is disorderly (disorganizedly). As if it was very dif

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

2022-05-12 Thread Guillaume Piolat via Digitalmars-d-learn
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 is TLS by default, so you don't accidentally introduce race conditions. What you accidentally have instead is

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

2022-05-12 Thread Chris Katko via Digitalmars-d-learn
On Thursday, 12 May 2022 at 16:04:09 UTC, Ali Çehreli wrote: My view on private has changed over the years. I need to be convinced that there is usage that needs to be protected. :) I don't see people using types freely especially the ones that are in the same module. The only argument for priv

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

2022-05-12 Thread Ali Çehreli via Digitalmars-d-learn
On 5/12/22 12:00, Paul Backus wrote: > Good news: starting from DMD 2.099, this error message has been > reworded. Instead of "cannot deduce function...". it now says: > > Error: none of the overloads of template `std.algorithm.iteration.sum` > are callable using argument types `!()(int[3])` Muc

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

2022-05-12 Thread Anonymouse via Digitalmars-d-learn
On Thursday, 12 May 2022 at 15:17:10 UTC, Adam D Ruppe wrote: It is simpler than it looks, I wrote about it in my book and in a post here: https://forum.dlang.org/post/xklcgjaqggihvhctc...@forum.dlang.org "Then commas separate the definitions of each placeholder variable, just as if they we

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

2022-05-12 Thread Anonymouse via Digitalmars-d-learn
On Thursday, 12 May 2022 at 16:48:05 UTC, H. S. Teoh wrote: static foreach isn't meant to handle large loops. Writing `static foreach (i; 0 .. 6)` is generally a bad idea; my suspicion is that the compiler ran out of stack space). It's more for unfolding groups of statements or declaration

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

2022-05-12 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 12 May 2022 at 18:07:05 UTC, H. S. Teoh wrote: On Thu, May 12, 2022 at 09:04:09AM -0700, Ali Çehreli via Digitalmars-d-learn wrote: Error: template `std.algorithm.iteration.sum` cannot deduce function from argument types `!()(int[3])` /usr/include/dlang/dmd/std/algorithm/iteration.

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

2022-05-12 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 12, 2022 at 09:04:09AM -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 5/11/22 18:06, Christopher Katko wrote: > > > Cool useful library functions like sumElement that magically don't > > work on static arrays. > > Yeah, that sometimes gets me as well. Although it is trivial t

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

2022-05-12 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 12, 2022 at 01:06:02AM +, Christopher Katko via Digitalmars-d-learn wrote: [...] > Cool useful library functions like sumElement that magically don't > work on static arrays. Just slice it with []: int[5] data = [ 1, 2, 3, 4, 5 ]; auto sum = data[].sumElement; Th

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

2022-05-12 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 11, 2022 at 06:43:39PM +, Guillaume Piolat via Digitalmars-d-learn wrote: > On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: > > What are you stuck at? What was the most difficult features to > > understand? etc. > > - How to do deterministic destruction with prog

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

2022-05-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 12 May 2022 at 16:24:26 UTC, Ali Çehreli wrote: Cool trick but "parent" confused me there. I think you mean "base". :) https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming mentions "base class" as much as "parent class"

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

2022-05-12 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 12, 2022 at 02:42:43PM +, Anonymouse via Digitalmars-d-learn wrote: [...] > The one thing that has caused me most anguish and woe is hands-down > https://issues.dlang.org/show_bug.cgi?id=18026 though. It hasn't bit > me for a while now, but the feeling of uncertainty, that the comp

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

2022-05-12 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 12, 2022 at 12:13:32PM +, Basile B. via Digitalmars-d-learn wrote: [...] > Problem is more (from https://dlang.org/spec/expression.html#is_expression) > > ``` > is ( Type : TypeSpecialization , TemplateParameterList ) > is ( Type == TypeSpecialization , TemplateParameterList ) > i

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

2022-05-12 Thread Ali Çehreli via Digitalmars-d-learn
On 5/12/22 07:28, Guillaume Piolat wrote: > On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote: >> - Certain variant forms of the `is` Expression are not obvious (not >> intuitive), I'm pretty sure I still cant use them without a quick look >> to the specs. > > That one was a trouble to hea

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

2022-05-12 Thread Ali Çehreli via Digitalmars-d-learn
On 5/11/22 19:35, zjh wrote: > On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: >> What are you stuck at? What was the most difficult features to >> understand? etc. >> > > I don't know the progress of `interface to C++`. > I want to use my C++ functions in `d`. That direction is eas

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

2022-05-12 Thread Ali Çehreli via Digitalmars-d-learn
On 5/11/22 18:06, Christopher Katko wrote: > Cool useful library functions like sumElement that magically don't work > on static arrays. Yeah, that sometimes gets me as well. Although it is trivial to deal with, the programmer may be surprised by the strange error messages: int[3] arr = [ 1

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

2022-05-12 Thread jmh530 via Digitalmars-d-learn
On Thursday, 12 May 2022 at 15:32:24 UTC, Adam D Ruppe wrote: On Thursday, 12 May 2022 at 15:18:34 UTC, jmh530 wrote: What's the difference between a Type and Type Identifier? The is expression roughly follows variable declaration style. You write int a; to declare a new symbol named `a` of

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

2022-05-12 Thread Basile B. via Digitalmars-d-learn
On Thursday, 12 May 2022 at 15:31:03 UTC, Steven Schveighoffer wrote: On 5/12/22 11:18 AM, jmh530 wrote: On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote: [snip] ``` is ( Type : TypeSpecialization , TemplateParameterList ) is ( Type == TypeSpecialization , TemplateParameterList ) is (

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

2022-05-12 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 12 May 2022 at 15:18:34 UTC, jmh530 wrote: What's the difference between a Type and Type Identifier? The is expression roughly follows variable declaration style. You write int a; to declare a new symbol named `a` of type `int`. Similarly, static if(is(T a)) declares a new sy

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

2022-05-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/12/22 11:18 AM, jmh530 wrote: On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote: [snip] ``` is ( Type : TypeSpecialization , TemplateParameterList ) is ( Type == TypeSpecialization , TemplateParameterList ) is ( Type Identifier : TypeSpecialization , TemplateParameterList ) is ( Typ

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

2022-05-12 Thread Tejas via Digitalmars-d-learn
On Thursday, 12 May 2022 at 15:18:34 UTC, jmh530 wrote: On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote: [snip] ``` is ( Type : TypeSpecialization , TemplateParameterList ) is ( Type == TypeSpecialization , TemplateParameterList ) is ( Type Identifier : TypeSpecialization , TemplatePa

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

2022-05-12 Thread jmh530 via Digitalmars-d-learn
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote: [snip] ``` is ( Type : TypeSpecialization , TemplateParameterList ) is ( Type == TypeSpecialization , TemplateParameterList ) is ( Type Identifier : TypeSpecialization , TemplateParameterList ) is ( Type Identifier == TypeSpecialization

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

2022-05-12 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 12 May 2022 at 14:42:43 UTC, Anonymouse wrote: That said, one thing I cannot seem to firmly wrap my head around is `is` expressions. `is` does so many things. It is simpler than it looks, I wrote about it in my book and in a post here: https://forum.dlang.org/post/xklcgjaqggihvh

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

2022-05-12 Thread Basile B. via Digitalmars-d-learn
On Thursday, 12 May 2022 at 14:06:13 UTC, Arjan wrote: On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote: On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: - Operator overloading in certain cases was confusing, I remember that for one particular form once I had to use your

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

2022-05-12 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. I came from shell scripts. They grew too large and overly complex when I wanted to do non-trivial things in a neat way, so I looked to proper programmi

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

2022-05-12 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote: - Certain variant forms of the `is` Expression are not obvious (not intuitive), I'm pretty sure I still cant use them without a quick look to the specs. That one was a trouble to hear about => http://p0nce.github.io/d-idioms/#Get-pare

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

2022-05-12 Thread Arjan via Digitalmars-d-learn
On Thursday, 12 May 2022 at 11:05:08 UTC, Basile B. wrote: On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali Overhall I

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

2022-05-12 Thread Basile B. via Digitalmars-d-learn
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote: On Thursday, 12 May 2022 at 11:50:59 UTC, Alain De Vos wrote: Some keywords are overloaded and have different meaning when used in a different place. Also some syntactic-sugar is way to much meaning too many different ways to do the sam

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

2022-05-12 Thread Basile B. via Digitalmars-d-learn
On Thursday, 12 May 2022 at 11:50:59 UTC, Alain De Vos wrote: Some keywords are overloaded and have different meaning when used in a different place. Also some syntactic-sugar is way to much meaning too many different ways to do the same thing. I would prefer one way which is advised. `ptr1 i

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

2022-05-12 Thread Alain De Vos via Digitalmars-d-learn
Some keywords are overloaded and have different meaning when used in a different place. Also some syntactic-sugar is way to much meaning too many different ways to do the same thing. I would prefer one way which is advised.

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

2022-05-12 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali Overhall I think that D was not hard to learn because well designed (

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

2022-05-11 Thread Siemargl via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali When i take old library from a dub or github and cannot compile it wi

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

2022-05-11 Thread zjh via Digitalmars-d-learn
On Thursday, 12 May 2022 at 02:40:09 UTC, zjh wrote: And C++'s `stackless coroutine`. Another one, I hope the `error message` can be adapted to different languages like `chinese/german/russion/turkish` etc.

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

2022-05-11 Thread zjh via Digitalmars-d-learn
On Thursday, 12 May 2022 at 02:35:50 UTC, zjh wrote: `C++`'s `concept` and `...` is very convenient. And C++'s `stackless coroutine`.

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

2022-05-11 Thread zjh via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. I don't know the progress of `interface to C++`. I want to use my C++ functions in `d`. `C++`'s `concept` and `...` is very convenient.

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

2022-05-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/22 9:06 PM, Christopher Katko wrote: I just realized foreach copies by value by default. Maybe. Sometimes. When? I don't even know anymore. Because I "thought" I had to use foreach(ref) to be able to affect the original data structure (because by value means its a copy, right?). Except

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

2022-05-11 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 12 May 2022 at 01:06:02 UTC, Christopher Katko wrote: completely different semantics for a class vs a struct. Is it a reference? Is it a value? Look up the entire declaration and have the entire Dlang manual open to find out. As far as I remember, no automatic RAII support, even t

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

2022-05-11 Thread Christopher Katko via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali Every time I think I understand D, I don't. Cool useful library funct

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

2022-05-11 Thread Ali Çehreli via Digitalmars-d-learn
On 5/11/22 11:27, templatedperson wrote: > I don't know if this counts as a feature, but reading the standard > library documentation was especially difficult. There are a ton of > `auto`s everywhere and function signatures are hard to read because of > that. I got used to confusing function sign

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

2022-05-11 Thread Ali Çehreli via Digitalmars-d-learn
On 5/11/22 12:20, Ola Fosheim Grøstad wrote: > On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: >> What are you stuck at? What was the most difficult features to >> understand? etc. > > Also, if you intend to use the responses for planning purposes No. :) I was hoping to get response

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

2022-05-11 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. Also, if you intend to use the responses for planning purposes, keep in mind that people who read the forums regularly are more informed about pitfalls

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

2022-05-11 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. - How to do deterministic destruction with programs that use everything (struct / class / dynamic dispatch / GC / manual / etc). This requires to u

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

2022-05-11 Thread templatedperson via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. I don't know if this counts as a feature, but reading the standard library documentation was especially difficult. There are a ton of `auto`s everywh

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

2022-05-11 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. No singular feature, but the overall cognitive load if you use the language sporadic. Which could be most users that don't use it for work or have it a

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

2022-05-11 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 09:06:52 UTC, bauss wrote: On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali dip1000 Ha,

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

2022-05-11 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 11, 2022 at 03:34:12PM +, Paul Backus via Digitalmars-d-learn wrote: > On Wednesday, 11 May 2022 at 15:10:28 UTC, Tejas wrote: > > That'll be true the day when `@safe` becomes the default... Until > > then, I'll atleast do `@safe:` on top of every module :) > > `@safe:` is actuall

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

2022-05-11 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 15:10:28 UTC, Tejas wrote: That'll be true the day when `@safe` becomes the default... Until then, I'll atleast do `@safe:` on top of every module :) `@safe:` is actually a bad idea if you're writing templated code, because it turns inference of `@system` into a co

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

2022-05-11 Thread Tejas via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 14:20:07 UTC, H. S. Teoh wrote: On Wed, May 11, 2022 at 01:37:21PM +, matheus via Digitalmars-d-learn wrote: > [...] [...] [...] [...] My suggestion is: when prototyping, don't even think about attributes. Just templatize your functions and let the compiler

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

2022-05-11 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 11, 2022 at 01:37:21PM +, matheus via Digitalmars-d-learn wrote: > On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: > > What are you stuck at? What was the most difficult features to > > understand? etc. > > > > To make it more meaningful, what is your experience with

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

2022-05-11 Thread matheus via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali I don't know if this will be helpful but here it goes, my user case i

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

2022-05-11 Thread bauss via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote: What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali dip1000

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

2022-05-10 Thread Ali Çehreli via Digitalmars-d-learn
What are you stuck at? What was the most difficult features to understand? etc. To make it more meaningful, what is your experience with other languages? Ali