ASCII-Nova 🇺🇦
86 subscribers
980 photos
39 videos
9 files
426 links
предложка: @ascii_nova_suggest_bot

Гиковство && занудство, инди-музыка, геймдев и непрошенные советы

Чат, где мы обсуждаем код и всё около него: @ascii_nova_chat
Download Telegram
Memory Safety in C++ vs Rust vs Zig | by B Shyam Sundar | Jul, 2024 | Medium
https://medium.com/@shyamsundarb/memory-safety-in-c-vs-rust-vs-zig-f78fa903f41e

Добротная статья. В целом, хорошая иллюстрация, зачем вообще #Rust

В мире C++ нужно писать новые компиляторы (или обёртки), чтобы работать с владением
1👀1
😁2😢2
Scientific Computing in Rust 2024
https://scientificcomputing.rs/

Прямо сейчас идёт классный онлайн-воркшоп по #Rust

Тем кто пропускает (например я), записи можно будет потом посмотреть на канале: https://www.youtube.com/@ScientificComputinginRust
В #Rust оператор ? работает не только для Result<T, E>, но оказывается и для Option<T>.

Т.е. применённый к Option<T>, сразу вернётся None, если значения нет.

Пока что не понимаю, насколько активно буду использовать, хотя для Result<T, E> использую 10 раз из 10.

#TIL
1😁1
lvkv/whenfs: A FUSE Filesystem for your Google calendar
https://github.com/lvkv/whenfs

вот это я понимаю, пет проекты у людей

PS. и конечно же на #Rust
🤣4🔥3
https://doc.rust-lang.org/nightly/unstable-book/language-features/postfix-match.html

Интересно, случайно наткнулся на классную штуку: возможность писать match в "текучем" стиле

для тех, кто как я, любит разные длинные ФП-шные колбасы из вызовов методов один за одним, может иметь смысл

#Rust #TIL
Forwarded from trace!("TheBestTvarynka") (Pavlo Myroniuk)
Both frontend and backend are written in Rust. Sometimes you need to know the host OS in the frontend code. #[cfg(target_os = "...")] will not work because all Rust frontend code is compiled with the wasm32-unknown-unknown target. So, you'll always get a non-Windows target OS.
After some googling, I wrote a small workaround.
// build.rs
fn main() {
println!("cargo::rustc-check-cfg=cfg(windows_is_host_os)");
if cfg!(windows) {
println!("cargo:rustc-cfg=windows_is_host_os");
}
}

The idea is to define a custom cfg attribute in the build.rs. All code in build.rs is executed after dependencies compilation but before app compilation. So, in the build.rs we have more information about the host OS than in the frontend code.
Now I can use the windows_is_host_os in the #[cfg(...)] attribute:
// somewhere in the frontend code
#[cfg(windows_is_host_os)]
{
// Windows
}
#[cfg(not(windows_is_host_os))]
{
// Not Windows
}


#rust
🔥4😁1
Я обычно для быстрых проверок пользуюсь официальной песочницей (онлайн компилятор): https://play.rust-lang.org

Но в нём нет возможности указать зависимости :(

Поэтому был рад, когда нашёл Rust Explorer, который позволяет их указывать, например: https://www.rustexplorer.com/b/q76rqj

#Rust #TIL
2
Rust Project goals for 2024 | Rust Blog
https://blog.rust-lang.org/2024/08/12/Project-goals.html


Здорово!

Выделил для себя всё связанное с async:
- Скоро будет 2024 Edition: небольшие (но долгожданные изменения) изменения синтаксиса
- Улучшения async (жду не меньше!): упрощение написания async кода

#Rust
3👍2🤡1
Forwarded from trace!("TheBestTvarynka") (Pavlo Myroniuk)
Around half a year ago, I started my new side project: Dataans. It already has plenty of good features and I think I'm ready to present it to you.

I'd say that it's not ready and missing a lot of functionality, but I remembered the following quote (Lessons learned in 35 years of making software):
When you deliver work you’re really proud of, you’ve almost certainly done too much and taken too long.

I've been thinking about it for a while and decided to finally publish a first release. Otherwise, it might never happen. I always have something in mind to implement/fix/improve. It is an infinite process 😌

So, let me introduce you: Dataans - a yet another note-taking app. The main idea is to take notes in markdown snippets and group them into spaces. It's like Telegram and Saved messages or personal channels (it is when you have a channel with only one subscriber you). I wanted such an app for years and finally wrote some MVP.

➡️ https://tbt.qkation.com/projects/dataans/ This post explains my motivations, wanted and missing features, and why I don't like existing note-taking apps. Alternatively, you can read the project README.md.

#rust #tool #dataans
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥1
Forwarded from Блог*
#prog #rust #article

"Why is the Rust compiler so slow?"

Чел погрузился в кроличью нору с твиками флагов LLVM, чтобы ускорить сборку в докере сервера для своего сайта.

Спойлер: из всех средств наиболее эффективным оказалось то, что подсказали автору уже после публикации. Именно, замена базового образа с Alpine на Debian (-69% времени сборки).
😁11🔥3