|
BorisTheBrave
|
 |
« on: November 10, 2008, 06:25:32 AM » |
|
Has anyone got anything to say on Inform 7? I know it's only for IF games, but it does seem a really cool new approach to coding. It's got pretty a lot of major programming concepts in there somewhere, but distorted by literary paradigm. Is there anyone other than me who'd love to see the same technology (i.e. rule based declarative natural language) being taken into non-text based games?
|
|
|
|
|
Logged
|
|
|
|
|
isaac
|
 |
« Reply #1 on: November 10, 2008, 06:29:27 AM » |
|
I personally find it painful to code in... It's a cool idea, but you end with the same problem that you get with text adventures: They give the illusion of natural language, but in fact it's just a set number of commands hidden in a vaguely readable sentence structure. A traditional programming language makes everything much more explicit, and it's easier to work with.
|
|
|
|
|
Logged
|
|
|
|
|
Hideous
|
 |
« Reply #2 on: November 10, 2008, 07:47:13 AM » |
|
I like working with it. It's pretty easy to code yourself a good IF in it. My current compo entry, The Museum, is being written with I7!
|
|
|
|
|
Logged
|
In a world where ugly babies rule supreme...
|
|
|
|
Chris Whitman
|
 |
« Reply #3 on: November 10, 2008, 11:26:17 AM » |
|
I also approve of Inform for writing IF.
The thing to remember is that it is in fact a programming language. It's excellently suited for the purpose of developing IF, and you can code complicated relations and such with relative ease, but don't be fooled into thinking it is not a programming language just because it looks like English.
Since the whole thing is defined by a BNF, it is actually exactly as explicit as a traditional programming language. However, the wildly different syntax can be frustrating to new users who are experienced programmers, as it is not based on traditional conventions which normally simplify programming language acquisition.
|
|
|
|
|
Logged
|
Formerly "I Like Cake."
|
|
|
|
BorisTheBrave
|
 |
« Reply #4 on: November 11, 2008, 02:19:46 AM » |
|
It's not "real" BFN, as it has a few extensions. I'm not sure if it's for that reason, or others, but it is quite possible to be ambiguous in the code. The compiler will either guess, or raise a Problem, but that doesn't take away from the fact the underlying English is valid code, but ambiguous.
Examples: The key is in the box. It is blue. Which is blue? The life support unit fits the egg. Support is a keyword, so this might not do what you think. Instead of hitting the tallest elf for the third time: Inform will count the number of times you hit an elf which is tallest at the time of hitting, instead of the general usage of meaning how often you hit the elf that is currently tallest.
NB: I haven't actually tried these
|
|
|
|
|
Logged
|
|
|
|
|
Chris Whitman
|
 |
« Reply #5 on: November 11, 2008, 10:56:21 AM » |
|
Hmm... I flipped through the BNF, but I guess I hadn't really thought too much about it. Now that you mention it, though, with pronouns it obviously cannot be a context-free grammar.
Still, while the language may appear to have ambiguities in reading it, obviously the compiler itself is deterministic and behaves in a predictable, if idiosyncratic, way.
|
|
|
|
|
Logged
|
Formerly "I Like Cake."
|
|
|
|
Gnarf
|
 |
« Reply #6 on: November 11, 2008, 11:28:14 AM » |
|
It's not like ambiguity in the BNFs is totally unheard of in other programming languages though. It is sometimes super-handy and can be dealt with in ways that can't be expressed in the BNF (and sometimes also by redesigning the BNF, obviously).
Not that I know if it causes any real problem in Infrom 7 or anything.
|
|
|
|
|
Logged
|
This is IT -- the missing link in the chain of my existence. Rondo's SPINNING BUDDHA is what I need to make me complete.
|
|
|
|
BorisTheBrave
|
 |
« Reply #7 on: November 11, 2008, 11:35:37 AM » |
|
It would be nightmarish to write a second compiler...
|
|
|
|
|
Logged
|
|
|
|
|
Gnarf
|
 |
« Reply #8 on: November 11, 2008, 12:05:31 PM » |
|
I'm not sure if you're saying that it's nightmarish to write a compiler for Inform 7 or if you're saying that it's nightmarish to write a compiler for a language with ambiguities in its BNF. But like, if the rules for how to deal with the different cases of ambiguity are somewhere to be found, chances are it's not that terrible. If not, you might be writing a compiler for a language you don't know how works, which I suppose is kind of nasty, yes 
|
|
|
|
|
Logged
|
This is IT -- the missing link in the chain of my existence. Rondo's SPINNING BUDDHA is what I need to make me complete.
|
|
|
|
bateleur
|
 |
« Reply #9 on: November 22, 2008, 03:08:56 AM » |
|
I've written some stuff in Inform 7. It's fun. However, I can't say I really like the language style. As a set of libraries for writing IF it's just amazing, but quite often I found myself wishing it had a more obvious formal syntax. Because the thing is, it doesn't really write like English. It reads like English, but that's not the same thing at all! The other big problem is that it doesn't scale well. For example, in a small game it's really cool being able to write stuff like: Understand "pockets" as the battered leather jacket. ...so that when the player writes "examine pockets" it will magically work. But once you write something big you then get horrible namespace clashes, so later on you write: Understand "pockets" as the trendy pink jeans. ...and you're doomed!
|
|
|
|
|
Logged
|
|
|
|
|
BorisTheBrave
|
 |
« Reply #10 on: November 22, 2008, 04:41:40 AM » |
|
Why are you doomed? Because I thought the interpreter was quite smart enough to say "Did you mean the battered leather jacket or the trendy pink jeans?" if both are visible / touchable, and otherwise pick the appropriate one. Or do you mean if you have code referring to pockets?
I see your point, but you example is not a great one. I could write: "Wear the pockets", and it would understand that, despite it being nonsensical. Or worse: "Turn the pockets inside out", where it would do something different from what you mean (if you had the right verb).
|
|
|
|
|
Logged
|
|
|
|
|
bateleur
|
 |
« Reply #11 on: November 23, 2008, 12:42:23 AM » |
|
Or do you mean if you have code referring to pockets? Believe it or not, that's Inform 7 source code!
|
|
|
|
|
Logged
|
|
|
|
|
PaleFox
Guest
|
 |
« Reply #12 on: November 23, 2008, 12:46:04 AM » |
|
The way Inform 7 works IS a good idea, if it was able to read your meanings better. You can phrase things in different ways, yes, but the program is not always able to get your point, and this can get frustrating.
|
|
|
|
|
Logged
|
|
|
|
|
george
|
 |
« Reply #13 on: November 23, 2008, 09:37:29 AM » |
|
One thing I've noticed from reading other people's I7 source is that the style of the programmer makes a huge difference in how easy it is to read the source. Of course this is true of any programming language, but maybe it's more prominent in I7 because the language is so verbose?
|
|
|
|
|
Logged
|
|
|
|
|