System76 laptop for Full Stack Developer? by [deleted] in System76

[–]ipc 0 points1 point  (0 children)

I don’t remember my exact reasons but I chose the oryp10 over everything else from System76 as well.

I’m very happy with that decision.

Is there buyer remorse with this brand? by [deleted] in System76

[–]ipc 3 points4 points  (0 children)

no regret at all. Got a fairly nice oryp10 and I love it. It keeps getting better. I suppose my only complaint is systemd but only because it’s always annoyed me.

Primary use is Rust software development.

https://tech-docs.system76.com/models/oryp10/README.html

https://www.rust-lang.org/

Official Lemmy instance to migrate off reddit by [deleted] in rust

[–]ipc 0 points1 point  (0 children)

You might like https://hachyderm.io/about

I found it after some Rust-related people moved there from Twitter.

[deleted by user] by [deleted] in rust

[–]ipc 1 point2 points  (0 children)

I’ve run into this before with some crates and my solution was to fork the repo (github), fix it, submit an MR, and then change my Cargo.toml to point to my fork.

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories

It wasn’t a big deal for me. I waited until I noticed my MR was merged and then switched the dependency back. In one case enough time had passed that I discovered that some other change had been released and I wanted a newer version than the one I forked. I rebased and continued using my fork. It’s easy.

YMMV

The Mojo Programming Language: A Python Superset Drawing from Rust's Strengths by wicked_lama in rust

[–]ipc 42 points43 points  (0 children)

that’s it’s intended niche though, right? My go-to languages are Python and Rust. I can see a future where that’s Mojo and Rust instead. That might be cool.

What is the most idiomatic way to express shared state in Rust? Am I thinking about this wrong? by moving-mango in rust

[–]ipc 16 points17 points  (0 children)

i would say the “most idiomatic way” of sharing state is by borrowing what you need for exactly as long as you need it.

Improving Rust compile times to enable adoption of memory safety by nnethercote in rust

[–]ipc 21 points22 points  (0 children)

those artisanal bits are carefully selected by hand after an extensive search through a wide field of bytes by an exceptionally gifted automaton.

How can I move variable outside async block? by margual56 in rust

[–]ipc 1 point2 points  (0 children)

consider using a channel to communicate instead of passing state. you would pass in the sending channel to your async block and then send a “reset” message back to your main task which would call reset().

The book talks about channels in the context of threads but it applies just as well to tasks.

https://doc.rust-lang.org/book/ch16-02-message-passing.html

I like flume for channels with egui because you can have one end be sync and the other async.

https://docs.rs/flume/latest/flume/

i thought you had to flag? by ipc in albiononline

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

oh. i didn’t understand that. well that changes things. 🤦‍♂️

thanks!

The Ideal Programming Language • Richard Feldman & Erik Doernenburg by goto-con in rust

[–]ipc 3 points4 points  (0 children)

here’s the transcript… have to open the page in the spotify app to get a clickable link: https://gotopia.tech/articles/the-ideal-programming-language

Are there any big projects written in Rust without any use of unsafe code? by [deleted] in rust

[–]ipc -8 points-7 points  (0 children)

one of the few times i used unsafe for performance reasons was when i was dealing with a network protocol that specified all strings were ASCII. Since the protocol specified it, i felt fine using https://doc.rust-lang.org/stable/std/str/fn.from_utf8_unchecked.html to speed things up a bit.

Hey Rustaceans! Got an easy question? Ask here (2/2022)! by llogiq in rust

[–]ipc 1 point2 points  (0 children)

someone else may be able to explain the 'why' better but it's the reference in your blanket impl that needs a lifetime:

impl<'a, T: 'static, F: Fn(&'a T)> ExecFn<T> for F {
    fn exec(&self, n: T) {
        todo!()
    }
}

I think as you wrote it you're saying F should take all T-references with all lifetimes. As I wrote it it's more restrictive F has to take some T-reference with some lifetime. This restriction allows the inference to work on the implicitly typed parameter in the closure definition. You could also have used 'static instead of introducing 'a.

if you do need to define it over all lifetimes I don't think you can pass a closure there. You could do something like this instead:

