kubikpixel, (edited )
@kubikpixel@chaos.social avatar

deleted_by_author

  • Loading...
    elrido,

    @kubikpixel When learning a new language, doing so with a concrete, but not too complex, use case in mind is certainly the way to go. With the advent of code you get the benefit of being able to compare your solutions with others written in the same language (i.e. search on GitHub for adventofcode, year & language being Rust).

    A web service with a simple scope (don't they all start out like this? 😅) will be a great toy project. With Rust, you need to be aware, if your not already, that it's standard library doesn't include HTTP or TLS protocol implementations (like C, C++, but unlike Python or Go). Since implementing HTTPS on a raw socket, multi-threaded is a bit of a steep learning curve, I would recommend to use a well supported library or framework for that part of your project, so you can focus on the logic you want to implement. This seems a good comparison list, ranked by how high level they are.

    From the high-level ones I can recommend Actix web and Rocket (I've used the latter more, but the former seems to be more popular these days). Hyper (part of the Tokio stack) would be a level below, interesting if you wanted to build some kind of HTTP(S) API where you'd do all the routing yourself or it has only a single function (like, a lambda function). For HTTPS clients, reqwest would provide a more convenient interface over hyper's client library. All of these are built on top of each other, Actix and Rocket as well as Reqwest use Hyper and the former two also use other parts of the Tokio stack to handle multi-threading and dealing with the network sockets and packets.

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • JohnLaRooy,

    @kubikpixel also recommend advent of code which starts soon

    kubikpixel,
    @kubikpixel@chaos.social avatar
    JohnLaRooy,

    @kubikpixel yes. You can do problems from previous years too

    mo8it,
    @mo8it@fosstodon.org avatar

    @kubikpixel @JohnLaRooy The good thing about Advent Of Code is that many people will be doing the same problem and you can just ask them about it or check their uploaded answers :D

    But I don't know how much of good fit they are for Rust beginners. I didn't do any Advent Of Code yet. This year will be my first :D

    You should definitely finish at least the first couple of chapters in the official Rust book though :D

    kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • jmsdnns,
    @jmsdnns@mastodon.social avatar

    @kubikpixel dont be so hard on yourself. what matters is that you continue! if you keep at it you'll be able to look back in a year from now and appreciate that the delays getting started didnt actually matter.

    you got this!

    kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • rkaj,
    @rkaj@mastodon.nu avatar

    @kubikpixel
    Wait what? less utf-8? I would think more utf-8 would make everything easier!

    Or do you mean that you had to do something to make the command less handle utf-8 correctly?

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • bobulous,
    @bobulous@fosstodon.org avatar

    @kubikpixel I'm using #Helix for #Rust programming and I love it. If you're going to give Helix a try then definitely follow the built-in tutorial first by typing (on the command line):

    hx --tutor

    And make sure to install the rust-analyzer tool so that Helix can highlight errors and warnings each time you save. Can be tricky to get the pieces to work together at first, but on re-reading the online instructions it becomes clear eventually.

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • calisti,
    @calisti@chaos.social avatar

    @kubikpixel Closures?

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • calisti,
    @calisti@chaos.social avatar

    @kubikpixel Hm. What else might someone think of being "just a function that is only used at one logic point and is a nameless function"?

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • calisti,
    @calisti@chaos.social avatar

    @kubikpixel Sounds like closures used for currying?

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • calisti,
    @calisti@chaos.social avatar

    @kubikpixel Feel free to ask if you ever have questions!

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • calisti,
    @calisti@chaos.social avatar

    @kubikpixel Have you been doing rustlings? It's a great starting point beyond "just reading".

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • calisti,
    @calisti@chaos.social avatar

    @kubikpixel I am referring to this amazing learning tool: https://rustlings.cool/

    This might help you a lot, as it is much more hands-on than the book.

    kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • etam,
    @etam@im-in.space avatar

    @kubikpixel

    Most popular Rust libraries

    If Rust had a huge standard library, it would be like this.

    https://lib.rs/std

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • Sofie,

    @kubikpixel

    Ok, gratuliere. Ich schlag mich mit viel rudimentäeren Zeugs rum. Gemütliche Tage trotz allem. Ich nutze sie zum Kraft tanken. Weiter nix. 🙂

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel, (edited )
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • myname,
    @myname@chaos.social avatar

    @kubikpixel Not sure why people make things so difficult. Traits are pretty similar to interfaces, just better in certain regards.
    Also, I assume you don't have a background in Haskell, otherwise, that would be relatively easy.

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • myname,
    @myname@chaos.social avatar

    @kubikpixel I get that, and it's a great language. I am just saying people seem to have a tendency to not make comparissons that aren't 100% accurate. And saying "a Trait is like an interface" is not 100% accurate, but it is a good basic mental model, especially if you take into account things like the default methods of Java interfaces.

    laund,
    @laund@hachyderm.io avatar

    @kubikpixel traits are pretty essential. just printing out any non-string type will already use traits like Display or Debug to convert it to a string.

    TimoBetcke,

    @kubikpixel It is good to learn traits well. The whole language is built around traits and any slightly more complex code base will make heavy use of them. I made the same mistake initially, thinking I can do traits later. But then I hit a brick wall when trying to write my first project.

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • schweinchen_gmbh,

    @kubikpixel Really like the thread! And all the helpful comments too. Also fighting my way through the rust book myself. But you are way ahead, as it seems. Keep on, really want to here more. 🥳👍

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • mo8it,
    @mo8it@fosstodon.org avatar

    @kubikpixel I would highly recommend Axum because it has more momentum and builds on an existing ecosystem (hyper, tower, tokio). I have blog posts about getting started with it with SQLx:

    Axum: https://mo8it.com/blog/getting-started-with-rust-backends/

    SQLx: https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust/

    SQLx in Axum: https://mo8it.com/blog/sqlx-integration-in-axum/

    I would love to help if you have any questions :ablobcatheart:

    silmeth,
    @silmeth@mstdn.social avatar

    @mo8it @kubikpixel I’ll just add that another axum’s strength is that it uses the type system for its magic and not macros.

    While axum (similar to game engine) sometimes feels like magic – it’s much easier to understand how it works and extend than (plain- and proc-) macros based frameworks.

    Also, it’s basically just a library layer on top of request handling, so you can get pretty low-level with it, close to using hyper directly, if you wish/when you need.

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • mo8it,
    @mo8it@fosstodon.org avatar

    @kubikpixel They have almost the same performance, as far as I know.

    kubikpixel,
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • kubikpixel,
    @kubikpixel@chaos.social avatar

    Day 36 of

    Oh well, now I've moved on from "Hello, world!" in with to a simple form page. In that sense I've learned a lot, although very slowly, because I'm not mentally fit today. I still learn a lot every time I do the . Well, then I'll configure the editor first so that I like it and it's easy for me to use 🧬🦀

    silwol,
    @silwol@chaos.social avatar

    @kubikpixel Using #Helix certainly boosted my productivity when developing in #RustLang. Used #NeoVim before but was unable to configure it such that it is as effective for me as Helix is out of the box.

    kubikpixel,
    @kubikpixel@chaos.social avatar

    Day 37 of

    Phew... I am challenged after a ~1⅔ month break with 'ing . Due to holidays and other circumstances, I had a (too long) break from learning . I tried a simple with today but the first two hours were spent searching for instructions that would help me in a rudimentary way. Then I discovered the one from @mo8it and didn't finish but tomorrow I should be able to continue nitting my head 😅🦀

    nightowl,
    @nightowl@social.tchncs.de avatar

    @kubikpixel @mo8it
    Klingt sehr ambitioniert. 🙂 Welche Vor- und Nachteile hat es eine Webseite in Rust zu schreiben? 🤔

    kubikpixel,
    @kubikpixel@chaos.social avatar

    Day 38 of

    Since I am learning again and for other reasons, it takes longer for me to understand . Well, today I solved the above mentioned problem. I not to be annoyed by error messages when compiling because the written code does not work. Just read it carefully and take it into account and the are solved and for me these are mostly sapalotte typos – tomorrow it goes on positively ➕🦀

    TheIdOfAlan,
    @TheIdOfAlan@hachyderm.io avatar

    @kubikpixel rust error messages looked like a foreign language when I first started working with the language. As I've gained practice learning to ready them, I can't imagine working without them.

    I've heard rust folks say that if an error doesn't contain enough information to let you know how to it, they consider that a bug. That's just an amazing philosophy.

    (Of course, it takes practice to learn how to read them to get the info so it's not an instant thing, but it's awesome)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rust
  • ethstaker
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • ngwrru68w68
  • GTA5RPClips
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • cisconetworking
  • mdbf
  • kavyap
  • Durango
  • JUstTest
  • khanakhh
  • cubers
  • anitta
  • osvaldo12
  • everett
  • normalnudes
  • tester
  • tacticalgear
  • provamag3
  • modclub
  • Leos
  • megavids
  • lostlight
  • All magazines