📰 newsreader

twostopbits score 0.23 好み 0.00 en

マゾヒスティックなYouTuber、FPSをすべてCOBOLで開発

原題: Masochistic YouTuber writes First Person Shooter Entirely in COBOL (gizmodo.com)

cobolfirst-person shootergame developmentprogramming languagedoom enginelegacy systemssoftware engineeringretro gaming
原文 ↗

日本語訳

# タイトル

マゾヒスティックなYouTuberが、FPSを完全にCOBOLで書き上げる(gizmodo.com)

# 本文

さて、「マゾヒズム」について。この言葉が19世紀のオーストリアの貴族であり作家のレオポルド・リッター・フォン・ザッハー=マゾに由来することをご存知かもしれません。具体的には、語り手の従順な性質や、痛みと屈辱を好む様子を描いた彼の有名な著作『毛皮のヴィーナス』の内容から来ています。マゾ自身、自分の名前がこのような嗜好と結び付けられたことを、おそらく愉快には思っていなかったでしょう。というのも、この言葉が最初に使われたのは『性的異常者(Psychopathia Sexualis)』という本で、そこではマゾ自身が「もし通常の性的感情に突き動かされていたなら、真の偉業を成し遂げていただろう」と推測するという、いわば相手を貶めるような手法の先駆けとも言える記述があったからです。幸いなことに、BDSMの「S」の部分に対する現代の考え方は、1880年代や1890年代よりもずっと開明的です。

全く関係のないニュースですが、icitryという名前のYouTuberが――彼のプロフィールには単に「今すぐ試せ、後で苦しむことになる」と書かれていますが――FPS(一人称視点シューティング)を、なんとCOBOLだけで書き上げました。

もしあなたがCOBOLを扱ったことがないのであれば、それは幸運なことであり、そのままにしておくのが賢明でしょう。この言語は最も古いコンピュータ言語の一つであり、1960年代にビジネス用のメインフレームを管理するために開発されました。おそらく、ドラマ『マッドメン』の哀れなジングスを狂わせたのもこれでしょう。COBOLは今日でも、主にレガシーなメインフレームや、欠点はあれど稼働し続けている既存のシステムを置き換えることが現実的ではない場所で、使い続けられています。

COBOLが使い続けられていない、あるいは、実際には一度も使われたことがない用途の一つが、FPSのプログラミングです。では、一体全体、なぜ誰かが自分自身にこのような苦行を課す必要があるのでしょうか?

彼の動画の中で、icitryは、プロジェクトのきっかけは「小さなFPSスタイルのゲームを書くのに、最も愚かだが、技術的に可能な言語は何だろう?」と考えたことだったと説明しています。その答えは、まさにCOBOLでした。そして、宇宙の法則によれば「起こりうることはすべて起こる」ため、icitryは作業に取り掛かったのです。長く、骨の折れる、退屈な時間の連続でした。

彼が指摘するように、COBOLは「古く、冗長で、最低レベルの現代の言語にさえ備わっている機能のほとんどが欠けており……ゲーム開発のために作られたものでは決してない」のです。これらはすべて事実ですが、COBOLに公平を期すならば、この言語はプログラミングがどのように機能すべきか、プログラミング言語が何を目指すべきかを人々がまだ模索していた時代に作られました。その初期の標準は、構造化プログラミングの概念よりも前のものでしたが、すぐにその概念の提唱者たちから批判を浴びることになりました。特にエドガー・ダイクストラは、この言語をひどく嫌い、その使用は「思考を麻痺させる」と述べたことで有名です。

現代の目から見れば、COBOLプログラムを解析しようとするだけで頭痛がしてきそうですが、ましてやそれを使ってゲームを書こうなどということは……しかし、奇跡的に、icitryは『Wolfenstein 3D』風のプロジェクトを動作させることに成功しました。彼は、COBOLにグラフィック機能が完全に欠如しているという問題を、ゲームをいわば「フレーム生成器」として扱うことで回避しました。彼のコードは各フレームの内容を計算し、標準出力関数を使用して結果を単純な画像形式に書き込みます。これはffplayによってレンダリングされます。――ええ、これはおそらく「ズル」と言えるでしょうが、たとえかつてのレオポルドであっても、COBOLでグラフィックスAPI全体をゼロから書こうとはしないはずです。

