30 karma · joined Feb 4, 2020 (6y ago) · 22 submissions
comment 1y ago · link · parent
It becomes very similar to try-catch exception handling at the place you draw the boundary, then within the boundary it’s monad land.
If you haven’t wrapped it in a monad, chances are you wouldn’t have wrapped it in a try-catch either!
comment 2y ago · link · parent
I have the afternoons of my past week trialling to see if you could achieve something similar to Toasty with just structs and proc macros.
https://github.com/jayy-lmao/sql-db-set-macros
Still WIP but made it past the hurdle of inserts, which I decided to generate a type-state builder pattern to enforce non-nullable fields and skip auto-fields. This is more intended as a proof of concept but I’ll see how much I can grow it and whether I can dogfood at my job
5.
Show HN: I made a CLI tool to generate Rust SQLX models/queries from migrations(github.com ↗)
2 points · by jayy-lmao · 2y ago · discuss
comment 3y ago · link · parent
Love that it makes the client somewhat backend agnostic, but the tools for the OpenAPI backend also look great.
Thank you for this, I hope it is successful in achieving some adoption!
comment 3y ago · link · parent
I find it’s a bit like C# in some ways, especially it’s ability to scale the codebase. Code navigation is incredibly clear and the libraries have been great. The experience of using async-graphql and sqlx is unbelievably intuitive.
For the bad: the compilation times can still be a little slow (especially in CI). This sometimes makes dev a just slightly awkward. I’ve had to contribute to a couple of libraries we depend on because they are still quite young, and we’ve had to move web framework once. Hiring might also be a slight challenge.
I’m not sure if I’d necessarily pick it again if I was to choose for a small business again - but frankly using it has still been a pleasure and the ecosystem is only feeling better.
comment 3y ago · link · parent
Feature delivery was slow to start due to familiarity with the language, the business domain, and the project. Now that the patterns within our project have been established (EDA, Vertical Slice, some DDD for those interested) it’s actually proving quite easy to work on.
Have been a ts dev in a past life, and while I wouldn’t necessarily reach for Rust for future green fields it has been quite pleasing to work with for the last year.
comment 4y ago · link · parent
Others mention the smoothness of Serde. I also really enjoy using sqlx, and the wider tooling and crate documentation makes it a pleasure.
I do really miss the compilation speeds of ts, and even with a lot of fiddling it’s hard to get close to but the borrow checker and dev speed has almost caught up at this point if it wasn’t for the compile times. CI/CD still 5-8 minutes for us even with a lot of caching etc. Lack of enterprise resources is also a little tough though I find C# and F# resources good analogues.
Perhaps my favourite little benefit which I really regret being without on ts services is the ability to clone a repo and then use your own copy as the crate. Allows a lot of debugging power, and allows you to run with your own patches while they’re still getting accepted into the crate. Honestly my favourite feature of crates.
Would I use Rust if I had to start a business from scratch? Maybe. I joke with a friend I’d probably prototype microservices in TS then migrate the high traffic ones to Rust. The memory footprint is great but rarely a business requirement. The volume it can handle might be?
comment 4y ago · link · parent
External (inter-domain) vs internal (domain) events was super useful to understand.
If you’re trying some idealised event driven architecture I feel this book, and later either Domain Modelling Made Functional (F#) or Domain Driven Design with .NET core could be of use (though this definitely does enough detail on its own).
I think the external events imho are the only must have though. Within the micro service or domain I don’t think event driven is necessarily cleaner or easier Vertical Slice, Clean/Onion, or even layered.
comment 4y ago · link · parent
Instead of using ML to diagnose, we are treating the student as the AI. They're given chatbots which they must treat and diagnose. Fortunately for us clinical sessions usually follow a formula, and so make for a good case for chatbots. (We're called SimConverse in case anyone is interested)
comment 5y ago · link · parent
Have also done Rust and really enjoyed GQL in it, both as hobby and "innovation projects" at work. Feels good.
WRT CDN Caching: Akamai has a pretty good GraphQL caching module that can also do POST requests. Cache directives are marvellous. I'd like to see explore the "private" directive to see if it disables certain queries from being cached.
comment 5y ago · link · parent
I saw a bunch of stuff on SSVM and their impressive WASM VM performance [0]. Wondering if this can be of any benefit to Lunatic?
Furthermore, would be really interested in seeing getting started guides / examples / maybe even some tutorial articles on an example or two. This could really help adoption if thats the goal.
comment 5y ago · link · parent
However for getting c++ish performance for a relatively high level syntax I think this fills a different niche than GC'd alternatives. The web-server libraries are still evolving, and I too would love to see a few crates designed for handling auth.
A lot of the issues with difficulty writing/safe practice will just improve once there's more examples/books/tutorials. It takes a little for this stuff to catch up.
Finally I really struggle to see the point about dataloaders - they may be a little confronting initially but its the same thing you often have to do in Nodejs. There's public examples on Github of how to use them with both Juniper and Async-Graphql.
I can understand a lot of this as "its just not there yet". Rust has a much smaller community than Golang/Python/Js, I think its understandable if its taking a little longer to have equivalents in tooling etc. I still enjoy writing it
comment 5y ago · link · parent
todos
}
```Obviously this code won't run, just want to gleam the gist of what you want from an example.
22.
Show HN: Rust+GraphQL, an example using Dataloaders to beat N+1(github.com ↗)
2 points · by jayy-lmao · 6y ago · discuss