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

improve in-browser usage #186

Merged
merged 6 commits into from
Jan 27, 2019
Merged

improve in-browser usage #186

merged 6 commits into from
Jan 27, 2019

Conversation

valq7711
Copy link
Collaborator

No description provided.

@valq7711 valq7711 requested a review from atsepkov December 20, 2018 22:22
@atsepkov
Copy link
Owner

Sorry for the ignorant comment, can you explain what exactly this achieves? Better compatibility with requirejs? Also, would it be better to check for the last declared item in init_mod rather than the first one (NATIVE_CLASSES) in case something causes the function to crash/terminate prematurely? Although I guess if it's a syntax error it will fail at compile time anyway.

@valq7711
Copy link
Collaborator Author

Hi!
As you have seen, I develop funny in-browser IDE, so It all for in-browser compilation.
Usually (meaning Node.js), you start Rapydscript per file, but in browser Rapydscript runs once, and then you call only compile - it is the same as Node.js run rapydscript file1 file1 ...
The problem is that parser's static objects are not cleaned before the next compilation and contain 'trash' from the previous one (issue#175).
Also, in some cases it is necessary to compile something during compilation of another one (i.e. recursively) - to allow this I add factory() that produce an independent clone of RS.
NATIVE_CLASSES is used to detect that parser was initialized (it may be any of objects that are initialized by init_mod), - OK, I will replace it with STDLIB.

It seems to be all right with my PR, but I worry about any side effect, so I would like you to have a look.

Sorry for the ignorant comment, can you explain what exactly this achieves? Better compatibility with requirejs? Also, would it be better to check for the last declared item in init_mod rather than the first one (NATIVE_CLASSES) in case something causes the function to crash/terminate prematurely? Although I guess if it's a syntax error it will fail at compile time anyway.

@amigrave
Copy link
Contributor

Hi @valq7711 and sorry for polluting your PR but your IDE project seems interesting, is it an open source project ? If so would you mind sharing a link ?

@valq7711
Copy link
Collaborator Author

Hi @amigrave!
Yes, it will be an open source project, this is a demo and here is a short description.
Now I am combing the code to make it clear and modular, I plan to complete this work on holidays and upload it to github.

@amigrave
Copy link
Contributor

@valq7711 nice ! Thanks for the link, it looks promising ! I'm also happy to see that there's still some discussion ongoing on the google group, i'll come there soon to post some toughs about RS. See you around.

@atsepkov atsepkov merged commit 677ca80 into master Jan 27, 2019
@valq7711 valq7711 deleted the valq7711-patch-inbrowser branch January 27, 2019 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants