| ▲ | Lua as a Query Language(remy.wang) | |||||||||||||
| 28 points by remywang 3 hours ago | 7 comments | ||||||||||||||
| ▲ | shakna 2 hours ago | parent | next [-] | |||||||||||||
> Sadly comparisons like < and == cannot be overloaded in Lua :( You can overload == in 5.3. Before that, there was a slightly-less-overloadable __eq method. But as of 5.3, as long as the bound __eq method is the same underlying function, it will be called. I assume you meant instead, that the return value of the comparison is always coerced to a boolean, so you can't re-use it to get arbitrary infix operators? For that sort of thing, I've used Mike Pall's hack in the past: | ||||||||||||||
| ||||||||||||||
| ▲ | phillc73 2 hours ago | parent | prev | next [-] | |||||||||||||
A little while ago I had a similar itch, but my query language at home happened to be Janet[1]. It's built over DuckDB and Rayforce[2]. Single query, either engine. | ||||||||||||||
| ▲ | PinkSheep 28 minutes ago | parent | prev | next [-] | |||||||||||||
Tarantool[1] has been using Lua for the queries since inception. Eventually 3rd party users complained enough that they added a SQL as a query frontend. | ||||||||||||||
| ▲ | behnamoh an hour ago | parent | prev [-] | |||||||||||||
You can do this with Ruby and Elixir too, and the syntax would end up much nicer! | ||||||||||||||
| ||||||||||||||