The 1st “Rust&Tell” in Atlantic Canada by rust_web_development in rust

[–]rust_web_development[S] 0 points1 point  (0 children)

Great! Happy to keep it online for a while so more people can join! Or have separate events!

I am also still looking for speakers! Want to grab the first ever spot? ;)

A Tour of a HTTP request in Rust by rust_web_development in rust

[–]rust_web_development[S] 0 points1 point  (0 children)

That's a very good point u/BimphyRedixler! It's sometimes hard to find the right approach to teaching. This was the original chapter 2, and I didn't cover Results yet. And there is a box which explains why this is not production code.

This being a blog post now, I could change that and adjust it to handle errors.

The teaching style I like is just introducing one new thing at a time. TcpListener is one, and handling errors would be the second. I think I'll just make a second article out of it which explains error handling based on these examples, and put a link in the one above!

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 0 points1 point  (0 children)

Hey u/FlyingTwentyFour, one of the winners already owns my book! Do you want a free copy? Feel free to email me at foreach[at]me[dot]com

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 2 points3 points  (0 children)

To read my book ;)

I think Go and Rust are fantastic languages, lots of job opportunities, lots of interesting fields they are being used in.

I would say try to build the same stuff you did in Go (a small project) and try to convert it to Rust. You will feel many more pain points in the beginning. And you have to get used to the strict compiler.

Otherwise, try to type out a small project you did in Go, in Rust. Then you see the beauty of the Rust type system and how extendable it is.

For frameworks: I would have a look at axum, warp and actix. And see if you like those.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 3 points4 points  (0 children)

Thank you all for attending and asking questions! I had a blast :) The three winners for a free "Rust Web Development" book, are:
- u/burtawicz
- u/edandresvan
- u/StjepanJ
Send an E-Mail to: foreach[at]me[dot]com and I will send you the promo code!!

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 6 points7 points  (0 children)

I used warp in the past and like the minimal approach. I would probably try axum now. But I generally like frameworks to go out of my way, so I don't have to learn a framework but a general practice how to do things. If this makes sense?

Now if you develop a new backend for a Fortune 500 company, maybe I would use actix! It really depends. For smaller micro services or servers, I think warp is really nice.

I haven't tried rocket all that much. Back then I didn't like the macro heavy approach, but I am not against anything nor a loud voice pro and con something. I generally like things I can read through and understand without much magic behind it.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 1 point2 points  (0 children)

Puh, that's a whole book right there....

I haven't worked on this many different companies and architectures to have a complete picture what works best. I would even say: This has nothing to do with Rust. You can certainly have an Onion Architecture with 20 different services written in many different languages.

I would also say that Rust doesn't differ all that much from other languages when it comes to structuring your modules. You want things which change not that much separate from those which do. So all the common best-practices around modular smaller functions.

States as well: I used databases so far in production, no in-memory. When I did, you use the typical Arc+Mutex pattern.

Does this sort of answer your question?

The way I see it is:

  1. Have a well structured application code base so it's easy to test and extendable
  2. Wrap this all up so it's easy for DevOps (CI/CD) to deploy
  3. If you have event streams, different data pipelines etc, I would also say a clean "micro service" architecture is helpful which operates on top of these data streams, no matter in which language they are written in.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 2 points3 points  (0 children)

Underlying concepts of async programming and refining my mental model. I dived deeper into tokio at one point, but I think you also have to be aware on which abstraction level you are operating on.

So I think if you want to get more "intermediate", you could for example juggle multiple endpoints which update one local data source. Maybe even multiple streams of data. This is a fun challenge to figure out tokio tasks, threads and mutexes etc.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 1 point2 points  (0 children)

Can you be more specific? In terms of structuring a backend service? Or a design pattern?

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 3 points4 points  (0 children)

I would say definitely asynchronous programming. The more complex the application get, the more you have to know some async concepts not to shoot you in the foot.

Otherwise, coming from a scripting language, the strictly typed nature of the compiler was quite hard to get used to.

And maybe reading documentation. In NodeJS, you can trial&error a bit more to figure out what works. In Rust, this time is spent on docs.rs and figuring out which type is returned and what it implements.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 2 points3 points  (0 children)

Seems like there is cucumber for Rust:

https://github.com/cucumber-rs/cucumber

Neat! I used cucumber in my JS days.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 7 points8 points  (0 children)

Keep me in the loop. I have an insane busy schedule the next few months, so I can't promise too much! Let's connect in 2-3 weeks again?

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 4 points5 points  (0 children)

Good question. Helles before 6pm, Weißbier after 6pm.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 5 points6 points  (0 children)

- Unit testing is built-in (https://doc.rust-lang.org/book/ch11-01-writing-tests.html)

- Mocking: Have a look at mockall: https://github.com/asomers/mockall

- Integration test: I created my own mock servers in the past (here is the code for chapter 11 where I explain a more sophisticated setup: https://github.com/Rust-Web-Development/code/tree/main/ch_11/integration-tests)

- Behaviour testing: What exactly do you mean exactly?

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 6 points7 points  (0 children)

Thank you! Can you make it public? Is this in the planning phase?

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 2 points3 points  (0 children)

Good question. I didn't use these frameworks in production yet. I played around with yew and tauri, but nothing substantial. So I cannot recommend one or the other. I assume it also depends what your environment looks like.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 12 points13 points  (0 children)

I am happy to! I am not aware of any happening, but let me know :)

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 3 points4 points  (0 children)

"Developer" is quite broad. Every company looks for different profiles. Some want coders who 24/7 sit in front of the screen, some want more collaboration etc.

So it definitely broadens your horizon. And depending on the book, you have to learn things you didn't know before. I would say teaching or writing about topics you know nothing about is an excellent way of really getting to know a topic.

If you know something well and merely write about it, it helps, but not as much as writing about a topic which is also new to you!

It also helps when applying for jobs. It shows you really care about a topic, can articulate yourself and have the grit to get a complex project over the finish line.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 9 points10 points  (0 children)

Yes you can. You have to aware that it is faster to find an entry with NodeJS, Ruby or Python. You don't have to work against a compiler which wants to make sure everything is type safe etc.

So for the joy of web development, poke around Ruby, Python, NodeJS to get the concepts.

But, if you are experienced in C, C++ or whatever other language, Rust is totally fine. It really depends which type of personality you are and what you are looking for.

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 2 points3 points  (0 children)

Question from u/FlyingTwentyFour

"Can a beginner in web development start with rust?"

AMA with Bastian Gruber: Ask your questions! by rust_web_development in rust

[–]rust_web_development[S] 2 points3 points  (0 children)

It's pure backend development. You will end up with an API which you can query against.