Inform 7: An Added Layer of Complexity

All I can say really is “practice makes perfect”. I was always more of a C++, C#, and web programming dude before I came to find Inform. Wasted countless hours just trying to figure out what syntax the compiler wanted or (even worse) how to word things correctly. After a while of doing it though it sort of comes natural… though I know I’m probably still wasting many lines of code that could be cleaned up if I didn’t rely on basic algebra so much when programming :laughing:

A friend of mine with a bachelors in computer science basically told me that he prefers TADS over Inform for this reason. Says TADS is more of a “programmer’s IF language” to him. shrug

Wait… what?

I probably shouldn’t say anything at all, but I can’t resist… :confused:

I can see two reasons why people say that:

  1. TADS is a more consistent language. Its complexities are in the libraries and the basic tools it provides don’t require hours and hours of learning and confusion. Fair enough, especially if you’re the kind of programmer that doesn’t mind learning how to use lots of libraries.

  2. TADS is a more traditional language. It’s strongly object-oriented, and doesn’t have any of this newfangled imperative/declarative/predicate hoo-hah. To make this claim, however, you have to limit your definition of “programmer” to someone who isn’t really interested in computer science… or in learning new computer languages.

I7 is the Perl of IF languages. TADS is the Java of IF languages. When the Python and Ruby of IF languages show up, please let me know.

Uh, I was kinda wondering about that too… Hope you’re ok!

I heard this comparison a lot before learning TADS 3, and it actually kept me away from the language since I never warmed to Java.

I think it is not accurate, or at least the salient features of Java - massive swathes of boilerplate and EnterpriseStyleVariableNames - are nowhere to be found in idiomatic T3.

TADS 3 has:

  • Macros
  • First class functions
  • Anonymous functions
  • Strong dynamic typing
  • Prototype-based inheritance

I would call it a multi-paradigm language that supports both functional and object-oriented styles. The sort of language that’s somewhat fashionable at the moment, in fact. The dynamic compilation features in 3.1 push it squarely into “not Java” territory.

IMO Inform 7 is more like the Haskell of IF languages; it is as genuinely innovative as it is unorthodox; for the uninitiated, the major challenge is getting your source code past the compiler.

I could see calling I7 the “academic’s IF language” on those grounds, to the extent you accept that as a neutral term. It is not unfair to call T3 the “programmer’s IF language” by way of contrast, though of course programmers use I7 (by definition), and in fact T3 is not bereft of design choices that might interest an academic.

To me (and I think I’m decidedly in the minority here), the fact that I7 works differently than most traditional programming languages is precisely what makes it usable for me. Prior to working with I7, the extent of my programming experience was a “bytes for troglodytes” introductory course in college in which we learned to say “hello, world” in WATFIV (this was about 35 years ago), and to me “C” refers to the grade I probably got in the course and Java refers to the hot brown liquid in my cup. My mind just does not work in a way that takes well to traditional programming languages, and as a practical matter if those were the only choices I would not be writing IF. I7, although it clearly not just standard English and requires a bunch of playing around to learn what works and what doesn’t, is nonethless far more consistent with the way my own mind works and far more “comfortable” for me. It allows people like me, who have ideas but don’t have a programming background, to produce a functional piece of IF.

I can understand why I7 is frustrating for those who do think more in traditional programming terms, but I think its great that there’s something available that is comfortable for the rest of us.

Robert Rothman

Some of us think it’s great.

We all think it’s great. That’s why we use it. But some of us also find some of the “conveniences” (Personally for me, the tab thing makes me crazy) a little difficult to get used to.

Yes, there are differences between I7 and TADS. My question, though, was regarding an IDE for I7. I hope that error reporting in I7 is going to improve. From the standpoint of “the rest of us”, I don’t need to be told “That’s like saying an apple is an orange”. I need to know that I have a semicolon on line 472 instead of a period.

I know that there are things to learn and adjust to. Like I can’t define a piece of furniture for a room before I’ve defined the room. I understand why, but… I don’t like it. And I struggle with organizing things like this.

I was just wondering if anyone had considered an IDE for “the rest” who are struggling with the syntax. At least in the beginning, until we complete our crucible and are fully baptized in the gospel of I7. Or maybe for those people who just work better with more pointy-clicky.

I guess it depends how you define “traditional,” as well. I wasn’t counting among those people programmers who spend their spare time thinking up schemes for a 100% rule-based programming language…

But back to the topic: I could imagine an IDE where you go into the World index and create rooms and objects and set their properties and connect them with relations. But the thing for me is that’s the EASY part of I7. The hard part is getting things to behave in special ways, and I can’t see a connect-the-boxes GUI doing that for you.

It would be nice to be able to drag things around the World index so they look nicer, though.

This rings so true. Check this out for example.

Does that make T3 the Scala? :wink:

I’ll take that challenge.

Not promising results… Just that I’ll take the challenge. :slight_smile:

Okay then! I’d love to see that.

I have a hazy memory of the old Mac OS IDE - pre-OSX, not CodeWarrior but the free one. I think it was for creating dialog boxes but it might have been something else. It had a bunch of checkboxes and entry fields, and as you set them, it would change the line of code that would be written. Does anyone remember more details? I know we’ve got some long-time Mac programmers out there…

I really liked Scala until I started using generics, where type inference breaks down and you’re forced to annotate everything.

[spoiler]Scala:

def compose[T](f:(T)=>T,g:(T)=>T):T=>T =
{
    (x:T)=>f(g(x))
}

T3:

compose(f,g) { return ({x: f(g(x))}); } [/spoiler]

There are definite similarities, but static vs. dynamic typing makes functional constructs a lot less appealing.

Thirded.

The “practical programmer’s” language? The “work-a-day programmer’s” language? Something like that. As opposed to the programmer who’s interested in languages for their own sake.

Scala with generics looks a lot like C#.

XCode, formerly ProjectBuilder, had a sticks n’ springs way of constructing GUIs, and used the same property-setting window that Borland pioneered with Delphi in the late 90’s.

But to answer the original poster, if you want to make IF with GUIs there are quality authoring tools other than Inform & TADS which allow that methodology. But I am surprised that someone who can AJAX has difficulty with compiler errors of that sort. All languages have an initial curve until you understand what each error message “really means”. I have a short list of C# error messages with “what it really means by that” explanations in a text document somewhere around here. There’s a popular one involving an inability to chain struct assignments the way proper classes can be done, for example.

However, I think someone did make an attempt at generating I7 from some other tool, though I can’t remember off the top of my head who or how or why. Um, try searching this I7 forum’s back messages over the past year or two?

Well, I don’t personally AJAX. But I’m not above borrowing that part heavily from those who do. :slight_smile:

We’ve beaten the error messages to death. Maybe I gave a bad example. Situations I’m talking about crop up when you forget some piece of punctuation somewhere, but it doesn’t actually choke the compiler until several lines (or blocks) of code later. So you’re left looking at a piece of code that is generating an error caused by something completely unrelated in a complete different part of the code.

Not saying it would be hugely successful. Not saying you could use it to write complete, complex games. (Not saying you couldn’t.) Just saying that maybe it would be useful for framing a game or ironing out the tricky bits.

I might go back through the forums to see what I can find about this archaic tool to which you make reference. It would have to be on a weekend during some heavy drinking, as I can’t think of a search function that I hate worse than this one. May try to bribe Google for some assistance.

Are you maybe thinking of Juhana’s I7 Thing Creator?

That’s a pretty good bet.

That’s something of a tautological problem: if the compiler could definitely know a punctuation mark was elided, then it didn’t need the punctuation mark to flag the spot in the first place.

Ah, I believe I was. Good memory.

Unless there was a lot of redundancy built into the syntax.

There may be programming languages designed to be redundant about syntax in a way that makes it easy to track down punctuation errors. However, I can’t think of any off-hand. (I6 isn’t one; neither is C, Python, Java… I remember my very first Pascal class, which was punctuated by repeated shrieks of “don’t put a semicolon before an ELSE!”)

(Javascript was originally intended to be resilient about missing semicolons, a terrible idea which is still causing problems today.)

I7 is somewhat more redundant than average, because it uses both indentation and semicolons for structure. (If you choose to use the indentation code form.) And (like some languages, but not all) it looks for different syntax inside and outside of code blocks. This means that it can detect most indentation errors and semicolon/period errors. But, obviously, not all of them; and it doesn’t have enough information to fix your code for you.

(Unless someone wants to quote an I7 case that generates an unusually good problem message. My tests mostly turn up either “But the tabs here seem to be misaligned, and I can’t determine the structure” or “the punctuation here ‘:’ makes me think this should be a definition of a phrase and it doesn’t begin as it should”.)

Now that that has been brought up, maybe a couple of words about it might be in order: First the disclaimer. it’s outdated, slightly buggy and the JavaScript behind it is just nauseous to read (I was just beginning with JS programming back then). It was made for an older I7 build and the syntax of some things and some default messages have since been changed. Secondly, one of the goals for that tool was to make it easier to see which default messages were inappropriate for the item in question so that they could be changed. The Object Response Tests extension later replaced that function and IMHO is much more better suited for the task.

The #1 problem with generators such as the Thing Creator and tools that turn transcripts into playable games is that writing a game is an organic process where you typically start with just the basic functionality and gradually add to it as you go on. These kind of tools assume that you have everything all thought out and that you actually know right from the start what to put in all the fields in the generator’s forms. (In project management terms you could say that they expect the process to follow a strict waterfall model.) I do think these kind of generators could be useful (think Adrift or Quest), but they really must be able to modify existing code so that you don’t have to make the exact final implementation right then and there.

I was annoyed by this (the vague syntax error reports) as well in early days but it’s the kind of thing I only get caught up a few times before you figure it out. In general I find i7’s error messages to be more useful than those of other languages. After using it over the past year the only behaviour that still bothers me is how picky i7 is about its various grammars – compared with how unpicky I believe it could be (perhaps based on faulty knowledge of the underlying challenges in resolving ambiguity, but I just intuitively feel that there is tons of room for improvement there).

Paul.