Inform6: Standard Library or PunyInform?

So, I’ve decided to try to learn Inform6, and I’m not sure… should I attempt to learn PunyInform or should I just learn the regular standard Inform library? I know that Puny is meant to generate smaller files which would allow for games to run on older 8-bit systems, but if that’s not something I care about, are there any benefits to focusing my attention on the standard version of Inform6? I’ve noticed a lot of posts about Puny in particular so I wasn’t sure which version had more users (and thus, perhaps, a better support network for getting help when I need it). I did see some talk about the differences but that thread was a couple years old, so I thought I’d do a new post.

Anyway, I would welcome any thoughts people have on this.

3 Likes

If it doesn’t matter if the result runs on old 8-bit machines or not, I don’t think it is important which library you choose. PunyInform is designed to, as long as it don’t compromices 8-bit performance, have the same interface/functionality as the standard library.

The big advantage with Puny is that it have a very active user group and the developers are very quick to respond when support is needed.

Just my five cents…

5 Likes

Yeah, PunyInform has two major benefits over the I6 standard library at this point. One is that it’s smaller, can compile to earlier versions of the Z-machine, and runs better on retro hardware (or emulators). But the other is that it’s under active development and has a very active user base!

Standard I6 doesn’t see much use nowadays. Most of the development being done on it currently is to support I7 instead of for its own sake. You’ll still get help if you ask for it—plenty of people here have been using I6 since the old days, and it is still actively maintained—but fewer are actively working with it than with the Puny library.

5 Likes

You’re thinking of the I6 compiler there. The I6 standard library is not part of I7, and its development is not driven by I7 needs.

It’s true that the PunyInform is under more active development than the standard library. You could say that’s because the standard library is mature and doesn’t need much active work.

PunyInform is designed to, as long as it don’t compromices 8-bit performance, have the same interface/functionality as the standard library.

That is a caveat, though. PunyInform omits some standard library features for the sake of saving space.

(But I don’t have a detailed list.)

4 Likes

There aren’t a lot of differences between the Inform 6 standard library and the PunyInform library, but those differences are significant. No matter which library you use, the DM4 is still the standard reference, even though it is quite out-of-date. If using PunyInform, you need the user manual to see the differences.

The main differences are the included library file names, how the code is organised, differences in the grammar definitions, lots of constants to enable or disable features (to save space) and some omissions from the standard library.

As others have mentioned, PunyInform compiles to a much smaller and faster file. You might think that only matters for old 8-bit platforms, but it also allows web-based games using Parchment to be smaller and therefore faster to load.

The biggest disadvantage of PunyInform is that you can’t compile to Glulx, so you can’t have graphics and sound. If that’s important to you, then use the standard library, otherwise stick with PunyInform. If you need any of the missing features, then you can always adapt the relevant code for that feature from the standard library.

5 Likes

For what matters, for me the core issue in stdlib vs. punyinform rotates about these basic, matter-of-fact, hard data:

punyinform -v5s minimal.inf 
Inform 6 Library Selection Wrapper by David Griffith.
Using Inform version 6.42.
Using PunyInform library.
Inform 6.42 for Linux (10th February 2024)
In:  7 source code files              6196 syntactic lines
  9359 textual lines                258446 characters (ISO 8859-1 Latin1)
Allocated:
  1091 symbols                      719982 bytes of memory
Out:   Version 5 "Advanced" story file 1.240529 (26K long):
     4 classes                           8 objects
    97 global vars (maximum 233)      1358 variable/array space
    58 verbs                           185 dictionary entries
   119 grammar lines (version 2)       228 grammar tokens (unlimited)
    64 actions                          28 attributes (maximum 48)
    26 common props (maximum 61)         9 individual props (unlimited)
 18656 bytes of Z-code                 460 unused bytes stripped out (2.5%)
  5491 characters used in text        4474 bytes compressed (rate 0.814)
     0 abbreviations (maximum 64)      206 routines (unlimited)
  4505 instructions of Z-code         2599 sequence points
  5368 bytes readable memory used (maximum 65536)
 26336 bytes used in Z-machine      235808 bytes free in Z-machine
Completed in 0.019 seconds

and

punyinform -v8s minimal.inf 
Inform 6 Library Selection Wrapper by David Griffith.
Using Inform version 6.42.
Using PunyInform library.
Inform 6.42 for Linux (10th February 2024)
In:  7 source code files              6196 syntactic lines
  9359 textual lines                258446 characters (ISO 8859-1 Latin1)
Allocated:
  1091 symbols                      720790 bytes of memory
Out:   Version 8 "Extended" story file 1.240529 (27K long):
     4 classes                           8 objects
    97 global vars (maximum 233)      1358 variable/array space
    58 verbs                           185 dictionary entries
   119 grammar lines (version 2)       228 grammar tokens (unlimited)
    64 actions                          28 attributes (maximum 48)
    26 common props (maximum 61)         9 individual props (unlimited)
 19096 bytes of Z-code                 496 unused bytes stripped out (2.6%)
  5491 characters used in text        4474 bytes compressed (rate 0.814)
     0 abbreviations (maximum 64)      206 routines (unlimited)
  4505 instructions of Z-code         2599 sequence points
  5368 bytes readable memory used (maximum 65536)
 27272 bytes used in Z-machine      497016 bytes free in Z-machine
