Overloading based on attributes - is it a good idea?

KnightMare black80 at bk.ru
Tue May 28 22:34:16 UTC 2019


> @nogc attributes are often inferred. Such constructs would make 
> it undecidable.

I doubt if nogc is needed to D.
- it takes resources attempts to rewrite phobos/compiler for two 
different worlds.
- we have good alternatives for that case: C++, rust, Go, Swift, 
ObjC..
- u can create almost same (x)strings, same 
int[]|double[]|real[], same maps/assoc.arrays with simple 
types(that (are|contains) no refs) through refcount.
even slices can be rewritten that do addref/release for 
refs-containers - slice { ptrToContainer, index, length }.
code can be same in text representation but incompatible at 
binary/obj - u cannot mix slices that point to GC-heap and using 
addref.
BUT when include types with refs fields, when u have MOAO, when 
field can be Object obj.. well, compatibility is finish here - u 
should use refcount with cycling-breaker, u should use weakptr. 
it will be not D, it will be Swift/ObjC with "D"-frontend that 
need another separate RT lets say DiNoGC.
why u want to do from D another Swift or C++ or rust? coz 0.1% 
lovers of bare metal want D for bare metal? but programmers for 
bare metal are 0.1% from all programmers and we have 0.0001%. we 
have totally 20kg of one programmer from 15k D-programmers (I 
threw dice) for whom u working, others use c++/rust/go.
u can continue improve D/C++ Calypso 
https://github.com/Syniurge/Calypso remove GC from it and .. and 
u'll get strange C++ that knows 2 persons only.
I can understand such job if no alternatives, somebody should be 
first, but we have alternatives with full RT already which grew 
up decades with a multimillion community for each alternative.
D is good and unlike to others coz it have GC and it very close 
to metal(can do sse/assembler with high order functions) in one 
bottle (lets leave metaprogramming, UFCS, CTFE for ads slogans).
u can say "without GC we can run D for WASM, for some 
hardware/arduino/raspberry". GC will appear in WASM. do u have RT 
for WASMwGC?

ok, lets say another:
how many people D-community will loose if will be declared 
"people, from today we finish works on nogc"?
probably.. two men?
D is good compiler, they cannot use strings, arrays, lambdas, 
well they can write own STL without GC.
but they cannot use classes with polymorphism.
with some allocator only.
ok, lets write such allocator that supports some refcount and 
weakptr and again need another slices(with 3 fields).
what to do with lambdas? same allocator too!
imo such an allocator is very similar to GC.
omg, we did cycle/loop to best DiNoGC and we are back to 
complicated version of slises, arrays/strings and classes and.. 
GC! again fking GC! that named aw/some allocator. ohh, no!).
well, 2 men that want D on raspberry, I tell u and u will be 
grateful to me, go now to C++/Swift/Go, no need to cherish wet 
dreams about DiNoGC, u will get better world there, not with some 
crutches named "C++ without classes/D with structs/strange SwifD"
Hallelujah!


More information about the Digitalmars-d mailing list