coAST icon indicating copy to clipboard operation
coAST copied to clipboard

Some insights on coAST

Open tushar-rishav opened this issue 8 years ago • 10 comments

It'd be helpful if we get to know more about what problems coAST would solve? Prefereably in some detail cc @sils1297

tushar-rishav avatar Mar 14 '16 21:03 tushar-rishav

well the idea is I can have any programming language, transform it to coAST and then I have a lot of algorithms that operate on coAST and do cool code analysis. I only need to write the algorithms once for all languages then, right?

Would you mind clarifying it in the repo a bit?

sils avatar Mar 14 '16 21:03 sils

@sils1297 Sure thing! So that's cool. What sort of algorithms you are expecting to run on AST? I assume language specifics checks won't apply here. We can run something which is more general. Maybe things like Cyclomatic complexity? Is there anything else in particular?

tushar-rishav avatar Mar 14 '16 21:03 tushar-rishav

@sils1297 I'd summarize what we discuss here and update the idea page in the end? Probably, I'd have better content then

tushar-rishav avatar Mar 14 '16 21:03 tushar-rishav

nothing in particular, if coast is good it can be rather complicated things too

Sincerely,

Lasse Schuirmann

[email protected] http://viperdev.io/

2016-03-14 22:35 GMT+01:00 Tushar [email protected]:

@sils1297 https://github.com/sils1297 Sure thing! So that's cool. What sort of algorithms you are expecting to run on AST? I assume language specifics checks won't apply here. We can run something which is more general. Maybe things like Cyclomatic complexity? Is there anything else in particular?

— Reply to this email directly or view it on GitHub https://github.com/coala-analyzer/coAST/issues/2#issuecomment-196531026.

sils avatar Mar 14 '16 21:03 sils

@tushar-rishav you are aware that coAST is mainly for having a language-independent AST generation?

Makman2 avatar Mar 15 '16 01:03 Makman2

@sils1297 @Makman2 IIUC we need to create a rule/grammar to create a parser that works for all languages? If we want coAST to create AST for all the languages. One rule that fits all?

tushar-rishav avatar Mar 18 '16 13:03 tushar-rishav

I think there'll be no way around making a parser for every language. Do you know https://github.com/BNFC/bnfc ? I talked to the maintainer briefly last guadec, that could be a possible thing...

Sincerely,

Lasse Schuirmann

[email protected] http://viperdev.io/

2016-03-18 14:36 GMT+01:00 Tushar [email protected]:

@sils1297 https://github.com/sils1297 @Makman2 https://github.com/Makman2 IIUC we need to create a rule/grammar to create a parser that works for all languages? If we want coAST to create AST for all the languages. One rule that fits all?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/coala-analyzer/coAST/issues/2#issuecomment-198361209

sils avatar Mar 18 '16 13:03 sils

@sils1297 True! It's difficult task. I was going through https://github.com/orlandohill/waxeye or http://waxeye.org/ . They seem to parse C, Java, Javascript, Python, Ruby , Scheme. So once we have AST we can do analysis on it.

tushar-rishav avatar Mar 18 '16 13:03 tushar-rishav

Performance is also something we need to consider. Writing a parser in pure python could be fairly slow^^ Using Flex and Bison is in fact the right approach for this kind of work imo^^

Makman2 avatar Mar 18 '16 20:03 Makman2

(If we write them ourselves)

Makman2 avatar Mar 18 '16 20:03 Makman2