Completed in 0.016 seconds

versus:

inform -v5s shell.inf 
Inform 6.42 for Linux (10th February 2024)
In:  7 source code files             10703 syntactic lines
 12852 textual lines                438311 characters (ISO 8859-1 Latin1)
Allocated:
  1641 symbols                      838387 bytes of memory
Out:   Version 5 "Advanced" story file 1.240529 (60.5K long):
     6 classes                          26 objects
   157 global vars (maximum 233)      2480 variable/array space
    96 verbs                           316 dictionary entries
   204 grammar lines (version 2)       339 grammar tokens (unlimited)
   110 actions                          31 attributes (maximum 48)
    48 common props (maximum 61)        50 individual props (unlimited)
 47444 bytes of Z-code                3108 unused bytes stripped out (6.6%)
 15386 characters used in text       12620 bytes compressed (rate 0.820)
     0 abbreviations (maximum 64)      389 routines (unlimited)
 10881 instructions of Z-code         6262 sequence points
  9744 bytes readable memory used (maximum 65536)
 61452 bytes used in Z-machine      200692 bytes free in Z-machine
Completed in 0.149 seconds

and

inform -v8s shell.inf 
Inform 6.42 for Linux (10th February 2024)
In:  7 source code files             10703 syntactic lines
 12852 textual lines                438311 characters (ISO 8859-1 Latin1)
Allocated:
  1641 symbols                      839601 bytes of memory
Out:   Version 8 "Extended" story file 1.240529 (63K long):
     6 classes                          26 objects
   157 global vars (maximum 233)      2480 variable/array space
    96 verbs                           316 dictionary entries
   204 grammar lines (version 2)       339 grammar tokens (unlimited)
   110 actions                          31 attributes (maximum 48)
    48 common props (maximum 61)        50 individual props (unlimited)
 48280 bytes of Z-code                3208 unused bytes stripped out (6.6%)
 15386 characters used in text       12620 bytes compressed (rate 0.820)
     0 abbreviations (maximum 64)      389 routines (unlimited)
 10881 instructions of Z-code         6262 sequence points
  9744 bytes readable memory used (maximum 65536)
 64224 bytes used in Z-machine      460064 bytes free in Z-machine
Completed in 0.031 seconds

that is, will be worth the more z5/z8 elbow space given by punyinform respect the standard lib ?
Personally, I suspect that, esp. under z8, the other limits will be hit well prior of reaching the bytes free limits with both libraries…

HTH and
Best regards from Italy,
dott. Piergiorgio

2 Likes

PunyInform and the standard library differ in how you do some things, like replacing library messages, checking for different directions the player has referred to etc, but this typically doesn’t change what you can do, only how you do it.

Featurewise, for a game in English, I think there are two major features of the standard library which the PunyInform library doesn’t support:

  • Identical objects - the standard library can group together identical objects, and the player can pick up or drop any number of them, e.g. “TAKE FIVE COINS”
  • Perspective and tense - the standard library lets you switch from the standard second person perspective and present tense and all library messages adapt, e.g. “You take the book.” might become “I took the book.”

Neither of these features can easily be added to the PunyInform library, so if you want to use either, you need to use the standard library.

However, included with PunyInform is an example of how to hack the library to support identical objects, in a limited way. This may be good enough for a game where you have say three candles, which the player needs to carry around together, and use in different places, e.g. “GET CANDLES” picks up all candles, “GET CANDLE” will pick up any candle if there are several, but “GET TWO CANDLES” isn’t supported.

Apart from these features: In some scenarios, the standard library is a bit more convenient and powerful, e.g. if the player types “TAKE STATUE” and there’s one object called “statue” and another called “silver statue”, the standard library will assume that they mean the “statue” object, but PunyInform will be confused and keep asking which object they mean. This particular difference is there because implementing this would make the library noticably slower, a bit bigger, and the game will break down completely on some 8-bit platforms, so it’s not a good fit for PunyInform. Instead, you’ll just need to make sure there’s always a way to tell two objects apart by adding a word, e.g. change “statue” to “small statue” and you’re good.

You’re always welcome to the PunyInform community. Should you start your project in PunyInform, and later find that your game really needs the standard library, you’ll still have all the knowledge you’ve acquired regarding PunyInform, and ~95% of it applies for the standard library as well. Changing the source code to work with the standard library isn’t a huge task either. Or you can start with the standard library and later decide to move to PunyInform of course.

4 Likes

Changing the player viewpoint is a matter of 20 mins work at best. I have libraries already done, in case someone needs them. On the train now but iirc I’ve made both 1st person and past tense. They are not tested though, but I can pass them if you will.

Ps: Puny ofc.

Correct. Right now, what I’m doing with the Standard Library is fixing bugs.

4 Likes