Tutorial: Simplify and Optimize Your YAML with YAMLScript - Ingy döt Net, YAML LLC
Tutorial: Simplify and Optimize Your YAML with YAMLScript - Ingy döt Net, YAML LLC
Nobody likes YAML (or anything for that matter) when its a giant and repetitive mess. Of course, there are already existing technologies like Helm and Kustomize that help provide make YAML nicer for Kubernetes. The new kid on the block is YAMLScript. Being a complete programming language (built over a vast and mature ecosystem) its capabilities are effectively limitless. That said, its primary focus is on refactoring and improving existing and new large YAML configurations. YAMLScript can help you make the most of YAML in any domain; even those that already make great use of Helm and Kustomize. Having been created by an original inventor and current lead maintainer of the YAML data language (Ingy döt Net) you can count on it meshing well with the YAML you already know. In this hands on interactive tutorial, Ingy will teach you how to make the most of YAML and YAMLScript.
Calling doc on the value of a variable
I'm just starting out with Clojure and I was trying to implement vim's keywordprg, which displays documentation for the word under the cursor. I want to call the doc() function on the value of a variable, but I'm not having any luck:
user=> (let [x "println"] (doc x))
-------------------------
user/x
nil
In Perl, I think I could use the eval() function, but I'm not seeing anything comparable in Clojure. Any suggestions? Thanks!
Clojure by Example
Array languages for Clojurians
As a lisp, Clojure of course qualifies as one such mind-altering substance. (It arguably qualifies again on the basis of its focus on immutability.) But Blazeski’s article points out that array-based languages such as J, its predecessor APL ("A Programming Language"), and the proprietary q are equally mind-expanding. Let’s see what was – and remains – so compelling about the array programming approach to problems, and compare it to Clojure’s approach.
One operator to do both is pretty handy. We can of course replicate each with out-of-the-box Clojure:
(map (partial + 2) [2 3 4]) ; => (4 5 6)
(map + [2 3 4] [1 2 3]) ; => (3 5 7)
What Web Framework Should I Use in Clojure?
In this guide, I describe the available Clojure web framework options and give my recommendations.
Grokking Hash Array Mapped Tries (HAMTs) - by Nick M
A simple and intuitive explanation of what Hash Array Mapped Tries are and where they're used.
HAMTs are frequently used in functional programming languages, such as Clojure and Scala in order to implement persistent data structures like maps and sets. HAMTs provide efficient lookup, insertion, and deletion operations while ensuring immutability. They’re also well-suited for concurrent environments where multiple threads or processes access and modify shared data structures simultaneously. Their structural sharing property allows for efficient copying and sharing of data, reducing the need for expensive locking mechanisms.