[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: images(4).jpg (25 KB, 512x390)
25 KB JPG
This looks like C++ but good.
What's the catch?
>>
>>108858225
Unemployment.
>>
the only catch is that, on windows, it relies on the visual studio linker
>>
>>108858311
oh also, the 1:1 relationship between modules and files sucks
>>
>>108858322
you can make a folder a module by having a package.d file inside it and declaring the module there and exposing the relevant methods via "public import ..."
>>108858225
smaller ecosystem means less libraries. C interop is fantastic, C++ passable, but it will still always be a bit of friction to use libraries from these language.
Generating some wrappers is pretty easy these days with LLMs though
>>
>>108858225
Walter Bright will add shitty half-baked features every fortnight for hype
>>
>>108858225
Unironically its a great language that simply has not much hype behind it, I use it and I enjoy it a lot.
Its the only language that feels good both for low level and high level code.

D has killed scripting languages for me, you can even use a shebang with rdmd to avoid the manual build step, its build time is near instant with DMD and you can write high level feeling code, but at any moment you can drop down and do the same systems level stuff you can in C or C++ with the very good C interop, its wonderful :D
Currently I am writing a MLX binding for D to avoid pytorch and python in general :^)
>>108858440
Basically this, the main pain point that its a non popular language so you end up having to role your own solutions. ImportC has made this a lot less of a pain, a D compiler is also a full C compiler so no longer even have to write most of the bindings, you can just directly import C headers as modules.
>>
no libraries, you will have to bind everything yourself (not impossible, there is a mechanism to use C and C++ libs in it but you will be rolling shit yourself).
weak tooling support, getting auto complete to work was a bitch last time I tried.

It's a good language but not for babies
>>
>>108859034
>It's a good language but not for babies
Go already fills that niche
>>
>>108859123
D is more enjoyable
>>
>>108859190
What's the quality of the D stdlib like? For example Odin is a nice language but to parse a 600mb json file that only contained a 2d array of floats took 16s in Odin. It took <0.1s when I rolled my own simple json parser. Does D suffer from a shitty std lib so in effect I would have to roll my own thing akin to C if I want X thing to be of decent quality?
>>
File: 1761225707058553.gif (1.64 MB, 336x252)
1.64 MB GIF
>>108858225
It is C++ but good.
Even so, they use braindead std naming conventions.
Just use C# + AOT and have sex.
C++ is fucking horrible.
>>
>>108859224
std.algorithm and std.range, the modules that work with ranges (dlangs iterators) are high quality and comparable to i.e. python's itertools, but it is actually enjoyable to use it and very expressive because D lambdas aren't trash.
The tools for parallelism are also nice, but you don't have stateless coroutines
for data formats, it's pretty bad and not really batteries included. The CSV is nice (streaming, typed), but no serializer is provided by default. the json parser is pretty trash. no xml lib either. There are idiomatric libraries for each of these though
>>
File: Pyjeet Saar.png (250 KB, 718x588)
250 KB PNG
>>108859346
Never compare any language to that pyjeet nocoder shit stain scripting lingo with subhuman nocoder syntax.
>>
Another thing that was not mentioned in this thread (sorry, I should of done so in my first post), is that it has some of the best compile time introspection around for a C style language. Pair that with actually good compile time function execution and its actually nice to use templates and your able to pull of a lot.
Look how easy it is for me for example to get a list of functions defined in a C file and then filter them.
#if __IMPORTC__
__module stuff.foo;
#endif

void foobar(void){}
void _bad_foobar(void){}

#!/usr/bin/env -S rdmd -g -i -I=..
module stuff.test;

void main() {
import std.stdio : writeln;
import std.algorithm : filter;
import std.array : array;
import stuff.foo;

enum string[] module_member_names = [__traits(allMembers, stuff.foo)].filter!(v => v[0] != '_').array;

writeln("hello ", module_member_names); // hello ["foobar"]
}