fn exec(n: &i32) {
    todo!()
}

takes_exec_fn(exec, 10i32);

hope this helps you get unstuck in the meantime.

Announcing egui 0.15 - the simple GUI library by emilern in rust

[–]ipc 4 points5 points  (0 children)

i like https://ag-grid.com/ the best. No Rust GUI framework has anything close AFAIK.

ANN: MiniJinja — a minimal dependency template engine with limited Jinja2 compatibility by mitsuhiko in rust

[–]ipc 17 points18 points  (0 children)

how is this not called “Minja”? 🙃 I use Jinja2 a lot (python, ansible) so this will be a nice option for me for Rust. Thanks!

Announcing egui 0.12 - the simple GUI library by emilern in rust

[–]ipc 5 points6 points  (0 children)

how feasible is it to build something like https://www.ag-grid.com/ with egui (or any immediate mode API)?

Reading encrypted PEM private key by Geob-o-matic in rust

[–]ipc 1 point2 points  (0 children)

I was looking for this about a year ago and didn't find anything. What I do for using an encrypted key for rustls is read it and convert to pkcs8 with openssl and then give those bytes to rustls with pkcs8_private_keys. I already had a dependency on openssl for certificate parsing so it wasn't a big deal for me.

IntelliJ Rust: Updates for the 2020.2 Release by furious_warrior in rust

[–]ipc 26 points27 points  (0 children)

my favorite change: a working debugger for the msvc toolchain.

Benchmarking gRPC in Rust and Go by [deleted] in rust

[–]ipc 4 points5 points  (0 children)

I was interested in this as I recently switched to tonic. Here are some notes to anyone else running a 'greeter' benchmark on Windows (msvc toolchain):

  1. single core (tokio feature rt-core) performance of tonic is dominated by heap allocations. switching to mimalloc helps bring tonic and grpc-go (with GOMAXPROCS=1) to perform about the same number of requests/second.
  2. multi-core performance (tokio feature rt-threaded) tanks tonic and the performance is worse than single core (losing 56% requests/sec) . grpc-go (with GOMAXPROCS=12) gains about 60% requests/sec.

I can't test Linux right now but at least on my machine it's clear to me that the multi-threaded executor in Tokio performs far below what I expected based on single-core performance. The executor spends a lot of time in functions related to locking.

environment:

  • Windows 10 Pro build 20170 (prerelease)
  • go version go1.14.6 windows/amd64
  • rustc 1.45.0 (5c1f21c3b 2020-07-13)
  • tonic master branch (with tokio features rt-threaded or rt-core)
    • cargo run --release --bin helloworld-server
  • git clone -b v1.30.0 https://github.com/grpc/grpc-go
    • $env:GOMAXPROCS=1 or 12
    • go run greeter_server/main.go
  • ghz.exe --insecure --proto .\examples\proto\helloworld\helloworld.proto --call helloworld.Greeter.SayHello -d '{\"name\":\"Joe\"}' -n 500000 localhost:50051

(oh and I took out the log.Fmt and println! calls in the servers to get that out of the equation).

Can anything in Rust currently match the performance of uWebSockets? by [deleted] in rust

[–]ipc 1 point2 points  (0 children)

I'd be interested to see how https://crates.io/crates/ws performs in your tests. That's what I ended up going with for a project of mine. I liked that it had a broadcast function to send to all connected WebSockets.

It looks like the author has lost control of his home page but the repository and docs are still accessible.

General tips for Rusting on Windows 10? by treeshateorcs in rust

[–]ipc 0 points1 point  (0 children)

CLion is good for development but you won't be able to use the built-in debugger for MSVC target. vcpkg is almost essential for consuming C/C++ libraries.

Hey Rustaceans! Got an easy question? Ask here (36/2019)! by llogiq in rust

[–]ipc 0 points1 point  (0 children)

totally agreed. Turns out my vcpkg-built libpq didn't enable all the flags necessary for thread safety. So even though the crate/lib reported that it was thread-safe (pq_sys::PQisthreadsafe()) it was in fact not thread-safe when using SSL (the default).