> What if, instead of lowering source code down...
# thinking-together
s
What if, instead of lowering source code down for the purpose of execution, we raised source code for the purpose of understanding?
What if we took the lessons of the semantic web and applied them to source code?
https://nshipster.com/as-we-may-code/
👍 1
t
Interesting article. It’s interesting to note that it is written as an invitation to imagine a better world. There really isn’t any need to imagine representing code as data and adding semantics to it by reasoning about it as data. That future is already here.
💯 10
k
The premise feels overblown for the rest of the content. Generating RDF triples from source code is not raising. At best it is flattening (not lowering). The distinction becomes clearer if cast in terms of information content. Lowering takes away information. Not lowering is feasible. But raising is adding information. What can we do to add information that the code doesn't already contain? That's a really hard problem that the article doesn't address. For starters, mining just the code has limited value because there are many properties of a program that someone reading it can (laboriously) deduce that don't actually exist in software. You may know things about the production environment or expected inputs based on past experience. You may inspect runtime using a debugger. Bottomline: the premise is a well-known holy grail akin to "world peace", and the rest of the content is doable/novel but of far more limited utility.
j
@Kartik Agaram There is value in placing the extracted triples in the context of an ontology, thus facilitating richer queries and automatic reasoning about the code. It "adds" knowledge to the codebase in the same way that having knowledge of programming adds to one's understanding of a given piece of code. I think it would be quite interesting to combine the ideas in that article with the direction seen in Codeq: https://blog.datomic.com/2012/10/codeq.html
💯 1
🤔 1
s
I really appreciate @Tudor Girba’s:
It’s interesting to note that it is written as an invitation to imagine a better world.
Because the two things we all seem to like most is (a) imagining a better world and (b) telling other people why their imagined version of a better world isn’t going to work. ;-)
t
@Kartik Agaram The representation itself does not add or remove any semantics, but once you see code as data, the semantics are added in the queries, visualizations you can do with that data. It is the act of formulating thought through those analysese that is the key.
🤔 1
e
Some of the ideas on that blog post reminded me of existing projects: • Queries over a code base: https://www.ndepend.com/features/cqlinq#CQL • Addressability of code: https://www.unisonweb.org/docs/tour
👍 2
Also came across this tiny ontology in teh past... I think it is a student project but who knows, may be useful if you decide to actually explore the RDF idea further: https://fno.io/spec/