また、icitryは、コンソールを使用してゲームに単一の文字を入力することで、COBOLの入力管理機能の欠如を回避しています。2Dの移動ベクトルを計算・操作することにゲームプレイのすべてがかかっているゲームにおいて、ベクトル演算機能の欠如を「回避」したというよりは、むしろそれらを自前で書くことで「対処」したと言えます。そして、これだけでは自傷行為として不十分だったのか、彼は可変天井高(variable ceiling height)のようなDOOMエンジンの機能まで実装するという、さらなる一歩を踏み出したのです。

このプロジェクト全体が、人類の創意工夫、機転、そしてあらゆる種類の自ら課した罰に耐え抜く能力の証です。ゲームが動いているのを見ていると、それがこれほどまでに不向きな言語で書かれているとは、到底思えません。

とはいえ! 少なくともFORTRANではないですよね? ですよね?? (カット:デスクに座るオーストリアの貴族。手元には『IBM 704用FORTRAN自動コーディングシステム』と『DOOMのソースコード』が置かれている)

原文(英語)を表示

So: masochism. You might know that it takes its name from 19th-century Austrian nobleman and writer Leopold Ritter von Sacher-Masoch—and specifically from the content of his famous work, Venus in Furs, which catalogued the narrator’s submissive nature and fondness for experiencing pain and humiliation. Masoch himself was apparently not amused by the fact that his name became attached to such predilections—probably fair, given that the term was first used in a book entitled Psychopathia Sexualis, which also pioneered negging by speculating that Masoch himself “would have achieved real greatness had he been actuated by normally sexual feelings.” Happily, modern attitudes to the “S” part of BDSM are significantly more enlightened than they were in the 1880s and 1890s.

In entirely unrelated news, a YouTuber by the name of icitry—whose bio on the site reads simply “try now, suffer later”—has written a whole first-person shooter in freaking COBOL.

If you’ve never had to deal with COBOL, well, good for you, and you should probably keep it that way. The language is amongst the oldest computer languages, and was developed in the 1960s for managing business mainframes. It’s probably what drove poor Ginsberg in Mad Men out of his mind. COBOL remains in use today, largely in such legacy mainframes and other places where it’s not feasible to replace existing systems that, for all their foibles, still work.

One purpose for which it absolutely does not remain in use—and, in fact, has never been used—is programming first-person shooters. So why in the name of all that is good and holy would anyone do this to themselves?

In his video, icitry explains that the project started with him wondering, “What’s the dumbest but still technically possible language for writing a small FPS style game?” The answer was, yes, COBOL, and because the laws of the universe dictate that anything that can happen must happen, icitry got to work. Long, painstaking, tedious hours of work.

As he points out, COBOL is “old, verbose, missing most features even the shittiest modern languages have … and is definitely not created for game development.” All of this is true, although in fairness to COBOL, it was created at a time when people were still figuring out how programming should work and what a programming language should aim to be. Its earliest standard predated the idea of structured programming, although it soon attracted criticism from advocates of that concept— Edsger Dijkstra, in particular, famously hated the language and said its use “cripples the mind.”

To modern eyes, just trying to parse a COBOL program is enough to induce a headache, let alone trying to write a game in it—but, miraculously, icitry manages to get his Wolfenstein 3D-esque project to work. He dodges COBOL’s complete lack of graphical functions by basically treating the game as what he calls a “frame generator”: his code computes the contents of each frame and uses a standard output function to write the results into a simple image format. This is rendered by ffplay—which, yes, is probably cheating, but not even old Leopold would try to write an entire graphics API from scratch in COBOL.

Elsewhere, icitry dodges COBOL’s lack of input management by using the console to input single characters to his game. He doesn’t so much dodge COBOL’s lack of any vector math functions—which are kind of important for a game where the entire gameplay loop revolves around calculating and manipulating 2D movement vectors—as he does just work around them by kinda writing them himself. And then, as if this wasn’t all enough self-punishment, he goes the extra mile by implementing DOOM engine functions like variable ceiling height.

The whole project is a testament to mankind’s ingenuity, resourcefulness, and ability to withstand all manner of self-inflicted punishment. Watching the game run, you’d never guess it was written in a language so manifestly unsuited for the task at hand.

Still! At least it’s not FORTRAN, right? Right?? *smash cut to an Austrian aristocrat at his desk with a copy of The Fortran Automatic Coding System for the IBM 704 and the DOOM source code*

← 一覧に戻る