| [21:33:12] | <jgaehring[m]> | <symbioquine[m]> "I highly recommend that book btw..." <- Oh interesting, I'll have to check that out. One of the things I was trying to do w/ farmOS.js when I first implemented those MongoDB-style queries was to narrow down the API so queries could be expressed as data alone (eg, a JSON-like object) w/o methods or functions. At the time, I was kinda obsessed w/ this fantastic talk by James Reeves, ["Transparency through |
| [21:33:12] | <jgaehring[m]> | data"](https://www.youtube.com/watch?v=zznwKCifC1A) which gives a compelling argument for DSL's based on the [Rule of Least Power](https://www.w3.org/2001/tag/doc/leastPower.html). |
| [21:34:46] | <symbioquine[m]> | I think I saw you mention that before, but haven't dived into the talk yet... kinda suspect it will go along similar lines as some of the discussion the the DSL book, but I could be wrong :) |
| [21:38:39] | <symbioquine[m]> | > One of the things I was trying to do w/ farmOS.js when I first implemented those MongoDB-style queries was to narrow down the API so queries could be expressed as data alone (eg, a JSON-like object) w/o methods or functions. |
| [21:38:39] | <symbioquine[m]> | You can also have a hybrid strategy where you provide the data-only DSL, but then also provide the "language bindings" version on top. This is especially nice in compiled and strongly typed languages where correct use of those language bindings can be checked at compile time... |
| [21:40:05] | <jgaehring[m]> | most likely... it's very Clojure-centric, for better or worse, but there are some interesting points that follow on the way Clojure, or any Lisp, embraces "code as data", which makes for some nice semantics |
| [21:41:26] | <symbioquine[m]> | For instance, you could provide a fluent builder where it's impossible to accidentally specify the page number multiple times because it always must appear at the end of the builder invocation and the returned builder object doesn't have that method on it. |
| [21:41:53] | <jgaehring[m]> | > <@symbioquine:matrix.org> > One of the things I was trying to do w/ farmOS.js when I first implemented those MongoDB-style queries was to narrow down the API so queries could be expressed as data alone (eg, a JSON-like object) w/o methods or functions. |
| [21:41:53] | <jgaehring[m]> | > |
| [21:41:53] | <jgaehring[m]> | > You can also have a hybrid strategy where you provide the data-only DSL, but then also provide the "language bindings" version on top. This is especially nice in compiled and strongly typed languages where correct use of those language bindings can be checked at compile time... |
| [21:41:53] | <jgaehring[m]> | yea, if I had more time I'd extract the part that parses the farmOS.js queries into its own library, which could then more easily be paired with bindings like that, as well as make it more useful to non-farmOS Drupal projects, but alas |
| [21:42:25] | <symbioquine[m]> | Yeah, I don't think it's necessary - especially for farmOS.js |
| [21:42:38] | <symbioquine[m]> | Maybe if we have a farmOS.java or something :) |
| [21:42:51] | <jgaehring[m]> | hahaha |
| [21:43:54] | <symbioquine[m]> | Which would then naturally lead to the Scala/Clojure world... |
| [21:49:57] | <jgaehring[m]> | jeez, how did Java ever become so pervasive? in all seriousness, it's probably just an indication of my own naivete having learned to code after 2010, but I really don't get it |
| [21:52:42] | <symbioquine[m]> | In some areas it does have a pretty amazing library/tooling ecosystem and being a strongly typed language with a bunch of enterprise-style integrations it can be fairly pretty pleasant to work with in a corporate/enterprise setting. |
| [21:53:23] | <symbioquine[m]> | Plus you always have the escape-hatch of integrating other JVM languages when teams rebel at all the boilerplate involved. |
| [04:00:05] | * Ian[m]1 has quit (Quit: You have been kicked for being idle) |
| [13:14:29] | <symbioquine[m]> | That "Transparency through data" talk is bringing a lot back for me! My previous work involved taking a relatively large body of conditional business logic spread over more than a dozen hodge-podge services and turning it into data that was interpreted by a single service. I designed and largely implemented an internal DSL that could be statically analyzed to enforce that the use-cases were mutually exclusive and valid in ways that |
| [13:14:29] | <symbioquine[m]> | weren't possible before. |
| [13:15:36] | <symbioquine[m]> | The DSL was just Java code, but using static analysis it enforced that it was a very restricted subset of Java. |
| [17:03:17] | * farmBOT has joined #farmos |