-
Notifications
You must be signed in to change notification settings - Fork 233
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
Question: is there a way to load the .ne files in the browser? #142
Comments
Look at the internals of nearleyc for how the tool is implemented. I don't know if this is supported, but I imagine you should be able to replicate that with browserify or the likes. |
On the other hand, from reading the linked issue it seems this is an X/Y problem. Why not compile the |
You don't need to compile the files on the client — you compile them ahead of time and use the compiled files on the client. It's kind of like using LESS CSS or CoffeeScript: it works great on the client! |
(Also: HERITAGE looks so cool! I'm a big IF nerd and I love seeing IF generation projects.) |
Thank you @bobbybee and @Hardmath123 for your extensive answers. I insist on client-side compilation, because, in my mind, HERITAGE should not be dependent on any server-side activity. So that, I can edit the code on any machine, and develop the game regardless of whether I have BTW, what's IF? |
IF is short for Interactive Fiction, or text-based adventure games. :-) To clarify, anyone using HERITAGE won't need node, because you can just give them compiled If you insist on being able to develop HERITAGE without node, though, you still have a few options:
What do you think? |
2 or 3 are preferable for me, and 3 is better. That's how I use Babel today. I know it's sub-optimal, but ATM I don't care. Or, if 2 is exposed enough, I could write a Makefile that will 'compile' the code using a Thanks for the great support @Hardmath123 :) |
@swooboo I guess I still don't understand why you are so dependent on the browser. As you said, your usage of Babel is not 'correct' in the sense that it has major performance (and stylistic) implications. Nearley doesn't have this feature setup because there is not a real reason to use it -- it would admittedly be neat for nearley's own documentation, but other than that, grammars are pretty much fixed from the program's launch -- I don't see how this is any different.. By the way, what text editor do you use? |
|
Another idea to consider is the time you take to refresh your browser is worth something, too. Even if you don't choose to use a save-hook or anything like that, you should be able to run a script to run nearleyc / babel / linters / minifiers and then open your browser in a blink of an eye. Maybe even less work! In vim, |
Hey @swooboo — here's a quick online thing I hacked together for you this morning. http://nearley.js.org/www/quick-compiler.html Let me know how it goes. |
Hi. Sorry for taking my time, I don't work on HERITAGE full time. @Hardmath123 - this is very very nice indeed, I'll use it.
@bobbybee - I like your points, you provide truly valid constructive criticism.
Thank you both for the help and constructive criticism! --swooboo |
|
Thanks, I also figured I'd have to do that. I'll give it a go, looks good, thanks a lot for the support. |
Sounds good. Closing for now — but if you have further questions, feel free to ask. |
I'm considering adding a nearley-based parser to one of the projects I work on (HERITAGE). As it stands now, I can't keep it client-side only, and have to compile the
.ne
files server-side, withnode.js
. Is there a way to do this on the client?The text was updated successfully, but these errors were encountered: