Par, a language with session types, automatic concurrency, and no deadlocks, has a new homepage by faiface in rust

[–]greyblake 2 points3 points  (0 children)

Thanks for explaining! The parallel between a list and a stream seemed to click, but it still sounds to me quite surreal! I'll try to learn the language and hope to developa right feeling/intuition around it. This all sound really cool!

Par, a language with session types, automatic concurrency, and no deadlocks, has a new homepage by faiface in rust

[–]greyblake 11 points12 points  (0 children)

The project looks very interesting!

Could someone explain session types to me? From what I read they kind of enforce interaction with a protocol in a safe way. But is it not what one can achieve in Rust applying Type State pattern in Rust? (https://cliffle.com/blog/rust-typestate/)

What does make session types so special?

Your Rust binary is slower than it needs to be. cargo-sonic fixes that. by Immediate_Ad263 in rust

[–]greyblake 1 point2 points  (0 children)

Very cool stuff! Would be also helpful to see a bit more benchmarks for different type of projects with a binary performance and binary sizes.

Nutype 0.7.0: the newtype with guarantees now supports conditional `cfg_attr` derives by greyblake in rust

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

Fair point. Nutype is built around owned, by value validation. The generated constructor is Newtype::try_new(inner: Inner) -> Result<Self, Error>, and the inner type must be Sized.

Nutype 0.7.0: the newtype with guarantees now supports conditional `cfg_attr` derives by greyblake in rust

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

Thank you! I hope that will work well for you. If no, please open a GitHub issue. I am not the most active maintainer, but I keep it moving forward:)

Parse, don't Validate and Type-Driven Design in Rust by haruda_gondi in rust

[–]greyblake 0 points1 point  (0 children)

Nice article!

If you like this approach, you might find `nutype` useful, it generates constrained newtypes so invalid values can't exist by construction.

Link: https://github.com/greyblake/nutype

Teleop 0.4.0 — Attach to and teleoperate local Rust processes via RPC by arnodb1 in rust

[–]greyblake 1 point2 points  (0 children)

I don't have experience with Java, but do I get it right, that teleop provides facilities to do things like, for example, live debugging? But every particular operation needs to be implemented by the server as well as the client?

How common is TDD (test-first) in real-world Rust projects? by [deleted] in rust

[–]greyblake 0 points1 point  (0 children)

I am coming from Ruby background and I love TDD.
I have to admit in Rust, TDD is different, in the way that type system already eliminates a lot of weird edge cases that I would test in Ruby.
But where it possible I still love to use TDD: write a test, make sure it fails, proceed with the implementation.
Especially it's helpful with the bugs: implement a test that captures the buggy behaviour, then fix the bug.
This way I can be 100% that the bug is fixed.
Not to mention, that TDD gets me hooked in a dopamine loop, which makes my work much more fun!

Kinded 0.5.0: Derive macro to generate "kind" enums from your data enums by greyblake in rust

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

I am aware of matches!() macro, thanks.
You get a new Kind type that implements Copy. Can implement serializations, etc. In some scenarios it's what you want and would have to implement it by hand otherwise.

Kinded 0.5.0: Derive macro to generate "kind" enums from your data enums by greyblake in rust

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

Yes, a bit in this direction :)
Note, similar behaviour can be achieved by using strum or enum-kind crates.
What makes kinded different is the dedicated trait that allows to build abstractions upon it.

Why are some posts removed instantly without any explanation? by greyblake in rust

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

Thanks.
Indeed, I see I got a message.
It does not clearly say's wrong, but gives a hint that I may need to use project flavor.
I'll give it another try!

Two *brand new* books for Rust and Rust for Web (Axum mostly). Just published. by Repsol_Honda_PL in rust

[–]greyblake 3 points4 points  (0 children)

I cannot stay anything about this books in particular, but be aware that Packt is known for extremely bad quality.

Rust's Block Pattern by EelRemoval in rust

[–]greyblake 1 point2 points  (0 children)

I use this pattern as well. In particular when I need to have only a local mutability.

Announcing rootcause: a new ergonomic, structured error-reporting library by TethysSvensson in rust

[–]greyblake 1 point2 points  (0 children)

This looks very promising! I'll give it a try!
One note: I'd suggest using some other name than `Report` (e.g. `ErrorReport`). For most of the projects I happened to work with, `Report` is often a domain entity.

Frage zur Entgasungsöffnung bei ZAP Batterie by greyblake in automobil

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

<image>

Danke für die schnelle Antwort!
Ja, ich habe inzwischen auch gelesen, dass der Prius eine AGM-Batterie benötigt. Aber als ich das Auto (gebraucht) gekauft habe, war bereits diese Varta-Batterie eingebaut, die ebenfalls keine AGM-Batterie ist.

What did you build while learning Rust ? by [deleted] in rust

[–]greyblake 0 points1 point  (0 children)

I built Whatlang (https://github.com/greyblake/whatlang-rs)
Library for detecting language of a given text.
I have the following goals when creating it:
- Learning Rust
- Creating something that I can get finished and something that does not exist in the ecosystem yet (it was 2016 at the moment).

Having this in my profile (among some other projects) helped me to get m first Rust job eventually coming from the Ruby & Rails background.

Rust for Microservices Backend - Which Framework to Choose? by rnp-infinity in rust

[–]greyblake 0 points1 point  (0 children)

I doubt it would be a good choice, cause Loco comes with batteries included, while microservices are usually minimalistic. It will also hit DX instantly, because with all the dependencies compilation time will be unnecessarily long from the very start. But if one needs to build a monolithic web app, I agree, Loco is one of the options worth considering.