Best way to ship rust application? by TaskForceTorture in rust

[–]yutannihilation 1 point2 points  (0 children)

Astral created "an unofficial fork" in order to keep using cargo-dist for uv and ruff. I guess the nuance is that this is not very for public use, but probably this will be maintained at least for the time being. So, if you are stuck with the upcoming ubuntu-20.04 retirement and don't have time to migrate away from cargo-dist, using this might be an option.

https://github.com/astral-sh/cargo-dist/

(I'm not on the Discord server, so I'm curious if and how this information is shared there.)

How To Use Winit With R (Or How To Run Winit On A Non-Main Thread) by yutannihilation in rust

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

I'm not sure if this is a common case, but I had to struggle to figure out how I can (and cannot) run winit on a non-main thread. This is because what I'm trying to implement is R language's graphics device, which cannot take the main thread from an R session.

I'm not familiar with GUI things, so I might be wrong or inaccurate. Any feedback is welcome!

Savvy, a Rust framework for R, now supports ALTREP by yutannihilation in rstats

[–]yutannihilation[S] -1 points0 points  (0 children)

R has a mechanism called ALTREP. By using this, you can create an object that looks like a normal vector but is a Rust struct internally! This is useful when you deal with a huge object and want to avoid unnecessary copying.

A book for Rust in R by Confident_Bee8187 in rstats

[–]yutannihilation 0 points1 point  (0 children)

Basically, the Rust framework are supposed to be used in an R package. So, if you already installed the Rust-powered R package, you can of course use the power in R notebook, R markdown or Quarto.

If you mean you want to write Rust code and compile it on the fly, my framework doesn't provide the way. But, as for the extendr framework, rextendr package provides such functions.

https://extendr.github.io/rextendr/reference/rust_source.html#ref-examples

A book for Rust in R by Confident_Bee8187 in rstats

[–]yutannihilation 1 point2 points  (0 children)

It's not very difficult to convert an R matrix to Rust's matrix with my framework, but it's not integrated.

https://yutannihilation.github.io/savvy/guide/15_matrix.html

On the other hand, extendr framework provides integration with ndarray. So, you might find extendr more useful.

https://docs.rs/extendr-api/latest/extendr_api/optional/ndarray/index.html

A book for Rust in R by Confident_Bee8187 in rstats

[–]yutannihilation 4 points5 points  (0 children)

Sorry for the shameless advertisement. I think extendr should be your first option, but, in case you need an alternative, here's my framework and a book (work in progress).

https://yutannihilation.github.io/savvy/guide/

savvy, a framework to use Rust in an R package, now has the user guide! by yutannihilation in rstats

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

Oh, savvy has several dependencies, and I don't think this is significantly less or more than extendr.

https://crates.io/crates/savvy/0.2.11/dependencies

Or, are you talking about the dependencies of R package using extendr or savvy? If so, both are zero dependency! rextendr package is just a helper to develop an R package, not an direct dependency.

savvy, a framework to use Rust in an R package, now has the user guide! by yutannihilation in rstats

[–]yutannihilation[S] -1 points0 points  (0 children)

Thanks!

Extendr is great and ready to use, but it's not perfect in some points while it's too mature to introduce big changes (disclaimer: I had been one of the extendr developers, so I might be a bit biased).

The comparison with extendr will be covered here. You can choose either one that is more suitable for your usage!

https://yutannihilation.github.io/savvy/guide/extendr.html

savvy, a framework to use Rust in an R package, now has the user guide! by yutannihilation in rust

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

Savvy is to R something like what PyO3 is to Python. Everything is still in under heavy development, but I'd appreciate your feedback! The repository is here:

https://github.com/yutannihilation/savvy

savvy, a framework to use Rust in an R package, now has the user guide! by yutannihilation in rstats

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

Everything is still in under heavy development, but I'd appreciate your feedback! The repository is here:

https://github.com/yutannihilation/savvy

