You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
とりあえず、よく言われてるやつから埋めていこうと思う。 構造体にライフタイムを持たせない 構造体にライフタイムを持たせるのは「基本的に」避けよ、というのが重要なのは間違いないのだけど、これをもう少し実践的な内容にしたい。ちょっと考えてみたけど、こういうのはどうだろうか。 ある関数呼び出しの中でしか絶対に使わない。returnするまでにその構造体のデータは全て破棄される。static変数に退避させることもできない。アロケーションもその関数が面倒を見る。そういう一蓮托生できる関数呼び出しに心当たりはあるか? ある→ 構造体にライフタイムを持たせてもよい。 ない→ ライフタイム禁止。 そう考えてみると、DIとかReduxとかとも通じるところがあるかもしれない。「つべこべ言ってないで全部の責務を一番外側に持っていく」という決断ができるときは構造体ライフタイムが選択肢に入る。
This project is dedicated to the one profound insight about Rust macro development: the difference between someone who is competent with macros vs an expert at macros mostly has nothing to do with how good they are "at macros". 90% of what enables people to push the limits of possibility in pursuit of a powerful and user-friendly macro library API is in their mastery of everything else about Rust
Learn Rust With Entirely Too Many Linked Lists Got any issues or want to check out all the final code at once? Everything's on Github! NOTE: The current edition of this book is written against Rust 2018, which was first released with rustc 1.31 (Dec 8, 2018). If your rust toolchain is new enough, the Cargo.toml file that cargo new creates should contain the line edition = "2018" (or if you're read
Rust でプログラムを書くうえで、用途や制約に応じた適切な型の定義は大変重要である。 たとえば Rust ではバイト列は [u8]、 UTF-8 文字列は str、OS ネイティブのエンコーディングの文字列は std::ffi::OsStr、パス文字列は std::path::Path といったように、横着すればひとつの型で済むような様々なデータに対してそれぞれの特徴に応じた型を標準で用意している。 ときに標準ライブラリで用意された型ばかりでなく、自分で専用の型を用意したいこともある。 たとえば「相対パスのみを保持できる型」のようなものを実装したくなるかもしれない。 もちろん Rust でこれは可能なのだが、 str のような (値として利用するときは &str のように参照を使う) 可変長のスライスのような型は、定義したり十分な利便性を確保するのに多少のコツが必要となる。 本書では、独
マイクロカーネルは浪漫に溢れる非常に作りがいのあるソフトウェアです。この記事は,「マイクロカーネルベースのOSの一から作ってIaaSで動かす」ことを目標に作ったマイクロカーネルベースのOS Resea(りーせあ)の設計と実装について軽くまとめた物です。 ソースコードはGitHubにあります。 マイクロカーネルとは Linuxのようなモノリシックカーネルでは色んな機能がカーネル空間で動きますが,マイクロカーネルではユーザプロセスたちが互いに通信しながらOSを作り上げます。プロセス・スレッド・仮想メモリ管理,プロセス間通信,タイマーといった必要最低限の機能だけをカーネルが担います。デバイスドライバやファイルシステムといった残りの機能は,独立したユーザプロセスとして動きます。たとえデバイスドライバが暴走しても他のコンポーネントを壊すことはないのです。マイクロカーネルは信頼性が高く,疎結合で美しい
ripgrep is faster than {grep, ag, git grep, ucg, pt, sift} In this article I will introduce a new command line search tool, ripgrep, that combines the usability of The Silver Searcher (an ack clone) with the raw performance of GNU grep. ripgrep is fast, cross platform (with binaries available for Linux, Mac and Windows) and written in Rust. ripgrep is available on Github. We will attempt to do the
A language empowering everyone to build reliable and efficient software. Performance Rust is blazingly fast and memory-efficient: with no runtime or garbage collector, it can power performance-critical services, run on embedded devices, and easily integrate with other languages. Reliability Rust’s rich type system and ownership model guarantee memory-safety and thread-safety — enabling you to elim
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く