Live data from Hacker News

Removed rust to gain speed

prisma.io

41–50 of 69 posts

Re: Removed rust to gain speed

#41

Earlier quoted context omitted.

Congratulations, you have now increased the cognitive load to be productive on your team and increased the SQL injection attack surface for your apps! I jest, but ORMs exist for a reason. And if I were a new senior or principal on your team I’d be worried that there was now an expectation for a junior to be a wizard at anything, even more so that thing being a rich and complex RDBMS toolchain that has more potential…

I think this needs some nuance - this is definitely true in some domains. Most of the domains I worked in it was the other way around: using an ORM didn’t mean we could skip learning SQL, it added an additional thing to learn and consider. In the last years writing SQLAlchemy or Django ORM the teams I was on would write queries in SQL and then spend the rest of the day trying to make the ORM reproduce it. At some poi…

> In the last years writing SQLAlchemy or Django ORM the teams I was on would write queries in SQL and then spend the rest of the day trying to make the ORM reproduce it.

Ah yes, good times! Not Django for me but similar general idea. I'm not a big fan of ORMs: give me a type safe query and I'm happy!

Re: Removed rust to gain speed

#42
post #37

Earlier quoted context omitted.

Meanwhile, earlier this week we had a big conversation about the skyrocketing costs of RAM. While it's technically true that GC doesn't mean a program has to hold allocations longer than the equivalent non-GC code, I've personally never seen a GC'ed program not using multiple times as much RAM. And then you have non-GC languages like Rust where you're hypothetically managing memory yourself, in the form of keeping th…

> And then you have non-GC languages like Rust Rust is a GC language: https://doc.rust-lang.org/std/rc/struct.Rc.html , https://doc.rust-lang.org/std/sync/struct.Arc.html

If Rust is a GC language because of Rc/Arc, then C++ is a GC language because of std::shared_ptr, right?

Re: Removed rust to gain speed

#43
post #38
post #37

Earlier quoted context omitted.

> And then you have non-GC languages like Rust Rust is a GC language: https://doc.rust-lang.org/std/rc/struct.Rc.html , https://doc.rust-lang.org/std/sync/struct.Arc.html

By that token so is C. GC is a very fuzzy topic, but overall trend is that a language is GC if it's opt-out of GC. Not opt-in. And more strictly, it has to be tracing GC.

By your definition, is Nim a GC language?

Re: Removed rust to gain speed

#44
post #36
post #27

Earlier quoted context omitted.

Large parts of web browsers (like entire Firefox' UI) is written in javascript already Operating systems _should_ use GC languages more. Sure, video needs to have absolute max performance... but there is no reason my keyboard or mouse driver should be in non-GC language.

Most programs should be written in GCd languages, but not this. Except in a few cases, GCs introduce small stop-the-world pauses. Even at 15ms pauses, it'd still be very noticeable.

There are GC algorithms that don’t require stopping the world.

Re: Removed rust to gain speed

#45
post #39
post #38

Earlier quoted context omitted.

By that token so is C. GC is a very fuzzy topic, but overall trend is that a language is GC if it's opt-out of GC. Not opt-in. And more strictly, it has to be tracing GC.

You can add your own custom GC in C — you can add your own custom anything to any language; its all just 1s and 0s at the end of the day — but it is not a feature provided by the language out of the box like in Rust. Not the same token at all. This is very different.

Well, that's mostly what a Arc and Rc in Rust are. Optional add-ons.

Re: Removed rust to gain speed

#46
post #43
post #38

Earlier quoted context omitted.

By that token so is C. GC is a very fuzzy topic, but overall trend is that a language is GC if it's opt-out of GC. Not opt-in. And more strictly, it has to be tracing GC.

By your definition, is Nim a GC language?

So by that definition yes, as of Nim 2.0 ORC is the default. You need to opt-out of it.

Re: Removed rust to gain speed

#47

Earlier quoted context omitted.

Every project I've come across that uses an ORM has terrible database design. All columns nullable, missing foreign key indexes, doing things in application code that could easily be done by triggers (fields like created, modified, ...), wrong datatypes (varchar(n) all over the place, just wwwhhhhyyy, floats for money, ...), using sentinel values (this one time, at bandcamp, I came across a datetime field that used a…

Honestly database schema management doesn't scale particularly well under any framework and i've seen those issues start to crop up in every org once you have enough devs constantly changing the schema. It happens with ORMs and with raw SQL. When that happens you really really should look into the much maligned no-sql alternatives. Similarly to the hatred ORMs get, no-sql data stores actually have some huge benefits.…

NoSQL is even worse, data gets duplicated and then forgotten, so it doesn't get updated correctly, or somebody names a field "mail" and another person names it "email" and so on...

There is zero guarantee that whatever you ask the database for contains anything valid, so your code gets littered with null and undefined checks, and if you ask for example a field "color" what is it going to contain? A hex value? rgb(), rgba(), integer? So you need to check that too.

In my experience NoSQL is even worse, they are literally data dumps (as in garbage dump).

Re: Removed rust to gain speed

#48
post #45
post #39

Earlier quoted context omitted.

You can add your own custom GC in C — you can add your own custom anything to any language; its all just 1s and 0s at the end of the day — but it is not a feature provided by the language out of the box like in Rust. Not the same token at all. This is very different.

Well, that's mostly what a Arc and Rc in Rust are. Optional add-ons.

...as part of the language. Hence it being a GC language.

Is this another case of "Rustacians" randomly renaming things? There was that whole debacle where sum types bizarrely became enums, even though enums already had an established, different meaning, with all the sad talking past everyone else that followed. This is starting to look like that again.

Re: Removed rust to gain speed

#49

I'm sure you could get even greater speed by removing Prisma. All you need is a migration tool and a database connection. Most recent example in my work where we removed an ORM resulted in all of our engineers, particularly juniors becoming Postgres wizards.

Congratulations, you have now increased the cognitive load to be productive on your team and increased the SQL injection attack surface for your apps! I jest, but ORMs exist for a reason. And if I were a new senior or principal on your team I’d be worried that there was now an expectation for a junior to be a wizard at anything, even more so that thing being a rich and complex RDBMS toolchain that has more potential…

> Congratulations, you have now increased the cognitive load to be productive on your team and increased the SQL injection attack surface for your apps!

Maybe I am speaking from too much experience but writing SQL is second-nature to me and I would wager my team feels similarly. Perhaps we are an anomaly. Secondly, most if not all SQL connector libraries have a query interface with all the usual injection vectors mitigated. Not saying it's impossible to break through but these are the same connector libraries even the ORMs use.

> ORMs exist for a reason. And if I were a new senior or principal on your team I’d be worried that there was now an expectation for a junior to be a wizard at anything

ORMs exist to hide the complexity of the RDBMS. Why would any engineer want to make arguably the most critical aspect of every single IT business opaque? ORMs may imply safety and ease, but in my experience they foster a culture with a tacit fear of SQL. Sounds a bit dramatic, but this has been a surprisingly consistent experience.

Re: Removed rust to gain speed

#50
post #37

Earlier quoted context omitted.

> And then you have non-GC languages like Rust Rust is a GC language: https://doc.rust-lang.org/std/rc/struct.Rc.html , https://doc.rust-lang.org/std/sync/struct.Arc.html

If Rust is a GC language because of Rc/Arc, then C++ is a GC language because of std::shared_ptr, right?

Absolutely.
Post reply on HN