ときどきの雑記帖 RE* (新南口)
Baking magnetic tape
Ruby 4.0
でるらしい
matz dropping truth bombs at #rubyworld pic.twitter.com/03VWesSI1x
— Leonard Chin 😷 (@lchin) November 7, 2025
Ruby 4.0 this year!
— Rhiannon Payne | ActiveAgents.ai 💎 (@rhiannon_io) November 7, 2025
Officially!! 🤩 #RubyWorld pic.twitter.com/uGORjH5K5t
検索してみると今年の4/1にこんな投稿が😄
We will see Ruby 4.0 this year.
— Yukihiro Matz (@yukihiro_matz) April 1, 2025
(Mind the date)
昼メシの流儀
先週放送分の後半エピソードがアメリカン中華だった。 あーアレ食いてえ(もちろんあの箱で(笑))
ザ・ウルトラマン@MX
最終回。 どんな終わり方だったかすっかり忘れていた。
にしてもウルトリアってもっと活躍していたような気がしたんだけどなあ
グレートマジンガー@MX
次が最終回らしい(ただし一週お休み)
YAPC
今週末に福岡で
そのタイミングに合わせてこんな本も
令和最新のPerlについて学べる本(になる予定)をZennに公開しました - Blog::kobaken
RPN Caluclator
CHF 259.00
って日本で買うといくらくらいになるんだ?
Lua
Lua 5.5(beta)の新機能紹介という記事で
浮動小数点数のprintを改善
floats are printed in decimal with enough digits to be read back correctly.
printで浮動小数点数を表示する際に、正確な値を読み取るのに十分な桁数で表示されるようになった…らしいです。
とあったのだけど、これって出力結果(の文字列)を再度読み込んでも(数値型に変換しても) 元の数値と同じ値になるって話じゃないかなあ?
ということでまずはマニュアルを
print (…) - Lua 5.5 Reference Manual
Receives any number of arguments and prints their values to stdout, converting each argument to a string following the same rules of tostring.
tostring (v) - Lua 5.5 Reference Manual
Receives a value of any type and converts it to a string in a human-readable format.
とくにこれといった情報はなし
次にソースコード。 ざっと探してみると文字列化はここでやっているらしい
src/lojbect.c lua/lobject.c at master - lua/lua - GitHub
/*
** Convert a float to a string, adding it to a buffer. First try with
** a not too large number of digits, to avoid noise (for instance,
** 1.1 going to "1.1000000000000001"). If that lose precision, so
** that reading the result back gives a different number, then do the
** conversion again with extra precision. Moreover, if the numeral looks
** like an integer (without a decimal point or an exponent), add ".0" to
** its end.
*/
static int tostringbuffFloat (lua_Number n, char *buff) {
/* first conversion */
int len = l_sprintf(buff, LUA_N2SBUFFSZ, LUA_NUMBER_FMT,
(LUAI_UACNUMBER)n);
lua_Number check = lua_str2number(buff, NULL); /* read it back */
if (check != n) { /* not enough precision? */
/* convert again with more precision */
len = l_sprintf(buff, LUA_N2SBUFFSZ, LUA_NUMBER_FMT_N,
(LUAI_UACNUMBER)n);
}
/* looks like an integer? */
if (buff[strspn(buff, "-0123456789")] == '\0') {
buff[len++] = lua_getlocaledecpoint();
buff[len++] = '0'; /* adds '.0' to result */
}
return len;
}
コメントにread it backと書いてある行で
lua_str2number(buff, NULL)と
逆変換をしてその値と元の値を比較して
異なっていたら、
ちょっと違う引数を使って
再度l_sprintfを呼び出している、
浮動小数点数の型としてdoubleを使っている場合 sprintfに渡す書式文字列は
lua/luaconf.h at master - lua/lua - GitHub
#define LUA_NUMBER_FMT "%.15g"
#define LUA_NUMBER_FMT_N "%.17g"
となっているのでまあそうですよね。と。
一方5.4.8だと 関数名が少し違うけど
Lua 5.4.8 source code - lobject.c
/*
** Convert a number object to a string, adding it to a buffer
*/
static int tostringbuff (TValue *obj, char *buff) {
int len;
lua_assert(ttisnumber(obj));
if (ttisinteger(obj))
len = lua_integer2str(buff, MAXNUMBER2STR, ivalue(obj));
else {
len = lua_number2str(buff, MAXNUMBER2STR, fltvalue(obj));
if (buff[strspn(buff, "-0123456789")] == '\0') { /* looks like an int? */
buff[len++] = lua_getlocaledecpoint();
buff[len++] = '0'; /* adds '.0' to result */
}
}
return len;
}
変換は一度だけ。
bake
「完全なコピーは現存しない」と言われていた52年前にベル研究所で作成されたUNIX V4を記録したテープが倉庫で見つかる - GIGAZINE
Bitsaversは、「機材は揃っています。(発見されたのは)3Mテープなので、おそらく大丈夫でしょう。 アナログ復旧システムでデジタル化し、Len Shustekのreadtapeを使ってデータを復旧する予定です。 今のところ唯一の問題は、私のワークフローが『待っている間に』というわけにはいかないので、 ペニーに持ち出しOKを伝える前に、全ての部品を物理的に一箇所に集めて全てをテストする必要があるという点です。 全体のプロセスは、テープリテンショナーで状態をテストすることです。 ベイク処理は1日かかるので、できれば避けたいです。その後、デジタル化し、 数十GBのサンプルを別のマシンに転送してデコードします。転送のステップを省略して、 デジタイザー上でアナライザーを動作させたいです」とコメントし、 早速データをアーカイブするための手順について記しています。
何を言っているんだ? となったので(ry
Unix V4: Only known copy may lurk on recently unearthed tape • The Register
That being the Computer History Museum in Mountain View, California – which Google Maps tells us is a mere 771 miles away, a modest 12 hours’ drive. The software librarian at the CHM is the redoubtable Al Kossow of Bitsavers, who commented in the thread that he is on the case. On the TUHS mailing list, he explained how he plans to do it:
taping off the head read amplifier, using a multi-channel high speed analog to digital converter which dumps into 100-ish gigabytes of RAM, then an analysis program Len Shustek wrote: https://github.com/LenShustek/readtape
It is a ’70s 1200ft 3M tape, likely 9 track, which has a pretty good chance of being recoverable.
なんか違うな。でMastdonへの投稿を見ると こっちを翻訳したものらしい
bitsavers.org: “@TerryHancock @ricci I have …” - OldBytes Space - Mastodon
I have the equipment. It is a 3M tape so it will probably be fine.
It will be digitized on my analog recovery set up and I’ll use Len Shustek’s readtape program to recover the data.
The only issue right now is my workflow isn’t a “while you wait” thing, so I need to pull all the pieces into one physical location and test everything before I tell Penny it’s OK to come out.The whole process is test the condition on a tape retensioner. I’m hoping I don’t have to bake it, since that takes a day, then digititze it, shuttle the 10s of gigabytes of samples to another machine to decode it. I want to skip the shuttle step and get the analyzer running on the digitizer.
そういう書き方があるのかわからんけど、The whole processは
test the condition on a tape retensioner.だけじゃなくて
その後ろの分も含んでいるんじゃなかろうか?
あと「ベイク処理」(bake it)もよくわかんなかったので調べてみると 劣化した磁気テープに対して行うものらしい
えーあいに聞いてみたところでは
「ベーキングテープ」とは、カビやスティッキー・シェッド症候群 (テープが加水分解して粘着性のある物質を生成する現象) が発生した古いビデオテープを保存・再生可能にするための技術です。 専門のオーブンでテープを加熱して湿気を除去することで、粘着物質が固まり、再生できるようになります。 この処理は、テープの寿命を延ばし、再生機器を損傷させるのを防ぐために行われます。
ということなのだと。
Sticky-shed syndrome - Wikipedia
Baking is a common practice for temporarily repairing sticky-shed syndrome. There is no standard equipment or practice for baking, so each engineer is left to create their own methods and materials. Generally, tapes are baked at low temperatures for relatively long periods of time, such as 130 to 140 °F (54 to 60 °C) for 1 to 8 hours.[6] Tapes wider than 1/4 inch (0.635 cm) may take longer. It is commonly thought that baking a tape will temporarily remove the moisture that has accumulated in the binder. A treated tape will reportedly function like new for a few weeks to a few months before it will reabsorb moisture and be unplayable again.[7]
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
- [TUHS] unix v4 tape found
Fil-C
メモリ安全なCやC++の実装が進んでるのか!Clangのフォークで、メモリ安全性の担保それ自体にはGCを採用している(パフォーマンスの低下は正直あるっぽい)。既存のCコードとの互換性を重視してるみたいで楽しみなプロジェクトだ😳
— yuki (@helloyuki_) October 30, 2025
Fil-C: A memory-safe C implementationhttps://t.co/IJQUzKsObL
Fil-Cに採用されているガベージコレクタの話が載ってそう。明日読もうかな
— yuki (@helloyuki_) October 30, 2025
Fil's Unbelievable Garbage Collectorhttps://t.co/uFT1deRpqg
はーなるほど。メモリ安全性の担保はちょっと論理構造が逆で、まずポインタ安全性(InvisiCapsとか呼ばれてる?)があって、その設計がGCにも優しい感じになっていて、結果的にGCを上手に搭載できた、みたいな流れなのかな。いずれにせよ新しいモデルを設計していてめっちゃおもしろい。
— yuki (@helloyuki_) October 31, 2025
InvisiCaps:…
- Notes by djb on using Fil-C (2025) : r/programming
- Fil-C is a fanatically compatible memory-safe implementation of C and C++ : r/programming
- Unbelievable C Compiler
- Fil’s Unbelievable Garbage Collector
- stdfil.h` Reference
- Fil’s Unbelievable Garbage Collector
- InvisiCaps: The Fil-C Capability Model
- Fil-C: A memory-safe C implementation | Hacker News
But pervasive security vulnerabilities mean that the traditional “YOLO” approach to C compilation is a bad idea for software that has to handle untrusted input, such as Web browsing or email.
- Fil-C: A memory-safe C implementation [LWN.net]
- はてな匿名ダイアリー
互換性が高い高いと主張するばかりで「じゃあ何ができないんだよ。数少ないエッジケースは何なんだ」という …
- GitHub - pizlonator/fil-c: Fil-C: completely compatible memory safety for C and C++
- What is Fil-c and how to use it? - GizVault
Posted by Looper 11 August 2025 4:14 AM
- A Note on Fil-C | Hacker News
- graydon2 | losing language features: some stories about disjoint unions
- Losing language features: some stories about disjoint unions : r/programming
新刊近刊
おぉーこれ、原著者が「日本語でも翻訳中」という旨を書いていたのをみて、読まずに待っていたやつだった。
— iwashi / Yoshimasa Iwase (@iwashi86) November 7, 2025
めちゃくちゃ楽しみなので確実に買う!
『ソフトウェアエンジニアガイドブック ―世界基準エンジニアの成功戦略ロードマップ』#adhttps://t.co/3B3SX3zanT
Xユーザーのiwashi / Yoshimasa Iwaseさん: 「原著者が執筆の裏側を語っていた。 ・著者は「The Software Engineer’s Guidebook」という技術書を2年前に出版 ・この本は2年間で約4万部売れ、印税収入は合計611,911ドル(約9000万円)に達した ・執筆のきっかけは、Uberで管理職をしていた際、エンジニアの成長を助ける本が必要だと感じたこと」 / X https://x.com/iwashi86/status/1988344467880095759 –>
原著者が執筆の裏側を語っていた。
— iwashi / Yoshimasa Iwase (@iwashi86) November 11, 2025
・著者は「The Software Engineer’s Guidebook」という技術書を2年前に出版
・この本は2年間で約4万部売れ、印税収入は合計611,911ドル(約9000万円)に達した
・執筆のきっかけは、Uberで管理職をしていた際、エンジニアの成長を助ける本が必要だと感じたこと…
ソフトウェアエンジニアガイドブック ―世界基準エンジニアの成功戦略ロードマップ : Gergely Orosz, 久富木 隆一(翻訳): 本 を見て訳者が気になったので Amazon.co.jp: 久富木 隆一: 本、バイオグラフィー、最新アップデート に行ってみると
ルールズ・オブ・プログラミング ―より良いコードを書くための21のルール
ああ、あれを訳した人か
12月発行予定の新刊『バイブコーディングを超えて ―AI時代を生き抜く開発者の未来』の情報をAmazonおよび楽天ブックスで公開開始しました!https://t.co/npoFCZEzm6https://t.co/QoUbzLeIhM
— O'Reilly Japan (@oreilly_japan) November 11, 2025
ちょっと前に原著が話題になってたやつすな
Control structures in programming languages
- Book draft: “Control structures in programming languages” - Community - OCaml
- Control structures in programming languages: from goto to algebraic effects | Hacker News
- Control structures in programming languages | Control structures in programming languages: from goto to algebraic effects
To be published by Cambridge University Press.
【7階辞書】
— 紀伊國屋書店 新宿本店 (@KinoShinjuku) November 7, 2025
✨新刊✨
『ホントに知ってる?カタカナ英語大全』(有隣堂)
趣味で!仕事で!SNSで!
生活に溢れている「カタカナ英語」をあなたはどこまで知ってますか?
意味だけではなく、語源や正式名称、豆知識などのワンポイント情報も掲載!
C-14にて展開中。mm pic.twitter.com/pdVijK2e3K
こういうの好き😄
awk
正規表現の話の続き
>echo #!a | sed -e "s/#\|#!//"
a
>echo #!a | grep -Goe "#\|#!"
#
>echo #!a | grep -Eoe "#|#!"
#
いずれもGNUのそれの結果なんだけど、sedはともかくgrepもこうなるとはちょっと意外。
FORTRAN Compiler on IBM 704
のp.42
2.17.0 LAMBDA, ALPHA, and BETA TABLES
ALPHA → LAMBDA → SCRIPL
→ BETA → CPBETA
12/6(土)イベント「絵の具になる鉱物」を開催します。「孔雀石から絵の具を作ろう(抽選予約)」と当日参加できる「絵の具になる鉱物をさがそう」の同時開催です。… pic.twitter.com/SFT7OL3Et5
— 地質標本館 (@GSJ_GeoMuseum) November 12, 2025
どこだろうと思ったのだけど、つくば?
SUICAのペンギン
マスコットキャラが変わると「あの像」はどうなるのか気になったのだけど 同じように思った人がいた
え、マジかよ
— 大守アロイ (@OmoriAlloy) November 11, 2025
じゃあ新宿駅近くにあるSuicaペンギンの銅像はどうなるんだ
レーニン像よろしく引き倒されるのか…? https://t.co/jmP1k65IKQ pic.twitter.com/qYkV1zybnY
【悲報】谷川岳の輝ける光明星にして公共交通統合の象徴、我らが東日本の偉大な領導者であらせられるSuicaペンギン同志、失脚 https://t.co/jX7WVLvfgh pic.twitter.com/yGEqhz3MUw
— 国木田 (@churuyasan1218) November 11, 2025
size_t
for (unsigned i = c.size()-1; i >= 0; --i)
— 百千万億 萬(つもいよろず) (@TumoiYorozu) November 11, 2025
みたいなバグを埋め込む…、ってのもあるし、
そもそも近代の C++ のコーディングガイド的に unsigned型は、本当に必要で無い限り非推奨なのもある。index に使いたい場合はほぼ同意を得られないhttps://t.co/3239cK4DSk
>… https://t.co/hlfYItWHwT
Google C++ スタイルガイド(日本語全訳) Google C++ Style Guide (Japanese)
歴史的な事情により、C++標準では、コンテナのサイズを表すためにunsigned整数型が使われており、 この点について多くのC++標準化委員会のメンバーがこれを失敗だったと考えていますが、 現在において、もはや修正は不可能となってしまいました。 標準によって定義されるunsigned整数演算は、単純な整数演算の挙動をモデル化したものではなく、
変数が常に非負であることを主張する目的程度のことでは、unsigned整数型を使ってはいけません。
へー
C++のサイズ型をunsignedにしてしまったのはBjarne Stroustrup自身が最大の失敗だと述べている https://t.co/uNbLWzUSI8
— さきさか (@_n_s_7_) November 11, 2025
このテーマでStroustrupが主著者でペーパー何本か出してるから探してみると良いと思う
— さきさか (@_n_s_7_) November 11, 2025
軽く検索してみると見つかったのはこの辺
- Bjarne Stroustrupは、すべてのサイズ型は符号付きであるべきだと考えています (PDF警告) : r/cpp
- Subscripts and sizes should be signed
- c++ - Why is size_t unsigned? - Stack Overflow
- optimization - Why prefer signed over unsigned in C++? - Stack Overflow
- unsigned vs signed - Is Bjarne Mistaken?
中を細かく見てはいないので「最大の失敗と述べている」部分は見つけてない