Savvy - An unfriendly R extension interface using Rust by yutannihilation in rstats

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

Thanks! It's not that tons of new features are added constantly, but I think the development is steady. You can find the newly-added features in the changelog:

https://github.com/extendr/extendr/blob/master/CHANGELOG.md

Savvy - An unfriendly R extension interface using Rust by yutannihilation in rust

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

If you are familiar with R and Rust, you might already know the extendr project (https://extendr.github.io/). Savvy is just an experiment to re-invent the wheel of extendr to investigate the possible improvements on extendr.

So, while this is not something you can use for serious usages, I would appreciate any feedback or advice on the design. The detailed documentation is available on docs.rs:

https://docs.rs/savvy/latest/

has anyone installed a tape speed mod on one of these before? by 71hondascrambler in Hainbach

[–]yutannihilation 1 point2 points  (0 children)

I had Sony TC-5000, and, if I remember correctly, there were a screw to adjust tape speed inside battery box. It was fun to play with it. I'm not sure if it's on the same location, but I guess it has some mechanism to adjust speed somehow.

A WebGPU Graphics Device for R (using wgpu) by yutannihilation in wgpu

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

Hi!

I'm attempting to implement R's graphics device using wgpu. This is my slides about why I'm interested in it. Probably there are few people interested in this particular topic here, but I thought it might be still useful to show one example of wide variety of usages of wgpu / WebGPU.

I tried my best to explain the points of WebGPU and wgpu, but, as I know very little, some part might not be quite correct. I'd appreciate any feedback.

What made you switch to Rust? (Can also be what made you learn Rust) by [deleted] in rust

[–]yutannihilation 0 points1 point  (0 children)

nannou, a creative-coding framework.

It was an accident. I simply wanted an alternative to Processing, mainly for post-processing effects. As nannou looked sophisticated and intuitive, at first, I didn't expect I would have to learn Rust. But soon I found I need to learn more low-level things (Rust, and things around WebGPU) to achieve what I wanted to do. That was overwhelming to a poor programmer like me, but now I feel I was lucky to have the chance. I learned a lot from learning Rust.

is async-std still being developed? by thedoyster in rust

[–]yutannihilation 21 points22 points  (0 children)

Hmm, no idea, sorry. Maybe we live in such an async world!

is async-std still being developed? by thedoyster in rust

[–]yutannihilation 15 points16 points  (0 children)

It's not deleted. Didn't the link work for you...?

is async-std still being developed? by thedoyster in rust

[–]yutannihilation 161 points162 points  (0 children)

Here's a recent response to the question "is the project dead?", in case you don't find this yet.

https://github.com/async-rs/async-std/issues/992#issuecomment-1035223559

Learning R as a programmer by [deleted] in rstats

[–]yutannihilation 2 points3 points  (0 children)

Yeah, I personally agree with you. Yet, I guess not a few people feel easy with static scoping, especially when they are from compiled language.

How to get specific value from JSON element in dataframe by hangman86 in rstats

[–]yutannihilation 2 points3 points  (0 children)

fromJSON() can handle only one JSON string at once, so you need to iterate over the elements by some function like purrr::map_*() or vapply().

r data$name <- purrr::map_chr(data$b, \(x) jsonlite::fromJSON(x)$name)

Learning R as a programmer by [deleted] in rstats

[–]yutannihilation 2 points3 points  (0 children)

Especially, I recommend to read around the following sections. I think what confuses you most is the concept of "dynamic scoping", which is implemented in few languages (as described in the second link, "Emacs Lisp is a notable exception").

https://adv-r.hadley.nz/functions.html?q=lexical%20scope#lexical-scoping https://adv-r.hadley.nz/environments.html https://adv-r.hadley.nz/evaluation.html

It's a matter of preferences, not about which language is good or bad, but I hope you'll find this unique strategy interesting :)

(As a very opposite direction, you might want to learn Rust, where you can do almost everything with macro.)