サクサク読めて、
アプリ限定の機能も多数!
アプリで開く
●はてなブックマークって?
●アプリ・拡張の紹介
●ユーザー登録
●ログイン
●ログアウト
トップへ戻る
総合
●人気
●新着
●
IT
●
最新ガジェット
●
自然科学
●
経済・金融
●
おもしろ
●
マンガ
●
ゲーム
●
はてなブログ︵総合︶
一般
●人気
●新着
●
社会ニュース
●
地域
●
国際
●
天気
●
グルメ
●
映画・音楽
●
スポーツ
●
はてな匿名ダイアリー
世の中
●人気
●新着
●
新型コロナウイルス
●
働き方
●
生き方
●
地域
●
医療・ヘルス
●
教育
●
はてな匿名ダイアリー
政治と経済
●人気
●新着
●
政治
●
経済・金融
●
企業
●
仕事・就職
●
マーケット
●
国際
●
はてなブログ︵政治と経済︶
暮らし
●人気
●新着
●
カルチャー・ライフスタイル
●
ファッション
●
運動・エクササイズ
●
結婚・子育て
●
住まい
●
グルメ
●
お金
●
はてなブログ︵暮らし︶
●
掃除・整理整頓
●
雑貨
●
買ってよかったもの
●
旅行
●
アウトドア
●
趣味
学び
●人気
●新着
●
人文科学
●
社会科学
●
自然科学
●
語学
●
ビジネス・経営学
●
デザイン
●
法律
●
本・書評
●
将棋・囲碁
●
はてなブログ︵学び︶
テクノロジー
●人気
●新着
●
IT
●
セキュリティ技術
●
はてなブログ︵テクノロジー︶
●
AI・機械学習
●
プログラミング
●
エンジニア
おもしろ
●人気
●新着
●
まとめ
●
ネタ
●
おもしろ
●
これはすごい
●
かわいい
●
雑学
●
癒やし
エンタメ
●人気
●新着
●
スポーツ
●
映画
●
音楽
●
アイドル
●
芸能
●
お笑い
●
サッカー
●
話題の動画
アニメとゲーム
●人気
●新着
●
マンガ
●
Webマンガ
●
ゲーム
●
任天堂
●
PlayStation
●
アニメ
●
バーチャルYouTuber
●
オタクカルチャー
●
おすすめ
Wikipedia
﹃matklad﹄
●
人気
●
新着
●
すべて
5users
matklad.github.io
Properly Testing Concurrent Data Structures Jul 5, 2024 There’s a fascinating Rust library, loom, which can be used to thoroughly test lock-free data structures. I always wanted to learn how it works. I still do! But recently I accidentally implemented a small toy which, I think, contains some of the loom’s ideas, and it seems worthwhile to write about that. The goal here isn’t to teach you what y
●
テクノロジー
●2024/07/06 12:51
●Rust
●test
7users
matklad.github.io
Regular, Recursive, Restricted Jun 4, 2024 A post/question about formal grammars, wherein I search for a good formalism for describing infix expressions. Problem statement: it’s hard to describe arithmetic expressions in a way that: declaratively captures the overall shape of expression, and has a clear precedence semantics Let’s start with the following grammar for arithmetic expressions: Expr =
●
テクノロジー
●2024/06/04 21:48
●Programming
3users
matklad.github.io
Zig defer Patterns Mar 21, 2024 A short note about some unexpected usages of Zig’s defer statement. This post assumes that you already know the basics about RAII, defer and errdefer. While discussing the differences between them is not the point, I will allow myself one high level comment. I don’t like defer as a replacement for RAII: after writing Zig for some time, I am relatively confident that
●
テクノロジー
●2024/03/22 11:49
3users
matklad.github.io
Push Ifs Up And Fors Down Nov 15, 2023 A short note on two related rules of thumb. Push Ifs Up If there’s an if condition inside a function, consider if it could be moved to the caller instead: // GOOD fn frobnicate(walrus: Walrus) { ... } // BAD fn frobnicate(walrus: Option<Walrus>) { let walrus = match walrus { Some(it) => it, None => return, }; ... } As in the example above, this often comes up
●
世の中
●2023/11/16 10:29
3users
matklad.github.io
LSP could have been better Oct 12, 2023 We talk about programming like it is about writing code, but the code ends up being less important than the architecture, and the architecture ends up being less important than social issues. The Success and Failure of Ninja The Why LSP post discusses the “social issues” solved by LSP. LSP (as a part of overarching Microsoft strategy) is brilliant, because i
●
テクノロジー
●2023/10/12 13:53
17users
matklad.github.io
TypeScript is Surprisingly OK for Compilers Aug 17, 2023 There are two main historical trends when choosing an implementation language for something compiler-shaped. For more language-centric tasks, like a formal specification, or a toy hobby language, OCaml makes most sense. See, for example, plzoo or WebAssembly reference interpreter. For something implementation-centric and production ready, C+
●
テクノロジー
●2023/08/18 16:05
●Compiler
●TypeScript
●Programming
●あとで読む
7users
matklad.github.io
Fantastic Learning Resources Aug 6, 2023 People sometimes ask me: “Alex, how do I learn X?”. This article is a compilation of advice I usually give. This is “things that worked for me” rather than “the most awesome things on earth”. I do consider every item on the list to be fantastic though, and I am forever grateful to people putting these resources together. Learning to Code I don’t think I hav
●
テクノロジー
●2023/08/08 10:57
●HotEntry
●Education
14users
matklad.github.io
Zig And Rust Mar 26, 2023 This post will be a bit all over the place. Several months ago, I wrote Hard Mode Rust, exploring an allocation-conscious style of programming. In the ensuing discussion, @jamii name-dropped TigerBeetle, a reliable, distributed, fast, and small database written in Zig in a similar style, and, well, I now find myself writing Zig full-time, after more than seven years of Ru
●
テクノロジー
●2023/03/28 00:52
●zig
●Rust
●article
●あとで読む
8users
matklad.github.io
<3 Deno Feb 12, 2023 Deno is a relatively new JavaScript runtime. I find quite interesting and aesthetically appealing, in-line with the recent trend to rein in the worse-is-better law of software evolution. This post explains why. The way I see it, the primary goal of Deno is to simplify development of software, relative to the status quo. Simplifying means removing the accidental complexity. To
●
テクノロジー
●2023/02/13 10:46
●Deno
3users
matklad.github.io
Next Rust Compiler Jan 25, 2023 In Rust in 2023, @nrc floated an idea of a Rust compiler rewrite. As my hobby is writing Rust compiler frontends (1, 2), I have some (but not very many) thoughts here! The post consists of two parts, covering organizational and technical aspects. Organization Writing a production-grade compiler is not a small endeavor. The questions of who writes the code, who pays
●
テクノロジー
●2023/02/01 22:01
●techfeed
20users
matklad.github.io
Rust’s Ugly Syntax Jan 26, 2023 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) ->
●
テクノロジー
●2023/01/27 14:05
●Rust
●techfeed
●programming
●あとで読む
8users
matklad.github.io
Hard Mode Rust Oct 6, 2022 This post is a case study of writing a Rust application using only minimal, artificially constrained API (eg, no dynamic memory allocation). It assumes a fair bit of familiarity with the language. The back story here is a particular criticism of Rust and C++ from hard-core C programmers. This criticism is aimed at RAII — the language-defining feature of C++, which was wh
●
テクノロジー
●2022/10/08 02:55
●rust
●あとで読む
8users
matklad.github.io
Caches In Rust Jun 11, 2022 In this post I’ll describe how to implement caches in Rust. It is inspired by two recent refactors I landed at nearcore (nearcore#6549, nearcore#6811). Based on that experience, it seems that implementing caches wrong is rather easy, and making a mistake there risks “spilling over”, and spoiling the overall architecture of the application a bit. Let’s start with an imag
●
テクノロジー
●2022/06/11 23:50
●Rust
●techfeed
29users
matklad.github.io
Why LSP? Apr 25, 2022 LSP (language server protocol) is fairly popular today. There’s a standard explanation of why that is the case. You probably have seen this picture before: I believe that this standard explanation of LSP popularity is wrong. In this post, I suggest an alternative picture. Standard Explanation The explanation goes like this: There are M editors and N languages. If you want to
●
テクノロジー
●2022/04/25 13:52
●LSP
●あとで読む
●language
●server
3users
matklad.github.io
Self Modifying Code Mar 26, 2022 This post has nothing to do with JIT-like techniques for patching machine code on the fly (though they are cool!). Instead, it describes a cute/horrible trick/hack you can use to generate source code if you are not a huge fan of macros. The final technique is going to be independent of any particular programming language, but the lead-up is going to be Rust-specifi
●
テクノロジー
●2022/03/27 21:42
21users
matklad.github.io
Fast Rust Builds Sep 4, 2021 It’s common knowledge that Rust code is slow to compile. But I have a strong gut feeling that most Rust code out there compiles much slower than it could. As an example, one fairly recent post says: With Rust, on the other hand, it takes between 15 and 45 minutes to run a CI pipeline, depending on your project and the power of your CI servers. This doesn’t make sense t
●
テクノロジー
●2021/09/06 10:18
●rust
●あとで読む
5users
matklad.github.io
Large Rust Workspaces Aug 22, 2021 In this article, I’ll share my experience with organizing large Rust projects. This is in no way authoritative — just some tips I’ve discovered through trial and error. Cargo, Rust’s build system, follows convention over configuration principle. It provides a set of good defaults for small projects, and it is especially well-tailored for public crates.io librarie
●
テクノロジー
●2021/08/25 10:32
5users
matklad.github.io
Inline In Rust Jul 9, 2021 There’s a lot of tribal knowledge surrounding #[inline] attribute in Rust. I often find myself teaching how it works, so I finally decided to write this down. Caveat Emptor: this is what I know, not necessarily what is true. Additionally, exact semantics of #[inline] is not set in stone and may change in future Rust versions. Why Inlining Matters? Inlining is an optimizi
●
テクノロジー
●2021/07/11 09:12
●Rust
●techfeed
4users
matklad.github.io
How to Test May 31, 2021 Alternative titles: Unit Tests are a Scam Test Features, Not Code Data Driven Integrated Tests This post describes my current approach to testing. When I started programming professionally, I knew how to write good code, but good tests remained a mystery for a long time. This is not due to the lack of advice — on the contrary, there’s abundance of information & terminology
●
テクノロジー
●2021/06/01 10:41
4users
matklad.github.io
Goroutines Are Not Significantly Smaller Than Threads Mar 12, 2021 The most commonly cited drawback of OS-level threads is that they use a lot of RAM. This is not true on Linux. Let’s compare memory footprint of 10_000 Linux threads with 10_000 goroutines. We spawn 10k workers, which sleep for about 10 seconds, waking up every 10 milliseconds. Each worker is staggered by a pseudorandom delay up to
●
テクノロジー
●2021/03/13 15:21
●golang
3users
matklad.github.io
For the Love of Macros Feb 14, 2021 I’ve been re-reading Ted Kaminski blog about software design. I highly recommend all the posts, especially the earlier ones (here’s the first). He manages to offer design advice which is both non-trivial and sound (a subjective judgment of course), a rare specimen! Anyway, one of the insights of the series is that, when designing an abstraction, we always face t
●
テクノロジー
●2021/02/21 00:22
62users
matklad.github.io
ARCHITECTURE.md Feb 6, 2021 If you maintain an open-source project in the range of 10k-200k lines of code, I strongly encourage you to add an ARCHITECTURE document next to README and CONTRIBUTING. Before going into the details of why and how, I want to emphasize that this is not another “docs are good, write more docs” advice. I am pretty sloppy about documentation, and, e.g., I often use just “si
●
テクノロジー
●2021/02/07 05:35
●documentation
●開発
●architecture
●あとで読む
●OSS
●GitHub
4users
matklad.github.io
Study of std::io::Error Oct 15, 2020 In this article we’ll dissect the implementation of std::io::Error type from the Rust’s standard library. The code in question is here: library/std/src/io/error.rs. You can read this post as either of: A study of a specific bit of standard library. An advanced error management guide. A case of a beautiful API design. The article requires basic familiarity with
●
テクノロジー
●2020/10/15 19:17
●Rust
8users
matklad.github.io
Fast Thread Locals In Rust Oct 3, 2020 Rust thread-locals are slower than they could be. This is because they violate zero-cost abstraction principle, specifically the “you don’t pay for what you don’t use” part. Rust’s thread-local implementation( 1, 2 ) comes with built-in support for laziness — thread locals are initialized on the first access. Sometimes this overhead is a big deal, as thread l
●
テクノロジー
●2020/10/09 22:13
●Rust
5users
matklad.github.io
Why Not Rust? Sep 20, 2020 I’ve recently read an article criticizing Rust, and, while it made a bunch of good points, I didn’t enjoy it — it was an easy to argue with piece. In general, I feel that I can’t recommend an article criticizing Rust. This is a shame — confronting drawbacks is important, and debunking low effort/miss informed attempts at critique sadly inoculates against actually good ar
●
テクノロジー
●2020/09/21 08:05
●Rust
●techfeed
●あとで読む
7users
matklad.github.io
Simple but Powerful Pratt Parsing Apr 13, 2020 Welcome to my article about Pratt parsing — the monad tutorial of syntactic analysis. The number of Pratt parsing articles is so large that there exists a survey post :) The goals of this particular article are: Raising an issue that the so-called left-recursion problem is overstated. Complaining about inadequacy of BNF for representing infix expressi
●
テクノロジー
●2020/09/13 00:18
●Programming
5users
matklad.github.io
Mutexes Are Faster Than Spinlocks Jan 4, 2020 (at least on commodity desktop Linux with stock settings) This is a followup to the previous post about spinlocks. The gist of the previous post was that spinlocks have some pretty bad worst-case behaviors, and, for that reason, one shouldn’t blindly use a spinlock if using a sleeping mutex or avoiding blocking altogether is cumbersome. In the comments
●
テクノロジー
●2020/01/05 07:44
3users
matklad.github.io
Modern Parser Generator Jun 6, 2018 Hi! During the last couple of years, I’ve spent a lot of time writing parsers and parser generators, and I want to write down my thoughts about this topic. Specifically, I want to describe some properties of a parser generator that I would enjoy using. Note that this is not an “introduction to parsing” blog post, some prior knowledge is assumed. Why do I care ab
●
テクノロジー
●2018/06/19 19:18
3users
matklad.github.io
Typed Key Pattern May 24, 2018 In this post, I’ll talk about a pattern for extracting values from a weakly typed map. This pattern applies to all statically typed languages, and even to dynamically typed ones, but the post is rather Rust-specific. I’ve put together a small crate which implements the pattern: https://github.com/matklad/typed_key If you want to skip all the blah-blah-blah, you can d
●
テクノロジー
●2018/05/28 20:56
●Rust
このページはまだ
ブックマークされていません
このページを最初にブックマークしてみませんか?
﹃matklad﹄の新着エントリーを見る
キーボードショートカット一覧
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く
●総合
●一般
●世の中
●政治と経済
●暮らし
●学び
●テクノロジー
●エンタメ
●アニメとゲーム
●おもしろ
●アプリ・拡張機能
●開発ブログ
●ヘルプ
●お問い合わせ
●ガイドライン
●利用規約
●プライバシーポリシー
●利用者情報の外部送信について
●ガイドライン
●利用規約
●プライバシーポリシー
●利用者情報の外部送信について
●公式アカウント
●ホットエントリー
●はてなブログ
●はてなブログPro
●人力検索はてな
●はてなブログ タグ
●はてなニュース
●ソレドコ
Copyright © 2005-2024 Hatena. All Rights Reserved.
設定を変更しましたx