2 ms·
> consider Kotlin Or C#. C# has async/await (it originated there) and does have a multithreaded event loop, but due to having GC is just a lot easier to work w
by seabrookmx 3y ago
> consider Kotlin
Or C#. C# has async/await (it originated there) and does have a multithreaded event loop, but due to having GC is just a lot easier to work with than Rust+Tokio.
If you're in the "don't colour my function" camp, GoLang is also worth throwing in the mix.
- CharlieDigital 3y agoC# is probably what most teams want but don't know it. - Language is very, very similar to TypeScript. If you're already doing TS on the backend with Node (or even JS), it's a very small lift to C# - Very rich standard libraries and first party libraries; reduces the need to import a bunch of third party code - .NET minimal web APIs are very similar to Express now and perhaps even easier since you don't need to import anything to get a microservice up and running - .NET AOT with .NET 8 will dramatically improve the cold-start for use cases like serverless functions (I find the cold start already pretty good with .NET 7 on Google Cloud Run with the CPU Boost feature turned on). - C# has a lot of functional features as a result of F# - Compiles fast and has hot reload via `dotnet watch` - Provides access to low level primitives where extra performance is needed
- seabrookmx 3y ago100%. > NET AOT with .NET 8 will dramatically improve the cold-start Don't get your hopes up on AOT. It still has lots of limitations, reflection being a big one. ASP.NET initialization relies heavily on reflection so it will be a while before we can have AOT compiled, HTTP microservices. > I find the cold start already pretty good with .NET 7 on Google Cloud Run Thanks for the tip! We're mostly using GKE but have a few services on Cloud Run that might benefit. Do you use the "always allocate CPU" option? We're seeing some memory creep we suspect would be solved by giving the GC cycles when a request isn't in flight.
- CharlieDigital 3y ago> ASP.NET initialization relies heavily on reflection Yes; the first thing I tried when .NET 7 went RTM was switch my web API over to AOT only to have it hang during build. .NET 8 AOT is specifically focused on ASP.NET; they've switched over many of the reflection paths to use source generation instead. I have hopes that some time during the .NET 8 lifecycle or .NET 9 horizon, we'll see full support: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot?view=aspnetcore-8.0 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/n... > Do you use the "always allocate CPU" option? With the CPU Boost option, the cold start is really, really good. Whether you need a warm instance is up to your own threshold for latency on cold starts. I generally avoid using "always allocate CPU" because I'm cheap. The magic of Google Cloud and Cloud Run is really that you don't need to be always on.
- o11c 3y agoDon't forget: - unlike Java, C# supports value types so you can avoid gratuitous overhead or ugly code when all you need is a simple wrapper It's still painful when you need strict ownership though, except for the limited case of an object allocated directly on the stack.
- anacrolix 3y agoAnd Haskell. The only 2 languages I know that got this right.