ときどきの雑記帖 RE* (新南口)
The Amulet of Yendor
Got the Amulet of Yendor for first time! Now what? : PixelDungeon
考えるカラス
今年も4月から放送してたのか! 全然気がつかずに見逃していたよ…
day of the programmer
(今年は)9/13がその日。 なぜかというと
>ruby -rdate -e "puts Date.new(2021,9,13).yday"
256
だからだとか。閏年は(2/29があるので)9/12に。
their
- Alan M. Turing made certain significant contributions to computer science. However, their importance and impact is often greatly exaggerated, at the expense of the field’s pioneers. (It’s not Turing’s fault, though) : programming
- Alan M. Turing made certain significant contributions to computer science. However, their importance and impact is often greatly exaggerated, at the expense of the field’s other pioneers. It’s not Turing’s fault, though. : programming
- Turing Oversold
なんで「thier」? と思ったけどそうか、he/she → they の置き換えのアレか (要確認)
英語の人称代名詞|性別が分からないときは?男女不明なときの人称代名詞 - 英語の杜
ZX81
シンクレアZXの生みの親であるSinclair卿が亡くなったらしい。享年81歳。欧米では ZX Spectrumは (Commodore 64と並んで) 「小中学生のころ買ってもらったパソコン」的な位置づけであり、これで人生が決まった人も多い。HNでは追悼のコメントであふれている。https://t.co/PAFZnsKVqb
— 新山祐介 (Yusuke Shinyama) (@mootastic) September 16, 2021
Sir Clive Sinclair has died | Hacker News
- Sir Clive Sinclair: Tireless inventor ahead of his time - BBC News
- Sir Clive Sinclair, 1940-2021 - Raspberry Pi
- Farewell Sir Clive Sinclair; Inspired A Generation Of Engineers | Hackaday
- Clive Sinclair and the offbeat brilliance of the ZX Spectrum | Retro games | The Guardian
pragprog のアカウントも反応していた。
RIP Clive Sinclairhttps://t.co/FFoW759x6V
— PragmaticProgrammers (@pragprog) September 17, 2021
ところで
ZX81は日本でも売られてたよね https://t.co/fBYZgI29Rj
— ほうめい マイコンで遊んでばっかりで (@houmei) September 17, 2021
ん?と思ってリンク先をたどってみたらこんなこと書いてるのね。
8bitコンピューターの名機「ZX Spectrum」開発者クライブ・シンクレア氏死去 - Engadget 日本版
日本では発売されなかったシンクレアZXシリーズですが、英国ではZX80、ZX81、ZX Spectrumといった機種を発売し、 累計500万台以上を売り上げる大ヒット作となりました。
誰だよこの記事書いたの。 先のほうめいさんのツイートに対する反応や [B! 訃報] 8bitコンピューターの名機「ZX Spectrum」開発者クライブ・シンクレア氏死去 - Engadget 日本版 にも言及している人がいるように、ZX81は(少なくとも)三省堂で扱っていたはず。
神保町の三省堂書店に置いてありましたね。
— ecd102 (@ecd102) September 17, 2021
"ZX81は発売されてた">RT
— n602💉💉💉💉 (@n602_NA) September 17, 2021
三井物産の通販みたいな形態で(ハガキに注文書?貼って送るとか)だった気がする(けど買えなかったんですね私)
あと有名書店でも買えるとかそんなのhttps://t.co/KztcwZT1Mo
わたしが見たのは神保町の本店ではなく、東急文化会館の5Fにあった三省堂 (当時神保町は自分の行動範囲になかった。半蔵門線がまだそこまで延伸されていなかったし)。 たしかエスカレーターで三省堂のあるフロアに行ってすぐのところだったと思う。
ところで東急文化会館にあった三省堂
その後もテナントの入れ替えを繰り返し、過去に第一家庭電器などが、最末期には三省堂書店や東急ストアなども入居していた。
って、「最末期」(になってから)てことはないと思うがなあ。
そして東急文化会館と言えばG3。
ガメラ3
付近も含めて今はもう面影の欠片すらありませんな(今もまだ変わっている最中だけど)。
そう言えば10年位前の深夜アニメで この東急文化会館の内部をわりと細かく描写していたカットのある 作品があったんだけど、なんだっけ?
find +
一部でfindネタが盛り上がっていたので(謎)、 GNU のfindのソース findutils.git - GNU findutils を眺めていた。そこで
find - findutils.git - GNU findutils
Mode Name Size
-rw-r--r-- .gitignore 63 logplain
-rw-r--r-- Makefile.am 2214 logplain
-rw-r--r-- defs.h 20313 logplain
-rw-r--r-- exec.c 10767 logplain
-rw-r--r-- find.1 75852 logplain
-rw-r--r-- finddata.c 1031 logplain
-rw-r--r-- fstype.c 7609 logplain
-rw-r--r-- ftsfind.c 23891 logplain
-rw-r--r-- oldfind.c 43302 logplain
-rw-r--r-- parser.c 97550 logplain
-rw-r--r-- pred.c 34427 logplain
-rw-r--r-- print.c 43033 logplain
-rw-r--r-- print.h 1200 logplain
-rw-r--r-- sharefile.c 4262 logplain
-rw-r--r-- sharefile.h 1039 logplain
d--------- testsuite 262 logplain
-rw-r--r-- tree.c 46523 logplain
-rw-r--r-- util.c 29921 logplain
oldfind.c とかいう怪しげな名前のファイルを発見。 コードはさておきコメントを見るといくつか興味深い記述があった。
oldfind.c\find - findutils.git - GNU findutils
/* CAUTION: this is the entry point for the oldfind executable, which is not the binary that
* will actually get installed. See ftsfind.c. */
int
main (int argc, char **argv)
{
int i;
int end_of_leading_options = 0; /* First arg after any -H/-L etc. */
struct predicate *eval_tree;
if (argv[0])
set_program_name (argv[0]);
else
set_program_name ("find");
なぜこんなコメントをつけ、oldind.cという名前にしてまで古いものを残しているんだろう?
そしてmain の最後にはこんなコメント。
/* If "-exec ... {} +" has been used, there may be some
* partially-full command lines which have been built,
* but which are not yet complete. Execute those now.
*/
show_success_rates (eval_tree);
cleanup ();
return state.exit_status;
}
See ftsfind.c
のftsfind.cも見てみる。
ftsfind.c\find - findutils.git - GNU findutils
/* This file was written by James Youngman, based on oldfind.c.
GNU find was written by Eric Decker <cire soe.ucsc.edu>,
with enhancements by David MacKenzie <djm gnu.org>,
Jay Plett <jay silence.princeton.nj.us>,
and Tim Wood <axolotl!tim toad.com>.
The idea for -print0 and xargs -0 came from
Dan Bernstein <brnstnd kramden.acf.nyu.edu>.
*/
int
main (int argc, char **argv)
{
int end_of_leading_options = 0; /* First arg after any -H/-L etc. */
struct predicate *eval_tree;
if (argv[0])
set_program_name (argv[0]);
else
set_program_name ("find");
record_initial_cwd ();
state.already_issued_stat_error_msg = false;
state.exit_status = 0;
state.execdirs_outstanding = false;
state.cwd_dir_fd = AT_FDCWD;
if (fd_leak_check_is_enabled ())
{
remember_non_cloexec_fds ();
}
state.shared_files = sharefile_init ("w");
if (NULL == state.shared_files)
{
die (EXIT_FAILURE, errno,
_("Failed to initialize shared-file hash table"));
}
/* Set the option defaults before we do the locale initialisation as
* check_nofollow() needs to be executed in the POSIX locale.
*/
set_option_defaults (&options);
C23
K&R スタイルの関数定義が廃止されるの ISO C 23 からなので、これは未来なのかな https://t.co/P90U5F690U
— AoiMoe a.k.aしお兄P (@AoiMoe) August 26, 2021
なぜかすでに廃止されたものと勘違いしていた>K&Rスタイルの関数定義
そういやC23の話題が最近あったなあと見返すと
The article didn’t mention fixing C’s Biggest Mistake https://www.digitalmars.co… | Hacker News
The article didn’t mention fixing C’s Biggest Mistake https://www.digitalmars.com/articles/C-biggest-mistake.html which has a simple and backwards compatible fix for C buffer overflows, probably the single biggest cause of memory safety bugs.
に対して記事の著者が反応してるのにちょっとうけた。
Hi! Article author here. I have long, long since waxed poetic about how many bugs and problems this can solve (even just a poor man’s library version):
別の流れの My favorite promises of c2x: Closures: http://www.open-std.org/jtc1/sc22/wg14/ww… | Hacker News には
My favorite promises of c2x:
- Closures: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2737.pdf
- Type inference for variable definitions and function returns: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2735.pdf
- Type generic programming: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2734.pdf
- Defer mechanism: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2589.pdf
というのがあるけど、どうなんすかねえ。
awk
frawk
Rust による awk 言語実装.主に高パフォーマンスと CSV 対応が売り.型推論によって全ての変数の型を静的に明らかにし SSA 形式の IR に変換 → LLVM で JIT コンパイルする.レコード単位での処理の並列実行をサポート | 'ezrosent/frawk: an efficient awk-like language' https://t.co/WvGiJmhUaL
— ドッグ (@Linda_pp) September 12, 2021
なぜawkと思ったけど ezrosent/frawk: an efficient awk-like language をみると
frawk is a small programming language for writing short programs processing textual data. To a first approximation, it is an implementation of the AWK language; many common Awk programs produce equivalent output when passed to frawk. You might be interested in frawk if you want your scripts to handle escaped CSV/TSV like standard Awk fields, or if you want your scripts to execute faster.
The info subdirectory has more in-depth information on frawk:
Overview: what frawk is all about, how it differs from Awk.
Types: A quick gloss on frawk’s approach to types and type inference.
Parallelism: An overview of frawk’s parallelism support.
Benchmarks: A sense of the relative performance of frawk and other tools when processing large CSV or TSV files.
Builtin Functions Reference: A list of builtin functions implemented by frawk, including some that are new when compared with Awk.
awkは単なる通過点?
それはそれとして、rustのコードを読むのにいい題材かもしれん(自分にとって。笑)
goawk
そいやgoでもawkが書かれていましたね。と。
benhoyt/goawk: A POSIX-compliant AWK interpreter written in Go