Why no interest in real coding with i7?

This may belong to another section, or maybe off the planet completely, but im ultimately and presently looking for collaborators after all.

Why is there no interest in using i7 for real programming? I showed that with a little help from the outside, its possible to use it to do real work, and man is it cool.

So…uh…am i looking in the wrong circles or something?
any ideas? :ugeek:

What exactly do you mean by “real programming”? At its most basic, using Inform 7 is as much a programming language as Tads 3, just with a different vest, and making - programming - a Cloak of Darkness is elementary.

If you want to do fancier stuff with I7, you can.

Maybe you mean an “abuse” (like a Sokoban or Tetris port - things the language was never meant to handle, but does). I’m pretty sure abuses are just as possible as they were in I6, though maybe harder and less intuitive. Nevertheless, an abuse does not constitute “real” programming, not necessarily.

If you simply mean that I7 is not just a toy and is a powerful programming language that’s been underused… I wouldn’t agree at all, thinking - mostly - of Blue Lacuna.

This question is either incomplete, or not in English.

Judging by koo5’s other posts, I think that by “real,” they mean non-IF. For example, this: https://intfiction.org/t/a-web-app/2602/1

Inform only compiles to virtual machines not used outside of the I-F community. How would you get it to talk to anything else? It’s kinda sandboxed by default.

I suspect you can get away with lots of things using Inform’s ability to read/write to a file, but that would be so inneficcient when compared to using a programming language that’s actually designed to do those things anyway…

to kinda answer: my frustration comes from my goal to make i6 compile to another, ordinary, language. The task is clearly on the limits of my abilities, im slacking off, and have barely finished reading the i6 language manual.

What do you mean by “compile to”? Do you want to translate I6 source code into, say, C source code? Do you want to compile I6 source code into a machine-code executable? I’m not sure what the purpose of either of these would be, other than as a (admittedly pretty interesting but ultimately useless) programming exercise.

I think what’s being asked is, “why no interest in using inform (or a language like it) to make a wide variety of programs?”

It is an interesting idea to use a language that looks more like spoken sentences to try and make computer programs, but for things more complicated than IF games, that gets tricky, and for more detailed programs, the advantages that come from an easy to learn syntax like Inform’s are no longer important.

It’s easier to learn to make an IF game in Inform, but even if a language with a more linguistic syntax existed to make “real” programs as you put it, I would probably still rather use Python.

At the risk of descending into pedantry, I’m not so sure Inform’s syntax is ‘easy to learn’ at all. Yes, it does look easy, but that’s illusory; I’m well past the point when I thought I could rely on raw I7 code without testing it thoroughly.

(So why use it? Well, because it confers other benefits, such as being easy to read and conceptualize in, or being damn fun. A language being enjoyable is nothing to sneeze at.)

I propose that Inform 7’s simplicity is found mostly in reading and understanding code, rather than the writing part.

If you want to learn a high-level language that can create a variety of types of applications, I suggest you look into learning C#. With a visual IDE like Visual Studio or Mono, it’s surprisingly easy to create applications and the coding learning curve is similar to learning Inform. Also, with the right libraries you can create games that you can sell on the Xbox marketplace.

Depends. I’d contend that the ability to read and understand one’s code confers benefits while writing. I still remember struggling with AMOS back during the Amiga days after one evening of programming, and trying vainly to pick up where I left up, all the while wondering what the idiot who wrote that code had even been thinking.

For a big project, clarity and readability pays dividends.

I would definitely recommend the C family (particularly C++), but while C# is legitimately impressive, I’d say it’s too platform specific to Windows machines to be considered truly general.

Not really, there’s always Mono for running C# code on Mac/Linux.

Also these days most software being web-based, you should be thinking about writing code that will run on a server anyway.

Huh. I didn’t know. Thanks.

I’ve thought about this a bit… I7’s rulebook nature seems like it’d be a good fit for the event-driven model that’s common in GUI and network applications. It also has some features like relations (more specifically, the relative clause syntax for stringing together relations) that don’t appear in mainstream languages, and it’d be interesting to see if those end up being widely applicable.

