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

Utilizing application as library in project #135

Closed
forstmeier opened this issue Jul 10, 2019 · 5 comments

Comments

@forstmeier
Copy link

commented Jul 10, 2019

Description

I’m in the process of putting together an MVP for a side project I’m working on which is to analyze repositories and identify how they can be broken up into open source and closed source segments. To do this, I’d like to incorporate the source{d} CE platform. Ideally, for the MVP I’d like to:

  • Pull in one/more target repositories into the application
  • Parse full repo(s) into UASTs
  • Query the UASTs to identify linkages between parts of the code (e.g. function declarations and calls)

This is basically to begin exploring/validating the hypothesis that it is possible to utilize MLoC to pull apart existing codebases and programmatically analyze them to identify which blocks are best served as open source and which are best kept as closed source.

I’ve been playing around with the CE, mostly through the UI, but I’d like to include the source{d} resources as a library in my own application. Any help/guidance would be greatly appreciated!

@carlosms

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

Bear in mind that this repo is not meant as a library, and that we are still in beta. Don't expect guaranteed stability in method signatures and such.

Also, you might want to consider using the individual components directly, without the code this repository. Depending on how you plan to handle your repositories, you might even find that the only component you need is bblfshd.

Feel free to ask us any other questions and we'll be happy to help.

@forstmeier

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

@carlosms Awesome, thanks! I was digging through the bblfshd repo last night and it seemed more like what I should pursue, as you say, but was running into issues trying to run go get and I'm not sure why that was. Should I direct follow up questions there?

@dpordomingo

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

I think you don't need to go get bblfsh, but just run bblfsh container and parse your files using one of its available clients from your app.

If you do so, you only need to add the client in your app, and then use it to call bblfsh container.

@forstmeier

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

@dpordomingo Would that be the go-client found in the bblfsh org?

@dpordomingo

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

If I understood what you're trying to achieve, yes: I think that you only need to run a bblfsh container, and use the go client (if you're using Go) in your app to parse files with bblfsh.
From the client README.md:

Babelfish Go client library provides the functionality to connect to the Babelfish server for parsing code and for analyzing UASTs.

You will also find there an example of how to use the client in your app.

Is that what you're looking for?

If at some point you need a dashboard to inspect git repos, playing with SQL queries and obtaining fancy charts, you can find us here again. 😉

For more opened questions, you might find useful our forum, and also our slack communty, where you could discuss different alternatives and also talk with our ML team.

@carlosms carlosms closed this Jul 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.