Since 2016, Rust has been voted the “most loved programming language” every year in the Stack Overflow Developer Survey by what appears to be a growing margin, and after checking it out for myself, it’s pretty clear why. Rust offers a plethora of features you’d expect from a modern language and addresses pain points that are present in many others. It competes in the same kind of space occupied by
Rust Advent Calendar 2024 19 日目 この記事は Rust Advent Calendar 2024 の 19 日目として書いています。 今日見たら偶然 19 日が空いていたので 9 日目同様にせっかくなら入れるかと思って入れています。 昨日は @sotanengel さんによる 「docs.rs 書くのめんどくさくない?」をできるだけ楽にした話 でした。 概要 Rust に慣れるがてら簡単な cli を書いてみようと思い、コマンドをいい感じに出来るライブラリを簡単にググって見つけたので、備忘録としてコマンドを struct にマッピングする周りを書き残そうと思いました。 いくつかコードが出てきますが、ベースの Cargo.toml はこちらです。 [package] name = "cli-with-clap" version = "0.1.0" edition
κeenです。 先日、先輩社員と話してるとシェルを作る話になりました。 だいたいのコンピュータサイエンスの学生なら学部生の頃に課題でシェルを作りますが数学科にいた私は作ったことありませんでした。 でも、その時「今ならシェルなんて作ろうと思えばすぐに作れますよ」なんて言っちゃったのでなんか作りました。 まあ、習作程度の雑なものです。 作ったのはこれ、KeenS/igaguri: my toy shell written in Rust。 名前は、Shellは木の実を覆う殻のようにカーネルを覆う殻とのことなのでRustのロゴに似てる毬栗を選びました。 パーサ パーサコンビネータライブラリのnomを使いました。 雰囲気こんな感じ。 named!(token<String>, map!(map_res!(is_a!("abcdefghijklmnopqlrstuvwxyzABCDEFGHIJKLM
はじめに 自作シェルを書いてみた記事はよく見かけるのですが、そのほとんどが fork -> exec という流れです。仕組みを学ぶという点で非常に有効なのでそれはそれで良いとして、 Rust では標準ライブラリの std::process::Command を使用してもっと簡単にコマンド実行ができるよ! という記事があまりないので書いてみました。 コマンドの実行 REPL パース処理はできるだけシンプルに書きます。 標準入力から1行読み取り、Command::spawn() で実行します。 それを繰り返すのが REPL (Read-Eval-Print Loop)です。 これだけでシェルと言い張っても良いと思っています🤔 use std::io::{self, Write}; use std::process::Command; fn main() { loop { // プロンプト p
(Editor's note - please read #9512 (comment) and #9512 (comment) before commenting if you are new to fish or not familiar with the context - @zanchey) (Progress report November 2023) (Sorry for the meme; also this is obligatory.) I think we should transition to Rust and aim to have it done by the next major release: Nobody really likes C++ or CMake, and there's no clear path for getting off old to
As asked by @PoignardAzur: some people over at r/rust are curious how the rewrite is going? In short: We're "mostly" done. Quantifying that isn't all that easy because there are separate measurements - do you use lines or bytes, do you use rust vs C++ or do you use the amount of C++ that was removed? Depending on how you count, we're at anywhere between 60% (c++ sloc removed) and 74% (rust sloc vs
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く