However, I7’s current implementation is not well-suited for this. The I7 compiler is tightly coupled to I6, so if you want to turn I7 into machine code, probably Plan A would be to translate the I6 code to C, or patch the I6 compiler to generate LLVM code. I think it’d be impractical to translate it to Java, C#, or any other language with a strict type system. (Plan B would be to compile to Glulx as usual, then embed a Glulx interpreter into the finished program and come up with some way for it to shuffle requests between the VM and the native library, which would hurt performance but save you a ton of time. This is how Guncho works.)

The Inform library is another issue. Most of the “traditional” Inform library, the IF stuff, is not going to be useful for general-purpose apps and would need to be stripped out. The newer stuff that was added to support I7 features like rulebooks and heap values would still be useful, but for performance reasons you might want to reimplement a lot of it. For example, I7’s memory manager is kind of wasteful and bizarre, and although its regular expression functionality is impressive for being written in I6, in a real app you’d want a fast, standard library like PCRE.

One more issue is I7’s data structures. The ones it has are mostly fine for what they are: tables are like SQL tables, dynamic relations are typed hash tables, lists are typed vectors, indexed text is mutable strings. But there are no trees, linked lists, records/tuples, or even floating-point numbers (yet). The dynamic structures like lists are always copied by value, which is a huge restriction on their usefulness (not to mention wasteful). Objects and tables are the only ways to combine more than one data type in a single entity, but neither of them are dynamically allocated; my extensions address that problem, but only partly.

Also, unless your name is Graham Nelson, you’d have to make all these changes without touching the I7 source code. A lot of them can be done by editing the template files, but the compiler still generates a lot of I6 code programmatically, which puts constraints on how radical your changes to the template and runtime environment can be.

Actually, this suggests a Plan C: don’t directly compile the generated I6 code, just treat it as an intermediate representation. Read everything I7 generates, including comments and the index, to reconstruct the type info that gets lost in translation to I6. Then generate new code based on what I7 already generated, but modify it as you go, rewriting snippets of code to fit your needs regarding performance, readability, types, memory model, linking to native code, etc. Benefits: you could work around nearly every problem above. Drawbacks: it’s a lot of work and it breaks compatibility with low-level I7 extensions (though you likely wouldn’t use those anyway).

So, rather than try to fit existing Inform 7 onto say, a C compiler, it would be easier to take an existing environment like .NET and write an Inform 7-like interpreter onto it from scratch.

An advantage of doing it that way would be you could, for example, code interface things in whatever .NET language you like, then code other segments in your natural language system.

This. And everything vaporware said.

My current project is an English-like general-purpose programming language, but it starts from square one rather than ports Inform 7 in any way. I believe I’m targeting Flash as the initial platform, partly since a mangled Flash program won’t endanger the OS like a .exe might, and partly cause we use Flash at work.

Writing an I7-like compiler from scratch is likely to be hard, because I7 does a lot of things that are hard.

It will probably be easier to attach I7 (or parts of I7) to a different problem domain and environment than to recreate it. But, unfortunately, only after Graham does a source release.

Indeed. And if you skip the hardest parts (e.g. all the predicate logic behind object definitions, conditions, and “now” statements) and simplify the grammar to the point where it can be handled by straightforward parsing techniques, what’s left is not much different from, say, AppleScript.

It’d be easier even before then, I think. The more I think about “Plan C”, the less crazy it sounds – or at least the more it sounds like a couple other crazy things that have already been done.

According to http://en.wikipedia.org/wiki/List_of_CLI_languages, there are numerous Common Language Infrastructure languages that work with the .NET framework. Surely it wouldn’t be too hard to write a CLI version of Inform, or something like it. Wouldn’t that be awesome to have the ability to compile Inform games into standalone applications that wouldn’t require a seperate parser?

Considering the number of projects listed there, I can’t imagine it would be that daunting to explore such a project.