Forgot your password?
typodupeerror
Databases Open Source Programming

Type Safety Coming To DB Queries 128

Posted by timothy
from the life-as-a-game dept.
An anonymous reader writes "A new type-safe query language for the popular full-text search platform Solr, called Slashem (a Rogue-like), has just been released. Slashem is implemented as a domain-specific language in Scala, providing compile time type-safety, allowing you do things like date range queries against date fields but keeping you from trying to do a date range query against a string field. Hopefully this trend catches on, resulting in fewer invalid queries exploding at runtime."
This discussion has been archived. No new comments can be posted.

Type Safety Coming To DB Queries

Comments Filter:
  • by Anonymous Coward on Sunday September 11, 2011 @06:10PM (#37371246)

    It's rogue-like and the link to define "rogue" is to a fucking github page that says "lift/mongodb query dsl".

      For fuck's sake... this tells people NOTHING. It's a completely useless article submission.

  • by Xgamer4 (970709) on Sunday September 11, 2011 @06:11PM (#37371260)
    ...Well, there's a namespace collision. There's Slashem and roguelike as referenced in the summary, and Slash'em and Roguelike as-in the Nethack-based game and the game genre. There's no way that wasn't intentional, and whoever's brilliant idea it was needs to be shot.
  • by loufoque (1400831) on Sunday September 11, 2011 @06:21PM (#37371332)

    The domain-specific language should just be SQL itself, rather than some weird variant which is then used to generate some weird language with XML crap in it.

    Embed SQL into the host language using a DSEL (domain specific embedded language), type-check it, then convert the AST to a the equivalent SQL string and send it to a server.
    That's the right thing to do.

    And it's trivial to do in a language like Scala or C++ (which is personally think is ironically more suited for DSELs than Scala).

  • Re:Dumbing it down (Score:4, Insightful)

    by InsertCleverUsername (950130) <slashdot@rruss o n . f a stmail.fm> on Sunday September 11, 2011 @07:47PM (#37371894) Homepage Journal

    This appears to be more of the 'nanny state' mentality that Microsoft is shoving down our throats.

    Sheesh... I was going to moderate a few items in this thread, but I just have to reply to your ignorant excuse to bash M$ --like they invented type-safety.

    This is the old case of narrowing the band of opportunity so that the lowest performers can't make the obvious mistakes. When will they realise that they are also stifling the highest performers? Give us some credit folks. We're not all first year out of college.

    Really? Technologies that help minimize errors through convention are a bad thing? So if you're in a shop that saves countless hours of time and debugging using a modern ORM [wikipedia.org] like Hibernate [wikipedia.org], that makes you some sort of slack-jawed moron because "real" programmers do everything in assembly and don't need no stinkin' oversight, static code analysis, testing, or code review, right? Sheesh... Remind me not to hire you to code any systems where human safety is on the line. Most employers --even for inconsequential crap-- would rather have working apps than theoretically pure code; they can buy another rack of servers for what a good developer earns, so in most cases they really don't give a damn about efficient code.

    Besides, even if you think type-safety = training wheels, if you've been coding long enough, you'll see idiots and geniuses get slapped by typos and inadvertent mistakes. Only an amateur thinks they're immune to error and that things like type-safety just cramp your style. And real programmers can go around these things off when they need to, but take advantage of lower bug counts the rest of the time.

"Stupidity, like virtue, is its own reward" -- William E. Davidsen

Working...