Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pkolaczk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
361.
▲
by
pkolaczk
4y ago
Typically those things would be enclosed in libraries providing safe and convenient APIs. Sometimes you might need to use a bit of Rc<RefCell> here and there. At worst, you are not any worse than in C++: use unsafe.
362.
▲
by
pkolaczk
4y ago
> For this reason I'd be much more comfortable jumping into an unknown Rust code base than anything else. Rust also promotes simple control flow and acyclic data structures by making writing complex control flow and cyclic data stru
363.
▲
by
pkolaczk
4y ago
That doesn't work when many libraries don't use type annotations.
364.
▲
by
pkolaczk
4y ago
It would be probably better if you haven't used naked usize, but wrapped it into a new type. When I find types get complex, I introduce type aliases or structs. That X in your signature likely deserves a name.
365.
▲
by
pkolaczk
4y ago
Management also often doesn't track the amount of drama products created by "fast" teams cause later in production. Because the negative impact is often delayed, those problems are rarely attributed to the original authors of
366.
▲
by
pkolaczk
4y ago
> Rust, still doesn't have anything that matches Swing, JavaFX There is GTK with gtk-rs, which surpasses Swing/JavaFX in many technical aspects and also has orders of magnitude higher popularity and bigger community.
367.
▲
by
pkolaczk
4y ago
Code can lie too. Example: poor naming of classes, functions and variables. A name can tell you it's doing one thing but it can be doing something different.
368.
▲
by
pkolaczk
4y ago
Scala has had coroutines (async+await) before Kotlin existed, so not sure if "introduced to JVM" is the right word here. But anyway, I agree they are nice in Kotlin.
369.
▲
by
pkolaczk
4y ago
Which isn't a big deal in most situations as you can still use mutable variables without mutexes, even across await points.
370.
▲
by
pkolaczk
4y ago
You don't need RefCell. You can just use mut variables as long as you keep everything local inside one task. But one task can actually run many things concurrently, unlike a thread, so this is very powerful.
371.
▲
by
pkolaczk
4y ago
For me it's also ability to run multiple concurrent actions on shared state without need for synchronization, Arc or dealing with Rust lifetimes. A simple loop with select! is hard to overrate.
372.
▲
by
pkolaczk
4y ago
Do they even use Scala? I thought they were using Java (but I may have outdated knowledge). Lichess is written in Scala. Do you have any pointer to an article describing chess.com tech stack?
373.
▲
by
pkolaczk
4y ago
> Part of the contract for objects is that you can't interact with an instance before its constructor has run, This contract doesn't hold anyway, because you can call object's methods from the constructor before the object
374.
▲
by
pkolaczk
4y ago
1. it can be always replaced with composition, which Rust already supports 2. it comes with a non-negligible complexity cost to the language (e.g. what if you do multiple inheritance, what code gets called at object construction etc) You pr
375.
▲
by
pkolaczk
4y ago
It definitely misses some features that are considered bad: e.g implementation inheritance or memory handling by exceptions. Those are not essential for anything and are not planned.
376.
▲
by
pkolaczk
4y ago
Not sure if it is strictly better, probably not, but it is actually damn close to being better in most domains and not worse in the others. I've been developing a GUI app in Rust, and even though this is an area considered widely a ver
377.
▲
by
pkolaczk
4y ago
> But modeling those 2% of problems that don't fit neatly into Rusts domain, the level of "unsafe", "PhantomData", and advanced type-system hacks you need feels obscene when I can use some pointers in C++. I don&
378.
▲
by
pkolaczk
4y ago
Deterministic is not the same as bounded. Deterministic means you can determine the moment the destruction happens and you can estimate its upper bound (knowing how much you want to release), not that it always happens in 100 ns. You also g
379.
▲
by
pkolaczk
4y ago
Sure, I know that. But sometimes you don't have a choice because the decision was made years earlier by someone else, and you obviously won't rewrite a 1M LOC codebase. Nevertheless, after spending a year writing Rust, I'd ta
380.
▲
by
pkolaczk
4y ago
Try-with-resources is tied to a lexical scope. C++/Rust RAII is not, you can move the resource e.g to another thread after initialization, and that thread can outlive the scope that created the resource. Also C++/Rust allows share
381.
▲
by
pkolaczk
4y ago
Yes, of course I need to know. An important part of production grade software is observability. And that "something" doesn't have to be memory. It can be a connection, file handle, semaphore permit or one of many other things
382.
▲
by
pkolaczk
4y ago
The trick is, when you have deterministic destruction you can use it for many more things than just memory management. E.g. need to add a metric to measure how many "somethings" are active - just attach a tracker to the struct rep
383.
▲
by
pkolaczk
4y ago
> because that’s the only one that works between machines There is a non-negligible number of problems that don't need multiple machines and are much easier to deal with using other concurrency paradigms. When the language forces on
384.
▲
by
pkolaczk
4y ago
It is easy to learn the concepts, but not actually to use them. It is like with assembly, learning mnemonics is easy, but writing useful programs is a whole lot different story.
385.
▲
by
pkolaczk
4y ago
It is surprising to me that so many people think that message passing is simpler to get right than shared memory concurrency, when in fact it is not: https://cseweb.ucsd.edu/~yiying/GoStudy-ASPLOS19.pdf
386.
▲
by
pkolaczk
4y ago
GC as an opt in, next to to RAII - so you can use it when you need it, that's fine. But it is a productivity issue when the only way to manage memory is non-deterministic GC, e.g. like in Java or Go.
387.
▲
by
pkolaczk
4y ago
Ok, I stand corrected. So that's not just Python but also some Electron-like madness. That explains everything. Looking for a different client now...
388.
▲
by
pkolaczk
4y ago
Lock-free data structures is a 0.001% niche, which can be implemented as libraries by experts and then used without any trouble by an average Joe programmer. An average Joe wouldn't get the implementation of them right even in a GC lan
389.
▲
by
pkolaczk
4y ago
I wish that the pgadmin team hadn't rewritten pgAdmin4 in Python. The GUI performance is abysmal. I can see it lagging when typing SQL text in the window. The experience is really worse than the worst Java IDE I happened to use in the
390.
▲
by
pkolaczk
4y ago
Whether GC improves productivity is a strong claim that needs a proof. I have yet to see such a proof. So far my experience has been that (nondeterministic) GC is only a productivity improvement over languages with manual memory management
More ›