3 ms·
Thanks for the feedback orf! I agree it looks strange at first, this is very experimental so I played a bit with syntax design choices. Sometimes for DSLs it's
by ekzhang 4y ago
Thanks for the feedback orf! I agree it looks strange at first, this is very experimental so I played a bit with syntax design choices. Sometimes for DSLs it's nice to have a bit of flexibility. You can compare it to the %timeit, %cython "magic" statements in Jupyter.
We could use a standard function application, but that doesn't convey the point that there's some DSL embedding going on here, such as variable substitution from the outside scope. It's also less nice to end multi-line queries with the string: """).
Other reasons: the bitwise XOR operator is almost never used in Python, so it's highly unlikely that people would confuse it as such (this is also why it's formatted without a space before the operator). Open to other proposals for syntax though.
- orf 4y agoThese are good points, especially around the magic substitution. I hadn’t really considered that. Even so, pandas has the same magic substitution going on with just a standard function call, and it’s somewhat intuitive. However, regardless of the syntax nitpicking, this is a cool project. Nice one!