ときどきの雑記帖 RE* (新南口)
残暑お見舞い申し上げます
po4a
実は、公開されたものより後のバージョンの gawk のドキュメントを 途中まで訳すというのを何度かやっていたりする。
以前のものからコピーということはせずに毎回ほぼイチからやり直していて、 せいぜいが半分くらい訳したところで次のバージョンが出たりしてめでたくお蔵入りに。
ここで使えるところは活かしてやればよかったのだけど、 手作業で色々やるのには気力が足りなかった。
というのも翻訳前のドキュメント同士を比較するのは難しいことではないけれど、 翻訳済みのドキュメントのどこにどう変更点が関係するのかを調べて反映していくのは 面倒この上なかった。
(ここで数年…十数年? 経過)
ドキュメントは texinfo で書かれているので、@section やら @subsction、@node なんかで分割していけば変更点の「位置決め」をやりやすくなって、 翻訳済みと翻訳前の対応も取りやすくなるんじゃないかと考えて ツールを作り始めたのが緊急事態宣言中のこと。
そしてゆるゆるやっているところで po4a が texinfo にも対応していたのに気がつく。
- po4a - ようこそ
- Po4a でドキュ メント翻訳の保守を楽にしよう
- mquinson/po4a: Maintain the translations of your documentation with ease (PO for anything)
ああ自作するよりこういうの使った方が楽でいいやと po4a をインストールしようとしたら…(続く?)
BASIC
PATB に関してはどうしても 復活!TINY BASIC と内容が被るので、方向性を模索中。 とは言っても、元々PATBの話を突っ込んで書くつもりはなかったのだった。
Tiny BASIC
例によって日本語版の記述はあれなので英語版から
For some implementations, including the first Tiny BASIC and Tom Pittman’s Tiny BASIC,[8] a virtual machine was used, others such as Palo Alto Tiny BASIC and 6800 Tiny BASIC, were direct interpreters. In a virtual machine implementation, the Tiny BASIC interpreter is itself run on a virtual machine interpreter. The designer’s idea to use an application virtual machine goes back to Val Schorre (with META II, 1964) and Glennie (Syntax Machine).[9]
なにか共通の「種」があって複数の実装が生まれたと思っていたのだけど違ったみたいですね。
引用文中の「In virttual machine implementation, 」で関連するであろうドキュメントを見つけたので そっち方面でなんかしら書くつもり。
PATB 1.0 → 2.0 でのラベルの変化
なんのかんの言いつつ今回もPATBから話題を一つ。
1.0 | 2.0 |
---|---|
BKA | |
BKS | |
CNTLC | |
CNTLO | |
CNTLU | |
DEL | |
DLLN | |
DWA | |
FDLNP | |
FNDLP | |
INIT | |
ITEM | |
MSG1 | |
PATLO | |
QT | |
RSTAR | |
UPA |
PRNファイルの末尾にあったクロスリファレンステーブルをごにょごにょして 1.0と2.0でどう変わったのかみてみた。 大部分は共通に存在するもの(値は異なるが)だったが、 上の表のように1.0だけにあるもの、逆に2.0だけにあるものもいくつかあった。
1.0のみにあるものはITEMがテーブルの要素を記述するのに使うマクロ (2.0ではDWAという名前になっている)で、 FDLNPが通常のラベル、それ以外はキャラクターコードに対応する値。
2.0 のみにあるものはDWAが前述の通りマクロで、それ以外は通常のラベル。
ところでMarkdownだと表(テーブル)に罫線入れるの簡単にはできない?
Hugo の機能とcssを組み合わせて…てのはいくつか見つかったのだけど。
八進定数は末尾にO
GW-BASIC からも小ネタを一つ。
八進数であることを末尾に「O」を置いて表しているので、 ぱっと見「0(ゼロ)」と区別がつけにくい。 OCRとかにかけたら誤判定でまくりじゃなかろうか(笑)
フォントによるかもしれないけど (手書きなら斜めに線を入れるとか上に線を入れるとかして区別するパターン?)。
起動時のエントリすぐに八進定数は登場している。
; There is a problem with running the ASM86 sources for BASIC as they
; stand. MSDOS puts a 100 hex byte control block at the beginning of the
; EXE file and sets up the ES register to point to it. BASIC, however,
; expects this block to be at 0 in the code segment. The quick and dirty
; solution is to copy the block into the code segment before doing anything
; else. This module is included in the linker file list AFTER all others,
; but is executed first since it is defined as the entry point.
; A 100H bytes are copied from ES:0 to CS:0 and then jump is done to
; the START label. To accomodate the block, BINTRP should have an ORG 100H
; before any code.
;
; NOTE: Never convert the EXE file to a COM file. COM files have the CS
; register pointing to the control block on entry, so all offsets
; for immediate values will be off by 100H.
;
EXTRN START:NEAR
;BIBOOT - ASM86 Version Specific Initialization
;Entry - ES:0 pointing to start of control block.
; DS:0 pointing to start of control block.
;
BIBOOT:
MOV CX,CS ; Get BASIC's segment
MOV ES,CX ; Make it the destination segment
XOR SI,SI ; Start at ES:0
XOR DI,DI ; Destination is CS:0
MOV CX,200O ; There are 100H bytes to move
CLD ;;
REP MOVSW ;;DS:0000~00ff → ES:0000(CS)~
MOV CX,DS ; Restore segment registers
MOV ES,CX
JMP START
CSEG ENDS
それと起動時になんかごにょごにょやってるこれ、コメントでは256バイトのコントロールブロックとかあるけど、 それって PSP (Program Segment Prefix - Wikipedia) のことだよねえ。
起動時のDS:0ってPSPだし(Notes on the format of DOS .EXE files)。 ただなんでそれを転送しないといけないのかはよくわからんけど。
Pragmatic Bookshelf
何か月かぶりに Pragmatic Bookshelf: By Developers, For Developers にアクセスしたら ログインできなくて(パスワードが違うとでてくる)、リニューアルでなんかあったのかと思っていろいろ みたらこんなページPragmatic Bookshelf: By Developers, For Developers に辿り着いた。
How do I login? Where’s my account? Everything is different!
In June 2020 we migrated to a new web store. The new system is faster, friendlier, more responsive and more robust than the previous system. We now use third-party shopping cart and fulfillment by Sendowl.com, you may notice their URL when checking out and downloading.
Your old password (prior to June 2020) will not work. If you’ve placed an order with us in the last four years, then we have automatically migrated all your orders for books still in print to the new system.
If you just want to download your books, you can resend your order emails. If you want to create a password to access your orders, enter your email address on the login page and click “Set/reset password.” You’ll receive a link via email to set your new password. If you don’t receive an email, you might not have been migrated, but don’t worry, we can do it manually.
なるほどそういうことかと、パスワードの再設定をして無事解決 (四年以内に買ったものがあったので過去の注文はちゃんと残っていた)。
訳語
Null coalescing operator - Wikipedia