4 ms·
virtually all abstractions are built on top of primitive data types and mappings
by midnight_eclair 6mo ago
virtually all abstractions are built on top of primitive data types and mappings
- lo_zamoyski 6mo ago> virtually all abstractions are built on top of primitive data types Obviously. The point being made is that the Clojure style discourages building DSLs and the like and prefers to remain close to Clojure types and constructs. It departs in various ways from traditionally Lisps.
- midnight_eclair 6mo ago> Clojure style discourages building DSLs does it really? https://github.com/simongray/clojure-dsl-resources https://github.com/simongray/clojure-dsl-resources
- embedding-shape 6mo agoI think you're talking past each other. "DSLs" can both mean "Using the language's variant of 'arrays' to build a DSL via specific shapes" like hiccup in Clojure does, and also "A mini-language inside of a program for a specific use case" like Cucumber is its own language for acceptance testing, but it's "built in in Ruby" in reality. Clojure favors the "DSLs made out of shapes" rather than "DSLs that don't look/work like lisp inside of our programs".
- midnight_eclair 6mo agono, not really. when people talk about DSLs in context of lisps, they usually still mean staying in the domain of s-expressions.
- embedding-shape 6mo agoYes, maybe that's the sort of DSL you're talking about, the other person mentioned "Clojure style discourages building DSLs" which I'm fairly sure to be about the other DSL and is also true, hence the whole "you're talking/reading past each other".
- midnight_eclair 6mo agothat doesn't make sense, why would they be talking about departure from traditional lisps if they weren't talking about macro-based DSLs?
- embedding-shape 6mo ago> Clojure style discourages building DSLs and the like and prefers to remain close to Clojure types and constructs This to me, seems to indicate they're talking about "DSLs not built with Clojure types and constructs", I'm just trying to have the most charitable reading of what people write and help you understand why it seems you're not actually disagreeing, just talking about different things.
- midnight_eclair 6mo ago> DSLs not built with Clojure types and constructs and in context of lisps that still most likely means macro-based DSLs using traditional lisp constructs ¯\_(ツ)_/¯
- geokon 6mo agoDSLs typically involves constructing macros that are domain specific (to cobble together a domain specific programming language on top of the host). Most of the linked examples are not macro based and are the exact opposite. They specifying domain specific data layouts built directly using the Clojure-native immutable datatypes. They don't create Domain specific datatypes or function-generating wrappers. It's just rarely necessary A good example is making GUIs in Clojure. At first there was a cool macro based system called `fn-fx` that maked a JavaFX GUI. Then vlaaad wrote `cljfx` which just used plain Clojure maps and removed the macros entirely. This increased the boilerplate a tiny amount but made the system much more flexible and extensible
- midnight_eclair 6mo ago> DSLs typically involves constructing macros that are domain specific a DSL is a constrained language for expressing domain concepts. in traditional Lisps they are often syntax-oriented, because code is lists and macros are a natural tool. in Clojure, pervasive use of keywords, vectors and maps allows you to shift DSL design towards data interpretation rather than syntax transformation. so in Clojure doesn't discourage DSLs - clojure practicioners simply prefer data-oriented DSLs to macro-oriented ones, mostly because they are easier to reason about and process with existing tools, while macros are used more selectively.
- geokon 6mo agoThe original comment you took issue with "The point being made is that the Clojure style discourages building DSLs and the like and prefers to remain close to Clojure types and constructs". You seemingly read half the sentence and in the most unfavorable way possible. (in context it's clearly not talking about "data-oriented DSLs) > DSL is a constrained language for expressing domain concepts What you're calling "data-oriented DSLs" is not constrained. I guess this is all semantic, but in my book just specifying a data-structure doesn't make a language. You're not extending the host language in any way
- midnight_eclair 6mo ago