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

IE-0018: Use options and kit configuration #18

Merged
merged 1 commit into from
May 2, 2023

Conversation

zedlopez
Copy link
Collaborator

@zedlopez zedlopez commented May 2, 2023

No description provided.

@zedlopez zedlopez changed the title gratuitous whitespace edits to create PR #18 for discussion IE-0018: Use options and kit configuration May 2, 2023
@curiousdannii curiousdannii merged commit 9fbc4e9 into ganelson:main May 2, 2023
@zedlopez zedlopez deleted the ie-0018 branch May 2, 2023 21:45
@zedlopez
Copy link
Collaborator Author

zedlopez commented May 3, 2023

Turns out everything I was thinking of asking about when I created the discussion PR is actually already addressed in the proposal, so I'll just say: this looks like a really nice improvement to use option organization.

@ganelson
Copy link
Owner

ganelson commented May 3, 2023

This is all so new that the paint is still wet on it, but I'm liking it so far.

I don't know if you have a convenient way of searching your archive of I7 extensions seen in the wild? It would be interesting to extract the Use option... translates as... sentences found in them, and see what people are actually doing. I'm asking because I'm not sure how rapidly we should deprecate the old Use option... syntax, i.e., how soon we could look towards removing (- ... -) as a possible way to express it. If it turns out that almost all of the sentences anybody ever uses always take these forms:

Use X translates as (- Constant IDENTIFIER = VALUE; -).

Use X translates as (- Constant IDENTIFIER; -)

...then I could sneakily handle those without recourse to I6 insertions, just by parsing them directly, and that would make it less painful to withdraw the more general use of (- ... -) here.

@zedlopez
Copy link
Collaborator Author

zedlopez commented May 3, 2023

I had already looked, actually... there's one in the built-ins

Emily Short/Locksmith.i7x:Use sequential action translates as (- Constant SEQUENTIAL_ACTION; -).

and many in the 10.1 branch of the friends Repo (nearly the same as the 10.1 public library):

