0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

htmlライクな言語で、AIとの「設計共有」を可能にする

0
Posted at

概要

AIとコーディングする際、最も厄介なのは「実装そのもの」ではなく
構造の認識ズレだと感じています。

例えば「Playerを持つゲーム」を作るときでも、

AIは実装ベースで解釈する
人間は構造や意図で考える

このズレが積み重なると、後半ほど修正コストが増えていきます。

そこで私は、構造そのものを共有するための中間言語としてPSML(Prototype Structure Markup Language)を提案します。

PSMLはHTMLライクな構文で、
「オブジェクトのプロトタイプ」と「実体の構成」を分離して記述することを目的としています。

プログラムの実装ではなく、まず構造の合意形成を優先するレイヤーです。

<ncs>
// 名前付きコンストラク定義
Player {
	default(x:float=10.0, y:float=0.0);
}

Image {
	player(path:string="./image/player.png", width:int=100, height:int=100);
	slime(paht:string="./image/slime.png", width:int=100, height:int=100);
	dragon(paht:string="./image/dragon.png", width:int=100, height:int=100);
}

Enemy {
	slime();
	dragon();
}
</ncs>
// ※ ncs(Named Constructor Sheet)は外部ファイルとして分離可能な定義領域ですが、PSML内部に直接記述することもできます。

// 実装に使う定義
<Game>//アッパーキャメルはプロトタイプ宣言のタグ、ロワーキャメルは確保するための変数名扱い
	<player single >// singleをつけると1つだけしか持てない
		<Player default >//デフォルトはncsタグ内で定義されたコントラクタを定義している
			<image>
				<Image player />
			</image>
		</Player>
	</plaeyr>
	<enemies enum >// enumをつけると列挙体として扱われる
		<Enemy slime >
			<image>
				<Image slime />
			</image>
		</Enemy>
		<Enemy dragon >
			<image>
				<Image dragon />
			</image>
		</Enemy>
	</enemy>
</Game>

補足

PSMLは現時点では実装を伴わない、
構造共有のための設計思想としての提案です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?