Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

structure-of-arrays パターンを見やすくする #34

Open
vain0x opened this issue Jul 15, 2019 · 1 comment
Open

structure-of-arrays パターンを見やすくする #34

vain0x opened this issue Jul 15, 2019 · 1 comment

Comments

@vain0x
Copy link
Owner

vain0x commented Jul 15, 2019

structure-of-arrays パターンは常用されている (& 推されるべき) なのに knowbug で見づらいというデメリットがある。

備考: structure-of-arrays (SoA) とは複数の配列を使ってオブジェクトの配列を表現する技法。例えば平面上に複数の点があるとき、i 番目の点の x, y 座標をそれぞれ配列 xs, ys の i 番目(xs(i), ys(i)) に入れるような方法。

  • どの配列が論理的に組になっているか knowbug には分からないので、ユーザーに何らかのヒントをもらう必要がありそう
  • SoA になっている配列群に対して、現在のモジュール変数と似たような表示をするノードを追加する、という仕組みがあると便利そう
  • SoA 以外の場合でも、例えば RDB のビューオブジェクトのようなものを定義できたら嬉しい
@vain0x vain0x added this to the いつか milestone Jul 15, 2019
@vain0x
Copy link
Owner Author

vain0x commented Jul 24, 2019

  • 案1: 特定の名前を持つ変数群を SoA とみなす。同じモジュールになる変数群で、名前の先頭のK文字以上が一致して、配列の長さが同一であるものは SoA とみなす。例えば以下のスクリプトでは pointx, pointy を SoA とみなす。
dim pointx, 10
dim pointy, 10
pointn = 10 // pointx と長さが違うので SoA に含まない

#module
dim pointw, 10 // pointx と属すモジュールが違うので SoA に含まない
#global

@vain0x vain0x changed the title structure-of-array パターンを見やすくする structure-of-arrays パターンを見やすくする Jul 24, 2019
@vain0x vain0x removed this from the いつか milestone Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant