Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pkolaczk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
20 ms
·
301.
▲
by
pkolaczk
3y ago
This is a matter of familiarity. For example, Golang is claimed to have simple syntax, but I find Golang's syntax much harder to read than Rust. The fact they avoided keywords and symbols like a plague caused that now e.g. function sig
302.
▲
by
pkolaczk
4y ago
This has been on my list of next blog posts for so long. But unfortunately no, not yet.
303.
▲
by
pkolaczk
4y ago
> EDIT: What I’m trying to say is that there is very little overhead to creating short-lived objects in Java. I've been working on high performance Java software (databases) for many years now and the overhead of creating short live
304.
▲
by
pkolaczk
4y ago
Have you ever tested it by yourself? I tested and no, it didn't win by a huge margin. Malloc+free was only a tad slower than the default Java GC new (stop the world, parallel) but the default GC is much faster than G1 and ZGC so I woul
305.
▲
by
pkolaczk
4y ago
But reference counting is just a tiny subcomponent of Rust's GC. The majority of Rust's automatic memory management is based on affine types and static code analysis, not refcounting. You're just picking subcomponents to make
306.
▲
by
pkolaczk
4y ago
Ah, it's that topic again. The whole point "but refcounting requires more maintenance per object than GC" is totally moot when there are only 0.01% of objects being refcounted (in Rust or C++) vs 100% objects traced by GC in
307.
▲
by
pkolaczk
4y ago
> Rust's GC (...) has worse performance [than tracing GC] That's an unsubstantiated claim. While reference counting may be slower than tracing in the general case, Rust's reference counting is not the same thing as general
308.
▲
by
pkolaczk
4y ago
Rust's lifetimes is a strict subset of the general case, but it covers a good majority of use-cases with affine types - which means trivial allocation and deallocation. The number of times I had to use lifetime specifiers or dynamic li
309.
▲
by
pkolaczk
4y ago
This is still true, albeit the problems are somewhat smaller or happen less frequently. All those low-pause garbage collectors like G1, ZGC and Shenandoah make no guarantees about pauses and all of them can degrade to stop-the-world mode of
310.
▲
by
pkolaczk
4y ago
There is a difference between a GC used for only a tiny fraction of objects that implement a certain interface (Unreal Engine case) and using a GC for all the things like Java does, which you cannot opt-out. In Java case the GC has to scan
311.
▲
by
pkolaczk
4y ago
GC pauses and a very high memory usage are still a problem. That's why we don't see many Java games (Minecraft was a notable exception and ran like a dog).
312.
▲
by
pkolaczk
4y ago
> RAM and CPU are much much faster than an SSD so almost all (98%) of the time will be spent writing to disk. I wouldn't be so sure about it. Current SSDs can do gigabytes per second read and write. Sure, this is order of magnitude
313.
▲
by
pkolaczk
4y ago
> One speed that Rust doesn't have on its side is compilation performance. I noticed that `cargo check` alone is plenty fast, and when you give it a program with a type issue to check, it reports errors nearly instantaneously (<
314.
▲
by
pkolaczk
4y ago
There are even more: - Java (compiled AOT, anyone remembers how dead slow code GCJ produced?) - Go (not always as bad as Java, but not perfect either)
315.
▲
by
pkolaczk
4y ago
You seem to be missing my point. The point was not about which languages are mainstream (which is highly subjective, hard to measure and also may be an effect of certain politics), but about their level of abstraction. Rust is often placed
316.
▲
by
pkolaczk
4y ago
The discussion was about being higher-level vs lower-level. Rust is a more expressive language than Kotlin. Where languages are used is a different matter, because expressiveness is not the only thing playing role there. Politics and histor
317.
▲
by
pkolaczk
4y ago
I've said it misses most of metaprogramming features, not all of them. Reflection can't do the same things as macros can. Macros can transform arbitrary AST to arbitrary AST, reflection can't. Similar thing with interfaces -
318.
▲
by
pkolaczk
4y ago
I don't think Kotlin is higher-level than Rust. It misses most metaprogramming features, and its generic programming capabilities are weaker (nothing remotely as capable as traits/implicits/type-classes). The others (except S
319.
▲
by
pkolaczk
4y ago
Rust is both a low level but also a high level language. There aren't many mainstream languages that can go higher level than Rust with its traits, sum types, generics and macros. Haskell, Scala, maybe C++ to some degree, what else?
320.
▲
by
pkolaczk
4y ago
Doesn't Go runtime offer anything like spawn_blocking in Rust async runtimes? Spawn_blocking allows to run any blocking operation without blocking the main executor threads, by spawning blocking operation into a separate thread-pool. T
321.
▲
by
pkolaczk
4y ago
That applies only to the stuff exposed by the go stdlib, which is the lowest common denominator between various systems. Databases often use many system specific, advanced calls, to gain more control.
322.
▲
by
pkolaczk
4y ago
How does it really solve the FFI issue? Now instead of an FFI boundary between the app and the database, you have an FFI boundary between the database (now implemented in Go) and the operating system C API. And the database quite likely per
323.
▲
by
pkolaczk
4y ago
-> fail to compile / crash at startup
324.
▲
by
pkolaczk
4y ago
Not only Go compiler is not as good at optimisation as C/C++/Rust/Zig/D compilers, but also Go FFI to C has significant overhead, which means there is often not much point in using low-level Linux APIs for performance ad
325.
▲
by
pkolaczk
4y ago
> Heap fragmentation is just a reality of some allocation patterns without a GC runtime. It is also a reality with a GC runtime, even a compacting one. Tracing GCs have acceptable performance only if the available memory is many times la
326.
▲
by
pkolaczk
4y ago
I guess the problem with Haskell is not really hiring, but it is simply a very hard sell to people without academic background. Haskell is for sure elegant, and has some cool features, but this is too little to get wide adoption. Seriously,
327.
▲
by
pkolaczk
4y ago
> I like Google's strategy of having the simplest language that anybody can pickup as fast as possible. Go. And then you lose 50k whenever the app crashes in production because someone forgot a nil/err check and your tests didn
328.
▲
by
pkolaczk
4y ago
For reference, a single Apache Cassandra node does about 150k inserts/second or also 150k selects/second on my laptop. All that from a single client thread using a very similar approach (also in Rust with async).
329.
▲
by
pkolaczk
4y ago
I'm talking from perspective of Rust's async/await implementation, I'm not sure if the same holds for other languages with async like C# or Kotlin. Nevertheless I can do a loop like this: let mut buffer = ... /
330.
▲
by
pkolaczk
4y ago
But then it is no longer a passive element. Sure, you can use N antennas connected to some electronics that adjust the phases dynamically so they always add up. This is what modern "beam-forming" wifi routers do these days to impr
More ›