Open luckytyphlosion opened 10 months ago
Command name styling: PascalCase
Entry-point label styling: PascalCase
Use local labels: No (as eventually we'll want to be able to use gcc)
Within-subroutine label styling: _UnderscorePrefixPascalCase
(would be happy with PascalCase_WithPascalCaseSubLabel
as well)
PascalCase
(fine with snake_case
)PascalCase
(fine with camelCase
)PascalCase
(fine with camelCase
, as in (2)).There is no reason to mandate subroutine prefixes on labels within the subroutine, as individual sequences are separate files in Gen4; every label within a single file is implicitly static, so the prefix is wholly unnecessary. You can have Loop
as a label within as many different subroutines as you want, so long as they are hosted within separate files.
My choices for mirroring pokeemerald's style:
Command name styling: alllowercase
Entry-point label styling: PascalCase
Use local labels: No
Within-subroutine label styling: PascalCase_WithPascalCaseSubLabel
A few things I should mention:
We should also note that, technically speaking, labels are implicitly local in DS scripts; they're individual files within an archive, not a collection of scripts stitched together and then compiled.
Command name styling: gods_chosen_casing
(pokeemerald was a mistake)
Entry-point label styling: LuckyMoment
(I hate it but why is it even up for debate)
Use local labels: Are you sure both assemblers are compatible enough anyway? Stick to whatever mwasmarm supports for the time being.
Within-subroutine label styling: KeepItConsistent_YouFuckingMong
(again, whole lotta words for a choice that was already made)
Are you sure both assemblers are compatible enough anyway? Stick to whatever mwasmarm supports for the time being.
Only matters for trainer AI, all other scripts are assembled and then extracted as binary anyway.
I wasn't talking about object file compatibility, using a different assembler for different things is a mess.
pfero — Today at 12:49 AM
Also re local labels Does mwasmarm support gas-style numbered labels? As in
1: thing 1f @jumps forward thing 1b @jumps back 1:
If so use those tbh
Seems like current consensus is probably:
PascalCase
PascalCase
PascalCase_WithPascalCaseSubLabel
We have no consensus on (4).
This issue has had no activity for 60 days and will be marked stale. If there is no further activity, it will be closed in 30 days.
Script/Bytecode styling
Probably don't need to explain what scripts are (e.g. trainer AI scripts, battle scripts, event scripts (if they're even called that in Gen 4)).
Shorthand for options are in the format., e.g. for
snake_case
local labels, write3a.2
. But it's always good to mention what the option is anyway.Example format for what styling you want
Command name styling:
PascalCase
Entry-point label styling:PascalCase
Use local labels: No Within-subroutine label styling:_UnderscorePrefixPascalCase
Copypasteable version:
1. There is no consensus for command name styling
Option 1:
PascalCase
Option 2:
alllowercase
Option 3:
snake_case
Option 4:
camelCase
2. There is no consensus for styling for "entry-point" or "subroutine" script labels
Option 1:
PascalCase
Option 2:
snake_case
Option 3:
camelCase
Option 4:
_UnderscorePrefixPascalCase
Note: Technically shouldn't be done because_
prefix means a symbol is reserved. This should only matter for Trainer AI scripts which are linked with C files.Suggest more options in the comments.
3. There is no consensus for "within-subroutine" labels
This issue is a bit more complicated because it depends on whether you use mwasmarm or not. mwasmarm has true local label support, where a label goes out of scope after a non-local label, for example:
mwasmarm pros:
mwasmarm cons:
GNU assembler pros are the reverse of mwasmarm pros
GNU assembler cons (not mentioned above):
#define
s3a. If using local labels (mwasmarm assumed/forced)
Option 1:
@camelCase
Option 2:
@snake_case
Option 3:
@PascalCase
3b. If not using local labels
Option 1:
PascalCase_WithPascalCaseSubLabel
(impliesPascalCase
for entry-point label)Option 2:
PascalCase_withCamelCaseSubLabel
(impliesPascalCase
for entry-point label)Option 3:
PascalCase_with_snake_case_sub_label
(impliesPascalCase
for entry-point label)Option 4:
_underscorePrefixCamelCase
, just try to avoid label conflictsOption 5:
_UnderscorePrefixPascalCase
, just try to avoid label conflictsOption 6:
_underscore_prefix_snake_case
, just try to avoid label conflicts