Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting up parser from runtime from web-preview #26

Open
lordmortis opened this issue Mar 18, 2018 · 2 comments
Open

Splitting up parser from runtime from web-preview #26

lordmortis opened this issue Mar 18, 2018 · 2 comments

Comments

@lordmortis
Copy link

lordmortis commented Mar 18, 2018

Thanks heaps for this library - it's been really useful in the tool we're working on (Jacquard - a yarn editor/debugger with (eventually) git integration to enable easier multi-writer collaboration on projects)

There's a few bugs with the parser in Bondage, plus @desplesda, @McJones me and some others have been thinking about how the yarn syntax should work in various cases (these discussions have been on the yarnspinner channel in the Narrative Game Dev slack). The other thing that @McJones and @desplesda have done in the main Yarnspinner branch is they are in the process of changing over to an ANTLR-based parsing solution, and the Secret Lab peeps have said that's how they think yarn should be parsed in the future.

The other thing is that Yarnspinner is converting to a different internal format (a bytecode representation) - but they're doing this at runtime. I floated the idea in the slack and @desplesda agreed that ultimatley the run-times would use a bytecode format, rather than the yarn text - which should make for simpler run-times.

Our tool is being primarily written in javascript (as an electron app is an easy way to get cross-platform support happening, plus we can re-use a lot of it if we do a web version) so i've been writing a bytecode output format there, and I've been using your parser and lexer as the basis for that.

I've reached the point where I'd like to make a few changes and I'm wondering if it wouldn't be better to split some of this stuff into seperate projects:
a) something that parses .yarn.txt and .yarn.json files into a defined represenatation and provides debugging information for both parser failure and the later stages (Bondage.js currently does most of this for JS, but will need some updates)
b) something that translates representation above into the runtime bytecode format (i've realised that this format can also easily represent twine/twee syntax as well)
c) something that runs the bytecode in a web-browser and can also provide a debugger (this is a super-useful tool for writers because they don't need to fire up unity or whatever to debug their yarn logic)

We're also trying to build a consensus / get feedback on how the yarn syntax itself should evolve and we'd love your input if you have any time. Again thanks for writing this - it has been super useful!

@hylyh
Copy link
Owner

hylyh commented Mar 18, 2018

Hello! This sounds awesome, glad this project is being of some use!

I'd actually been thinking a while ago about doing a splitup of the project that is similar to what you described there, which I was putting off until there was a usecase for it and here we are!

It's 6:30 in the morning and I'm about to catch a plane to gdc, so I won't be able to put any more thought into this until next week unfortunately. if you're going maybe we could talk there? if not ill get back to you more specifically afterwards

@lordmortis
Copy link
Author

I'm not, but @desplesda and Robert Yang both are and were thinking of having a mini meetup - do you have a way of contacting them? (I've sent an invite to the narrative games slack, but they are both on the twitters as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants