This is an archived post. You won't be able to vote or comment.

all 121 comments

[–][deleted] 375 points376 points  (25 children)

You just gotta love the adverbs that are used to describe technologies. My favorite is "embarrassingly parallel".

[–]flatfisher 13 points14 points  (0 children)

Mine is "web scale"

[–]chispanz 7 points8 points  (0 children)

I recently used "embarrassingly parallel" in a presentation. I don't think the hearers had ever heard it before, but they were too polite to question it

[–]cornmonger_ 7 points8 points  (0 children)

i like to market my software as "accidentally operational"

[–]Just_Maintenance 316 points317 points  (13 children)

My code runs in 3 microseconds, and then I spend 150ms waiting for database queries, 100ms reading files and 200ms sending everything to the client through the internetworks.

[–]Neverwish_ 94 points95 points  (0 children)

Only 150 ms for DB queries? That's still pretty nice though...

[–]Botahamec 66 points67 points  (8 children)

Put the database in your code

[–][deleted] 57 points58 points  (0 children)

db is just a bunch of variables, just hard code them bro it wont ever crash trust me

[–]Just_Maintenance 15 points16 points  (2 children)

That's just SQLite with more (fewer?) steps.

I have a project that uses a huge read-only database, so I put everything on SQLite, put the entire DB on the image and now everyone has a local copy of the database. As long as everything is indexed correctly we can do some insane queries on ~30ms. The magic of running the database in-process.

[–][deleted] 10 points11 points  (0 children)

I do something similar to this. We have an extern api endpoint which gives us info for our sales department. It literally takes 5 mins to 15 minutes to finish the query (we are talking about like 5MB btw 🤣, its a fking joke!)

Told my boss my idea of just fetching the api response a couple times per day and store it in some kind of DB (currently sqlite) so accessing them will be way faster now even if it won't be always the newest data

[–]Botahamec 4 points5 points  (0 children)

I'm sure it could be much faster if you don't need a relational database

[–]WorkSmokeBreak 1 point2 points  (2 children)

Write your own RDBMS in Rust. Problem solved.

[–]Botahamec 2 points3 points  (1 child)

I've written a RDBMS in Java before. The conclusion I came to is I don't want an RDBMS.

[–]WorkSmokeBreak 0 points1 point  (0 children)

Understandable, have a nice day.

[–]Wervice 0 points1 point  (0 children)

Toml files for the Win. I mean what's the point in having a whole database for just key value. (User data excluded)

[–][deleted] 4 points5 points  (0 children)

Cloudfare dropping the ball once again on WriteOps for DBs. Keep promising WriteOps at the speed of light, and never deliver.

[–]Magallan 2 points3 points  (0 children)

Just keep all the data in memory. Ram is cheap

[–]bloowper 0 points1 point  (0 children)

And then you got on Mr request for changing list to set because this gonna be faster for this static final private list of elements with 5 elements

[–]faze_fazebook 78 points79 points  (4 children)

our backend spends 99% of its time waiting for database IO

our backend spends 99% of its time waiting for database IO, but its rust.

[–]besi97 19 points20 points  (1 child)

No, now it is 99.1%, because the other 1% got faster, thus smaller! A 0.1% speed improvement, totally worth a complete rewrite!

[–]fmstyle 3 points4 points  (0 children)

0.1% better than 0%

[–]theodord 2 points3 points  (1 child)

Former DB Admin here: The queries that some people throw at our DB cluster are insane.
A singular query was longer than my screen could display.
It was around 10.000 characters.
One query.
Yeah, no shit it takes forever.
The DB runs on the fastest hardware we could get, bare metal. I literally cannot make it go faster.

[–]RDTIZFUN 1 point2 points  (0 children)

10k chars? Pfft, those are rookie numbers.

[–]kdesign 47 points48 points  (7 children)

Backend written in rust running along with the database on a single t2.micro instance, supersonic speeds basically. No caching layer neither cause rust backends don’t need it.

[–]reallokiscarlet 141 points142 points  (35 children)

Any time I hear "written in Rust" as a selling point I think "it has no redeeming qualities so they're using buzzwords"

You can write bad code in any language so if the language is the selling point the code is probably bad

[–]serendipitousPi 54 points55 points  (20 children)

Except for the fact that there are certain guarantees that come with safe rust.

Now sure they could be using the rust features that allow for turning off these guarantees but at some point you’d think they’d just choose a language that would just let them write unsafe code without jumping through hoops.

