この記事はRust Advent Calendar 2023 シリーズ3の17日の記事です。 TL;DR 色々な作業ディレクトリに散らばってしまうrustのビルドキャッシュの大きさをリスティングしてインタラクティブに削除するTUIツールのcargo-cleanerを作りcrates.ioに公開しました。 その構成要素として作った、RwLockを魔改造したオレオレロックを作成することでメインスレッドへの通知を一本化したのでその説明も書いています。 動機 自分のRustの唯一の苦手なところがディスク問題だった 自分は仕事でも趣味でもRustを使っているのですが、大量のcargoプロジェクトを管理していると必ず出てくる問題がビルドディレクトリの肥大化問題でした。 私の中での3大ディスクを食い尽くし王は Rustのビルドキャッシュ dockerのビルドキャッシュ 機械学習系のデータセット です。
Enums (or tagged unions) whose variants vary in size are prone to significant memory fragmentation in Rust. That's because we need to allocate enough data to accommodate the largest variant. Figure 1: Consider the following enum: This presents real pain when collecting a large number of them into a Vec or HashMap. The padding can be dealt with using some form of struct of arrays (SoA) transformati
はじめに AtCoder 2023年8月の 新ジャッジコンテストから、Zig 0.10.1 が使えるようになりました。 ホーム ⚡ Zig Programming Language 普段 Rust で AtCoder ABC に参加しています。 Zig 言語は Rust 同様に高速なバイナリ出力を狙った、Rust とは違うアプローチのモダンな言語と言うことで、気になっていました。 Zig 言語は Bun の開発で使われていることでも話題です。今月 Bun 1.0 になりました。 Bun — A fast all-in-one JavaScript runtime というわけで、AtCoder 202308 新ジャッジテストコンテスト -Algorithm- の問題を Zig 言語で解いてみて、感想を書こうという記事です。超初心者ですので変なところも多いかもしれませんがご了承ください。 対象
Run Rust files and expressions as scripts without any setup or compilation step. Overview News Installation Distro Packages Arch Linux Scripts Executable Scripts Expressions Filters Environment Variables Troubleshooting Overview With rust-script Rust files and expressions can be executed just like a shell or Python script. Features include: Caching compiled artifacts for speed. Reading Cargo manif
In this blog post, I delve into the comparison of memory consumption between asynchronous and multi-threaded programming across popular languages like Rust, Go, Java, C#, Python, Node.js and Elixir. Some time ago I had to compare performance of a few computer programs designed to handle a large number of network connections. I saw huge differences in memory consumption of those programs, even exce
People complain about Rust syntax. I think that most of the time when people think they have an issue with Rust’s syntax, they actually object to Rust’s semantics. In this slightly whimsical post, I’ll try to disentangle the two. Let’s start with an example of an ugly Rust syntax: pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> { fn inner(path: &Path) -> io::Result<Vec<u8>> { let mut f
2022-09-09改訂: gcc バージョンが古すぎたのと、C が内部計測でなかった点を改め計測しなおしました。結果、Rust は C より速くはなくなりました。紛らわしいことで、ごめんなさい。また、gcc のバージョンアップに伴い、Python および Ruby についてはビルドと計測をしなおしたので、これらも少し速い値に変わっています。この点もどうぞあしからず。 2022-09-10追記:ご要望のあった Python numba.njit 使用時と Go の結果を追加しました。PHP は JIT 有効化が面倒だったので断念しました^^; 2022-09-10追記2:C の計測で clock() を使うのはフェアではないという指摘がありましたので、念のため clock_gettime() を使用したコードに差し替えました。結果に大きな差はありません。 2022-09-10追記3:PHP
N.B. Ruff now supports over 200 lint rules and is used in major open-source projects like FastAPI, Bokeh, Zulip, and Pydantic. It’s also about ~50% faster than the benchmarks advertised in this blog post. Try it today! Over the past few years, there’s been a mindset shift in JavaScript ecosystem, best summarized as: “our tools should be extremely fast”. As projects grew in complexity, and builds s
自己紹介冨田陽介氏:私は「コンセプトから理解したいRust(願望)」について紹介したいと思います。 (スライドを示して)自己紹介はザッと流しますが、1つだけ伝えたいことがあるとすると、私自身はこんな感じで、これまでのキャリアから少し離れている領域でRustに携わっているので、自分がチャレンジしたいと言うと、その領域を任せてもらえる会社であるかなと思います。 もしも「キャディという会社に興味があるけれど、Rustをやったことないしなぁ」という感じで迷っている方がいたら、ぜひカジュアル面談やほかのイベントに参加してもらえるとうれしいです。このイベントもその1つのきっかけになるとうれしいなと思っているので、そこだけはお伝えしたいです。 Rustを勉強する中で感銘を受けた本では、Rustの話に入っていきます。私自身はこの会社に入るまでRustに関わっていなかったので、キャディに内定してはじめてRu
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く