Earlier quoted context omitted.
It was a small personal project, I posted about it here some months ago fwiw: https://news.ycombinator.com/item?id=34211482 D has no (FAANG) corporate sponsor and it does all things well/has no particular speciality, these two things make it hard to compete with marketing of other languages I think There's a small but dedicated and active community
> does all things well a great feature IMO, helps communication in large teams I believe (in the imaginary world where teams use D :) thanks for the link, have the best day
Beautiful Binary Search in D
31–40 of 62 posts
Re: Beautiful Binary Search in D
#32Earlier quoted context omitted.
It won't compile. You can also make it so it will compile but won't collect unless you ask it to explicitly. We don't exclusively market to C++ developers. D replaced PHP and Java for quite a few D users.
It won't compile, and... how is that a solution? You've basically told some users they can't use your language in that case. That's problem solved? If you see PHP and Java replacement as taking off, that's awesome. I was addressing those who want to see it replace C++.
There is lots of @nogc code available to depend upon
Re: Beautiful Binary Search in D
#33Earlier quoted context omitted.
Aye, you can turn off GC entirely, for the whole program There's even a mode of D that operates this way by default, "-betterC" meant to be a C replacement The GC really is an entirety opt-in component. I'd encourage you/other folks to give D an honest try, you might be surprised
You're not understanding my point unfortunately. I never said you can't turn it off. I said if you do, and any of your dependencies expect it to be on, then you have a problem. (Yes, I have tried D. That's how I know this.)
Re: Beautiful Binary Search in D
#34Earlier quoted context omitted.
Aye, you can turn off GC entirely, for the whole program There's even a mode of D that operates this way by default, "-betterC" meant to be a C replacement The GC really is an entirety opt-in component. I'd encourage you/other folks to give D an honest try, you might be surprised
You're not understanding my point unfortunately. I never said you can't turn it off. I said if you do, and any of your dependencies expect it to be on, then you have a problem. (Yes, I have tried D. That's how I know this.)
Yeah you're boned in that case I think and that's a real problem that can pop up if you want full @nogc
EDIT: Maybe not based on Max's comment
D-Plug (Audio FX plugins) is one example of having to build up a dependency stack of @nogc compatible deps, a lot of that is in-house stuff.
Not impossible but it's a commitment, at which point you may as well use something else unless you REALLY want to use D, for sure.
Re: Beautiful Binary Search in D
#35Beauty is in the eye of the beholder. While clever, this is (IMO) far less understandable and more error-prone than say COBOL's positively ancient built-in SEARCH ALL binary search statement. Here's an example of a 3-key binary table search from IBM's COBOL documentation that includes options for found and not found conditions. SEARCH ALL TABLE-ENTRY AT END PERFORM NOENTRY WHEN KEY-1 (INDX-1) = VALUE-1 AND KEY-2 (IND…
Re: Beautiful Binary Search in D
#36Unless I am missing something, you can just use .length on a static array: int[5] a = [1,2,3,4,5]; writeln(a.length); // 5
Re: Beautiful Binary Search in D
#37Earlier quoted context omitted.
It won't compile, and... how is that a solution? You've basically told some users they can't use your language in that case. That's problem solved? If you see PHP and Java replacement as taking off, that's awesome. I was addressing those who want to see it replace C++.
The express purpose of the @nogc attribute is to enforce that code under it's influence doesn't use the GC. There is lots of @nogc code available to depend upon
That's not sufficient here. You can literally have a billion @nogc libraries, and even if there was one single GC-requiring library that many people want to use, the problem would be still there.
The only way to make this work is to ensure all of the libraries most people want to use work fine without a GC (or have @nogc alternatives that people would actually want to use). While not theoretically impossible, practically speaking, that's incredibly hard to pull off when you have a shiny GC sitting there.
Re: Beautiful Binary Search in D
#38Earlier quoted context omitted.
You're not understanding my point unfortunately. I never said you can't turn it off. I said if you do, and any of your dependencies expect it to be on, then you have a problem. (Yes, I have tried D. That's how I know this.)
Ohhh, fair enough, yeah I see what you're saying. Yeah you're boned in that case I think and that's a real problem that can pop up if you want full @nogc EDIT: Maybe not based on Max's comment D-Plug (Audio FX plugins) is one example of having to build up a dependency stack of @nogc compatible deps, a lot of that is in-house stuff. Not impossible but it's a commitment, at which point you may as well use something els…
That's exactly the issue. Having to reinvent every wheel you need just isn't a selling point.
Re: Beautiful Binary Search in D
#39When it comes to metaprogramming, it's excellent, but it is a double edged sword, it can be useful, but if abused it'll tank your build speed, so one must find a proper balance to avoid pain later
One of the few languages that offers its own backend! (LLVM/GCC backends are also available)
I love this level of independence, a real labor of love, one of the best better C, i'd even say this is the evolution C needed
Re: Beautiful Binary Search in D
#40Earlier quoted context omitted.
It won't compile, and... how is that a solution? You've basically told some users they can't use your language in that case. That's problem solved? If you see PHP and Java replacement as taking off, that's awesome. I was addressing those who want to see it replace C++.
The express purpose of the @nogc attribute is to enforce that code under it's influence doesn't use the GC. There is lots of @nogc code available to depend upon