Take a look at features like https://dlang.org/spec/traits.html and https://dlang.org/articles/mixin.html
Lesser languages require horrible build scripts with several steps where you compile source code generators to work around the inability to introspect and to generate at compile time.
>>
>>108859414
the itertools library is actually ok (despite guido hating functional programming). D's iteration capabilities are also best in class, only purely functional languages like haskell have better tools.
That said, D has some warts: Functional programming in D is not based on classes but templates, which means you get horribly mangled names in error messages (and higher executable size due to the symbols being so long). Also, some function are named differently than what is standard. `until` in other languages is `find` in D, for example. I remember there being one or two other functions that are hard to find due to shitty naming
Another wart is that once you do advanced stuff, you will eventually hit the limit of the language in a way that isn't a problem in a dynamic language like python. One thing I run into quite frequently is that defining delegates or lambdas inside member functions can be problematic if they want to use the `this` pointer, as delegates already reuse that slot for for the delegate context and somehow they can't seem to fix this
>>
>>108859484
The -i flag tells the compiler to automatically build any module imported, the builds even for large projects are fast in D, unlike rust or C++
So no makefiles, cmake, dub (D's package manager) and other annoying bullshit. There is tons of little things about D that make it a joy to work with, you can tell the language is written by someone who enjoys programming. Its also why I have a hard time explaining what makes it so nice, it has no one big hype killer feature or dogma (thats why I like it).
>>
File: mahirocunny.jpg (160 KB, 774x774)
160 KB JPG
>>108858225
Editor/IDE support, it just plain sucks
Also for some reason the SDL binding is implemented with compiletime string mixins which i suppose is a smart move for implementing it but has the kafkaian consequence of completely disabling IDE autocomplete and documentation on SDL symbols, nice! If someone could convince them to just fucking fix it even with no-op aliases that have ddoc documentation that would massively improve the binding's ease of use
The language itself is good and Ali Çehreli's Programming in D book is unarguably one of the best if not the best programming learning book ever made, my only complaint is everything else around D, the ecosystem if you want to call it that, it is just unsufficient and is a self reinforcing problem like pyshit and webshit still maintaining their shitty language alive is made possible by the ecosystem of fools tolerating their bullshit and maintaining the ecosystem tools.
>>
>>108858225
>gc
>no users
>retarded main dev
you have exactly 0 reason to use it
>>
>>108858225
unintuitive standard library from the last decade. some people dislike GC. package manager and docs are kinda shit. Thats pretty much it its neat otherwise. My favorite gc lang.
>>
>>108859810
GC is mostly a skill issue, the problem is again an ecosystem one, not making it easy to move off of GC on apps that are negatively impacted by GC.
>>
>>108859851
>GC is mostly a skill issue
absolutely fucking not, it's a tail-latency and a throughput issue, there is NOTHING you can do to avoid these things except avoiding the GC one way or another but then at this point you have 0 reason to use anything else than C/C++/rust
the world would be a better place if we didn't waste cpu cycles because of this retarded tech that barely progressed in over 30 years.
>>
>>108860042
https://dlang.org/blog/2017/06/16/life-in-the-fast-lane/
>>
>>108860278
this is hte most retarded answer possible, they should remove it from the language, that's the only real answer.
>>
I'm writing a text editor in it, it's super comfy and the best choice for that kind of software.

No idea why I would care that D doesn't have some kind of "editor support" which I assume is LSP (which it actually has, I just don't use it) and some retarded overdone syntax highlight. All you really need tro write in any given language is just a little bit of syntax highlight. All this IDE bullshit is not useful.
>>
>>108860364
This is my own editor's syntax highlight for D. Let me guess, you need more.
>>
>>108860364
auto complete is extremely useful for software dev, don't be sour grapes about it. There's a D lsp but it sucks compared to Clion and C++ . D is the better language which is the worst part too
>>
>>108860485
So, maybe I just trained myself that way, but I only use autocomple with YouCompleteMe in vim, so it auto-completes things from my codebase (like variable names, struct names etc), but if I need something from the language stdlib itself, I just go look it up or remember.
>>
It useless, it tries to be everything. Fuck that. Just use rust.
>>
>>108860574
Rust is useless. Literally no reason for it to exist, except to appeal to trannies whose sole purpose of existence is to show everyone they are nerdier and smarter than everyone else.
>>
>>108860688
Only one who was making anything useful with D was ikey and he bent the knee to rust. Troons won, you have to fuck them on ass now if you want to survive.
>>
File: just-one-copium.jpg (361 KB, 1041x1008)
361 KB JPG
the catch is the same as the try-catch in the c++. it is a runtime feature. when people want runtime features, they use full-fledged explicit runtimes and there's nothing you or me or anyone else can do about it. you may invent new features, improve performance to 1000%. it is still dialup vs adsl. so, the only thing that is left.. the copium.
>>
>>108859123
go is literally for babies
that is the entire reason that language exists
>>
>>108858225
If I want garbage collector language I just pick java, there's no reason for other languages to exists except python.
>>
>>108860688
>rust is too hard
sounds like a (you) problem
>>
>>108860712
Wait, you guys don't pay to fuck traps?
>>
>>108860994
Rust is too hard for the problems people use it for. Sorry, I'm not wasting extra 1000 hours so my webapp is written in Rust, I'm not going to care if a cli utility uses GC instead of a borrow-checker, because it literally doesn't matter because it runs for a second or so, then exits. And I certainly am not going to bend the architecture I have in mind for my software just to satisfy someone's autistic wet dream of correctness. You're fine with a GC 99% of the time and when you're not, there are much better options than Rust.
>>
>>108859810
>>108860845
>>108861046
Cant you just turn off the gc for the classes you want to manage manually?
>>
>>108861166
You can't use classes with GC turned of as far a I'm aware, because classes are references managed by GC.
>>
>>108861202
u don't like capitalism?
>>
>>108858225
>What's the catch?
It IS better than C++.

