3 ms·
> Ok, let's try: Do SQL without the SQL syntax. Select(`my_table`, [`column_A`, `column_B`]) .Filter(`column_C` > 53 && `column_D` == $varA)
by ogoffart 6y ago
> Ok, let's try: Do SQL without the SQL syntax.
Select(`my_table`, [`column_A`, `column_B`])
.Filter(`column_C` > 53 && `column_D` == $varA)
.Sort_by(`column_C`)
There you go: you have the exact semantic as a traditional SQL query (1:1 mapping) and only the syntax is different.
Now, one may argue that the syntax is "ugly", less familiar, that the ` are hard to type or whatever, but this is just taste. One simply get used to it. The expressiveness and semantic are the same as in SQL
> Syntax is 100% tied to paradigms, idioms, and such. Is intrinsic to the language we use.
I think then we don't have the same definition of syntax.
The way i understand it is that the syntax is just the way to represent these idioms and paradigms visually.
What the parent is saying is that these paradigms and idiom as what is important, but the exact way they are written, not as much (as long as it is within reason)
- mamcx 6y agoI was to talk about the SQL stuff, but I think it will be wasted as long we get blind to the fact syntax IS semantic. However this: > but the exact way they are written, not as much (as long as it is within reason) Then what is "within reason?". Is more logical to only have GOTO than IF, is better to have ELSEIF or nest IF?, what happened if my lang say that null is the same than Option.None?, what if generics use [] and not <>?. Whitespace matter, yes? no? Allow unicode? CamelCase, snake_case or what? What if all const are lowercase, types mixcase and the rest UPPERCASE? For some, APL syntax make more sense than algol. Talk about why, that is the point of this kind of talk. Is VERY easy to rug this kind of stuff. VERY. I WAS in that camp before. But now, I try to build my own lang (relational), and DAMM, it start to be much clear why syntax matter, even "the exact way they are written", because switch this to that and suddenly, my lang is ANOTHER paradigm (or worse, will be CONFUSED as be). Naming, is one the hard things in computer science. --- I understand why is easy to dismmis this as irrelevant. Sometimes I don't see why some people are so upset about typography and font selection, or why my profesional brother complain about framing in photograph. But go and SEE what the DESIGNERS of lang say about this stuff and you will note that for them, even this apparent less-significant thing matter. you can even get a prize on the field for show the importance of syntax (http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pdf http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pd...)! If that mean that most will not see, GREAT! That is the mark of good design.
- perl4ever 6y agoOne thing that I've found myself doing a lot after using SQL for a while is writing SQL to produce SQL. Maybe the syntax could be more oriented towards that, which would not be just a matter of taste.