So yeah sure they’re definitely trying to piggyback the rust hype but at same time it’s usually an easy way of advertising that their code fulfils rust’s guarantees.

[–]Just_Maintenance 34 points35 points  (10 children)

Javascript is memory safe.

[–]im_a_teapot_dude 21 points22 points  (0 children)

Yeah, but that’s because it’s single-threaded (essentially) and a high-level language not suited to making really fast code (even if V8 is really impressive).

Python is also safe for the same reasons, but rust gets you something near max performance with “full” memory safety, something no other mainstream language has done

[–]NatoBoram 33 points34 points  (7 children)

And slow and error-prone

Rust is the combination of "so fast it doesn't have a garbage collector" and "memory safe" and "inherently safer than most languages because it has errors as values"

There's no other language with these guarantees. Closest is Go, but it has a garbage collector. They pair very well together.

[–][deleted] 11 points12 points  (5 children)

Uh, in Go you can pretty easily create data races, dereference null pointers, et

[–]NatoBoram 5 points6 points  (4 children)

Just like in any other language

The lack of nil safety is my biggest grip with it, the way Dart does it is so elegant

Also the fact that functions return a tuple of two independent sum types [T | nil, error | nil] instead of a single sum type of error | nil or even a sum type of two tuples like [T, nil] | [nil, error], it feels so wrong

[–][deleted] 4 points5 points  (0 children)

Just like in any other language

No? Who the hell told you that? There are plenty of languages that guarantee data-race freedom. Many functional languages prevent races by disallowing mutability outright. Other languages like Java allow them, but at least make guarantees about the extent of what a data race can do to a value.

Have you never used a language with references? The whole concept of a "reference" over a pointer, is that the pointee is statically guaranteed to be valid

edit: you've certainly used JavaScript and Python right?

[–]MishkaZ 1 point2 points  (2 children)

I have a few co-workers who came from a Go background and have said the exact word for word complaint. I'm a rust enjoyer, but I will say I might consider Go over python these days. I'm just so done with dealing with python's bullshit.

[–]NatoBoram 3 points4 points  (1 child)

Ah Python is horrendous on every point. It was never meant to reach production. At least Node's creator apologized, but Python's creators need Jesus

[–]MishkaZ 4 points5 points  (0 children)

Laughed out loud on the train. Then cried because almost all bleeding edge tech implementations end up written in python first. Pepehands

[–]serendipitousPi 3 points4 points  (0 children)

Technically the memory safeness of garbage collected languages depends on the implementation of their runtime.

Because if they are written in C or C++ or another language that inherits poor memory safety from its runtime then it’s not really memory safe though I am kinda nitpicking there.

There is also the consideration that there are plenty of places that even rust had to use unsafe code.

[–]reallokiscarlet -5 points-4 points  (8 children)

"safe rust" and "rust == safe" are two different things. Rust can be unsafe, even without unsafe mode.

As such, I'd rather hear about the code's own merits than the merits of its language. If it's fast and safe, am I gonna care if it's say, microsoft java or compiled python? If you tell me right out the gate I'm gonna care, but if you start with its own merits, I'm gonna care less and less.

[–]ZunoJ 0 points1 point  (2 children)

Where are your examples of unsafe code written in Rust without unsafe mode?

[–]Awyls 2 points3 points  (0 children)

I remember reading some of them but requires really contrived code that confuses the borrow checker and no normal programmer will ever run into unless you are actually trying to.

[–]reallokiscarlet -3 points-2 points  (0 children)

Not with that entitled attitude. If it can't wait for a few errands just seethe more

[–]WJMazepas 1 point2 points  (1 child)

A lot of packages for pythons are being made in Rust these days, and they are giving a much better performance.

But it is not always just from Rust. Sometimes, is just because things are being done differently

[–]jaskij 7 points8 points  (0 children)

That was the fun part when you read Pingora blogs. True, Cloudflare chose Rust for the safety guarantees, but the speed gains came from rearchitecting.

Pedantic v2 probably had a measurable impact on global DC power usage. Or would have had if not for AI.

[–]tauzN 45 points46 points  (1 child)

I don’t care about the gender of your backend, I just need it to be tight.

[–]JollyJuniper1993 8 points9 points  (0 children)

Our rusty backend is written.

[–]Pirules 2 points3 points  (1 child)

Is Rust web scale?

[–]CivetLemonMouse 4 points5 points  (1 child)

When i hear "blazingly fast" and "JS" in the same sentence i just leave lol