Aaron Reed/Small Kindnesses-v13.i7x:Use no normal movement tricks translates as (- Constant NO_NORMAL_MOVEMENT_TRICKS; -).
Aaron Reed/Smarter Parser-v16.i7x:Use empty Smarter Parser rulebook translates as (- Constant NO_SMARTER_PARSER_RULES; -).
Aaron Reed/Smarter Parser-v16.i7x:Use normal blank lines translates as (- Constant USE_NORMAL_BLANK_LINES; -).
Aaron Reed/Smarter Parser-v16.i7x:[Use no comma-based orders translates as (- Constant USE_NO_COMMA_ORDERS; -).
Aaron Reed/Smarter Parser-v16.i7x:Use normal lonely noun behavior translates as (- Constant USE_NORMAL_LONELY_NOUN_BEHAVIOR; -).
AW Freyr/Hybrid Choices-v7.i7x:Use cyoa examining translates as (- Constant CYOA_EXAMINING; -).
Emily Short/Measured Liquid-v6.i7x:Use no trace amounts translates as (- Constant TRACES_OFF; -).
Emily Short/Measured Liquid-v6.i7x:Use variable sip size translates as (- Constant VARIABLE_SIP; -).
Emily Short/Measured Liquid-v6.i7x:Use mixed liquids translates as (- Constant MIXED_LIQUIDS; -).
Emily Short/Modified Exit-v6.i7x:Use sequential action translates as (- Constant SEQUENTIAL_ACTION; -).
Emily Short/Postures-v2.i7x:Use posture visibility checks translates as (- Constant POSTURE_VISIBILITY_CHECKS; -).
Emily Short/Facing-v11.i7x:Use sequential action translates as (- Constant SEQUENTIAL_ACTION; -).
Jesse McGrew/Hypothetical Questions-v5.i7x:Use hypothetical output length of at least 256 translates as (- Constant HYPO_CAPTURE_BYTES = {N}; -).
Zed Lopez/Inquiry-v4.i7x:Use restart y/n translates as (- Constant RESTART_YN; -).
Zed Lopez/Beta Test-v1.i7x:Use manual transcript start translates as (- Constant DONT_AUTOSTART_TRANSCRIPT = 1; -).
Zed Lopez/captured action.ni:Use maximum capture buffer length of at least 256 translates as (- Constant CAPTURE_BUFFER_LEN = {N}; -).
Zed Lopez/Screenreader-v2.i7x:Use screenreader query translates as (- Constant SCREENREADER_QUERY; -).
Zed Lopez/Screenreader-v2.i7x:Use simple spelling features intro translates as (- Constant SIMPLE_SPELLING_INTRO; -).
Zed Lopez/Screenreader-v2.i7x:Use no status bar with screenreaders translates as (- Constant NO_SCREENREADER_STATUSBAR; -).
Zed Lopez/Unit Tests-v7.i7x:Use test automatically translates as (- Constant TEST_AUTOMATICALLY; -).
Zed Lopez/Unit Tests-v7.i7x:Use quit after autotesting translates as (- Constant QUIT_AFTER_AUTOTESTING; -).
Zed Lopez/Unit Tests-v7.i7x:Use write test results to file translates as (- Constant WRITE_TEST_RESULTS_TO_FILE; -).
Zed Lopez/Unit Tests-v7.i7x:Use don't report passing tests translates as (- Constant DONT_REPORT_PASSING_TESTS; -).
Zed Lopez/Unit Tests-v7.i7x:Use test quietly translates as (- Constant TEST_QUIETLY; -).
Eric Eve/Text Capture-v8.i7x:Use maximum capture buffer length of at least 256 translates as (- Constant CAPTURE_BUFFER_LEN = {N}; -).
Mike Ciul/Effective Infinity-v1.i7x:Use maximum counting number of at least 4 translates as (- Constant MAX_FINITE_INT = {N}; -).
Mike Ciul/Autotaking-v1.i7x:Use sequential action translates as (- Constant SEQUENTIAL_ACTION; -).
Gavin Lambert/Title Page-v1.i7x:Use hidden title page translates as (- Constant Hide_title; -).
Gavin Lambert/Title Page-v1.i7x:Use left aligned title page translates as (- Constant Left_align_title; -).
Gavin Lambert/Title Page-v1.i7x:Use art in title page translates as (- Constant Title_art; -).
Juhana Leinonen/Achievements-v1.i7x:Use persistent achievements translates as (- Constant PERSISTENT_ACHIEVEMENTS; -).
Juhana Leinonen/Debug Files-v2.i7x:Use debug files translates as (- Constant USE_FILE_DEBUGGING; -).
Juhana Leinonen/Reversed Persuasion Correction-v2.i7x:Use silent persuasion correction translates as (- Constant SILENT_REVERSING; -).
Jon Ingold/Far Away-v5.i7x:Use far away extension translates as (- Constant FARAWAY; -).
Chris Conley/Threaded Conversation-v9.i7x:Use hard cache translates as (- Constant HARD_CACHE; -).
Erik Temple/Extended Debugging-v2.i7x:Use initial intensive debug tracing translates as (- Constant INIT_ALL_TRACE; -).
Erik Temple/Extended Debugging-v2.i7x:Use initial brief debug tracing translates as (- Constant INIT_RULE_TRACE; -).
Nathanael Nerode/Large Game Speedup-v6.i7x:Use static object grouping translates as (- Constant STATIC_OBJECT_GROUPING; -).
Nathanael Nerode/Nathanael's Cookbook-v6.i7x:   Use command debugging translates as (- CONSTANT COMMAND_DEBUGGING; -).
Nathanael Nerode/Nathanael's Debug Tools-v3.i7x:Use startup rules tracing translates as (- CONSTANT STARTUP_RULES_TRACING; -).
Nathanael Nerode/Neutral Standard Responses-v5.i7x:Use parser error debugging translates as (- Constant PARSER_ERROR_DEBUGGING; -);
Nathanael Nerode/Neutral Standard Responses-v5.i7x:Use traditional can't see any such thing translates as (- Constant TRADITIONAL_CANT_SEE; -).
Nathanael Nerode/Compliant Characters-v5.i7x:Use command debugging translates as (- CONSTANT COMMAND_DEBUGGING; -).

@ganelson
Copy link
Owner

ganelson commented May 3, 2023

Thanks: that's very helpful, and makes up my mind to be slightly more aggressive about deprecating the old feature. What I've implemented today is that simple definitions of the kind in the list above will all continue to work as always, but in fact by being directly parsed to work out their intentions: i.e. if Inform can see that somebody just wanted to define a constant, then it goes ahead and does that, without injecting I6 code. More complicated definitions are rejected. This removes the code path from the compiler which creates Inter splat nodes from these definitions, which is a welcome simplification internally. Anyway, see the new section of the proposal on deprecation, which I hope is a reasonable policy line to take.

I've replaced the line in Locksmith with

Use sequential action translates as a configuration flag.

which turned out to be the only change needed: Locksmith, tellingly I think, wasn't actually using the constant SEQUENTIAL_ACTION at all, and was creating this meaningless value just to satisfy the old syntax.

However, doing this did bring to my attention that chosen and unchosen, my shiny new adjectives, in fact already existed! But were called active and inactive. One could argue which wording is better, but active and inactive are already used in the wild, so let's stick with those. I've therefore removed chosen and unchosen again, saving (a very small amount of) memory.

@zedlopez
Copy link
Collaborator Author

does this leave any recourse for access to kits' constants at assertion time without writing a kit oneself?

I don't think it's outré to want to get one's hands on MAX_POSITIVE_NUMBER (which I see is now compiled directly into interb without occurring in the .i6t files. hunh).

@ganelson
Copy link
Owner

MAX_POSITIVE_NUMBER is a so-called "architectural constant", which means that the linker makes it available everywhere and with the same value everywhere: they basically specify things to do with the size of numbers in the current runtime architecture. See the function LargeScale::make_architectural_definitions in the building module. There are currently only ten such constants:

CHARSIZE
WORDSIZE
NULL
WORD_HIGHBIT
WORD_NEXTTOHIGHBIT
IMPROBABLE_VALUE
MAX_POSITIVE_NUMBER
MIN_NEGATIVE_NUMBER
TARGET_ZCODE
TARGET_GLULX

with the latter two being either-or.

@curiousdannii curiousdannii added the formal-proposal A formal proposal that has been accepted for consideration by the core Inform team label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formal-proposal A formal proposal that has been accepted for consideration by the core Inform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants