Statically Typed APIs with Poem and Rust

  Рет қаралды 87,658

No Boilerplate

No Boilerplate

Жыл бұрын

Today I'm going to make some web service recommendations, mixing some of my favourite rust crates together into something that I use across most of my Rust projects.
The stack I'm going to talk about today isn't the best stack, nor most fully featured or fanciest.
It's my favourite stack, it showcases what rust is GREAT at, and it focusses on correctness above all else.
❤️ If you would like to support what I do, I have set up a patreon here: / noboilerplate - Thank you!
📄 All my videos are built in compile-checked markdown, transcript sourcecode available here github.com/0atman/noboilerplate this is also where you'll find links to everything mentioned.
🖊️ Corrections are in the pinned ERRATA comment.
🦀 Start your Rust journey here: • How to Learn Rust
👕 Bad shirts available here www.teepublic.com/user/no-boi...
🙏🏻 CREDITS & PROMO
My name is Tris Oaten and I produce fast, technical videos.
Follow me here / 0atman
Website for the show: noboilerplate.org
Come chat to me on my discord server: / discord
If you like sci-fi, I also produce a hopepunk podcast narrated by a little AI, videos written in Rust! www.lostterminal.com
If urban fantasy is more your thing, I also produce a podcast of wonderful modern folktales www.modemprometheus.com
👏🏻 Special thanks to my patreon sponsors:
- JC Andrever-Wright
- Miah Beach
And to all my patrons!

Пікірлер: 287
@NoBoilerplate
@NoBoilerplate Жыл бұрын
ERRATA - 1:01 We miss you Aaron, we need you now more than ever kzfaq.info/get/bejne/b9yqY5mCtJm5m4U.html - 6:15 This is correct: map_err() takes a function, and InternalServerError() IS a function, albeit a confusingly-named one. docs.rs/poem/1.3.57/poem/error/fn.InternalServerError.html
@nathan44u
@nathan44u Жыл бұрын
6:15 map_err should take a closure. Also prefer returning the raw error and mapping it externally with the framework so the actual error could be logged.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@nathan44u Thank you so much - wild that that example is from the official docs and compiles fine!
@netfri25
@netfri25 Жыл бұрын
in 6:15 , the map_err isn't an error, it's a function so you can pass it instead of creating a closure
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@netfri25 oh great! Good to know the poem exmapl WAS right!
@sparrownauts
@sparrownauts Жыл бұрын
what is the http cli you are using to test the apis
@codetales
@codetales Жыл бұрын
Sqlx tapping into the compiler to validate SQL is deep magic. You're making me want to write web apps just to get a look at all this witchcraft.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
All apps probably need a little db, dive in!
@azaleacolburn
@azaleacolburn Жыл бұрын
It’s a powerful macro system
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@azaleacolburn Sure is! My video on the macro system is here, if you're interested kzfaq.info/get/bejne/g72Cg7xz1KmpkY0.html
@azaleacolburn
@azaleacolburn Жыл бұрын
@@NoBoilerplateI know, I've seen it multiple times. Love your content, keep up the good work!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@azaleacolburn thank you so much! 🙂
@tsalVlog
@tsalVlog Жыл бұрын
Thank you for the tribute and mention of Aaron. I get so mad at people who trample on the things he's created; he was a good dude who only wanted what was supposed to be free information to actually be .. free.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Markdown and RSS literally run my life. it's been 10 years already! We need him now more than ever.
@LinkEX
@LinkEX Жыл бұрын
@@NoBoilerplate Seconded. My daily notes are in markdown and RSS is how I get my podcasts. His story really reads like a classic tragedy in a modern setting. While trying to not make things too melodramatic: In a bittersweet way, among the many things wrong in our current culture, he is a reminder that there are good people out there. And, even if they get overwhelmed or screwed over, their good deeds can still go a long way.
@fumano2679
@fumano2679 10 ай бұрын
Who is aaron? I dont want to be disrespectful, just have no clue.
@NoBoilerplate
@NoBoilerplate 10 ай бұрын
@@fumano2679 boingboing.net/2013/01/12/rip-aaron-swartz.html
@forresthopkinsa
@forresthopkinsa 6 ай бұрын
His legacy is tainted by what Marak did with Faker.js and Colors.js - distributing malware through open source channels is not an effective form of political protest
@adamd0ggg2
@adamd0ggg2 Жыл бұрын
I don't really get a chance to use Rust, but learning it made me a better TS developer. My codebases now use deeply immutable objects and zod for runtime validation. When it comes to making API calls its like the KGB. "Trust, but verify" I return errors instead of throwing them too.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
YES! This is how I felt after learning Haskell at the start of my python career!
@Rudxain
@Rudxain 11 ай бұрын
Me too! I've started using generics much more than overloads. I use the rust naming conventions (such as snake_case) for custom vars, and camelCase for stuff that behaves like built-in JS stuff. I've learned to use some FP constructs to avoid using `let` instead of `const` (such as IIFEs, while we wait for `do` expressions). I've learned to modularize my code, and I even write "boilerplate" to make my code safer and more readable (such as implementing a basic `range` generator, to do for-loops like in Rust and Python. Of course, I only do this for "small projects" where importing a whole lib is inconvenient). And more! Learning Rust literally changed my way of reasoning about programs, and it changed my life (not in a *EXTREME RADICAL* way, but considerably enough)
@ItsVasl
@ItsVasl Жыл бұрын
I'm slowing getting into rust using your videos, these rust videos are so underrated!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
You're too kind!
@theherk
@theherk Жыл бұрын
I think they're not known or consumed as much as they should be; needs more exposure. However, I think they're rated very highly by the community. All the top Rust voices seem to speak very highly of this content, as they should.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@theherk that's so wonderful to hear!
@noisetide
@noisetide Жыл бұрын
@@theherk No untruthful words here. The content is great!
@LinkEX
@LinkEX Жыл бұрын
5:00 Wow! Congratulations and respect on taking that step, and best of luck to you in the future. Your content stands out to me for being both unique and high in quality: A distinct style with a clear structure that shows technical expertise and practicality in the matter, while still integrating your personal (occasionally uncommon, yet intriguing) preferences.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thank you so much! You're very kind to say
@ETBCOR
@ETBCOR Жыл бұрын
There are so many, but one of the things I LOVE about your videos is the blue line at the bottom to indicate slide progress. **chef's kiss**
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thanks! A few people don't like it, but most do! I like to always know how far through a video I am, and touching/clicking on the screen all the time doesn't do it for me!
@ChrisPatti
@ChrisPatti 9 ай бұрын
Really love your videos! The perfect length and information density!
@NoBoilerplate
@NoBoilerplate 9 ай бұрын
Thank you!
@alangamer50
@alangamer50 Жыл бұрын
Sqlx compile time checking is pure dark magic and I love it
@NoBoilerplate
@NoBoilerplate Жыл бұрын
SO good right!
@masoodahmad3312
@masoodahmad3312 5 ай бұрын
Please make more videos on the frontend side. Rust options vs react,svelte etc vs htmx or any combination
@thebaconbreadful
@thebaconbreadful Жыл бұрын
I'm blown away what rust can to again and the reason I am is that you can get across what's special about it really well. You are great at simplifying things. Maybe you someone outside the field of web dev could have benefited from this skill by you explaining a little more of the server client structure of the web upfront? Just a thought. Having experience in this field it was really pleasant to follow. PS: I still would wish for chapter marks.
@hmbil694
@hmbil694 Жыл бұрын
I think it would be really cool to cover Leptos in the UI stack talk. It’s a very interesting framework that and I think you’d enjoy it
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Oh I'm familiar, it's not mature enough for me to recommend yet. But you bet I'll talk about it when it is!
@JOHNDATGOONV2
@JOHNDATGOONV2 Жыл бұрын
Yes! I’d love to hear your thoughts on Leptos. I love it, I’ve been using it for a product that I plan to launch later this year, I think it’s plenty stable!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@JOHNDATGOONV2 That's the thing with Rust code - it's pretty much all stable! XD Joking aside, I think it's a great tech choice for a project you'd launch a bit later on, perf!
@hartvenus
@hartvenus Жыл бұрын
Was binging your videos and this came up fresh from the oven!! Thanks for all the quality, time-respecting content.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
My pleasure, thanks for your nice comment :-)
@eboatwright_
@eboatwright_ Жыл бұрын
This is amazing, also congrats on 100k+! You blew past that milestone
@NoBoilerplate
@NoBoilerplate Жыл бұрын
THE PLAY BUTTON IS ARRIVING NEXT WEEK :-D
@eboatwright_
@eboatwright_ Жыл бұрын
@@NoBoilerplate WOOOOO!!
@necauqua
@necauqua Жыл бұрын
Hah, I did some work a few years back on what-would-become the activej framework :) Yes the uber-optimization down to writing specific java code that would get JIT-ed to specific machine code was something that they did - not me, I was a student, too dumb for that part of the thing, at least at the time - ok one thing I worked on was the dependency injection thing, that part I'm proud of lol Also the magic specializer which converts DSL code into handwritten-like bytecode at startup, essentially getting those sweet zero-cost abstractions in Java 🙃
@NoBoilerplate
@NoBoilerplate Жыл бұрын
SOUNDS LIKE A NIGHTMARE XD
@necauqua
@necauqua Жыл бұрын
@@NoBoilerplate honestly from what I remember, it's relatively not bad, and I really liked the highlevel APIs and DSLs, imo (still) they are close to the best thing you can get in Java (ew, Java) However, there was a moment when I committed something to master that broke the tests (yes we rebased-and-committed straight to master) and the guy was almost yelling at me for not running them before pushing (I forgor 💀) and I was trying to suggest "um we can setup like an automated thing that would run the tests whenever you push something [to master]" - not yet knowing at the time what CI is or what are the better practices of it omg - and they didn't have that, and I just looked at the activej repo - they still don't
@RogerValor
@RogerValor Жыл бұрын
@@necauqua to be fair, most companies just started investing into CI/CD in the last few years, as it only started to proliferate with stuff like gitlab. I know the more wealthy java houses I worked with decades ago had their own build pipelines already with CVS and SVN, but testing was still often done with manual processes or only around releases.
@sasha35719
@sasha35719 Жыл бұрын
Amazing videos! They slowly got me into rust
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Wonderful!
@papamegamind
@papamegamind Жыл бұрын
the OpenAPI one looks really nice, i wish axum did something like this
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Search and ye shall receive crates.io/crates/axum-swagger-ui Of course, they're not first-party, which was my delight when finding poem, but I bet there's others!
@papamegamind
@papamegamind Жыл бұрын
@@NoBoilerplate LETS GOO, I will check it out
@jakobankarhem6281
@jakobankarhem6281 Жыл бұрын
I’m using utoipa with axum in a project. It is framework agnostic and have similar macros as shown in this video.
@RogerValor
@RogerValor Жыл бұрын
@@jakobankarhem6281 that sounds interesting. especially since axum-swagger-ui seems to only adding swagger ui, but utoipa allows decorating the views.
@kaushikkumarbora
@kaushikkumarbora Жыл бұрын
Adding rust to my resume to become one among the elite
@isaacdruin
@isaacdruin Жыл бұрын
I just started learning Rust, and even the configs and basic boilerplate looks intimidating. I'm defiantly not going to be leaving my SvelteKit safe space in the front end for a long time, but the Rust ecosystem for backend looks like it's worth my time.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Totally understand, it is a bit intimidating! Whenever you want to learn, here's my video for teaching yourself Rust: kzfaq.info/get/bejne/aM6Igcdn3Z_Xiqc.html
@isaacdruin
@isaacdruin Жыл бұрын
@@NoBoilerplate thank you :)
@NewLondonMarshall
@NewLondonMarshall Жыл бұрын
You're incredible, thank you for your videos they are so good!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
You're too kind, thank you so much!
@Turalcar
@Turalcar 11 ай бұрын
My main problem with picking a stack is that it should be easier to make your own. A reasonably good async framework should be possible without unsafe using only the standard library. And my brain almost broke trying to convert Pin to Pin (I accept that this one might need some unsafe).
@Dev-Siri
@Dev-Siri 11 ай бұрын
I make stacks by planning their acronyms. like the FAST stack (F)lutter (A)ctix (S)velte (T) ypeScript I never used it, but I have to say its my favourite to look cool.
@Tszyu01
@Tszyu01 Жыл бұрын
Appreciate your video. Definitely nice that OpenAPI is built into poem. If I was going to bet on a rust api framework, to me it would be Axum. I enjoyed working in Axum and seems as closest as expressjs as I could find so far.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
No betting needed - there's different frameworks for different purposes! Axum is indeed very good.
@angelurena
@angelurena 9 ай бұрын
I love your videos! I came across Poem when looking for a Rust web framework that had good OpenAPI support, and seeing your “endorsement” of it makes me more confident in choosing it.
@NoBoilerplate
@NoBoilerplate 9 ай бұрын
it's SO lovely to work with!
@lesptitsoiseaux
@lesptitsoiseaux 7 ай бұрын
First time on your channel. I do love your concise, informative and pleasant style so far. Could you consider doing a video for startups? You see, for example, we're writing an app with a Flutter front end, which relies heavily on a geographical map component and on webrtc for video calls. The great void in KZfaq is found, for us, in choosing our backend stack and opting for the cheapest possible hosting (cloud vs our own hardware) to allow ramp up until profitability or proof of concept is achieved. Thereafter funding would, one would hope, come elegance in design and scale. There's very few people with the expertise to talk about how to initially scale up fast, cheap and inevitably dirty to a degree. It could be a fun video I believe. Anyway, thank you for your videos, I'll sub now!
@NoBoilerplate
@NoBoilerplate 7 ай бұрын
You could literally use Poem-openapi for that, as I say in this video, Rust is Cheap: kzfaq.info/get/bejne/asqmmZmcsp2UoYE.html
@ch1n3du3
@ch1n3du3 Жыл бұрын
Thanks for another amazing video, I wanted to know if there was something that specifically caught your eye with poem over say axum or actix?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
the first-party openapi plugin - it's lovely!
@user-er8iy5dg8b
@user-er8iy5dg8b Жыл бұрын
I’m currently learning how to use Warp, I’d try to implement this using warp
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Nice! There's no warp first-party openapi plugin, but people have told me about docs.rs/utoipa/latest/utoipa/ It's less DRY than poem-openapi, but should be a good starting point!
@gertrudessampaio8689
@gertrudessampaio8689 8 ай бұрын
Your English and your voice are wonderful, I am learning English and I will try to imitate you, you have the most beautiful English I have ever heard
@NoBoilerplate
@NoBoilerplate 8 ай бұрын
You are very kind! I have practised public speaking a lot, starting when I was at university - practice makes perfect! I also practised making a little weekly fiction podcast for 3 years before starting this channel. I talk about this all in this video, if you're interested: kzfaq.info/get/bejne/nOB-nsJi3bKte30.html
@seannewell397
@seannewell397 Жыл бұрын
Dang this is thorough af.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thank you!
@NewAccount770
@NewAccount770 Жыл бұрын
I just listened to the Oxide and Friends podcast, where they are using their own Dropshot HTTP server to generate OpenAPI from their code, and how that boundary has helped them craft a reliable frontend. Poem looks super interesting!
@yurtle1851
@yurtle1851 Жыл бұрын
Same - I'm curious about the differences between Poem and Dropshot, I'll have to try them both at some point I guess
@absolutejam
@absolutejam Жыл бұрын
Awesome video! I've been using the majority of these and the rest have been on my list to tackle next. Absolutely love the channel and the quality of the videos you put out! Regarding Poem - I actually recently discovered the library/ecosystem after I'd started my first project using Actix & Utoipa for OpenAPI. I had a few concerns and wondered if you have hit any of these? The first was the much much smaller following for this library, and I (probably naively) perceived that the library had less activity. As well as this, I found that the docs aren't as good, as they're mostly just API docs & examples (but the examples are high quality). And my last issue was that I was having some major headaches with converting between error types in the handlers, which was much easier in Actix.
@absolutejam
@absolutejam Жыл бұрын
Also, forgot to say that the Poem openapi was much nicer than Utoipa as the schema was defined as code instead of alongside the code 👍
@NoBoilerplate
@NoBoilerplate Жыл бұрын
That's the big difference, poem-openapi is extremely DRY
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Yeah, the docs could use some work (maybe you or I should do that!) but the examples are great, that's how I learned.
@OrbitalCookie
@OrbitalCookie Жыл бұрын
I can't get over of sqlx accessing the DB at COMPILE TIME. This feels so wrong. All my programmer instincts are screaming that this is a path of madness.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Oh it would be TERRIBLE to do this in any other language. But Rust is so comprehensive that it can do these impossible things, see my video: kzfaq.info/get/bejne/g72Cg7xz1KmpkY0.html
@LuisCassih
@LuisCassih Жыл бұрын
@@NoBoilerplate I understand, but what happen if I don't have a local database? it wont compile? so if I'm working at a large company with a large app/db, and I don't have access to replicate a local database (because there's a highly confidential layer of security and you can only do a query to a sandbox limited db where you need to access via website), I wont be able to code? It may be an edge case, but it's based on the company I'm currently working on, it's a pain in the ass to work with sql queries.
@mustafazakiassagaf1757
@mustafazakiassagaf1757 Жыл бұрын
​@@LuisCassihthere's sqlx offline mode where it checks and save the result to a metadata
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@LuisCassih It's not an edge case - CI would suck if you had to have a db in there right? SQLx has this covered, I talk about it in detail here in the video I pinned when I introduced sqlx, here: kzfaq.info/get/bejne/gK-mfsqE3tzYqH0.html
@LuisCassih
@LuisCassih Жыл бұрын
oh, that's a nice feature, I can even create schemas without even accessing the db. Thanks both of you for the insight.
@alexandersemionov5790
@alexandersemionov5790 Жыл бұрын
"I am going to shave a yak" is probably most interesting debug message I've seen
@mwlpdx
@mwlpdx Ай бұрын
Your explanations are so fantastic. I echo the request for a video with html templates with HTMX for interactivity (look mom, no JavaScript). Just exploring Rust, but it seems like the front end story would be greatly helped with a "just return html templates, with tailwind css and htmx for get / post behavior," similar to Jinja, Chameleon in Python.
@NoBoilerplate
@NoBoilerplate Ай бұрын
Since this video, the community has rallied around dioxuslabs.com/
@tabiasgeehuman
@tabiasgeehuman Жыл бұрын
1:30 out of curiosity: why colour-eyre over something like error-stack? Error stack preserves the underlying type used in the error and still has all the niceities of color-eyre with a few extra features. I personally don't see why somebody would use eyre over error-stack if they are focusing on correctness
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Interesting! I wasn't aware of error-stack, probably because it's just a year old. I trust anyhow a LOT, it's the #1 results handler in Rust, and so Eyre being a fork I don't have to think too much about before recommending. I will follow error-stack with great interest, thank you!
@tabiasgeehuman
@tabiasgeehuman Жыл бұрын
@@NoBoilerplate btw, error-stack has full support for Eyre and anyhow! You just need to enable the feature. It's based around the same idea of building up a report from context, except the context is fully typesafe so you can use e.g. enums as errors
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@tabiasgeehuman oh INTERESTING! Well thank you I'll take a look 🙂
@kinositajona
@kinositajona Жыл бұрын
Me: axum is the clear winner. Also Me: what's this POEM all about now????
@kinositajona
@kinositajona Жыл бұрын
Rust library selection is the ultimate ADHD time sink. lol
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Yeah, there's a 'winner' but they're ALL wildly fast, that's why I put the normal frameworks down the bottom for context :-D
@hypario
@hypario Жыл бұрын
Nice video, I'm still trying to learn how to organize projects on Rust, as I'm switching from a OOP type of language (Java), I'm not really used to rust that feels a lot more functional oriented like. I was wondering if you had any tips for that. Also, any tips for Desktop applications with GUIs ? I can't find anything really reliable, I don't feel like it's mature enough yet
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Come ask those questions on my discord in #newbie-advice, folks will have great suggestions! I have answers: 1. Enums: kzfaq.info/get/bejne/sJNgYMWTyJ6UeoE.html 2. wasm inside Tauri (or electron) kzfaq.info/get/bejne/hpp8gMmcq7K2o30.html
@ironosenshicas
@ironosenshicas Жыл бұрын
Could you do an video on how things like sqlx and leptos achieve their compile time checking?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Already did, they do this with the WILDLY powerful macro system, my deep dive is here kzfaq.info/get/bejne/g72Cg7xz1KmpkY0.html I also talked specifically about how SQLx works in this video kzfaq.info/get/bejne/gK-mfsqE3tzYqH0.html
@DerSolinski
@DerSolinski Жыл бұрын
OMG! POEM is exactly what I'm looking for, seems to be a god send for HATEOAS. Add htmx to mix and its a win. Your recommendations are solid ;-D I'm actually trying to slay the Excel Makromonster my uncle created... Meaning I finally begun work on it, after procrastinating literally for years now. First step is writing software to analyze the thing for data and app logic. Trying that with pest, egui and calamine. Just managed to get some life-signs today. After that is finished I want a proper custom build lightweight ERP and *"THE STACK"* seems to be a good starting point for that.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I just can't get too excited for htmx, it's easy to get going but suffers from the same unsafety that js does. Try Yew.rs, it's very simple and will give you huge confidence in your frontend!
@DerSolinski
@DerSolinski Жыл бұрын
@@NoBoilerplate nah it's internal tools only nothing exposed for the web. Well you could completely go the SSR HATEOAS route but htmx reduced the boilerplate/templating a lot.
@SelfMadeSystem
@SelfMadeSystem Жыл бұрын
While I'm impressed by all the amazing backend support that rust is getting, I haven't really seen a satisfyingly complete frontend rust crate on par with js/ts alternatives like React, Svelte, Vue, Lit, etc. I find that libs like egui or iced are pretty cool, but they're not made for the web, and yew seems promising, but I haven't been able to get it to work with the stability and ease of development that the js/ts ones have, let alone something like Next, Nuxt or SvelteKit (I see rocket, but it really seems to be more of an HTTP framework/backend web framework than a frontend/fullstack framework that I'm looking for). This has really been the only thing preventing me from getting into rust. I'd love to see a video that delves into the web frontends and web frameworks that rust has to offer.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Oh for sure javascript has a big headstart. HOWEVER we're all getting very excited by leptos.dev - have you tried it?
@SelfMadeSystem
@SelfMadeSystem Жыл бұрын
@@NoBoilerplate I haven't. I'll be sure to check it out when I have time. Thanks for sharing!
@FineWine-v4.0
@FineWine-v4.0 Жыл бұрын
What happened to Aaron was a great injustice & it honestly set the tone for what'll become of the internet I had this thought, since we can use BASH-scripting to automate video editing with FFMPEG Can we do it with RUST & what about Picture-editing ?? (E.g: making thumbnails)
@NoBoilerplate
@NoBoilerplate Жыл бұрын
the only limit is your imagination! For example crates.io/crates/silicon
@mldy1
@mldy1 Жыл бұрын
4:17 should also be considered that requests/sec doesnt tell the whole story with performance as any framework written in java or js will have greater memory usage and most likely latency even if it is able to achieve greater throughput
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thank you for being chill XD yes indeed! This video isn't about how rust is the best (see my others for that!) but just putting Poem in context.
@ben6
@ben6 Жыл бұрын
Express is known to be slow. Compare it to Fastify or Hono, and there wouldn't be much difference.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Why didn't YOU do this comparison before making this comment? I gave you the link in the video! Both Fastify and Hono are extremely mediocre: web-frameworks-benchmark.netlify.app/result?asc=0&f=fastify,hono,express,poem
@phoenicianathletix2866
@phoenicianathletix2866 Жыл бұрын
In regards to the quote on the thumbnail Jay-Z, Biggie, Kanye west & other rapper don't write their poems/raps. They just memorize their best lines
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Fair, though isn't memorisation writing, of a sort? Only writing to the medium of your mind, rather than paper - Dijkstra didn't mean the physical act of writing, really, he meant the act of creation. Consider the sentence "I wrote a song", you might physically write the lyrics, but the tune is in your head.
@cagataykaydr3015
@cagataykaydr3015 Жыл бұрын
I checked out poem thanks to you! I loved it and I want to use it in my next project. But I see that I have fears on frameworks like this about their futures, can I get your opinions about it please? What do you think about community-made frameworks and their futures, because we have an example like Rocket. I'm sure that I'll not use these frameworks in billion dollar startups ;) Yet, do you have any trick on understanding which library will stay long enough?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
That'd be a good trick! Here's how I evaluate rust crates, I use lib.rs: lib.rs/crates/poem Note the statistics right at the top of the page: - latest release July 23rd 23 (before then, Feb 23, Dec 22, Nov 22 etc) - #9 in 'http server' - 48k downloads/month - used in 116 crates lib.rs surfaces exactly what I need to know, and all without javascript! Rust and the Rust community make STAGGERINGLY stable software - even 0.0.2 crates I trust more than 2.0.0 npm packages!
@RahndelDaVandal
@RahndelDaVandal Жыл бұрын
What font are you using on the code snippets? The ligatures for #[..] is really cool!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
That's Fira Code! Though there's a few ligature nerd fonts around
@RahndelDaVandal
@RahndelDaVandal Жыл бұрын
@@NoBoilerplate thanks I’ll have to check it out. I’m using a custom NF font with ligatures but it doesn’t have that ligature
@flwi
@flwi 4 ай бұрын
Great video! Thanks for the recommendations! Does anyone have experience with generating rust code from an existing openapi spec? I'm just starting on my rust journey and could use sth like that for a side project. Recommendations would be appreciated!
@blidardiapinal
@blidardiapinal Жыл бұрын
thanks Tom
@NoBoilerplate
@NoBoilerplate Жыл бұрын
You're welcome Dennis
@dionysis_
@dionysis_ Жыл бұрын
Bacon is amazing!!!!! 🤯 Thanks 🙂
@NoBoilerplate
@NoBoilerplate Жыл бұрын
SO good right! cargo-watch is fine, too, though it flickers when refreshing.
@jonnyb2956
@jonnyb2956 Жыл бұрын
How does the sqlx compiler handle CI builds, does he just skip the checks then? This sounds like the build-step would need access to a database, which feels kind of unintuitive.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Ooh, you're gonna love the solution: It's got a built in cache mode for CI. Check my explanation here kzfaq.info/get/bejne/gK-mfsqE3tzYqH0.html
@ahuman32478
@ahuman32478 Жыл бұрын
Hi Triss How come you write SQL by hand rather than using an object-relational mapper for Rust? Is there a performance benefit? Finer control over database operations?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Two reasons: 1. compile time verification, 2. optimisation. 1. Only SQLx (I believe) with the query_as! macro can check your queries at compile time. Though it'd be more ergonomic to write in an ORM, I happily give it up to get compile time verification. 2. Every project that uses an ORM eventually has to hand-optimise their queries at scale. Universally, with no exceptions. I am fully bought-in to Rust's "upfront the work" mentality, and writing queries in sql, rather than sometimes writing orm and sometimes writing sql is MUCH cleaner. Also, it's very likely you'll write your own functions to abstract both the ORM or the raw SQL, so you might as well get compile-time guarantees!
@DmitryDodzin
@DmitryDodzin Жыл бұрын
I like axum not because of speed or ergonomics but because it's under tokio's development team and therefore I don't fear the framework will fall behind and will be updated even if some dependency introduces breaking changes (ehm ehm looking at you hyper 1.0.0)
@NoBoilerplate
@NoBoilerplate Жыл бұрын
no such thing as breaking changes with Cargo, right? Human error, sure XD
@irlshrek
@irlshrek Жыл бұрын
*in my opinion* we should rally around Axum as our web framework. its built on top of the tokio stack by the tokio people and its super ergonomic and powerful
@NoBoilerplate
@NoBoilerplate Жыл бұрын
1. I don't think we need to 2. Good luck herding the cats XD
@irlshrek
@irlshrek Жыл бұрын
​@@NoBoilerplate hahah fair enough
@mustafazakiassagaf1757
@mustafazakiassagaf1757 Жыл бұрын
i personality like using seaql query builder with my sqlx
@astroorbis
@astroorbis Жыл бұрын
the mention of Jane Eyre gave me a flashback, goddamn that book was long my D:\ drive has the writing on the tombstone of her friend as its namesake - Resurgam
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Amazing!
@RenderingUser
@RenderingUser Жыл бұрын
LETS GOOOOO new rust video!!!!!!!!1
@vpetryniak
@vpetryniak Жыл бұрын
What about graphql with rust? I fall in love with graphql since it gives me output validation on the frontend and really would be awesome to combine Graphql + Rust
@NoBoilerplate
@NoBoilerplate Жыл бұрын
there are 423 crates on crates.io that mention graphql - Go forth!
@JoeWasson
@JoeWasson Жыл бұрын
I've used async-graphql and juniper. I slightly prefer Juniper, although I think async-graphql may have more features/be more active. Both have been more pleasant to work with than their Typescript counterparts.
@Joe-sm7mf
@Joe-sm7mf Жыл бұрын
I am curious, what is anyone's opinion of Leptos? I've been playing with it and am enjoying it for both frontend and backend. I will have to give Poem a try so I have have no comparison at this time.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Leptos looks really good, and I look forward to it maturing!
@yondaime500
@yondaime500 Жыл бұрын
What do you use for i18n? I've been trying to get people at work to try Rust, but that's one thing I'm not sure about, because it's so easy to do in the language we currently use (C#), and I don't know if there is an equivalent in Rust yet.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Poem has built-in i18n support, check the readme! crates.io/crates/poem
@yondaime500
@yondaime500 Жыл бұрын
@@NoBoilerplate That's nice, but I mostly write desktop applications. I just found a crate named i18n-embed-fl that looks promising. I'll try to understand how it works and if it does what I need.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@yondaime500 I think you've got it - the standard seems to be crates.io/crates/rust-i18n
@after_alec
@after_alec Жыл бұрын
Omg GjengStack has me rolling
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Gotcha!
@spencerpogo
@spencerpogo Жыл бұрын
"fasterthanthine" 😂😂
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I learned Rust from Amos's amazing posts!
@spencerpogo
@spencerpogo Жыл бұрын
@@NoBoilerplate I'm a big fan too :)
@joaosouza2678
@joaosouza2678 Жыл бұрын
I don't use Rust daily, but have interest in learning it deeper. Do you think doing Leetcode problems in Rust is a good option? I heard that lifetimes and other features can make simple problems harder.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I actually have a whole video explaining my tips on how to learn Rust, and it centres around Rustlings, a code kata system like leetcode problems! Do watch (and check out the other videos in the playlist if you have time kzfaq.info/get/bejne/aM6Igcdn3Z_Xiqc.html
@neociber24
@neociber24 Жыл бұрын
Congrast for going fulltime with what you enjoy
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thank you so much, it's so wonderful to be, effectively, teaching professionally, I've always wanted to!
@Kiaulen
@Kiaulen Жыл бұрын
Well, you were right. I looked up what happened to Aaron Swartz, and I'm now angry and sad. I hope we can one day create that kinder world.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@jacobwilliams2246
@jacobwilliams2246 Жыл бұрын
Have you tried leptos for front end?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
We're all very excited for leptos! Not quite mature enough for me to be recommending just yet, though.
@SanteeRocks
@SanteeRocks 7 ай бұрын
Hi can sqlx support clickhouse too?
@icanonlysuffer
@icanonlysuffer Жыл бұрын
yay more rust
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Every other video I make is on Rust at the moment :-)
@emddebatebriankim9942
@emddebatebriankim9942 8 ай бұрын
RIP Aaron Swartz
@NoBoilerplate
@NoBoilerplate 8 ай бұрын
We need him now more than ever
@lel7531
@lel7531 Жыл бұрын
Did you try miette ? It's great for error reporting too
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Looks like miette is on the `thiserror` side - creating good library errors, not handling good library errors. I don't write libraries, but if I did, I'd check it out!
@laundmo
@laundmo Жыл бұрын
​@@NoBoilerplatemiette is on all sides: it has guides for using it in either libraries, applications or as the main() return. it's main claim to fame is ultimately very nicely formatted errors, akin to rust compiler errors, which are desirable in applications too.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@laundmo it's very exciting! Thanks both for bringing it to my attention!
@dionysis_
@dionysis_ 4 ай бұрын
Ok tried to use poem and liked it but this is my first API and there is no community or material for support. Will try axum
@martinheuschober4341
@martinheuschober4341 9 ай бұрын
when you bind your db and your rest api, don't you tie your user facing api to what you store. which is probably ok for something simple, but IMHO for something more complex you want to be able to evolve the API independently from your business layer and DB layer
@NoBoilerplate
@NoBoilerplate 9 ай бұрын
An excellent point. Yes, especially for API versioning, you'd want that decoupled, which is easy enough, just make another struct. The strict typing of your API, and the compiler keeping you safe when making changes, still applies after this useful weakening of the relationship between DB and API.
@mr_diamond_gold9842
@mr_diamond_gold9842 Жыл бұрын
Why choose postgres over other options when given a choice?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
It's the stand-out best SQL database on the planet, and has been for my entire 15 year career.
@broggl
@broggl Жыл бұрын
crablang for life
@NoBoilerplate
@NoBoilerplate Жыл бұрын
crablang until it's merged, maybe. I remember the node/io.js split - history is cyclical XD
@miguelguthridge
@miguelguthridge Жыл бұрын
My main problem with creating backends has been the fact that I don't know databases. I tried taking the databases course at my university, but the lectures were extremely dry and the setup process tedious enough that my ADHD brain gave up (I was also taking my university's Rust course and it was far more interesting, since static analysis is so cool). Since understanding databases seems essential if I want to have any hope of success as a software engineer, do you have any recommendations for a way I could learn how to work with databases that will be manageable? While sqlx looks nice, the fact that you need to use strings to build up the queries means that there likely isn't any intellisense for it (which would make things quite challenging for me).
@tserhey
@tserhey Жыл бұрын
Working with an ORM - like Diesel in the Rust ecosystem - might be a good fit if writing SQL seems too daunting at first.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Diesel is a very good ORM, but it doesn't do compile time verification, and its runtime errors are not very nice.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I too used to feel like this. You could try Diesel, a very popular rust ORM. Here's why I now prefer to write SQL: In every large project I've worked with, we've EVENTUALLY had to write SQL. ORMs don't scale, and the bigger your app gets, the more hand-crafted SQL you have to write. This is the same problem as Javascript, it STARTS OFF nice and simple, but by the end, you wish it weren't so simple, because the edge cases break you. Use SQL with SQLx, and don't be afraid, because the compiler is holding your hand :-)
@minciNashu
@minciNashu Жыл бұрын
Planetscale has a good intro to SQL. They also have a free tier for hobbyists.
@miguelguthridge
@miguelguthridge Жыл бұрын
@@NoBoilerplate that makes sense, but an ORM definitely sounds like a much nicer starting point. Maybe I'll also look and see if there's a kata-like course for SQL! I used Tom Kunc's MacroKata to learn Macros in Rust and it was awesome
@LoganVanCuren
@LoganVanCuren Жыл бұрын
Awwwwww, I really like Nim!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Ah, so do I. Nim was my gateway from Python to Rust, igniting my passion for single-binary deployment and static typing! Popularity matters, as I always say, so I looked at three mainstream languages that I stood a chance at writing professionally: Go, Haskell, and Rust. Go is ruthlessly practical, but with no beauty, Haskell is beautiful but not practical, and Rust has the best of both, and is somehow greater than the sum of its parts! I wrote this comment on a hackernews nim v rust comment thread last month, perhaps it's useful to read: Nim is too timid. Most languages are too timid. My context: I'm a maintainer of iNim, creator of the Rust channel, No Boilerplate, and a professional python web developer for 15 years. The features you are excited about in Nim are compromised for the sake of simplicity: - Macros can't change syntax, - There's a limit to how real-time the standard language is, - Compiling to javascript is a nice trick, but if it didn't rely on GC it could compile to webassembly, which is better, - Ask any advanced python developer: Indentation for syntax is a bad idea at scale. Hell, have you ever used YAML? What Rust does is a revolution because they solved the problem of memory safety without garbage collection with the Borrow Checker. The knock-on effects are GARGANTUAN. This was a hard problem to solve, and it makes the language more complex to learn, but it unlocks all the language's superpowers. If you 'cheat' with a GC, you get nothing. Nim started its life, just as most languages did with a GC, and the efforts to keep the syntax the same while offering alternatives are greatly compromised. It's far easier to add GC/RC to a low-level language than it is to remove it from a high-level one, where the whole ecosystem relies upon this behvaviour. Of COURSE I know about Nim's plugabble GC options. That doesn't impress me at all (though Araq's effort is to be commended). In Nim they are compiler options, in Rust they're libraries. The difference is vital. For example, at a per-variable level, I can choose to reference count with doc.rust-lang.org/std/sync/struct.Arc.html if I so wish (I rarely need to because the borrow checker is magic). If you want python, you can have it inside a Rust macro, sort of like this crates.io/crates/inline-python because rust macros CAN change syntax. With Macros and no GC, you can rebuild ANY FEATURE inside Rust, the floor of the abstraction is the metal, and the ceiling is the sky. This is what Rust is all about: full power to the developer, no compromises. My video on this topic for those interested is: kzfaq.info/get/bejne/htt9i7qUld7We2Q.html I love both languages, but I can only see one language being the standard next 40 years, and demonstrably so can Linux, Microsoft, Cloudflare, Discord, and many others.
@LoganVanCuren
@LoganVanCuren Жыл бұрын
@@NoBoilerplate Thank you for the response, and thank you for making it a wonderful response! I feel like I've met a celebrity! I've been loving your videos and sharing them wherever I can. ☺️ The way you reference Nim just caught me off-guard because I had just discovered it and was really liking it. I'm primarily a Python developer, so it was really nice to see similar syntax and I appreciate this simplicity over the very verbose Rust I've been trying to learn. And have you seen the Uniform Function Call Syntax? ♥️♥️♥️
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@LoganVanCuren UFC is SO fun isn't it! Look, learn nim, do it without any guilt, it's a great language. Rust will be here when you want more ;-) BTW Rust has something that feels a bit UFC - you can attach methods to any struct using `impl`. It feels like much looser coupling than classes (though less loose than UFC) doc.rust-lang.org/beta/std/keyword.impl.html
@viniciusataidedealbuquerqu2837
@viniciusataidedealbuquerqu2837 5 ай бұрын
wait what no leptos on the frontend?
@SimoneBigozzi1998
@SimoneBigozzi1998 Жыл бұрын
Thank you to the tribute to the internet's own boy
@NoBoilerplate
@NoBoilerplate Жыл бұрын
We need Aaron more than ever
@d3j4v00
@d3j4v00 Жыл бұрын
1:01 wow, what a portfolio. RIP
@NoBoilerplate
@NoBoilerplate Жыл бұрын
We need him now more than ever
@jagagemo8141
@jagagemo8141 Жыл бұрын
Have you considered making a nix with your stack?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I really like Nix, and have NixOS on a laptop for testing. However... This whole stack is pure Rust, even using RusTLS, no external dependencies other than rustup.rs. Nix is ESSENTIAL in other languages, but I've found since switching to Rust, I can just choose pure Rust dependencies and never trip up. As Cargo is extremely deterministic, I don't miss Nix there either. The Rust Editions system guarantees anything that compiles today will compile in 40 years time!
@AbhishekBajpaiHere
@AbhishekBajpaiHere Жыл бұрын
Great video, why not axum though ?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I'm uninterested in closed source silos.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Axum is great! They're all great really. As I said in the intro to poem, axum doesn't have a first-party openapi plugin, and I've heard that those it does have are not ideal.
@AbhishekBajpaiHere
@AbhishekBajpaiHere Жыл бұрын
@@NoBoilerplate The reason I like axum is its well integrated in tokio stack. So I think it will be maintained for a long time. Also having OpenAPI is not important to me, that's just my prespective, its a developer feature mostly and they usually use Postman or something similar. Again great video and I hope you find success now that you are doing rust videos full time. I would love a detailed video on tracing, not a gloss I think basics everyone can get.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@AbhishekBajpaiHere Thank you so much! Axum's great too, of course. You can't go wrong with the Rust frameworks! What's to know about tracing? The readme's very comprehensive - what value could I add?
@Scio_
@Scio_ Жыл бұрын
Sad that Fasterthanthine was the first to go...
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Solid name honestly. I learned Rust from Amos at fasterthanli.me :-)
@izwe794
@izwe794 Жыл бұрын
RIP Aaron
@NoBoilerplate
@NoBoilerplate Жыл бұрын
We need his help now more than ever.
@ThundaAaAaAaAaAh
@ThundaAaAaAaAaAh Жыл бұрын
RIP Aaron, reddit died with him
@NoBoilerplate
@NoBoilerplate Жыл бұрын
We need him now more than ever
@tiagomacedo7068
@tiagomacedo7068 Жыл бұрын
Hey, you didn't explain what Bacon/Clippy is :(
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Apologies! This isn't targeted at beginners to Rust, however I do have a whole playlist that IS! Here's the exact video in that playlist where I talk about bacon kzfaq.info/get/bejne/mqyberGWmdXFe58.html
@tiagomacedo7068
@tiagomacedo7068 9 ай бұрын
@@NoBoilerplate Ooh, thank you! Love your podcast too btw!
@NoBoilerplate
@NoBoilerplate 9 ай бұрын
@@tiagomacedo7068 oh thank you so much! I started planning Lost Terminal season 14 just today! Drops on the first Monday of November 😀
@klemens_gak
@klemens_gak Жыл бұрын
The channel that is worth to turn off AdBlock. Greetings from Poland! I love your approach to technology and not only. That's make me moriveted.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Thank you so much!
@danyldavidiuk9507
@danyldavidiuk9507 Жыл бұрын
what about diesel rs? (why sqlx...)
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Diesel, like all ORMs I've tried so far, does not connect to your real sql database at compile time and validate your queries. Just incredible, check out kzfaq.info/get/bejne/g72Cg7xz1KmpkY0.html
@danyldavidiuk9507
@danyldavidiuk9507 Жыл бұрын
@@NoBoilerplate but you can provide file with sql commands so you will have structures of tables, so you will have some compile time checks like for types
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@danyldavidiuk9507 That is not good enough
@theappearedone
@theappearedone Жыл бұрын
Now I looked up Aaron Swatz or whatever. I read something about downloading MIT documents but dont exactly get how its related? Anyone?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Watch "The Internet's Own Boy", linked in the pinned ERRATA comment.
@tauiin
@tauiin Жыл бұрын
excluding C++ based ones is kinda funny
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Yeah, if you check the link there are some nim and cpp webservers that punch a bit higher than ActivJ, but as I said, you'll never persuade a team to use them, so I feel safe discounting them XD I'm here talking about Rust not just because it's a WILDLY great language, with alien magic in, but that, somehow, despite all this, it's already the #19th most popular language redmonk.com/sogrady/2023/05/16/language-rankings-1-23/
@user-du9ch3tn2v
@user-du9ch3tn2v Жыл бұрын
There are other metrics than popularity (but rust for http stuff is good)
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@user-du9ch3tn2v popularity doesn't matter comparing the top languages, they're all popular enough, but if you see where nim (for instance) is on that graph, it really does matter.
@porky1118
@porky1118 Жыл бұрын
2:28 I never used Tokio and I don't want to use Serde anymore.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
you MUST have used tokio! really?
@porky1118
@porky1118 Жыл бұрын
​@@NoBoilerplate No, I really never used it. I've seen it a long time ago, but I always thought, I don't want to know that much. I was rather expecting critique on not using Serde :)
@livb4139
@livb4139 Жыл бұрын
what if the database connection breaks
@NoBoilerplate
@NoBoilerplate Жыл бұрын
If you're talking about the development experience, SQLx has you covered, I explain their 'offline' feature in this video: kzfaq.info/get/bejne/gK-mfsqE3tzYqH0.html
@fumano2679
@fumano2679 10 ай бұрын
Why postgresql > mysql ?
@NoBoilerplate
@NoBoilerplate 10 ай бұрын
though mysql has a large legacy install base, postgres has beaten it in features and performance my entire career.
@jordixboy
@jordixboy Жыл бұрын
Good video! fastapi is missing in the framework benchmap, its one of the fastest python web frameworks
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Click through, it's comically slow (10x) compared to the big players. web-frameworks-benchmark.netlify.app/result?asc=0&f=poem,fastapi I don't hate python, but fast it aint. I'm DEVASTATED they're keeping the GIL for python 4.0. That's a CHOICE.
@murtaza6464
@murtaza6464 Жыл бұрын
Has there been any official talk of python 4.0?
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@murtaza6464 I can't find where I read about it now - but reading the mailing lists they are focusing on optimising so much that the GIL doesn't hold them back. Sure, great, sounds wonderful. Byeeeeeee!
@maksimmuruev423
@maksimmuruev423 11 ай бұрын
I've amaized how slow and sluggish JS outperform Rust ? You can expalin Java .. it snor really interpreted...and has JIT thing..but JS..
@NoBoilerplate
@NoBoilerplate 11 ай бұрын
It's because it's actually a frontend for C++, it bypasses all of nodejs and replaces them with native wrappers. SOME might call this cheating ;-) Sifrr is based on github.com/uNetworking/uWebSockets.js You find this a lot at the top of the benchmarks - artificial frameworks that are designed to 'win' framework competitions, but don't actual use your language in a normal way, so you'd never choose them (as you have to throw away much)
@norude
@norude 11 ай бұрын
Please do chapters for your videos
@allesarfint
@allesarfint Жыл бұрын
Wait, I thought everyone was choosing their stack based on some meme name.
@NoBoilerplate
@NoBoilerplate Жыл бұрын
I'm as surprised as you
@minerj101
@minerj101 Жыл бұрын
What about leptos
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Not quite mature enough yet, but it's very exciting!
@shiroi2971
@shiroi2971 Жыл бұрын
RIP Aaron, he messed with the wrong kind of people
@NoBoilerplate
@NoBoilerplate Жыл бұрын
We need him now more than ever
@s1nistr433
@s1nistr433 10 ай бұрын
Yeah, sorry Rust just isn't ready yet for web development. I tried it in the past, there isn't a major established web framework that has been tried and tested in enterprise, the ones that exist are underdocumented or undermaintained. Axum doesn't even have a website and is barely documented. I couldn't find a good e2e testing solution in the level of playwright. The orms feel incomplete, nothing like entity framework or prisma. Still, I hope it does get there someday cause rust is a good language. I do think it will with the performance Rust is offering A good alternative to get away from JS in the server is C#. Better performance, has a good ecosystem and tons of jobs. The only downside to it is Microsoft.
@NoBoilerplate
@NoBoilerplate 10 ай бұрын
Rust is indeed an excellent language, and though you're right that the web frameworks are still being developed, I would trust a 0.2.0 Rust framework over a 5.0.0 JS framework in production every day of the week. Note I say 'trust' not 'use', there are many cases where the downsides of a JS framework (say, react or express) are overwhelmed by the benefits you get from popularity and longevity: If you want gmaps in react you can choose between several plugins. If you want it in rust wasm (leptos or yew, say), you'll have to write that plugin yourself. Some people will be fine with that, others will have to wait, and use React or similar in the meantime. But this doesn't mean that you should write off the whole language, as your comment suggests. That's too blunt. The web stack I feature in this video: poem-openapi coupled with SQLx, TODAY, is better than any other option in any language for building a lightweight API in production. This combination of rust/poem/sqlx gives you features you simply can't have in any other popular language or framework. compared to rails-api or express or django-restful etc etc, the stack I show in this video is more reliable, safer (both memory and high-level) and faster than them all. As a senior web dev, there's one thing above all else that I care about these days: that you can actually finish your project with this stack. It will sit in production, reliably, being upgraded as the compiler improves without a single line of code that needs porting, for decades to come. My team and I can move on to other projects. There's enormous momentum in the Rust ecosystem, I'm testing out leptos for replacing js in my frontend projects, and I'm extremely excited by what I'm finding, for instance. But unlike poem, I don't recommend laptos for everyone just yet, perhaps in a year. What I do recommend is that for people who are sold on Rust, this is a good stack for building an API, which is the vast majority of backend web projects. For now, I recommend to most people to stick a react app or a swift UI on the frontend. But not for long! :-D
@dombou70
@dombou70 Жыл бұрын
Wait till you discover Haskell :P
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Wait till you discover my other videos XD (specifically this one kzfaq.info/get/bejne/aM6Igcdn3Z_Xiqc.html)
@dombou70
@dombou70 Жыл бұрын
@@NoBoilerplate Heh I was being facetious. Watched all your vids, and love them. Does feel though that you love the aspects of Rust that are actually stronger in Haskell than Rust (imo). I wonder if a more FP, and less systems would be ideal
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@dombou70 I adore haskell, learned it 15 years ago and it made me a better programmer in OTHER languages! However, Popularity Matters. I evaluated go, haskell, and rust in 2020 and found go was very practical, but not beautiful, haskell beautiful but not practical. Rust is a wonderful blend of haskell and lisp, all in syntax that doesn't scare people away!
@dombou70
@dombou70 Жыл бұрын
@@NoBoilerplate That's fair. Fwiw, I went through my Haskell phase, and i've also moved on as the community was just too small. I now use TS and it's mostly good enough. I'd love proper ADT's like Rust has, and a std lib built around Result/Option types
@NoBoilerplate
@NoBoilerplate Жыл бұрын
@@dombou70 TS is great if you have no option, yeah, I dig it for sneaking in some safety into frontend teams! Yes, this is the exact problem - you can TELL when a language wasn't built around sum types, like TS, if it gets bolted on later, you have deep compromises that you can't remove from the language. RUST IS SO EXCITING FOR THIS
@astrakernel
@astrakernel Жыл бұрын
Actix 🤩 And how java and Js frameworks above Rust?! What could be the reason?!
@NoBoilerplate
@NoBoilerplate Жыл бұрын
Elaborate hand-crafted native extensions. They're basically built to win benchmarking competitions.
In Search of Code Purity
16:37
No Boilerplate
Рет қаралды 96 М.
Rust makes cents
13:24
No Boilerplate
Рет қаралды 114 М.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН
Little girl's dream of a giant teddy bear is about to come true #shorts
00:32
Самый Молодой Актёр Без Оскара 😂
00:13
Глеб Рандалайнен
Рет қаралды 12 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 8 МЛН
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 122 М.
Build your entire tech stack in Rust
7:22
Let's Get Rusty
Рет қаралды 206 М.
What Makes Rust Different?
12:38
No Boilerplate
Рет қаралды 200 М.
The Downfall of Actix Web
20:25
Ben Awad
Рет қаралды 240 М.
Rust makes you feel like a GENIUS
10:48
No Boilerplate
Рет қаралды 403 М.
Rust on Rails
11:34
No Boilerplate
Рет қаралды 131 М.
Rust is not a faster horse
11:37
No Boilerplate
Рет қаралды 322 М.
Your Command Line, Oxidised
10:09
No Boilerplate
Рет қаралды 199 М.
Rust Tests Itself (kind of!)
11:41
No Boilerplate
Рет қаралды 77 М.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН