Your opinions for a standard and using RDF or XML for PL's AST? (a bit out of topic)

33 views
Skip to first unread message

Yannick Duchêne

unread,
Feb 12, 2015, 9:27:52 AM2/12/15
to ats-lan...@googlegroups.com
It's a bit out of topic for this Usenet, but I also believe it's a good place to discuss it, as the question rose about the integration of ATS in various IDE.

The big issue with PL in IDE, is that there is no standard at all (I'm not to discuss the benefit of standards, I assume everyone know), not even for syntax colorization. Everything has to be made for every single IDE, which has its own way of doing this, often on a per developer basis. I'm not the only one to search for this, as attested by this question on SO:


From time to time I search the web to see if something emerges in this area. I found about various standard XML formats for graphs, which may be good candidates for syntax tree with or without name/binding resolution and semantic interpretation attached to it. Especially this one, which seems stable (not a toy) and rather well adopted:


But I never found any concrete use of it for this application (to use GXL to deal with PL), so it's hard to believe in its potential acceptance.

Another option I see, is RDF. RDF is about relations, can represent trees and is well suited to various languages semantic needs, as it knows about about references to definitions of concepts (at least, about a way to unambiguously refer to definitions of relations).

I landed today into something I already seen before: an application of RDF for SQL AST :

That's a good point, as this use case may be an experience to study (I will read the document a future day).

I see another advantage of using RDF: its query language. Having a query language could allow an IDE to query about things without having to generate or deal with the whole bunch of data. It's the tool conforming to the standard which would have to deal with data generation and storage. 

XML has XQuery though, and may be that would be nice to compare both in the context of dealing with programming language source: abstract syntax and bindings and other kinds of semantic resolutions.

Basically: which base for a standard? Rather XML or RDF? Which query language? Rather XQuery or RDF query language? In particular if XML, what already existing XML standard? One of the XML standards (or more or less standard) for graphs? GXL or another?

Note: I'm not asking this question in the context of ATS2 only, rather with ATS2 in mind too.

Now remains the question of publishing a real standard to be recognized as such (at least from people who care). ISO is far too laborious and expensive for individuals or tiny groups of people. The OMG does not target this issue. The W3C even less. So what about submitting an ECMA standard? I feel to understand ECMA is rather accessible and has low cost (or I hope).

What are your own thoughts and opinions on the topic?

Yannick Duchêne

unread,
Feb 12, 2015, 9:33:11 AM2/12/15
to ats-lan...@googlegroups.com


Le jeudi 12 février 2015 15:27:52 UTC+1, Yannick Duchêne a écrit :
The OMG does not target this issue.

Ian Denhardt

unread,
Feb 12, 2015, 7:31:04 PM2/12/15
to ats-lan...@googlegroups.com
Quoting 'Yannick Duchêne' via ats-lang-users (2015-02-12 09:27:52)
> Now remains the question of publishing a real standard to be
> recognized

Re: standards bodies, I think they're not the place to start -- try to
design something, and write a good spec. It doesn't need to be a
published "standard" for it to be a clear enough thing for people to
use. My take would be to start there.

Just my $0.02.

-Ian
signature.asc

gmhwxi

unread,
Feb 12, 2015, 11:49:25 PM2/12/15
to ats-lan...@googlegroups.com
I don't feel like I have an opinion here because I don't really know much about the issue.
Nonetheless, I would like to say that writing a standard in this case should probably be
coupled with implementing the standard.

Brandon Barker

unread,
Feb 13, 2015, 7:52:14 AM2/13/15
to ats-lang-users
When I was using RDF a little a few months ago, I came across this intro video that seemed to present some compelling use cases for RDF near the end: https://www.youtube.com/watch?v=Nk9TOx1sBUk

Not saying that XML couldn't be used for it, but I do think RDF is much simpler and may be able to do what is needed.

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/381a2574-d920-456b-82af-536be3469366%40googlegroups.com.



--
Brandon Barker
brandon...@gmail.com

Artyom Shalkhakov

unread,
Feb 13, 2015, 9:11:54 AM2/13/15
to ats-lan...@googlegroups.com
Hello Yannick,

I'm not sure what are you talking about here. If you're looking for one universal AST that CSTs of various programming languages can be reduced to, then I guess you're out of luck. Are you instead looking for a common format that could be adopted for ATS2?

Regarding XML technologies: please keep the complexity in mind. While XML tools are relatively widespread, this is all quite complex stuff. For instance, in the case of XForms, the XPath features put a great burden on the implementor (that's one of the reasons there aren't many full-fledged XForms implementations around). A similar argument can be made about XQuery and XSLT.

Regarding RDF queries: if you're asking me, I'd rather use ML than XSLT for AST manipulation. It's so much easier to get things working. This is from my experience with the NORMA tool, that encodes various ASTs in XML.

I think we should take a closer look at what other PL communities are doing. For instance, how does TypeRex for OCaml deal with ASTs? What can we learn from them?
Reply all
Reply to author
Forward
0 new messages