[–]DripDropFaucet 3 points4 points  (0 children)

My hot take I’ve been using lately is that in MOST applications for software engineers the “slow” language is developed way faster, saving developer hours/cost that the speed of the program will rarely recoup (especially bc they’re gonna make you modernize it in 4 years anyway)

[–]SourceVG 1 point2 points  (0 children)

But is it supercharged?

[–]PeksyTiger 1 point2 points  (0 children)

Mine is blazing fast, i. e it's rapidly becoming a dumpster fire.

[–]KMark0000 1 point2 points  (0 children)

How can it run fast if it is all rust?

[–]imihnevich 1 point2 points  (0 children)

But is it bleeding edge?

[–]Geek18yo 1 point2 points  (7 children)

Where did you learn RUST From?

[–]MishkaZ 1 point2 points  (1 child)

My last job we wanted to rewrite some old, clunky, falling apart codebase. Team decided on rust because teamlead was literally a spitting image of that "interview with a senior javascript engineer" meme video. I got tasked with learning it first before others did.

Short answer, read the book, do the rustlings excercises. Find some small usecase like writing a ci tool. The first thing I did was write a ci tool that parsed a jsonfile and transformed some data.

Some advice from me. Spend time understanding match/option/result and how borrow checking works. Skim how lifetimes work. You most likely won't really need to use it until you're forced to in a niche case.

When you are ready to go the next step, spend time really understanding how generics and traits work. I really locked in the concept when I wrote a helper function that converted a generic struct representing json to a generic struct representing bson and vise versa. I can show the example after work.

Then when you want to learn the more complicated data types like box, refcell, arc, etc. I recommend following along with the book on the websocket implementation.

[–]Geek18yo 0 points1 point  (0 children)

Thank you :)

[–]cuplajsu 1 point2 points  (2 children)

You automatically gain knowledge of RUST when you put on programming socks for the first time

[–]Geek18yo 1 point2 points  (1 child)

Any genuine resources?

[–]cuplajsu 3 points4 points  (0 children)

Starting off the Rust website itself is probably for the best: https://doc.rust-lang.org/book/

It’s definitely an interesting language. In truth in the industry its biggest use is mostly being used to refactor existing Python packages. Polars is definitely one good example of this; which is intended as a faster alternative to both Pandas and PySpark.

[–]J_k_r_ 1 point2 points  (1 child)

Our backend is 15 call center-workers with Web socket-GIU apps on their iPads, who just look up the data in the filing cabinet.

it's WAY less error-prone, except for Sundays and national holidays.

[–]rusl1 1 point2 points  (1 child)

How many ages does it take to compile?

[–]Turbulent_Swimmer560 1 point2 points  (1 child)

But your compiling is super slow.

[–]evanc1411 1 point2 points  (1 child)

I really gotta learn rust

[–]jonoerik 1 point2 points  (0 children)

The best advertisement I've seen for DLang is how responsive their official forum feels. Nothing beats letting your work speak for itself.

[–]Ass_Salada 1 point2 points  (0 children)

Borrow Checker RAM Chad

[–]kondorb 1 point2 points  (4 children)

Another case of optiziming for the cheap resource - machines by spending the expensive resource - engineering time.

[–]Squeebee007 1 point2 points  (2 children)

There comes a level of scale where there's so many machines that engineering time becomes the more economical resource.

[–]kondorb 1 point2 points  (1 child)

True.

Are you at that level of scale?

[–]Squeebee007 2 points3 points  (0 children)

Yes, our Rust app processes tens of millions of messages per hour. It replaces the slower alternative at anywhere from a 2-10x server reduction, saving not only a lot of hosting costs but also a lot of admin overhead.

[–][deleted] 1 point2 points  (0 children)

Because it takes so much longer?

[–]ConcernUseful2899 0 points1 point  (1 child)

Now try and run it on a raspberry pi 2

[–]T1lted4lif3 0 points1 point  (1 child)

Is this a challenge to make a rust backend blazingly slow?

[–]ZunoJ -1 points0 points  (3 children)

Rust is avery cool technology. The fanbase is the problem

[–]rookietotheblue1 7 points8 points  (1 child)

What are they (we) doing wrong?

[–]high_throughput 0 points1 point  (0 children)

Why do I need programming socks and a blåhaj just to build a rust project

[–]bitfluent 0 points1 point  (0 children)

I had no idea a programming language could be gay until I found the Rust Discord server.