ときどきの雑記帖 RE* (新南口)
Wait for Me
値上げ
入れ替えやら補充のタイミングなのか ここにきて身近なところの自販機に入っているドリンク類の値段が
復刊ドットコム
復刊ドットコムにハッカーズ大辞典のリクエストページがあるのを発見 (んが、Firefoxだと何も表示されない?)
『ハッカーズ大辞典(エリック・S・レイモンド)』 投票ページ | 復刊ドットコム
anonymous function
中文表記でも「匿名」らしい。
Java中的内部类与匿名内部类详解_Java_共饮一杯无_InfoQ写作社区
ねこー 见证历史!数学家张益唐北大讲座:本质上已证明“零点猜想”,111页论文已公开_AI_凌敏_InfoQ精选文章
_FORTIFY_SOURCE
以前ちょっと触れた __FORTIFY_SOURCEの話がHN _FORTIFY_SOURCE | Hacker News にあった(コメントがついてないけど)。
リンク先 _FORTIFY_SOURCE | MaskRay を見ると
glibc 2.3.4 introduced _FORTIFY_SOURCE in 2004 to catch security errors due to misuse of some C library functions. The initially supported functions was fprintf, gets, memcpy, memmove, mempcpy, memset, printf, snprintf, sprintf, stpcpy, strcat, strcpy, strncat, strncpy, vfprintf, vprintf, vsnprintf, vsprintf and focused on buffer overflow and dangerous printf %n uses. The implementation leverages inline functions and __builtin_object_size (see [PATCH] Object size checking to prevent (some) buffer overflows). More functions were added over time and __builtin_constant_p was used as well. As of 2022-11 glibc defines 79 default version *_chk functions.
ふむ。 この後も色々書いてあるみたいだから後で読む(たぶん)。
B
Arthur Whitney (K, Q, kdbの開発者) による謎の言語「B」コンパイラ。構文的にはCと同一だがコンパイルはgcc/llvmの1000倍速く、生成されるバイナリも極小、かつ実行時間も速い。ただしそのソースコード (b.c) は1画面に収まるサイズで書かれており常人には理解不能。https://t.co/xn9cslM3e8
— 新山祐介 (Yusuke Shinyama) (@mootastic) November 6, 2022
Cの前身(?)のあれと同じ名前だけど関係なさそう? リンク先のファイルの日付を見ると 2015年なので、どこでこのネタ拾ったのかもちょっと気になる (HNには見当たらなかった。と思う)。
ついでにファイルをいくつか眺めてみると たしかに「常人には理解不能」な感じが。
readme.txtをみると
b generated code is fast. already matches the fastest gcc/llvm.
b is fast. 1000 times faster than gcc/llvm/visualc. game changer.
b is interactive. much better error reporting and development potential.
b code is smaller(shrug?) and uses much less stack(shrug?).b parses and compiles a language isomorphic to c.
same types. same ops. same control. more compact. (no precedence)b : +-*%^&|<> = / \ $[c;t;f] c = +-*/^&|<> == << >> if(c)t;else f;
argtypes(for x,y,z) declared.
result and local types are automatic.e.g. binary search
b: b[Ii]{h:#x;l:0;while(h>l)$[y>x[i:/l+h];l:i+1;h:i];l} c: I b(I*x,I y){I h=x[-1],i,l=0;while(h>l)if(y>x[i=l+h>>1])l=i+1;else h=i;R l;}
などとあるのだけど、
このBでは除算は’%’、代入は:
、左シフトは/
、
右シフトは\
ということなんだろうか?
if文の表記もわけわからんな😓
サンプルの二分探索のコード、Cだと右シフトを使っている部分が 前述の対比で考えると Bでは左シフトになっているような気がするんだけど これでいいのかな?🤔
ところでソースコードを眺めていたら なんとなくJのそれの雰囲気を感じるなあと思っていたら 作者が同じっぽい?
Kやkdbの作者であることは知っていたけど、wikipedia見て Jのプロトタイプも書いたことを知って納得した。(最初、Jのソースを見たときは、KCLコンパイラの出力かと思った)
— Nobuhiko FUNATO (@nfunato) November 6, 2022
本当にあれが頭の中から湧いて出てくるんだろうなと思える。 https://t.co/6T9V07HJH8
Arthur Whitney (computer scientist) - Wikipedia
He also wrote the initial prototype of J, a terse and macro-heavy single page of code, in one afternoon, which then served as the model for J implementor, Roger Hui, and was responsible for suggesting the rank operators in J.[6][7]
jsource/jsrc at master · jsoftware/jsource
FORTRAN Compiler on IBM 704
304349-Volume_I.pdf の p Iにこんな記述があった (原文では全部大文字)。
These listing constitute the entire final version of 704 FORTRAN II. Listings of associated programs, such as the editor, have also been included. the listings have been arranged so that there is a close correspondence with the records of tge final FORTAN II master tape. Whereve, on the master tape, A single FORATAN record must appear as separate 4K and 8K versions, the main listings sequence includes the 4K version. The 8K records, therefore, appear at the end. Further information pretient to these listings and the FORTAN II master tape can be found in the operations manual, particulary on pages 5 through 15.
The following FORTRAN II records are diagnostic call-in records and are besically the same. For this reason they have been omitted from the main listings. An example of a diagnostic call-in record can be found on page 969 of these listings.
2 035 054 074 093 4 038 057 077 095 6 040 059 079 097 8 042 061 081 099 23 044 063 083 102 25 046 066 085 104 28 048 068 087 106 31 050 070 089 108 33 052 072 091 114
なるほどそれで同じコードが二度現れていたのか。 確かにソースコードのコメント部を見ていくと 4Kや8Kという文字列が何か所か見つかる。
おなじく304349-Volume_I.pdf の次のページp IIには
CONTENTS
SECTION 1 PRIME
SECTION 1 DOBULE PRIME
SRCTION 2 BLOCK 1
SRCTION 2 BLOCK 2
SRCTION 2 BLOCK 3
SRCTION 2 BLOCK 4
SRCTION 2 BLOCK 5
SRCTION 2 BLOCK 6
SECTION 3 OPEN SUBROUTINES
SECTION 3 PART 1 OF MERGE
SECTION 3 PART 2 OF MERGE
SECTION 3 PART 3 OF MERGE
SECTION 4 /4K AND 8K VERSIONS
SECTION 5 /4K VERSION/
SECTION 5 PRIME
SECTION 6 RECORD A
SECTION 6 RECORD B
省略...
SECTION 6 RECORD N
SECTION 6 RECORD P
SECTION 1 /8K VERSION/
SECTION 5 /8K VERSION/
というのがあって、これと ソースコード右端のラベルを対比させてみると このセクションとラベルの体系が 対応しているようだ
ラベルの先頭4桁を並べてみた結果
4F10
4F11
4F12
4F13
4F14
4F15
4F1D
BDC/
CD1
CSH
CSH/
DBC/
EDT
EXP1
EXP2
EXP3
F1BM
F1ME
F1P0
F1P1
F1SC
F1SP F1SPE
F210
F211
F220
F221
F222
F230
F231
F232
F240
F250
F251
F252
F253
F260
F2AT F2ATN
F2EX F2EXP
F2SI F2SIN
F2TN F2TNH
F3B0
F3B1
F440
F441
F442
F443
F444
F445
F446
F5G0
F5G1
F5G2
F5G3
F5G4
F6A0
F6B0
F6C0
F6D0
F6E0
F6F0
F6G0
F6H0
F6I0
F6J0
F6K0
F6L0
F6M0
F6N0
F6P0
F6R0
F6S0
F6T0
LBL3
LOG
LOG/
LRT/
MR 1
MR 2
MR 3
MULB
REC
REV
SCH
SCH/
SCH2
SPH
SPH/
SQRT
STH/
STHF
TSH/
TSH0
XP1/
XP2/
XP3/