13 ms·
> I don't want to live in a world where the language I speak evolved slowly over the past 1600 years. Also, this? This is the illustrative example you chose fo
by tylerl 8y ago
> I don't want to live in a world where the language I speak evolved slowly over the past 1600 years.
Also, this? This is the illustrative example you chose for your amazing new query language?
square = (table=<-) => {
table |> map(fn: (r) => r._value = r._value * r._value)
}
So you're saying you're combining the expressiveness of SQL with the readability of, what, perl?
- gshulegaard 8y agoI have to say...I definitely laughed harder at this than I should have...
- jarym 8y agoAgreed. The reason SQL rules is that nothing has really come into existence that is as or more powerful AND easier. I used to hate writing SQL (I still do somewhat) but I took the time some years ago to really learn the language and once you do that you appreciate a few things: 1. Yes it requires a high mental load to craft something sophisticated 2. I can’t think of a ‘better’ alternative to SQL that isn’t a compromise. 3. You can do a crap load of stuff with joins, procedures and CTEs once you understand it.
- Rapzid 8y agoAn improvement would be a slight reorder of clause's to improve intellisense ala linq though.
- blablabla123 8y ago> 3. You can do a crap load of stuff with joins, procedures and CTEs once you understand it. Yes, or you can skip that part and do the tricky part in an actual programming language ;) For instance in Haskell or JavaScript. There is then even a chance that the code is both fast and actually works. :D I mean in the end this is just a cheap marketing trick to literally buy people into the platform. People can write it into their CVs. The whole Influx ecosystem looks great. Although the UI (Grafana) is slow as hell once there are enough Graphs in and if you need fail-over or scaling, you need to buy an expensive license. Also already the existing query language is obscure and counter-intuitive.
- okket 8y ago> Yes, or you can skip that part and do the tricky part in an actual programming language But then - you miss out the power of the query optimiser - you have to transfer a lot of unnecessary data - have a harder time to enforce consistency - have a harder time to enforce access rules / security There are good reasons to do as much as possible in the database and not in a programming language in the backend or even worse, the frontend/browser.
- srean 8y agoI don't think that follows. Many of the optimizations you mention (for example the first two) may in fact be removing baggage that probably would not have been there in the first place.
- gnur 8y agoThe Influx ecosystem actually offers https://github.com/influxdata/chronograf https://github.com/influxdata/chronograf for graphing in stead of Grafana.
- tdurden 8y ago> Yes, or you can skip that part and do the tricky part in an actual programming language Are you proposing pulling in an entire dataset into memory and post-processing it vs. creating efficient SQL to get what you need?
- blablabla123 8y agoAs crazy as this sounds, yes. Not the entire dataset of course, a selection of it and then tie things together on the fly. I've seen a handful of systems (one of them I wrote myself :D) that did complex queries. In part and in certain situations this can be very efficient, no doubt. But what I observed is: - dev-wise these systems become one-man-shows - implementing feature over feature becomes exponentially slower with time - initial performance is there but it turns into slow performance over time I prefer to do things on the application side.
- xor1 8y agoWhat resources did you use to master SQL?
- sitkack 8y agoI recommend everything by Joe Celko and CJ Date. Start with Celko. The most advanced book on SQL I have read is https://www.goodreads.com/book/show/1255518.SQL_Design_Patterns https://www.goodreads.com/book/show/1255518.SQL_Design_Patte...
- jarym 8y agoI used a number of online resources - don’t recall them all but notable ones were: https://use-the-index-luke.com/ https://use-the-index-luke.com/ http://www.postgresqltutorial.com/ http://www.postgresqltutorial.com/ Postgres documentation Postgres conference videos and slides (can find on Postgres website and on YouTube) ...you can guess I don’t rely on books too much!
- xor1 8y agoThank you!
- bryanrasmussen 8y agopeople this cool obviously shoot for the readability of J.
- Ultimatt 8y agoAs someone who actually glares at Perl quite frequently can I gently request you take that slight back. Or at least qualify it to be "perl regex". Unless youve used Perl 6 (a different language) and not found it readable youd do well to say Perl 5 too. Or perhaps you've never used either language but use it as a defacto meme to make a point? The bigger argument is not readability but where the abstraction lies. From the examples I cant see much sugar beyond what an ORM often provides.
- carlmr 8y ago>can I gently request you take that slight back. Or at least qualify it to be "perl regex". Regex has the same complexity in any language, that can't be a valid reason to denigrate Perl. My biggest issue with Perl is that functions don't even have proper parameters and you need somewhat cryptic syntax to work with arrays, scalars and dictionaries.
- yellowapple 8y agoDefine "proper parameters". Perl subroutines are delightfully flexible in that regard compared to most other languages, and they also happen to be closer to your machine's reality (x86 doesn't care about what's in your stack when you JMP). With the Perl approach, you have the tools to implement multiple dispatch, variable numbers of arguments, etc. rather easily and elegantly. Yeah, it looks weird from the outside, but once you're used to it you start to want it in other languages. That's one example of what makes Perl a great teaching tool for general programming: it doesn't hide the mechanics of function/method calls behind the language, but instead shows it off to you and encourages you to explore and experiment.
- carlmr 8y agoI don't want a great teaching tool, I can use ASM for that. I want something that's easy to read and maintain. I think Perl 6 got it right, but a little too late.
- 8y ago
- theandrewbailey 8y ago> I don't want to live in a world where the language I speak evolved slowly over the past 1600 years. English is ultimately derived from Proto-Indo-European (as far as we can tell), which goes back at least six thousand years.
- petre 8y agoPerl is actually readable compated to that.
- kazinator 8y agoTXR Lisp: 1> (op mapcar [dup *]) #<interpreted fun: lambda #:arg-rest-0011> 2> [*1 '(1 2 3 4 5)] (1 4 9 16 25) Let's do it with a vector of objects that need their value slot accessed: 1> (defstruct (silly-wrapper value) () value) #<struct-type silly-wrapper> 2> (defun square (table) (mapcar [chain .value [dup *]] table)) square 3> (square (vec (new (silly-wrapper 2)) (new (silly-wrapper 5)))) #(4 25)