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

Investigation: compile libuast to js and use it on client instead of server side libuast #120

Open
smacker opened this issue Apr 4, 2018 · 4 comments

Comments

@smacker
Copy link
Collaborator

smacker commented Apr 4, 2018

Currently, for x-path filtering we use libuast on server side. For every filter request we send all source code to the server, reparse it using bblfsh then applying filtering on server side.

Looks like we can skip most of this steps and simplify code if we would be able to compile libuast to js.

If it's possible, together with #118 we will be able to remove backend almost completely.

@bzz
Copy link
Contributor

bzz commented May 14, 2018

Used ecmascripten to cross-compile both, libxml2 and libuast to JS/wasm on one of the OSDs, for the purpose of running it on BigQuery. Examples work after cross-compilation with browser and node for me, but resulting binary is few Mbs so not possible to fit 1mb BigQuery external UDF limit.

Did not peruse it any further, but would be happy to share if somebody what's to apply it in dashboard.

@smacker
Copy link
Collaborator Author

smacker commented Jul 10, 2018

Example of using cross compiled libuast is here:
https://github.com/smacker/in-browser-uast

there is an example which is a simplified version of the dashboard.

The current size of wasm+js is ~750kb.

@smacker
Copy link
Collaborator Author

smacker commented Jul 23, 2018

implemented here: https://github.com/smacker/dashboard/tree/bblfsh_js

@dennwc
Copy link
Member

dennwc commented Jul 30, 2018

Any plans to integrate it?

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

4 participants