7 ms·
At this point I'm not sure why you would used Dlang when you can use C#. Maybe if your doing really close to the metal stuff. But not sure why for anything else
by DonnyV 6y ago
At this point I'm not sure why you would used Dlang when you can use C#. Maybe if your doing really close to the metal stuff. But not sure why for anything else.
- scns 6y agoBecause you can just deploy a binary / no runtime needed?
- cameronh90 6y agohttps://docs.microsoft.com/en-us/dotnet/core/deploying/single-file https://docs.microsoft.com/en-us/dotnet/core/deploying/singl... You can do that now. Technically the binary contains an embedded runtime, but is that really much different? Full AOT is possibly coming with the next version of .NET, mainly aimed at non-JIT-capable targets, such as WASM and iPhone. Currently they only work with Mono due to lack of AOT in .NET 5.
- Shadonototro 6y ago30mb for a hello world 60mb + for a HTTP server is not what i call a single binary without runtime at best it is called packing giant runtime together with user executable hack and their AOT story is far from being perfect, it has to deal with the fact that C# is a managed language first so exit system programming needs, it's just not playing on the same field c# is aimed at webdevs and game scripters with unity
- cameronh90 6y agoAs I mentioned it is mostly just packing a runtime with the binary. But for most use cases, does it matter? It won't work well for microcontrollers, but for most other things a 60MB binary is not a big deal. It takes under 3 seconds to download on an average internet connection. The main reason I wouldn't use it for system programming is lack of good Linux libraries.
- Shadonototro 6y agoit doesn't matter how long it takes for people to download it it is plain and simple, waste of bits, and bits is money, the more you have, the more money it'll cost you to move around, process and store scale this to billion of computers, and you'll understand what i mean by waste
- cameronh90 6y agoIt's an insignificant cost. Nobody cares about it at any scale except embedded development (or occasionally due to artificial restrictions created by app stores). The money saved by shaving a few MB off your binary is going to always be like 0.00001% of your costs, and even if you're at such a massive scale where that could justify developer investment, there's going to be lower hanging fruit to worry about. If you're at such a level of optimisation that it's correct to worry about deploying a 60MB binary, you must be doing exceptionally well. Most places (including Amazon and Google) are using 200MB+ docker images and serving poorly optimised image files. And if it _really_ bothers you, you can always install the runtime separately for a sub-1MB binary, or use trimming for a sub-10MB binary.
- Shadonototro 6y agoall i am saying is fact, it is a waste don't ship what's not needed, it's a waste and it tells a lot about the mentality of the developers/company 60mb, now CDN server need at least 60mb of storage to cache your file compare this to a developer that care and will produce the same with a native language for 6mb, that's 10x less the space needed it'll cost CDN 10x less money to store and serve since they'll need 10x less storage and will require less bandwidth too for you single dev, you apparently don't care, but it then hurts everyone, including global warming issue and at the end, it'll hurt me, now my 128gb SSD isn't enough to store all the electron shit, i need upgrade to install new update cpu and memory also has to take longer to load and cache all your program it is the reason why software sucks despite hardware becoming better, nobody care anymore and it all start at the developper computer, if you don't care, nothing will improve, and every bits matter, either you like it or not, that's how computers work
- WalterBright 6y ago> 30mb for a hello world hello.d: import core.stdc.stdio; extern (C) void main() { printf("hello world\n"); } dmd hello -betterC comes to 23,068 bytes.
- Shadonototro 6y agoi was referring to the C# hello world that produces a 30mb executable
- WalterBright 6y agoI know. I was just constrasting it with D.
- teleforce 6y agoPerhaps someone needs to compare all the major programming languages for their "Hello World" default executable size. But again some programming languages will probably going to optimize it to oblivion wink Julia wink.
- WalterBright 6y agoIndeed they will. Gaming compiler benchmarks has been going on since the early 1980's. Datalight C was the first C compiler for DOS to do data flow optimizations. Since the benchmarks of the time simply did some operations and ignored the result, the data flow optimizations would delete the benchmark code. I was accused of gaming and cheating on the benchmarks. After they published, of course. Sigh. It wasn't long before other compilers did DFA, and the benchmarks (of course) were changed.
- eigenspace 6y agoWhat benchmarks exactly do you think the julia community is cheating at?
- mhh__ 6y agoI get around 6k and ldc
- pjmlp 6y agoNope, https://www.wildernesslabs.co/ https://www.wildernesslabs.co/ https://azure.microsoft.com/en-us/overview/iot/ https://azure.microsoft.com/en-us/overview/iot/
- WalterBright 6y agoIf you're using D in betterC mode, all it needs is the C runtime library. You can build very small executables that way, as small as C can.
- destructionator 6y agoC# is a pretty good language and for some tasks, probably a better choice. But D is very versatile, so once you get into it, you can expand your use into all kinds of different areas. It can do your regular application or line of business support code reasonably well, but it can then also expand out to new platforms, new paradigms, and tie together niches under one language. As an individual programmer, it is pretty cool being able to write web apps and homebrew video games with the same language. For a company, you probably aren't going to be that varied, but it can still be good to dive into some special optimizations as needed. Many of the organizations on this list use D for some combination of its flexibility. They have two areas of interest that need to co-exist and D lets that happen with minimal friction.
- mhh__ 6y agoI'm obviously biased as I work for the D foundation, but I tried C# for a while - it's was fairly nice to use but the lack of const-correctness and purity where I wanted it made me badly miss D. D is not a simple language, but the solutions it chooses are usually very simple - for example, D has unit testing in the language, this is maybe a day's work in most compilers and yet not many others do it.
- WalterBright 6y agoBuilt in unit testing sounds like a dumb feature, but it really is transformative in how one writes code. It's so dang convenient to write unit tests, it's hard to justify not doing it. It's the same with the builtin documentation generator.
- mhh__ 6y agoA feature so useful, in fact, that some people write their unittests in D even if the other project is written in something else
- crazypython 6y ago> It's the same with the builtin documentation generator. The syntax of the documentation generator is also far more convenient than JSDoc or JavaDoc.
- WalterBright 6y agoThe documentation generator has recently acquired the ability to recognize Markdown, making it even easier. I was initially skeptical of Markdown, but after using it here and there became a fan.
- crazypython 6y agoMarkdown is like C and XML: Popular not because it's very easy to write a single-pass parser for, giving it widespread and universal use.
- p0nce 6y agoSome workloads work better in native code.
- pjmlp 6y agoC# also compiles to native code, just like D, csc isn't the only option.
- mastrsushi 6y agoIf you're referring to .NET native, I dont think it's considered industry reliable.
- pjmlp 6y agoNot only, there are others to chose from, and regarding .NET Native is reliable enough to build an whole business on top of it, Windows Store, upcoming Windows 10X, and the late Windows Phone definitely did not fail due to it.
- mastrsushi 6y agoThen why is the rest of the C# world using traditional CLR?
- pjmlp 6y agoFor the same reason plenty of people here are completely unaware of what Java and .NET are fully capable of. Many just learn the minimum to deliver something.
- p0nce 6y agoBut then you can't do reflection? Besides I'm in native space I never seen any native C#.
- pjmlp 6y ago
- p0nce 6y agoNot sure why you would use C# when you can use Dlang?
- Kranar 6y agoTo get access to a wealth of libraries, support, documentation and tools, that D is sorely lacking in. To be able to use a state of the art garbage collector that provides some degree of guarantee about runtime performance as opposed to D's very poor garbage collector that provides basically no guarantees and is known to sometimes block an application for upwards of dozens of seconds at a time [1]. And most importantly, to be able to use a platform that has pretty strong guarantees about backwards compatibility and that is able to run code from 10 years ago without modification, as opposed to D where even a minor version update can end up breaking D's own standard library. Certainly D has a niche of users who are very passionate about it and for those guys, all the power to you guys and don't bother listening to me... but for most of us, well after 20 years it really hasn't established itself as a reliable language to use beyond that niche. It's no longer 2005, a time when C++ was stagnating and there was a lot of opportunity for a new programming language to sit some where between Java and C. Instead of being released with a roadmap, some promising libraries and frameworks that establish a clear use case where D could shine, and a license that allowed broader community involvement in the implementation of the language and its standard library, it was released as a proprietary compiler that ended up quickly resulting a very fragmented community with a lot of infighting, many missteps and mismanagement made on the part of D's leadership the result of which is that D lost on the order of 5-10 years worth of progress for nothing. It's now 2021, C++ has advanced significantly since those days, there's many new languages such as Go and Rust that have taken the steam out of D and are progressing far more rapidly... and D, which at one point in time was actually innovating on language design, is now constantly trying to play catch up with other languages and implementing half-assed features. The language is often referred to as a kitchen sink of functionality and I kid you not when I say D is literally in the process of working on adding a quasi-borrow checker to the language just so it can keep up with Rust. [1] https://pointersgonewild.com/2014/09/09/ds-garbage-collector-problem/ https://pointersgonewild.com/2014/09/09/ds-garbage-collector...
- 6y ago
- Shadonototro 6y agoC# is a Java for the poor Missing: - native compilation, of course - mateprogramming, ctfe, mixin etc etc - raw performance - free c/c++ interop - optional GC - manual memory management At best it is a Java clone that tries to eat NodeJS cake at the same time, but is then eaten alive by GOLANG C# is plagued with enterprise bullshit (OOP, dependency injection, factory bullshit, one class per file bullshit, etc etc etc) Worse, it only has a JIT, no AOT native compilation (there is one compiler but AFAIK Microsoft is focusing on JIT) so it can't do system/native development at all
- cameronh90 6y agoC# has metaprogramming through generics, the Roslyn compiler API and source generators. C# supports limited manual memory management through unsafe and manual memory allocation methods, but this is primarily aimed at C/C++ interop. Newer performance oriented features like stackalloc and Span/Memory give most of the benefits of manual memory management without the dangers. Performance of .NET on Linux is on average better than Java and Go. Mono has an AOT implementation and Microsoft are expected to release one soon. C# normal coding style may not be to your preference, but it's become a lot less "enterprisey" in recent years. XML is nowhere to be seen any more, for example. But yes indeed it's not a very good language if you're wanting to directly manipulate registersand hardware addresses.
- Shadonototro 6y ago.net performance is good once fully warmed up JIT, wich never happen for most usecases, only in raw and longrunning benchmarks so no, real performance scenarios, .net don't do better than GO wich is AOT compiled mono performance is very bad actually generics isn't playing on same level as metaprogramming in D, not even close to templates in C++, even Rust do better here using roslyn compiler API is nice, but again, it is not the same as using the language itself already, the experience is different, it is on other hand much better than what GO has to offer
- pjmlp 6y ago> native compilation, of course There are plenty of AOT options for .NET, better improve your knowledge. > - mateprogramming, ctfe, mixin etc etc Attributes, reflection, compiler plugins, T4 templates, code generators > - raw performance So how does D stand in Techpower benchmarks or gRPC serialization performance? > optional GC If you know how to actually program in C# you also get some ways of doing it, even more so in C# 9. > - manual memory management Available since C# 1.0 via Marshal namespace. I like D, but lets not pretend C# in 2021 is the same when Alexandrescu wrote the D book.