So this doesn't fit in a Tweet, I'll just dump my mind here.
I have been working on tweaking Scala and Python to play along nicely with SPARQL. In particular, with SPASQL which is a blend of SPARQL and SQL. It can be mixed and matched with a PL-style language and together they comprise the main programming paradigm for OpenLink Virtuoso.
SPASQL is really productive when dealing with Linked Data middleware deployments, but it lacks the conciseness of modern languages, so coding large systems can become a bit annoying. Both the code itself and the codebase organization in general. Even so, the language is so powerful that it trumps the best contender in a second so I have walked the extra mile trying to find how to mix the best of both worlds.
How good is SPASQL? Well, I have reduced Java codebases by a factor of 3 when moving to Scala, and then again by a factor of two when moving to SPASQL. Yeah, that sounds crazy, and it is. The first reduction is mostly syntactic. Scala lets you get away with less accessory code such as redundant typing and then there is also some more expressiveness to be found in functional programing, etc. The second reduction, when moving to SPASQL, is deeper as it is about moving away from control structures in the code and into complex SPARQL expressions against a graph based datamodel. Basically, most of your loops, filtering and conditionals can be gone and replaced by smart query composition. Then, if you wish so, you can also toss away most of your indirection model.
No more Business Classes and modeling at the scripting/code/controller level. RDF is already object oriented (or even better), so you should not be scared to just totally forget about Classes and encapsulation most of the time.
(There are also other tools that will help tackle the common cases behind encapsulation and getter/setter kind of patterns, such as bult-in inference).
In the end, using SPASQL, inference and other stuff becomes a much more "declarative" way of stating what you need. Don't code your way in, just ask for it in an elegant manner.
Anyway, back to scripting. I don't intend to explain the nuances and little details behind the execution ( be it interpreted or generating code ) or the possible solutions for remoting ( for example, hacking the continuations plugin in Scala ), nor the problems when trying to match the grammars and coming up with escape sequences for all the possible productions, etc.
I won't because frankly, I don't think I made a very good job. I only skimmed through the possibilities and ended up using a cheap (from an investment POV) code generator. I also know MANY C.S. students are going to realize this is the next frontier rather soon. All I want to say here is a simple trick I discovered and I hope it helps someone avoid hell.
Here it is:
Most modern languages, including Javascript, are really scared of URIs and that is your biggest problem when trying to make them play along. You will have a really hard time trying to fit them in as identifiers. Not because you can't model them in their value space ( they can be objects/entities, etc ) but because the lexer will go crazy on you when it runs into all the "?#&:/" stuff.
Is not really a valid Javascript statement, so you can kiss any OOTB JS parser goodbye. Same thing applies for most modern languages you can find out there. URIs are not valid identifiers.
So you will most probably have to create an API atop the language and end up with something like:
alert( store.getResource("http://foo.com/aldo")
.getProperty("foaf","name" )
);
But that isn't really integrating, it's just an API and forces you to operate on a layer of indirection with an immense overhead. Then, some languages might allow you to create DSLs ( such as Ruby and Scala ), but you will still have a very hard time just trying to make a URI behave like a native citizen. And that sucks. Because URIs are all there is. That's the crux of the matter really.
Now, what about this?
Looks horrible, I know. And I just made it up. But the point is that there are many ways in which you can create a bijective transformation between URIs and the identifier system of the language you choose to extend. Hopefully you can take the time to make it easy to remember and nice to read.
Anyway, just keep this in mind. URIs will make you bleed. And if you want to see why you want to go down this road for you EII projects, just take a Virtuoso SPASQL for a ride and feel the power of Linked Data.
LOL, it sounds like a pitch. But I'm serious. You will end up doing this anyway sometime soon because SPARQL will eventually knock on your door. In the end, if you do it now you are just... way cooler ;)
Cya!