My point being (and please correct me), this is practical but 15-20 years away from widespread adaption, best case.
As a small project Clojure dev (and admittedly a couple years out of daily Clojure use), these types of projects are hard for me to place in a day-to-day work context. The doc says that Morse is one tool that can "amplify the power of the programmer during interactive development".
I totally feel like Clojure REPL-based dev is better for me personally - the interactive feedback feels so natural and functional programming matches so well my preferred dev process. But it is more difficult for me to understand where this type of tooling fits in dev workflow. Is Morse an incremental improvement? Does it make more sense in significant Clojure dev shops with many programmers vs just me sitting around with an Emacs repl going?
>Fogus has been mostly focusing on some new tooling derived from REBL and we are hopefully nearing a point of release on that and some additional supporting libs soon as well.
From third paragraph here: https://clojure.org/news/2023/03/27/deref
This is important because the core Clojure license is true open source vs REBL which had a semi closed license, so it’s always been a little difficult of a choice for many people.
Once you learn how Emacs works and how it can be programmed, you can create interactive tools extremely quickly to make lots of tasks you encounter day to day easier. I do this all the time.
Also note for others with regard to eagerness, this is only for maps. "When conformance is checked on a map, it does two things - checking that the required attributes are included, and checking that every registered key has a conforming value. We’ll see later where optional attributes can be useful. Also note that ALL attributes are checked via keys, not just those listed in the :req and :opt keys. Thus a bare (s/keys) is valid and will check all attributes of a map without checking which keys are required or optional."
Can you explain the point of :opt with s/keys if it will always check any registered spec in if present?
Here's a quick list of gotchas (well, they got me, so perhaps other people will find this list useful):
* `s/valid?` does not actually tell you that the data is valid
The naming of `s/valid?` suggests that you can call it on your data and find out if the data is valid according to the spec. This isn't true. What it actually tells you is if the data, when conformed, will be valid according to the spec. If you pass the data as-is to your functions (without passing it through `s/conform`), you might find that they will be surprised at what they get.
* Conformers are likely not what you think. They are not intended for coercion and have many pitfalls (for example, multi-specs dispatch on unconformed value).
* s/merge doesn't necessarily do what you wanted if you're using conformers, only the last spec passed to merge will be used for s/conform (but you're not using conformers, right?)
* specs are checked eagerly. If you think that (s/valid? ::my-spec x) will only check ::my-spec, that is not the case. It will check any key of x found in the spec registry.
I settled on a subset of spec, because of the pitfalls.
Also note for others with regard to eagerness, this is only for maps. "When conformance is checked on a map, it does two things - checking that the required attributes are included, and checking that every registered key has a conforming value. We’ll see later where optional attributes can be useful. Also note that ALL attributes are checked via keys, not just those listed in the :req and :opt keys. Thus a bare (s/keys) is valid and will check all attributes of a map without checking which keys are required or optional."
Can you explain the point of :opt with s/keys if it will always check any registered spec in if present?
can you elaborate why? are these sentences fundamentally wrong? they dont appear so.