Live data from Hacker News

Ebay launches query language

ql.io

11–20 of 32 posts

Re: Ebay launches query language

#12
post #10
post #9

Interesting. Isn't this the metalinguistic paradigm in action? Ie instead of creating a library/API you create a whole new Domain-Specific Language. Thoughts on this? Is there room for innovation in APIs via DSLs?

It would be cool if there was some kind of meta-DSL which allowed you to create your own DSL. That way, more developers could go that route without having to learn all the intricacies of compiler theory and stuff like that. I am imagining DSLs being useful both on the server side and the client side. For the former, imagine sending off a single query instead of doing a bunch of different API calls. For the latter, we…

It's called Lisp. I hate to be Yet Another Hacker News Lisp Punditparrot, but it's true.

For example, take a look at how easy it is to implement BrainF inside Racket, a lisp focused on language experimentation. http://hashcollision.org/brainfudge/ I bet you could walk through these steps in maybe half an hour with little to no prior experience.

Re: Ebay launches query language

#14
post #10
post #9

Interesting. Isn't this the metalinguistic paradigm in action? Ie instead of creating a library/API you create a whole new Domain-Specific Language. Thoughts on this? Is there room for innovation in APIs via DSLs?

It would be cool if there was some kind of meta-DSL which allowed you to create your own DSL. That way, more developers could go that route without having to learn all the intricacies of compiler theory and stuff like that. I am imagining DSLs being useful both on the server side and the client side. For the former, imagine sending off a single query instead of doing a bunch of different API calls. For the latter, we…

[deleted]

Re: Ebay launches query language

#15
post #12
post #10

Earlier quoted context omitted.

It would be cool if there was some kind of meta-DSL which allowed you to create your own DSL. That way, more developers could go that route without having to learn all the intricacies of compiler theory and stuff like that. I am imagining DSLs being useful both on the server side and the client side. For the former, imagine sending off a single query instead of doing a bunch of different API calls. For the latter, we…

It's called Lisp. I hate to be Yet Another Hacker News Lisp Punditparrot, but it's true. For example, take a look at how easy it is to implement BrainF inside Racket, a lisp focused on language experimentation. http://hashcollision.org/brainfudge/ I bet you could walk through these steps in maybe half an hour with little to no prior experience.

Nice. Is it possible to cross-compile it to other languages?

Re: Ebay launches query language

#16
post #15
post #12

Earlier quoted context omitted.

It's called Lisp. I hate to be Yet Another Hacker News Lisp Punditparrot, but it's true. For example, take a look at how easy it is to implement BrainF inside Racket, a lisp focused on language experimentation. http://hashcollision.org/brainfudge/ I bet you could walk through these steps in maybe half an hour with little to no prior experience.

Nice. Is it possible to cross-compile it to other languages?

I... don't think so. Not in the way you're thinking of, anyway. In this BrainF example, your language "compiles" (translates, really) to Racket expressions; then, the Racket VM "compiles" it to Racket bytecode just before running it.

For something as simple as BrainF, it's not hard to write your own translator. Just replace every [ with while (* ptr) {, replace + with (* ptr)++; replace It's not so simple for racket in the general case. Danny Yoo is working on "Whalesong", a javascript interpreter that interprets racket bytecode so you can run racket in your web browser. http://hashcollision.org/whalesong/ It's still not a Racket->Javascript translator though.

I'm not aware of similar projects for other languages.

(Edit: formatting ate my asterisks)

Re: Ebay launches query language

#18
post #7

Interesting, another use of a SQL-like language as the query language for a data store that's definitely not an SQL database. (YQL is another example.) I really don't understand why ORMs always seem to want to create their an object-based query language--SQL is just fine for querying.

It's difficult to provide tooling for SQL in a way that provides a good experience for the user. For example, providing auto-completion in a SELECT statement is hard because attributes are specified before the tables which contain them are declared, leading to a-more-annoying-than-it-should-be editing experience.

Re: Ebay launches query language

#19
I've been thinking lately that certain APIs would benefit from two distinct 'entry points':

1. a nice, object-oriented hierarchical RESTful interface for standard queries and getting started e.g. /api/user/12345/friends/

2. a sql-esque query language interface for arbitrary, complicated requests e.g. /api/?q=select id from users where name="Joe"

It looks like ql.io could be a good way to provide the latter.

Post reply on HN