Skip to content

Conversation

@takejohn
Copy link
Member

@takejohn takejohn commented Aug 7, 2025

What

数値リテラルを指数表記で記述できるようにします。

Why

Resolves #951

Additional info (optional)

@takejohn takejohn changed the title 数値リテラルに指数表記を追加 enhance: 数値リテラルに指数表記を追加 Aug 7, 2025
@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
src/parser/scanner.ts 95.83% <100.00%> (+7.06%) ⬆️

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@syuilo
Copy link
Collaborator

syuilo commented Aug 8, 2025

これがあるとどのようなときに嬉しいのかしら?

@takejohn
Copy link
Member Author

takejohn commented Aug 8, 2025

これがあるとどのようなときに嬉しいのかしら?

もともとのモチベーションは、JSON5やJSONとの互換性です。
Misskey Playなどにおける実用的なAiScriptとしては、非常に大きい数や小さい数の定数を簡潔に表現できることで、
指数関数的にスコアが増えるゲームの実績システムや物理計算に活用できる可能性があります。

@syuilo
Copy link
Collaborator

syuilo commented Aug 8, 2025

ほむん

@FineArchs
Copy link
Member

これがあるとどのようなときに嬉しいのかしら?

AiScriptはJavaScriptで書かれたオブジェクトをそのままコピペ可能にしたいという理念的には指数表記できたほうがいいですね

@takejohn takejohn merged commit 77cf3fd into aiscript-dev:master Sep 10, 2025
4 checks passed
@syuilo
Copy link
Collaborator

syuilo commented Nov 26, 2025

取り込んだ後になって大変申し訳ないのですが、AiScriptはJavaScript/JSONとの互換性追求よりも、(極端に不便でない範囲で)なるべく仕様がシンプルで実装が軽量な言語にした方が、AiScriptの主な用途・言語のアイデンティティを考えると良いのではないかと思い始めており、当機能については、そこまでスクリプト内で指数表記したい機会は多くないのではないかという独断と偏見で、いったんコメントアウトしておき、将来的に指数表記を行いたいという強い要望が発生した際に改めて提供するかどうか考えるという方針にしようと思います。
(現在存在するほかの機能についても、必要に応じて必要性を見直し、利用される機会が特に少ないと判断したものについては将来のメジャーバージョンで仕様から削除するといった、AiScriptを無駄に太らせないためのメンテナンスはするべきなのかなと思います)

syuilo added a commit that referenced this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

指数表記

4 participants