Rust is doing this correctly. It’s better to model things as they are rather than requiring a bunch of implicit knowledge.
The simplicity of C is dangerously misleading.
I think I’m now at a point where I’m more productive in Rust than TypeScript or PHP because I spend almost no time debugging. An expressive type system and pattern matching is a game changer.
If it compiles it works.
Rust has a fear problem.
I semi-seriously implied to someone that they could re-write their Typescript lambdas in Rust and save a bunch of money.
They were terrified that it would be impossible to find people capable of doing it.
@tem_dev
This obscures the business logic and makes it hard to reason about correctness. I assume you’re doing this because you think it’s more efficient. But that’s usually far less important than clarity.
And it’s not even obvious to me it would be faster.
@kiyov09
The advantage of starting with C is that it hides much less of the machinery and is a relatively simple language.
The effort required to accomplish things might be a bit terrifying!
Rather than “you should learn C before learning Rust” how about “I found having some knowledge of C useful when I was learning Rust.”
People understandably dislike being told they SHOULD do something but often appreciate hearing about experiences.
@GeorgeMayer
Trust really is the foundation needed to accomplish so many things. I think its importance is often under appreciated.
Whenever I see some sort of dysfunction I often try to start by first considering what trust issues might be involved.
The One Billion Row Challenge looks like a great one: write a Java program for retrieving temperature measurement values from a text file and calculating min, mean, and max temperature per weather station. The file has 1,000,000,000 rows!
Is there any practical reason to learn assembly today unless you’re working on a compiler and need to emit the assembly code?
I mean other than very specialized cases like writing a video codec?
Core databases like Postgres are typically written in C or C++. The tools emerging from the big data era - Lucene, Spark, Presto/Trino… are all on the JVM (Java, Scala).
Now there’s a new generation written in Rust: Arrow, DataFusion, Tantivity… We live in interesting times!
I've been playing around with different ways of implementing binary trees in Rust. It's one of those things that seems to be treated as a black art but that seems unwarranted.
This is a simple one just using Box.
@jamonholmgren
I think people are falling into the “it doesn’t always work and sometimes does dumb things so I’m not going to use it all” trap.
Or perhaps the even worse trap: “I can’t imagine how it could work so I’m not going to try it.”
Or the worst trap: “I read that it doesn’t work.”
Rust can be verbose. The types compose well but you often have nested types like Result<Option<T>,E> and then have to return a result with Ok(Some(thing)). It’s taken me a while to get used to that.
I think the database per customer approach to multi-tenancy is a good one and agree that SQLite becomes a reasonable choice.
We live in interesting times.
"I for one am terribly excited about what conceptual compressions might lie just around the corner, if single-tenancy at scale pans out as a strategy. Let’s go find out!"
I can confirm that as my fluency with Rust improves memory management and the borrow checker has receded into the background. And lifetimes hardly ever come up.
A lot of people feeling the need to show us how smart they are by mentioning that a compiler won’t save you from math, logic and domain errors.
Thank you for your service. There might be someone who doesn’t know this.
I think I’m now at a point where I’m more productive in Rust than TypeScript or PHP because I spend almost no time debugging. An expressive type system and pattern matching is a game changer.
If it compiles it works.
The C and Rust folks are fighting (again?). And some are suggesting that everything would be better if we just had one programming language.
And the AI bois are still saying we won’t need any soon enough.
Yesterday a few of us were talking about CUDA kernels in PyTorch. This paper introduces the idea of database kernels running on SSD devices. That seems like a very cool idea.
Slowly working out some general principles on how kernel is used in computer science.
@JosephJacks_
On the other hand it’s possible that forcing people to create models that learn more efficiently with less data will inspire innovation and accelerate progress. Current techniques might just be the lazy ones made possible only by cheap data.
F# seems like an interesting language. I just can’t work up the energy to take on the .net ecosystem. I feel like I can get things done in the JVM world of if I need to and .net just seems similar but different.
Error handling in Rust scales well. You can start by YOLO ing it with the ? operator and then add in more sophisticated error handling as it becomes necessary.
Rust 1.78 has just been released!
The new diagnostic attribute unlocks *massive* quality of life improvements for day-to-day Rust usage.
Library authors finally get access to (some of) the machinery that allows Rust's standard library to emit high quality compiler errors.
@GeorgeMayer
I honestly can’t tell if they are serious or it’s just memes all the way down.
All the comments on the post are about the quality of the presentation and nobody discussing the substance.
@exhaze
In Rust I have deeply nested enums and structs that I can flexibly serialize and deserialize in a type safe way and map to other forms with pattern matching.
Typescript unions and switch statements are more limited leading to a lot of “manual” code that is error prone.
I was researching using Debezium to replicate Postgres data to Iceberg tables in S3. It’s definitely a thing.
Then I wanted to know if it could handle sharded data. I was not finding good answers until I gave Duck Duck Go a try.
Nailed it:
If you have Xcode tools installed building ARM 64 assembly on an Apple Silicon Mac is straight forward. It can be as simple as
gcc hello.s -o hello
It takes a bit of poking around to get there. Some useful links in the replies.
@algo_luca
The definition in the standard library seems good:
More specifically, this is the offset in bytes between successive elements in an array with that item type including alignment padding. Thus, for any type T and length n, [T; n] has a size of n * size_of::<T>().
@Lucretiel
When you’re sure you need the thing it’s worth being ambitious and doing it right. The lesser thing is only worth considering if it might get thrown away.
@lemire
I know you’re not a fan but I find iterators very useful in Rust. It’s possible I just haven’t used it enough to encounter the downsides. So if there’s more on iterators in Rust being bad I’d like to learn more.
The null, undefined, optional thing in JavaScript and Typescript is the worst programming language design choice of all time.
Name one thing that’s worse?
Did you know rust-analyzer can convert JSON into Rust structs? Simply paste your JSON into a Rust file and run the `convert JSON to struct` code action.
@AdamRackis
I mean - I’d support that rule. Not in a dogmatic fight for my life way but in a the alternative is the way I prefer way.
This seems like an easy one to fix too.
On the one hand we have people rewriting things in Go, Rust and C++ to make them more computationally efficient,
On the other hand we are using generative AI to calculate things in an insanely inefficient way that makes Python look like a Lambo,
Someone is confused?
Now that we’re down arguing about C… real programmers start by building a lisp compiler from their own boot-strapped forth implementation.
And then use that to build an editor.
C can be memory-safe by
@ErrataRob
Forking is a foolish idea. The core principle of computer-science is that we need to live with legacy, not abandon it.
And there's no need. Modern C compilers already have the ability to be memory-safe, we just need to make minor -- and…
LLMs give “mid” solutions which is fine for things you don’t know well or while you’re learning.
But for people with a higher level of skill they are just a distraction.
You know that feeling when you’ve slowly walked into a cold lake and the water is now up to the sensitive bits and it’s time to just jump in?
That’s me and async Rust right now.
I used to take photographs.
This one got used as a classical cd cover.
There are forms of generative art that I dabble with sometimes but nothing has stuck so far. I’m kind of a minimalist at heart and they tend to be too busy for me.
Very interesting read on using Rust to solve the
#1brc
It uses a perfect hash function. The current solution is not quite a general one. But the speed is starting to approach the constraint of RAM bandwidth.
Subsecond
#1brc
is here :)
Down to <5s single threaded, and 0.90s on 6 cores!
Mostly from processing 4 streams in parallel in each thread, which boosts instructions/cycle from 2.2 to almost 3. Still not quite 4 yet though.
That feeling when you finally decide to do that refactor you've been putting off and discover that you've laid some good groundwork that's going to make it easier now.
Thank you previous version of me.
@Cernovich
I’m probably well to left of you on most things. And old enough that I was there for the outrageous responses to the Satanic Verses. And I’m fully outraged again.
This definition of Algebraic Data Types (ADTs) makes sense to me. I have to look it up every time to remember which is which. Easier for me to remember when I think in more concrete terms.
In Rust:
- product type is a struct or tuple
- sum type is an enum
Did reactive streams ever achieve a critical mass of popularity?
The learning curve of the domain specific languages and difficulty of debugging suggested to me they would remain fairly niche.
I really hate inheritance as a construct. Happy that Rust doesn’t have it. Loathe that it’s still pervasive in the PHP code I have to navigate. Happy that Typescript is mostly mousing away from it.
It’s Day 3 of people fighting about whether or not people should learn C.
The Harvard introduction to computer science course starts with C and then moves on to Python. I thought it was an interesting approach, but I suspect it has a high abandonment rate.
📢
#1BRC
—The Results Are In!
Oh what a ride it was. A big congrats to the winners
🥇
@thomaswue
/
@quananh1999
/
@TheMukel
🥈 Artsiom Korzun
🥉
@jerrinot
and everyone else on the leaderboard! What a great experience. Complete results and some stats:
👉
@ryanflorence
Why is everyone using tens of thousands of records as the benchmark? It’s certainly a realistic size for many use cases but what about millions and tens of millions or more? Those come up too.
@rustafariandev
When my son was 3 he wanted to get a motorcycle. I told him he couldn’t even ride a bike yet so how could he get a motorcycle?
So he learned to ride a bike then insisted we go get him a motorcycle. He was very upset when he learnt he was still not going to be able to ride one!
@Scobleizer
@ChickfilA
I tried desperately to get Siri to give me directions to a Starbucks I knew was ahead of me on the road I was travelling but kept trying to send me back to the one I’d already passed because it was closer.
End of an era for spring. You served us well for a while, good friend. But progress waits for no complication. The spoils of faster silicon should be simpler stacks. (This is already the default for new Rails apps!).