Look over my notes and add in anything I’m missing about Clojure, and let me know of any…
- User
Look over my notes and add in anything I’m missing about Clojure, and let me know of any inaccuracies you see. Try to keep to the same lowercase point form writing style.
Basics
Clojure
- lisp heritage
- lisp dialect with functional emphasis
- well designed thanks to that
- prefix notation
- operator comes first
- clojure.jar is the runtime environment containing the compiler and libraries
- takes code in clojure, compiles to JVM java bytecode
- hosted language
- JVM provides garbage collection and more
- can also work with javascript (clojurescript) and .net (clojureCLR)
- general-purpose language
- code represented as data structures
- suited for distributed and parallel computing
- immutable data, functions, structures
- no fixed types, giving flexibility
- programming to abstractions
- so long as a data structure fits sequence operations, it will work with any of the operations that target sequences
- due to polymorphism
- base functions with the same name call different function bodies based on what they receive
- programming to abstractions
Leiningen
- dependency manager
- on new launch, automatically pulls all dependencies needed for the project
- builds and manages projects for clojure
- lein new app alkjalf TO create new project
- lein uberjar TO create new package
REPL
- read evaluate print loop
- interactive development and testing
- quick feedback cycle
- can be integrated with various IDEs
- like a local ssh for a running clojure process
Concepts
Immutability
- cannot be changed, altered, modified once created
- ensures data integrity and consistency
- once created, cannot be modified - any modifications result in a new data structure
- vectors, maps, sets are data structures that follow immutability
- can be created with vector, hash-map, hash-set
- modified with conj, assoc, more
- anything that "updates" just returns a new structure with different values
- functions also immutable
- immutability can be technically circumvented with atoms but they still follow rules
- vectors, maps, sets are data structures that follow immutability
- lisp heritage
- Assistant
- User
Add more I didn't talk about in the notes
- Assistant
- User
Give me in-depth information about Ring and Compojure
- Assistant