Hacker News new | ask | show | jobs
by tombert 2384 days ago
I agree with all of your points except the "startup time" and "easier deployment"; GraalVM is pretty sweet and produces nice, self-contained executables.
1 comments

Prisma engineer here who's been part of the rewrite since the beginning. We tried GraalVM, but the binary size was huge and we anyways needed to write parts, such as the JDBC drivers in Rust, C or C++ due to GraalVM not being able to compile certain JVM code to a native binary.

We distribute the binary with our NodeJS package and hundreds of megabytes of binary size will not work that well for our users.

Oh! That's a valid reason; I'm actually surprised that GraalVM has issues not supporting JVM features, since I've been using it for Clojure code locally (though admittedly just for fun, nothing serious). Definitely makes sense if you're stuck rewriting things anyway, might as well just do it in a more modern language.

Thanks for the insight!

Yep. I remember how at least JDBC and JWT libs were needed to rewrite using a native language (which we did until some point!). And the GraalVM has a weird API that is not JNA/JNI when you want to use the native-image. It is not very robust system for our needs, but it was a good learning experience.

What we did in the end is we rewrote parts of the system with Rust, plugged that to the JVM package and we had all our tests ready to use. First the database connectors and at the same time the other part of the team was writing the graphql parsing in Rust. We could all utilize our Scala integration tests which was crucial for our success.

And btw. we still have our tests in JVM, although the rest of the stack is Rust now.

That's interesting, would love to read more (blog post maybe?) on issues with GraalVM.