Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ntrel
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
ntrel
2mo ago
OK (I saw this but forgot), found: https://dpldocs.info/this-week-in-arsd/Blog.Posted_2025_09_2...
2.
▲
by
ntrel
2mo ago
> the two bigger things I did they have talked about but probably won't do is i made the class monitor opt-in https://dlang.org/changelog/pending.html#dmd.monitor-field
3.
▲
by
ntrel
1y ago
My understanding is that RC is relatively expensive in time (especially for atomic RC) but uses a lot less memory than state of the art fast GC. And RC doesn't handle cycles.
4.
▲
by
ntrel
4y ago
D doesn't store capacity in each slice. This allows a slice to fit in registers more often. Instead for GC allocated slices, the GC will store metadata before the first element of the allocation. That does make it slower to access, par
5.
▲
by
ntrel
4y ago
Because Go designers don't like OOP and didn't want low-level system programming as core features. They also were not keen on generic programming. Basically they wanted a simpler language. (Then they realized generics are useful,
6.
▲
by
ntrel
4y ago
This compiles: ref ubyte[n*2] requires_ptr_twice_as_large_as_input(uint n) ( const ref ubyte[n] input, ref ubyte[n*2] output, ) { output[0..n] = input[0..n]; output[n..2*n] = input[0..n];
7.
▲
by
ntrel
4y ago
Why is your proposal better than this: import std.sumtype; void main(){ struct A { int a; } struct B { string b; } struct C { bool c; } alias TaggedUnion = SumType!(A, B, C); auto tgu = TaggedUnion(B("hi
8.
▲
by
ntrel
4y ago
Class instances can go on the stack too using `scope`: scope obj = new Object; ... // destroyed at end of scope
9.
▲
by
ntrel
14y ago
Arrays and slices really have nothing to do with generic programming. Java has poor generic support (type erasure) and C++ has poor syntax and a bad design for iterators. Languages with decent generics support have none of these problems. I
10.
▲
by
ntrel
14y ago
Lack of generics does not ease development speed. Generic programming is about safe reusability. (Development speed includes the test, debug, fix cycle). No generics actually harms code clarity and destroys type safety.
11.
▲
by
ntrel
14y ago
C's preprocessor means C code can often do interesting tricks, such as the X macro: http://www.drdobbs.com/the-new-c-x-macros/184401387 There are tons of other interesting uses for macros. Obviously I'd rather a language had safer equival
12.
▲
by
ntrel
14y ago
None of those things cause as much greenhouse gas emissions as a high meat diet. The level of meat consumption in rich countries is unjustifiable.
13.
▲
by
ntrel
14y ago
> C++ has the best (imperative) language support for templates D's template support is far superior: static if, constraints, compile-time function execution, string mixins, opDispatch. These features make templates much more practical a
14.
▲
by
ntrel
14y ago
Actually it is simple: eat less meat. Meat production is vastly more wasteful than vegetable production calorie-for-calorie.
15.
▲
by
ntrel
14y ago
The problem is it's no better than C - the correct way is to return sum types, either values or errors. A good language would statically check that any returned values are only used when there are no errors, preventing invalid values being
16.
▲
by
ntrel
14y ago
> D's garbage collection is global, and either off or on That makes it sound like you can't use GC and manual memory management together; you can - std.container uses manual memory management internally for max efficiency.
17.
▲
by
ntrel
14y ago
> things that were mutable are still mutable `string` is immutable. You can use immutable everywhere if you like. C++ doesn't even have transitive const. > templates are still templates With constraints, unlike C++. > hard-to-so