Lamp is just a hobby language I’m playing with. I got Cloak of Darkness running (reasonably complete I think), and I wanted to share it with y’all.
ETA: Here’s the source.
Lamp is just a hobby language I’m playing with. I got Cloak of Darkness running (reasonably complete I think), and I wanted to share it with y’all.
ETA: Here’s the source.
The initial commit is around (I guess) 1000 lines over a dozen or two files, was that code developed before creating the repository?
I am not an AI hater (though I prefer not to use it myself), however I think that when AI has been used in a significant amount to create something, that usage should be disclosed.
Writing 1000 lines before creating a repo doesn’t strike me as particularly odd, especially for something that started as an experiment. In any case, @rileypb was very transparent about using AI coding assistance to make fweep, so I don’t see any reason to expect him to be less transparent here.
@rileypb , can you tell us anything about the language? From skimming the samples it looks like a rules-based engine like I7 or Dialog, with a syntax that’s somewhat reminiscent of Gruescript?
Ahh I see. Sorry if I went off-topic.
No, you’re right. I neglected to say I used Claude to develop this project.
The goal is indeed to imitate Inform 7 as much as possible (rulebooks and relations for instance) but with a programmer-ish syntax. To which you might rightly say “well, why not I6 or Dialog?” I don’t really like the syntax of I6 and I find Dialog impenetrable. I also wanted to experiment with getting away from the Z-machine/Glulx – Lantern (the compiler) emits JavaScript which can be bundled into a web page or (on the roadmap) an Electron app by Lighthouse (the bundler).
The syntax is heavily Pythonic, but with type checking. My favorite bit of syntax is relation queries: connects foyer _ ?all selects all rooms that connect to the foyer in any direction.
Full disclosure: I’m not really all that knowledgeable about language design, so I’m letting this take me where it wants to go, which is why I’m describing it as a “hobby project” and not really something I’m pushing as an alternative to I7. But it would be nice to ship a game for IFComp 2027 using Lamp (the project name).
Me too. I really wish someone would make an “explain like I’m 5” tutorial for it.
I’ll probably stick to
either (a) Tads3
or (b) writing an IF from scratch
but Lamp’s syntax looks simple and powerful. Nicely done.
I’ll add it to the roadmap! That seems like something the documentation should include.
Back on-topic: I see a lot of parser-IF-specific features in the Cloak of Darkness source, like specifying a start room. How much of this comes from the standard library and how much is hard-wired into the compiler?
There are four layers actually – the compiler (Lantern), the JS runtime library (Lamplighter), and two libs written in Lamp itself: lib/sys, which exists mostly to declare native (JS) functions available to any Lamp program, and lib/advent, which is analogous to I7’s Standard Rules.
That said, there are currently a number of leaks between them that I’d really like to iron out. It’s difficult to keep IF from leaking into the compiler without allowing the compiler to be extended by libs, which I imagine could be done, but I haven’t explored the possibility. For instance, action (properly an IF concept) has leaked into the compiler for syntactical reasons – it’s a reserved keyword. Now I’m wondering if that’s necessary… let me think about it for a while.
So the answer is, most of it comes from lib/advent with some smelly bits that have sneaked over and keep me awake at night.
A couple data points on this:
So all three routes are viable. It’s up to you which route you want to take.
It is a compiler for making IF, isn’t it?
Why try to force it to be a general purpose language with no IF-isms?
So that you can change your IF world model or parser without needing to do a new compiler release.
Right. But every time you introduce a special syntax for a part of your world model, you’ve tied the two together more tightly. It’s a tricky line to walk.
Actions are important, it makes sense for them to be part of the language. Looking at your lib/advent, I’m not sure how else that code could work without them.
Dialog can get away without having actions as values, since it has lists which can represent them fairly naturally, and the language itself makes matching against actions (or any list) easy.
True re Dialog, but I6 and ZIL don’t really have actions as values at all—in both of them (not coincidentally), an “action name” (as I7 calls it) is just an enum, and the parameters are stored in globals. The only part the compiler needs to care about is creating a special data table for the library to process, and then the rest is handled entirely by library code.
(I6 also has syntactic sugar like <<Action noun>> and special switch statements, but how those work is implemented in the library. A non-IF project could make that syntax do something else unrelated to parsing actions.)
Yeah that’s correct, I’m talking more about representing a complete action, including the objects involved.
In ZIL and I6 those objects are just in global variables, which works well enough, but is not as elegant as Dialog.
Cloak of Darkness in French: Manteau de l obscurite by Roger Firth
Still needs a little polishing, but it works in the meantime.
Since you are using AI, did the AI simply replace all the text to be in French? I’m presuming as much because I saw a Claude.md command file in the repo. Does everything else work the same? Please tell. Can you explain what Claud.md does? I looked at it and am curious.