Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pkolaczk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
481.
▲
by
pkolaczk
4y ago
You can switch the GC implementation only globally. In languages like C++ or Rust you can have different parts of program using different memory management strategy, from carefully hand-crafted region allocation through refcounting to even
482.
▲
by
pkolaczk
4y ago
> why else would I use a systems programming language if I wasn't doing funky stuff with memory? Actually quite the opposite. You would appreciate Rust in applications that manage non-memory resources. RAII is a breath of fresh air
483.
▲
by
pkolaczk
4y ago
Yeah, this. Particularly when you come from a language that is heavy on using references like JS, Python or Java (and probably a good majority of languages with GC), you might get initially hard time with Rust. After I started appreciating
484.
▲
by
pkolaczk
4y ago
The places it may jump are explicitly marked in the code, though. And that makes a tremendous difference in readability. The problem with exceptions is not the alternative control flow, but the fact it is hidden, and an exception can come o
485.
▲
by
pkolaczk
5y ago
Yeah, according to the paper you pay for it by a very high overhead, up to 2x. So generally, pick your poison ;)
486.
▲
by
pkolaczk
5y ago
There is a difference between pausing a single thread in a known, predictable point and pausing all threads at random point in time. Tracing GCs do the latter. It is way easier to avoid long pauses with recounting than with tracing GC.
487.
▲
by
pkolaczk
5y ago
Code comments that are wrong can be very useful. I've found many bugs that way. If I find a comment that states an assumption that does not hold in the code, that's the first place I analyze when looking for a bug. And very often
488.
▲
by
pkolaczk
5y ago
> A tacit assumption of Rust's model is that code is running on top of a transparent virtual memory system e.g. what Linux provides by default. Where did you get that from? There is nothing more in Rust than there is in C++ that rel
489.
▲
by
pkolaczk
5y ago
Definitely not my experience with file io and database-related software in rust. Actually two of my publically available programs - fclones and latte - seem to be the most efficient in their respective classes, beating a wide variety of C a
490.
▲
by
pkolaczk
5y ago
But it's not just interpreting linear code. It is also classloading which involves a non-trivial amount of work before any code in a class can even run. Also I never said the testing code doesn't have any loops. There often are lo
491.
▲
by
pkolaczk
5y ago
But noone cares about hello world. You're not building hello-worlds in real life. Slow startup time is a problem in automated testing of big codebases - when you aim to test the whole codebase, but each test alone does not stress any c
492.
▲
by
pkolaczk
5y ago
> Checking errors is dreadful. That's true, but that doesn't mean we should pretend the problem does not exist. Using unchecked exceptions is sweeping things under the carpet. Generally unchecked exceptions should be used only
493.
▲
by
pkolaczk
5y ago
That's not the real problem with checked exceptions in Java. You actually have the same problem with any result type in a language with static types and mandatory explicit types in function signatures - you change one type and you have
494.
▲
STFU-8 Text Format
(crates.io)
2 points
by
pkolaczk
5y ago
|
0 comments
495.
▲
by
pkolaczk
5y ago
> And Wayland supports HiDPI with fractured scaling very well Very well only for the apps that cooperate well, e.g. GTK-based apps. Non-native apps (eg IntelliJ Idea) on my Ubuntu desktop were blurry when I used any kind of scaling - not
496.
▲
by
pkolaczk
5y ago
For me, getting bug reports and feature requests is actually fun and makes the project more interesting. It is telling me that someone uses my software seriously and the bug was worth reporting. Many people don't report bugs because it
497.
▲
by
pkolaczk
5y ago
Sublime success shows people do need those 0.01 seconds saved (well, actually it is often not just 0.01 seconds, but a lot more - VS Code is sometimes laggy and that's really annoying).
498.
▲
by
pkolaczk
5y ago
Sure, the problem is - Java apps did neither. Looking good? The default Swing metal theme was truly awful. It was possible to switch to Windows-like theme, but it was even more awful - it had plenty of visual glitches and things misplaced b
499.
▲
by
pkolaczk
5y ago
javac doesn't have to generate optimized machine code, which saves it a lot of time. But you pay the price incrementally in all those slow startups of java apps.
500.
▲
by
pkolaczk
5y ago
> Most code written today do not require manual memory management Rust has automatic memory management. > or even explicit multithreading. You don't need explicit multithreading to run into data races. Languages that allow any ki
501.
▲
by
pkolaczk
5y ago
You can fit many more uuids encoded as 128 bit numbers than as strings in a 4K page. Hence you'll need fewer pages to store your data and that might make a difference between fetching from cache vs fetching from disk.
502.
▲
by
pkolaczk
5y ago
Oh interesting, I stand corrected, thank you!
503.
▲
by
pkolaczk
5y ago
“Programs are meant to be read by humans and only incidentally for computers to execute.” -- D. Knuth I believe that the ones who create error messages like "Invalid value" (without telling you the value nor why it was invalid) or
504.
▲
by
pkolaczk
5y ago
I fixed it but will HN pick up the change? The "edit" doesn't allow to change the URL. Is it ok to delete it and repost?
505.
▲
by
pkolaczk
5y ago
Indeed, will fix it, thanks. Never happened before to me on HN before, but you're right - my site is incorrect - will need to change the way I generate it.
506.
▲
How a Single Line of Code Made a 24-Core Server Slower Than a Laptop
(pkolaczk.github.io)
4 points
by
pkolaczk
5y ago
|
7 comments
507.
▲
by
pkolaczk
5y ago
If someone gave you a library of functions for doing table joins in C, it wouldn't take you much longer than those 2 minutes as well.
508.
▲
by
pkolaczk
5y ago
Partial, generational or region based GCs still need to scan the whole heap from time to time. By bringing stuff once a while into cache they also push stuff that's actively used out of cache. Those effects are typically not visible in
509.
▲
by
pkolaczk
5y ago
The only overhead memory used by a pool allocator is the rounding to the page size. The difference from a compacting GC is that a pool allocator can allocate from the freed memory immediately after the memory was freed. So the overhead does
510.
▲
by
pkolaczk
5y ago
Static compilers can do PGO as well. In practice though, the benefits of PGO in languages like C or C++ that rely on static dispatch are small enough that most people don't care, except for programs that are extremely performance sensi
More ›