Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
fluffybucktsnek
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
61.
▲
by
fluffybucktsnek
5mo ago
Conceptually, processes are more akin to units of isolation. Threads are closer to function calls.
62.
▲
by
fluffybucktsnek
5mo ago
I know. I mentioned C++ inheritance because it's its default dynamic dispatch mechanism that I'm aware of.
63.
▲
by
fluffybucktsnek
5mo ago
I feel like you are attacking a strawman here. My point isn't that it's impossible to optimize, but such optimizations are fickle and easy to break by programmer error and require adequate language expressivity (although low-level
64.
▲
by
fluffybucktsnek
5mo ago
How did it not lack of contextual info? By adding "const", you provided more info to the compiler, and it decided it was safe to inline, despite no actual behavior change. My point is, despite the possibility, these optimizations
65.
▲
by
fluffybucktsnek
5mo ago
My issue isn't that the modification made it impossible to inline, more so how trivial it was: I just added a different type. Generally, optimizations are disabled not because the compiler finds them inneficent, but because it lacks en
66.
▲
by
fluffybucktsnek
5mo ago
A bit of a nitpick, but I think this would be closer to a generic array: https://godbolt.org/z/cfdPWb6zz Still, adding a different typed array already breaks inlining, https://godbolt.org/z/zavojE8
67.
▲
by
fluffybucktsnek
5mo ago
I am not sure why either (I believe it is aliasing), here's an example: https://godbolt.org/z/9szhxoxrf From the code, we can already tell all elements have the same type, but the compiler is already adding checks
68.
▲
by
fluffybucktsnek
5mo ago
You seem to be underestimating how easy it is to lose type information. Creating a array of type-erased is already enough to cause confusion, even if the surrounding code is enough to prove the array only has one type. If we are to assume p
69.
▲
by
fluffybucktsnek
5mo ago
Beg to differ. After musing for while, I realized Rust could only have chosen monomorphism for its goals, thus it's not a fundamental design mistake, but a necessary choice. One of the overall philosophies is zero-cost abstractions, an
70.
▲
by
fluffybucktsnek
5mo ago
Tbf, I'd say Rust's concepts of Trait Objects and Generics are better implementations (in general) of C++'s inheritance and templates, respectively, rather than entirely different things. I'd also add constexpr/cons
71.
▲
by
fluffybucktsnek
5mo ago
Not necessarily. In pure theory, yes. But in pure theory, monomorphized code can be deduplicated too. Monomorphization often forces types information to flow, whereas type-erasure considers that a bonus. As such, a compiler may accidentally
72.
▲
by
fluffybucktsnek
5mo ago
As I stated in my follow up, vtables can only be removed when the type information is still available, which, generally, aligns with specialization, except when dealing with libraries (even with LTO). You say the "vtable can be removed
73.
▲
by
fluffybucktsnek
5mo ago
I just noticed you said "The compiler can always specialize". That's indisputably false. That only happens if the compiler has enough information to infer the concrete type at the call point. Conditionals, collections, or any
74.
▲
by
fluffybucktsnek
5mo ago
The inherent overhead of type-erasure is the vtable. Which is funny, because you said you prefer one over the other at the end, when they are basically synonymous. The compiler may choose to devirtualize and specialize, but that isn'
75.
▲
by
fluffybucktsnek
5mo ago
Neither codegen nor macros (they are a part of the preprocessor) are really a part of C. For the latter, the lack of integration becomes more noticeable if you try writing a macro in which the compare param can accept a function identifier.
76.
▲
by
fluffybucktsnek
5mo ago
Type-erasure does have an inherent overhead. Sure, optimizations can be made, but they can be fickle and specialization is basically implicit monomorphization. Using C macros to replicate Rust's monomorphism has several drawbacks: they
77.
▲
by
fluffybucktsnek
5mo ago
A pair of words requires more keywords (they also tend to be more verbose) and whitespace has ergonomy issues (specially with copy-pasting). Whitespace may come with intrinsic alignment, but formatting tools do short work of that.
78.
▲
by
fluffybucktsnek
5mo ago
You speak as if this isn't neat in its own way.
79.
▲
by
fluffybucktsnek
5mo ago
But it isn't a strawman. It summarizes the argument or, rather, the lack of argument, pretty nicely. Why is it a bad DSL? Why is it relevant that it was invented before the internet before the internet was widely used? These are just a
80.
▲
by
fluffybucktsnek
5mo ago
I don't think people value labor. Failed delayed games serve as examples. I think it's more of the case that labor is correlated with uniqueness. And I think uniqueness is closer to what people are truly looking for in art.
81.
▲
by
fluffybucktsnek
5mo ago
They might, but that isn't what they are addressing.
82.
▲
by
fluffybucktsnek
5mo ago
One of the points of consumer articulation is to prevent incentives to being "unable to file without facebook". And, where I live, taxis still exist, although as expensive as before.
83.
▲
by
fluffybucktsnek
5mo ago
Who are you talking to?
84.
▲
by
fluffybucktsnek
5mo ago
It should polyfills are basically a no-go for no-JS sites.
85.
▲
by
fluffybucktsnek
5mo ago
TBF, Tailwind is more about optimizing CSS sizes via the utility classes approach IIRC.
86.
▲
by
fluffybucktsnek
5mo ago
While their comment is abbrasive, that's a lot of assumptions about OP. Do you really know what their information source is? The core point remains valid, you could've just skipped the play on "alt-man" and you wouldn&#x
87.
▲
by
fluffybucktsnek
5mo ago
For starters, I'm talking about @Ferret7446's post, so I don't know why you are talking for them. Still, if the lack of something of note was the main issue, just say that. Nitpicks like these are only informative to people w
88.
▲
by
fluffybucktsnek
5mo ago
No one sensible reads it as that. Besides, my biggest gripe is with point 2. Had it been just point 1, it could have been seen as just a tongue-in-cheek comment.
89.
▲
by
fluffybucktsnek
5mo ago
Technically, running malicious code doesn't necessarily give control over all your data in the device. But common Linux is still lacking in sandboxing practicality, so it might as well be that way.
90.
▲
by
fluffybucktsnek
5mo ago
Why don't you just compile rustc?
More ›