ときどきの雑記帖 RE* (新南口)
Make Room! Make Room!
pktmon
というのがWindows 10(の途中から)にあることを知った
- パケット モニター (Pktmon) | Microsoft Learn
- Windows 10 18H2で追加されたLANアナライザ「pktmon」とは? | TECH+(テックプラス)
- Windows 10 quietly got a built-in network sniffer, how to use (ざっくり翻訳) #Windows10 - Qiita
コンビニのビニール傘
ふと気になってとあるコンビニで値段を見てみたら 記憶にあるものと比べてだいぶ値上がりしていて、 納得するやらびっくりするやら
炊き餃子
というものがあるのを知った
黙示録
[B! 物欲] 【PC Watchのキーボード黙示録】 数十のキーボードを渡り歩き、辿り着いたのは30年物のレトロモデル【編集者上田の場合】
どういう意味で「黙示録」を使っているんだろう?
じつは間違える人が多い「黙示録」の読み方と言葉の正しい意味|@DIME アットダイム
WG 14
N3781が面白かった (どう面白かったかまで書く余裕がなっしんぐ)
ちょっとだけ。 FUNCTIONS WITH DATA - CLOSURES IN C AN OVERVIEW に HTMLバージョンのリンク があるのでそれを使って
最後のページ Committee Questions ぶ
“We encourage further work for C2y/C3a into a Technical Specification.” (NOT into the IS.)
とあるのだけど、C2yの次はC3a?
n3809
プリプロセッサーに関するものが結構あるけどこれもそのひとつ Unselected _Generic branches should be ignored
struct MyString {
char *chars;
size_t len;
};
#define string_length(s) \
_Generic(s, \
char*: strlen(s), \
struct MyString: s.len \
}
The proposal N3785 [1] aims to solve the same problem as this one. N3785: Expression Evaluation and Access in _Generic https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3785.htm will spit out this error from latest trunk GCC (December 16th, 2025):
現状(?)のプリプロセッサーでは問題があるのをどうにかしよう。 という話?
N3785: Expression Evaluation and Access in _Generic
int use_int_ptr(int* pi); int use_dbl_ptr(double* pd); #define USE_THING(THING) _Generic(&(typeof(THING)){ THING }, \ int*: use_int_ptr(&v), \ double*: use_dbl_ptr(&v), \ default: 0 \ ) int main () { int c = 0; int v = USE_THING(c); return v; }will spit out this error from latest trunk GCC (December 16th, 2025):
source>: In function 'main': <source>:6:30: error: passing argument 1 of 'use_dbl_ptr' from incompatible pointer type [-Wincompatible-pointer-types] 6 | double*: use_dbl_ptr(&v), \ | ^~ | | | int * <source>:12:17: note: in expansion of macro 'USE_THING' 12 | int v = USE_THING(c); | ^~~~~~~~~ <source>:2:25: note: expected 'double *' but argument is of type 'int *' 2 | int use_dbl_ptr(double* pd); | ~~~~~~~~^~ <source>:6:33: error: expected ')' before ':' token 6 | double*: use_dbl_ptr(&v): \ | ^ <source>:12:17: note: in expansion of macro 'USE_THING' 12 | int v = USE_THING(c); | ^~~~~~~~~ <source>:4:34: note: to match this '(' 4 | #define USE_THING(THING) _Generic(&(typeof(THING)){ THING }, \ | ^ <source>:12:17: note: in expansion of macro 'USE_THING' 12 | int v = USE_THING(c); | ^~~~~~~~~
なぜそうなる(エラーになる)のも想像つくし、 それを解消したいというのもわからんでもない
新刊近刊
ソフトウェアアーキテクチャの基礎
『ソフトウェアアーキテクチャの基礎』第1版と第2版の厚さの比較画像です pic.twitter.com/0UcafsCV0B
— Koji Shimada / 島田浩二 (@snoozer05) March 4, 2026
値段を見たときに結構値上がりしてるなと思ったのだけど、 ページ数も結構増えていた
神保町
これは神保町の可愛いお店 pic.twitter.com/Y1Gd79SOzY
— 磊落エナ (@rairaku_ena) March 3, 2026
神保町もご無沙汰だなあ😓
50
【今日は何の日】
— RSデザインスパーク(日本語) (@DesignSpark_JP) March 4, 2026
1976年の今日3月4日、革新的なスーパーコンピュータ「Cray-1」リリースされました。
最初の納品先はロスアラモス国立研究所、納品価格は1台9,000,000ドル(当時の日本円換算で26億円)でした。 pic.twitter.com/uDFcyDlI24
アセンブラおじさん
元になった投稿はさておき、すげー人たちが観測できて面白かった😄
こういう世界に2桁くらいしかいない怪物氏もいるので、気をつけましょう。 https://t.co/0tSdKWR3O9
— ほりい なおき (@hor11) March 5, 2026
なんかたくさんのいいねありがとうございます。
— スダ/渡波郁「CPUの創りかた」「お嬢様 投資をはじめる!」発売中 (@sudamin) March 6, 2026
これなんでアセンブラだったのかというと、アプリじゃなくてOSの初期化みたいな部位だったから。… https://t.co/D34ywoTR36
↓まぁアセンブリ言語なんて、当時それしか無かったから使った必要悪にすぎん。それと、マクロを使えばそれなりに可読性のあるコードは書けるよ、8086の話だけど。何を作るかが重要で、言語なんて必要なら覚えればいいだけ。
— c.mos (@c_mos) March 4, 2026
ところで
TLに急にアセンブラの話題が増えて個人的には楽しいんだけど😅、一部ポストで極端にアセンブラを敵視してる人はどうしたんだろ?
— yunk (@yunkya2) March 4, 2026
高級言語で問題ない箇所でアセンブラをゴリ押しされて迷惑したなんて経験、そんなにあるのだろうか。
確率的にはどれほど低くても 「遭遇してしまった人」にしてみれば 1/1だろうしねえ…
もうひとつ
昔の(オンメモリでアセンブルすることを想定していない)アセンブラ/リンカは本当に遅かったそうだし、オンメモリでも「ラベルテーブルを線形探索する」アセンブラ/リンカはかなり遅かったときいている。… https://t.co/rDRevRe3Xs
— 後藤 浩昭 / GORRY (@gorry5) March 4, 2026
とあるアセンブラーのバージョンアップ(名前も変わってたかも)で ラベルの検索にハッシュテーブルを使うようになった。 というのがハッシュテーブルの使用例を見た初めてなような気がする。
コンパイル測度
そういえば Turbo Pascal もコンパイルは速かった https://t.co/HrhTrQXJvi
— 魔法少女くにゅくにゅ a.k.a. 椚座 淳介 (@kunukunu) March 4, 2026
C++とDelphi(Turbo Pascal)との比較でいうと、 C++はヘッダーファイルでテキストとして取り込んだ上で ごにょごにょしなければならないのに対し、 Turbo Pascalのunit はそんなことはなかったのが大きそう。
C++でも別の投稿で言及されているように プリコンパイルドヘッダーのようなものが 導入されたりもしたけど。
プリプロセッサー
たぶんカーニハンやリッチーは、単にコンパイラ処理系の実装が簡単になるという理由でdefineやincludeの仕様をクソ単純な文字列置換とファイル挿入にしたのでしょうけど、automakeで吐いたMakefileの$(CC)行に画面10周するくらい-Iや-Dがぶら下がるのが常態化してしまいました。
— ウチューじん・ささき (@uchujin17) March 4, 2026
この方以前にも同様の勘違いをされていたと思うんだけど、 カーニハン大先生はその辺りには関わっていないんじゃないかなあ (要検証)
そもそもなんで/いつCにプリプロセッサーがつくようになったのだっけ? BにもBCPLにもないし、最初期のCにもなかったような…
によると構造体の導入と同時期っぽい。
んで Chistory にもなにか書いてないかと調べてみたら しっかり書かれていた(「なぜ」の部分は物足りないけど)
Many other changes occurred around 1972-3, but the most important was the introduction of the preprocessor, partly at the urging of Alan Snyder [Snyder 74], but also in recognition of the utility of the the file-inclusion mechanisms available in BCPL and PL/I. Its original version was exceedingly simple, and provided only included files and simple string replacements: #include and #define of parameterless macros. Soon thereafter, it was extended, mostly by Mike Lesk and then by John Reiser, to incorporate macros with arguments and conditional compilation. The preprocessor was originally considered an optional adjunct to the language itself. Indeed, for some years, it was not even invoked unless the source program contained a special signal at its beginning. This attitude persisted, and explains both the incomplete integration of the syntax of the preprocessor with the rest of the language and the imprecision of its description in early reference manuals.
あ、BCPLにはあったのか(↓のGET。機能的にはCのプリプロセッサーとは差があるけど)
GET "LIBHDR"
LET START() = VALOF $(
FOR I = 1 TO 5 DO
WRITEF("%N! = %I4*N", I, FACT(I))
RESULTIS 0
$)
AND FACT(N) = N = 0 -> 1, N * FACT(N - 1)
https://www.nokia.com/bell-labs/about/dennis-m-ritchie/bcpl.pdf
get <specifier>
may be used anywhere in a BCPL program; it directs the compiler to replace the directive with the file or input stream of text referred to by the specifier. The exact syntactic form of the specifier is implementation dependent but it will usually be either a string constant or an intege
Mike Lesk とJohn Reiserのうち、 Mike Leskはうぃきぺにエントリーがあった
From 1970 to 1984, Lesk worked at Bell Labs in the group that built Unix. Lesk wrote Unix tools for word processing (tbl, refer, and the standard ms macro package, all for troff), for compiling (Lex), and for networking (uucp). He also wrote the Portable I/O Library (the predecessor to stdio.h in C) and contributed significantly to the development of the C language preprocessor.[4]
Cのうぃきぺのエントリーにも 二人の名前が。 まあこれはリッチーのページからのものだろうけど
C (programming language) - Wikipedia
it was extended, mostly by Mike Lesk and then by John Reiser, to incorporate macros with arguments and conditional compilation.[12]
Cプリプロセッサーのページも同様なんだけど、 脚注に元となったものの情報があった
The C preprocessor was part of a long macro-language tradition at Bell Labs, which was started by Douglas Eastwood and Douglas McIlroy in 1959.[6]
Bell SAP - SAP with conditional and recursive macros (Computer Language)
SAP extended to include conditional and recursive macros: the beginning of the great macro-language tradition at Bell Labs (everything from L6 and AMBIT to C)
とりあえずはこの辺りまでで
BPS
https://t.co/nUTQu8lFTT
— まるまる@公認ぼっち党員@KOTO (@maruhisao) March 3, 2026
ホームページまだあるんですね
本当だ>ホームページがまだある
作品用にドメインとってないのが効いてそう