Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Could this adapted to work with srclib? #107

Open
lilith opened this issue Jan 22, 2015 · 11 comments
Open

Could this adapted to work with srclib? #107

lilith opened this issue Jan 22, 2015 · 11 comments

Comments

@lilith
Copy link

lilith commented Jan 22, 2015

Perhaps someone here knows enough about both pfff and srclib to help.

Would it be possible to make pff work as a srclib toolchain backend?

@aryx
Copy link
Contributor

aryx commented Jan 22, 2015

Sure. I exchanged a few emails with the people from sourcegraph.com and srclib and I think it's totally doable. One could take the codegraph file generated by pfff and generate the appropriate metadata srclib expects.
The codegraph file format is very simple, see https://github.com/facebook/pfff/blob/master/graph_code/graph_code.mli

@aryx
Copy link
Contributor

aryx commented Jan 22, 2015

One could also to the reverse, use srclib object file to generate the codegraph file so one could use some of the pfff frontend tools (codemap, codegraph, codequery, etc) on the languages supported by srclib (Go, python, ruby).

@lilith
Copy link
Author

lilith commented Jan 22, 2015

Awesome!

@aryx
Copy link
Contributor

aryx commented Jan 22, 2015

@sqs who I think was the person who contacted me a few months ago

@sqs
Copy link

sqs commented Jan 22, 2015

I'm happy to help with any efforts to share stuff between srclib and pfff. (I'm one of the srclib creators.) Let me know how I could help.

The current srclib schema is defined in Go structs (that serialize to JSON with eponymous fields) at, e.g., https://srclib.org/toolchains/grapher-output/. We'll have a JSON Schema or similar schema soon. As a first version, just getting the names, paths, and file/byte locations would be a great start.

@phooji
Copy link
Contributor

phooji commented Jan 23, 2015

@nathanaeljones Do you have a particular language that you're interested in?

@lilith
Copy link
Author

lilith commented Jan 23, 2015

I'm trying to add C# and F# support. I assume that F# support (given its OCaml roots) wouldn't be a long stretch?

@lilith
Copy link
Author

lilith commented Jan 23, 2015

My larger goal is to combine generated docs and annotated, literate source browsing.

Literate source browsing, like docco style.

Input data needed would seem to include {filesystem, srclib output, extracted docs, class/package/unit structure, and some optional manual components}.

I'm unclear on whether pfff or srclib can help with doc extraction, but it's certainly an easier parsing task. The structure is another thing I'm still working on analyzing.

The idea of giving a tool a list of method or class names, and letting it generate step-by-step source-code walkthroughs is kind of seductive.

@aryx
Copy link
Contributor

aryx commented Jan 23, 2015

Regarding srclib data generation, I think the problem is language independent. The codegraph file (graph_code.marshall) of pfff is language independent and I think it's the only thing you need to generate srclib data. Once this is done every language supported by pfff will then be available to srclib too.
One needs to write this graph_code.marshall -> GO scrclib JSON thing though ...

@krishnavaidy
Copy link

This pull request might help: #129

The pr converts graph_code.marshall to the GraphSON format (json). But could also easily be tweaked to serialize to xml and protocol buffers, from which GO srclib can read...

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

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

No branches or pull requests

5 participants