But that's not a great achievement.
>>
>>108858225
What's the point of D when we have Go?
>>
>>108858225
>What's the catch?
Adding more features.
>>
>>108861504
try it and see
>>
I'll admit I'm a codelet but why is it that c++ is the only true "c with objects"?
You would think that one of the 1826 c replacement langs would have implemented objects without a GC, but no, if I want nice things I'm forced to use a language crippled by 40 years of retarded naming conventions
>>
>>108860375
What is the purpose of that maneuver? Aren't you just left with a bunch of invalid syntax or can you fill it in just as quickly somehow?
>>
>>108858225
Last I checked the stdlib was originally written in gc-mode, so your non-gc programs either had to use a custom stdlib or would suffer from the issues of gc. Also you can't rely on the ecosystem in non-gc mode because most libraries are written in gc-mode and 'contaminate' anything they are included in. I know they were working to un-gc-ify the stdlib for ages but didn't seem to be making much progress.
Additionally it's really C++ ++, so not enough differences to really justify it while losing a lot of benefits from C++.
>>
>>108861924
Are you saying I should try the D, and that I just may like it?
>>
>>108864052
No purpose, but it's just a demo of how you can combine multiple command primitives (multiple selection which itself consists of many commands, word movement, selection) into one command. Thought it be very cool, but no purpose yet.
>>
>>108864090
Here's a trick for demos: NEVER do something that is "technically cool". Always do something that is PRACTICALLY cool, even if it means it uses fewer technical concepts. People don't care how the sausage is made, so long as it's good. It is much easier to explain to someone why they want something by showing them HOW the thing solves their issue rather than letting them spend a lot of thinking time and effort in figuring out how to rephrase what you showed them into a usecase they may have.
>>
>>108864074
>it's really C++ ++, so not enough differences to really justify it while losing a lot of benefits from C++.
My issue with c++ is that 80% of the std is deprecated and there is no central resource to learn it "the right way"
Plus header files
You are right that D is a simplified C++, but that sould be all that's needed, I just dont get why there are 50 c clones but 0 c++ alternatives
>>
>>108864170
I agree that C++ alternative is the "right thing" and people don't think about it enough. I think it's mostly due to ignorance. The main argument is that the language should not have a large runtime and should be able to be used to write code/libraries that can be reused everywhere, but those aren't limitations of a "C++ successor" and only specific to C++ itself (namely, unstable ABI, which all these C clones have an issue with as well; and poor design, which is just a C++-specific thing). No need to throw the baby out with the bathwater.
>>
>>108864100
Sure, but anon, it's not even a real demo, it's just for 4chan.
>>
>>108864222
Nice trips, but as you've clearly seen, the basic principle still applies: you have presented your demo and people are confused about what you're even trying to show because there is no obvious point in it.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.