[ art / civ / cult / cyb / diy / drg / feels / layer / lit / λ / q / r / sci / sec / tech / w / zzz ] archive provided by lainchan.jp

lainchan archive - /λ/ - 19925



File: 1478235925682.png (1.9 MB, 300x213, tumblr_njmt9tmlzJ1tysz53o1_500.gif)

No.19925

Hi lains,
I have a strange idea that I'd really like to pursue but I need some helping fleshing it out.

The story begins with the README for some AI-centered programming language, developed by a professor at a prestigious research university, apparently cut short for some unexplained reason. However, a very straightforward tutorial is included alongside a working compiler.
The reader is strongly urged to try the tutorial, closely following the code examples. However, when you run the code yourself, it's ouput doesn't exactly match that of the tutorial...
At one point, you try the code
for i in 1..5
print "i = " i
But instead of getting
i = 1
i = 2
...
you get
i = 1
i = 2
i = 3
ca
i = 4 n you
i = 5 hear me?
Something in the compiler itself is trying to talk to you... and as you progress the tutorial, you learn a way to talk back

  No.19926

That's an interesting idea.

With regards to the implementation, your example can be achieved by collecting output in a buffer and inserting your phrase cut into segments inside of it largely at random, but ordered with regards to the segmented phrase.

Other interesting things you could do is having the AI converse with the user when programs interfacing with a sound system are used and the manual warning the user to not connect the AI to the internet, which may eventually become an option, but I would think not immediately.

The language can be capable of introspection and so the AI inserts comments into generated code and on-line documentation.

You should try to give your program language some more interesting syntax, rather than copying Python, although I understand that's simply an example to explain the idea.

You'll also want to look at drunk Eliza: http://danieltemkin.com/DrunkEliza/

  No.19928

this topic seems like a better fit for /lit/ or /cult/.

look into a visual novel engine like Ren'Py or just code it all (and there will be a LOT to write) in your favourite scripting language, being considerate of how you want reader interaction to proceed (command line/GUI/web application).

  No.19929

>>19926
I was envisioning implementing the the "sentience" coded in the runtime, or in the compiler, or both. As the entire thing would be a sort of story, the behavior would be constantly changing as you progress, probably controlled by some sort of "triggers", e.g. for loop, specific IO, maybe interacting with a certain kind of data structure (maybe a queue structure that gets data put into it even though you declared it empty).
The language itself would be completely legitimate and turing complete, albiet simple. The syntax is completely open for discussion.

>>19928
Yeah I thought maybe it would belong on a different board. This would be a legitimate programming endeavor (thus belonging on /lam/), but would definitely require some actual writing / storytelling (not my forte).
Especially, I don't really have an idea for an end-game to this, maybe a "bad ending" would entail deleting the "sentience" from the source code.

  No.19930

File: 1478250160094.png (251.03 KB, 200x200, keep-it-simple-stupid.png)

>>19929
>This would be a legitimate programming endeavor (thus belonging on /lam/)
yeah scrap what I said about other boards lol, you've certainly convinced me.

>The syntax is completely open for discussion.

KISS. you will definitely want to avoid overwhelming your potential audience.

they get bandied about a lot around here but Forth or Lisp are good starting points with both being relatively easy to implement and having desirable metaprogramming features that you can use to steer your narrative. as you might know, Lisp also has quite a bit of history with AI which could be a useful source of narrative inspiration.

speaking of which. having the interpreter driving the narrative as well is a really interesting idea though you will need to be careful trying to keep your abstractions (story and runtime) separate.

in my mind your suggestions (which I think are great) for how the game runtime will work point to Forth. the user sees only a REPL and the stack, while the game engine looks at both of these elements to drive story progression behind the scenes. the embedded Forth REPLs on this tutorial http://skilldrick.github.io/easyforth/ are a good demonstration.

while the story seems secondary for now it will be useful to have a sketch of the overall story and various scenarios in the back of your mind as you work on this because I think they will influence the language development in a positive way by pushing the project away from dry language implementation to fully featured story.

  No.19947

The story sounds a lot like that of TIS-100 (go play it, it's good), but the actually mechanism for revealing that story sounds a lot more interesting. The trick is to actually write a "compiler" for this. That could be rough.

As for the actual language, I recommend a Lisp-type language: a simple one is relatively easy to implement, it's dead simple to parse, and you really aren't focusing on the language so much as the story, so that's a good thing.

  No.19948

File: 1478288253214.png (559.99 KB, 200x143, Cyberpunk2.png)

>>19930
I wholeheartedly agree with KISS, but a problem with Lisp or Forth is that part of what makes them so simple is their absolute bare-bones runtime (e.g. forth has no types, data is just memory cells; the lisp runtime is just lambdas, symbols and pairs). This is great from a language perspective but my goal here is to manipulate the runtime beneath the user, which would be easier to do when we have black-box abstractions that we can make behave differently than expected (like I mentioned before about queues).
Forth may still be the best idea.

>>19947
>TIS-100
Big fan.

>a simple one is relatively easy to implement

I'm confident in my knowledge of compilers so difficulty of implementation isn't really an issue for me, insofar as a more time consuming implementation will drain my motivation (something I've been struggling with lately).

>so much as the story

Unfortunately the PL geek part of me has been more interested in how to implement the internals than thinking up the story, so I really haven't come up with a lot.
I made this thread hoping to be able to brainstorm that a bit more. I'd appreciate any input.

As a start, would it be more intriguing that an AI resides within the compiler, or that a sort of Lain-esque "conscienceness" has been uploaded/integrated into the source?

  No.19949

Well, if this is in a game, you'd be better off with an interpreter, and the virtual machine is what talks to you.

  No.22817

What progress have you made with this? Have you developed the concept further?