Skip to content

Commit d9042c1

Browse files
committed
Merge branch 'master' into cli-doc
2 parents 7a2d810 + 55ca1f4 commit d9042c1

File tree

14 files changed

+124
-58
lines changed

14 files changed

+124
-58
lines changed

content/dev/contrib_howto.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Things you should do if you are a Clojure Contrib committer:
2525

2626
* maintain your library and respond to questions/issues that arise
2727
* do your work on the master branch, or (if you are working on a significant chunk you want to keep temporarily separate) on a feature-specific branch that you create yourself
28-
* use the Maven Release option on build.clojure.org to make releases
28+
* use the GitHub "Release on demand" Action to make releases
2929
* coordinate with other committers before making changes to their libraries
3030
* accept contributions from others only if they have <<contributors#,signed the CA>>
3131

content/dev/contrib_libs.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ These libraries use the same contribution model (<<contributor_agreement#,Contri
1414
* Source control - Git libraries on GitHub
1515
* Issues - https://clojure.atlassian.net/projects/CLJ[JIRA]
1616
* Development model - patches in JIRA, no PRs
17-
* Continuous integration - https://build.clojure.org[Jenkins]
17+
* Continuous integration - GitHub actions in each project
1818
* Doc generation and hosting - https://tomfaulhaber.github.io/autodoc/[Autodoc] and GitHub https://clojure.github.io/[pages]
1919
* Builds - Maven with deployment to Maven Central under the groupId `org.clojure`
2020

content/dev/contributors.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ Alan Malloy,
10131013
Henrish Maluleka,henroid
10141014
Itay Maman,
10151015
Chester Mancini,chetmancini
1016-
Vedang Manerikar,
1016+
Vedang Manerikar,vedang
10171017
Max Jiayin Mao,jmao
10181018
Matthew Maravillas,
10191019
Tom Marble,

content/guides/dev_startup_time.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ The `compile` function takes a namespace symbol and compiles that namespace and
2424

2525
Subsequently, when any of those compiled namespaces are required, the class file will be loaded, rather than the original `.clj` file. If a source file is updated (and thus newer), it will be loaded instead. Periodically, you will need to re-compile to account for new dependencies or changing code.
2626

27-
One special case is the `user.clj` file loaded automatically by the Clojure runtime, before any other code is loaded. If you are using a `user.clj` in dev, you need to force a reload because it has already been loaded automatically:
27+
Note that compilation is a side effect of loading, so has no effect on already loaded namespaces. In particular, one special case is the `user.clj` file, which is loaded automatically by the Clojure runtime. If you are using a `user.clj` in dev (or need to compile namespaces that are already compiled), you can do so by forcing a reload while compiling:
2828

2929
[source,clojure]
3030
----
31-
(binding [*compile-files* true] (require 'user :reload-all))
31+
(binding [*compile-files* true] ;; compile during load
32+
(require 'user :reload-all)) ;; reload this and all transitively loaded namespaces
3233
----
3334

3435
That's it! This technique can substantially reduce your startup time during development, particularly as the number of dependencies you load increases.

content/guides/faq.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ All Clojure vars are globally available so again there is not much in the way of
383383
[[clj_replace]]
384384
**<<faq#clj_replace,Is clj a replacement for lein and boot?>>**
385385

386-
No. The clojure tools are focused on a) building classpaths and b) launching clojure programs. They do not (and will not) create artifacts, deploy artifacts, etc.
386+
No. The Clojure CLI is focused on a) building classpaths and b) launching clojure programs. It does not (and will not) create artifacts, deploy artifacts, etc, although they may facilitate these actions through tools and libraries.
387387

388388
tools.deps aims to provide programmatic building blocks for dependency resolution and classpath construction. clj/clojure wraps these into a command-line form that can be used to run Clojure programs. You can compose these pieces to do many other things.
389389

@@ -438,7 +438,7 @@ https://groups.google.com/forum/#!msg/clojure/jWMaop_eVaQ/3M4gddaXDZoJ[Link] to
438438
[[native]]
439439
**<<faq#native,Will there be a native version of Clojure in the future?>>**
440440

441-
Frequently people ask for a "native" version of Clojure, ie one that does not rely on the JVM. ClojureScript self-hosting is one current path but probably only useful for a subset of use cases. The https://www.graalvm.org/[GraalVM] project includes standalone execution using the SubstrateVM. Native images produced with Graal start extremely fast but may have fewer opportunities to optimize performance than the full JVM.
441+
Frequently people ask for a "native" version of Clojure, ie one that does not rely on the JVM. ClojureScript self-hosting is one current path but probably only useful for a subset of use cases. The https://www.graalvm.org/[GraalVM] project can be used to create a standalone binary executable. Native images produced with Graal start extremely fast but may have fewer opportunities to optimize performance than the full JVM.
442442

443443
However, neither of these is likely what people are envisioning when they ask for a "native version of Clojure", which is a version of the language that is not JVM-hosted and compiles directly to a native executable, probably via something like LLVM. Clojure leverages an enormous amount of performance, portability, and functionality from the JVM and relies heavily on things like a world-class garbage collector. Building a "Clojure native" would require a large amount of work to make a version of Clojure that was slower (probably much slower), less portable, and with significantly less functionality (as the Clojure library relies heavily on the JDK). The Clojure core team has no plans to work on this but it would be an amazing learning project for anyone and we encourage you to go for it!
444444

content/guides/tools_build.adoc

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The remainder of this guide demonstrates individual common use cases and how to
5757

5858
The most common Clojure build creates a jar file containing Clojure source code. To do this with tools.build we'll use the following tasks:
5959

60-
* `create-basis` - to create a project basis
60+
* `create-basis` - to create a project basis (note: this will download deps as a side effect)
6161
* `copy-dir` - to copy Clojure source and resources into a working dir
6262
* `write-pom` - to write a pom file in the working dir
6363
* `jar` - to jar up the working dir into a jar file
@@ -72,17 +72,19 @@ The build.clj will look like this:
7272
(def lib 'my/lib1)
7373
(def version (format "1.2.%s" (b/git-count-revs nil)))
7474
(def class-dir "target/classes")
75-
(def basis (b/create-basis {:project "deps.edn"}))
7675
(def jar-file (format "target/%s-%s.jar" (name lib) version))
7776
77+
;; delay to defer side effects (artifact downloads)
78+
(def basis (delay (b/create-basis {:project "deps.edn"})))
79+
7880
(defn clean [_]
7981
(b/delete {:path "target"}))
8082
8183
(defn jar [_]
8284
(b/write-pom {:class-dir class-dir
8385
:lib lib
8486
:version version
85-
:basis basis
87+
:basis @basis
8688
:src-dirs ["src"]})
8789
(b/copy-dir {:src-dirs ["src" "resources"]
8890
:target-dir class-dir})
@@ -148,23 +150,25 @@ An example build for a compiled uberjar will look like this:
148150
(def lib 'my/lib1)
149151
(def version (format "1.2.%s" (b/git-count-revs nil)))
150152
(def class-dir "target/classes")
151-
(def basis (b/create-basis {:project "deps.edn"}))
152153
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
153154
155+
;; delay to defer side effects (artifact downloads)
156+
(def basis (delay (b/create-basis {:project "deps.edn"})))
157+
154158
(defn clean [_]
155159
(b/delete {:path "target"}))
156160
157161
(defn uber [_]
158162
(clean nil)
159163
(b/copy-dir {:src-dirs ["src" "resources"]
160164
:target-dir class-dir})
161-
(b/compile-clj {:basis basis
165+
(b/compile-clj {:basis @basis
162166
:ns-compile '[my.lib.main]
163167
:class-dir class-dir})
164168
(b/uber {:class-dir class-dir
165169
:uber-file uber-file
166-
:basis basis
167-
:main 'my.lib.main}))
170+
:basis @basis
171+
:main 'my.lib.main})))
168172
----
169173

170174
This example directs `compile-clj` to compile the main namespace (by default source will be loaded from the basis :paths). Compilation is transitive and all namespaces loaded by the compiled namespace will also be compiled. You may need to add additional namespaces if code is dynamically or optionally loaded.
@@ -199,10 +203,12 @@ For example, consider a parameterization that includes an extra set of dev resou
199203
(def lib 'my/lib1)
200204
(def version (format "1.2.%s" (b/git-count-revs nil)))
201205
(def class-dir "target/classes")
202-
(def basis (b/create-basis {:project "deps.edn"}))
203206
(def jar-file (format "target/%s-%s.jar" (name lib) version))
204207
(def copy-srcs ["src" "resources"])
205208
209+
;; delay to defer side effects (artifact downloads)
210+
(def basis (delay (b/create-basis {:project "deps.edn"})))
211+
206212
(defn clean [params]
207213
(b/delete {:path "target"})
208214
params)
@@ -212,7 +218,7 @@ For example, consider a parameterization that includes an extra set of dev resou
212218
(b/write-pom {:class-dir class-dir
213219
:lib lib
214220
:version version
215-
:basis basis
221+
:basis @basis
216222
:src-dirs ["src"]})
217223
(b/copy-dir {:src-dirs srcs
218224
:target-dir class-dir})
@@ -246,24 +252,26 @@ This build creates a jar with classes compiled from Java sources and your Clojur
246252
(def lib 'my/lib1)
247253
(def version (format "1.2.%s" (b/git-count-revs nil)))
248254
(def class-dir "target/classes")
249-
(def basis (b/create-basis {:project "deps.edn"}))
250255
(def jar-file (format "target/%s-%s.jar" (name lib) version))
251256
257+
;; delay to defer side effects (artifact downloads)
258+
(def basis (delay (b/create-basis {:project "deps.edn"})))
259+
252260
(defn clean [_]
253261
(b/delete {:path "target"}))
254262
255263
(defn compile [_]
256264
(b/javac {:src-dirs ["java"]
257265
:class-dir class-dir
258-
:basis basis
266+
:basis @basis
259267
:javac-opts ["--release" "11"]}))
260268
261269
(defn jar [_]
262270
(compile nil)
263271
(b/write-pom {:class-dir class-dir
264272
:lib lib
265273
:version version
266-
:basis basis
274+
:basis @basis
267275
:src-dirs ["src"]})
268276
(b/copy-dir {:src-dirs ["src" "resources"]
269277
:target-dir class-dir})

content/news/2013/06/28/clojure-clore-async-channels.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ There are analogous operations for use on ordinary threads - http://clojure.gith
5757

5858
=== Mixing modes
5959

60-
You can put on a channel from either flavor of `>!`/`>!!` and similarly take with either of `<!`/`<<!` in any combination, i.e. the channel is oblivious to the nature of the threads which use it.
60+
You can put on a channel from either flavor of `>!`/`>!!` and similarly take with either of `<!`/`<!!` in any combination, i.e. the channel is oblivious to the nature of the threads which use it.
6161

6262
=== alt
6363

content/news/2023/12/15/deref.adoc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
= Clojure Deref (Dec 15, 2023)
2+
Alex Miller
3+
2023-12-15
4+
:jbake-type: post
5+
6+
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
7+
8+
Welcome to the Clojure Deref! This is a weekly link/news roundup for the Clojure ecosystem (feed: https://clojure.org/feed.xml[RSS]). Thanks to Anton Fonarev for link aggregation.
9+
10+
== Podcasts and videos
11+
12+
* https://www.youtube.com/watch?v=skMMvxWjmNM[Cooking up a workflow for data (by Slutsky, Prately & McLean)] - London Clojurians
13+
* https://www.youtube.com/watch?v=xgewqM39KNo[Learning Clojure, First Steps—Printing Things] - Clojure Diary
14+
* https://www.youtube.com/watch?v=TjzEIHgsgEM[Learn Clojure, First Steps — Arithmetic] - Clojure Diary
15+
* https://www.youtube.com/watch?v=Y4J8PJuBB6U[Flutter/MX: Compute Cycle Detected?! It Happens. We fix it] - Ken Tilton
16+
* https://www.youtube.com/watch?v=77WFLQiroXg[Flutter/MX: Yes, Virginia, the dataflow paradigm can procedural] - Ken Tilton
17+
* https://www.youtube.com/watch?v=YCW-du_y4s4[Beginner's guide to clojure.test and test runners: eftest, kaocha, cognitect test runner] - Andrey Fadeev
18+
* https://www.youtube.com/watch?v=ME-XEC1yEjs[Improving UI :: Advent of Clojure] - Roman Liutikov
19+
* https://www.youtube.com/watch?v=7PiocGVzEDs[Hacking the compiler! :: Advent of Clojure] - Roman Liutikov
20+
* https://clojuredesign.club/episode/103-explorify/[Ep 103: Explorify!] - Functional Design in Clojure
21+
22+
== Blogs, articles, and projects
23+
24+
* https://fpsd.codes/blog/clojure-bites-mazeboard-3-more-async-to-fully-decouple-layers/[Clojure Bites - Mazeboard 3 - core.async to update the UI layer] - Francesco Pischedda
25+
* https://blog.janetacarr.com/building-a-clojure-ci-cd-pipeline/[Building a Clojure CI/CD pipeline of CERTAIN DOOM] - Janet A. Carr
26+
* https://tonitalksdev.com/digitalocean-app-platform-database-migrations[DigitalOcean App Platform and Database Migrations] - Toni Talks Dev
27+
* https://blog.nundrum.net/posts-output/2023-12-07-clojure-to-clojurescript/[From Clojure to ClojureScript] - Nundrum
28+
* https://yamlscript.org/posts/advent-2023/dec-15/[Naughty is Nice!] - Ingy döt Net
29+
30+
== Libraries and Tools
31+
32+
New releases and tools this week:
33+
34+
* https://github.com/balloneij/familiar-codox-theme[familiar-codox-theme] 0.1.0 - A Javadoc inspired Codox theme
35+
* https://github.com/roman01la/cljs-react-devtools[cljs-react-devtools] - React DevTools for ClojureScript wrappers
36+
* https://github.com/noahtheduke/splint[splint] https://github.com/NoahTheDuke/splint/releases/tag/v1.11[1.11] - A Clojure linter focused on style and code shape
37+
* https://github.com/studistcorporation/sleepydog[sleepydog] 0.1.3 - Clojure library for tracing (possibly async) applications with Datadog
38+
* https://github.com/damn/gdl[gdl] - Make 2D desktop games in clojure
39+
* https://github.com/clyfe/clara-eav[clara-eav] https://github.com/clyfe/clara-eav/blob/master/CHANGELOG.md#019---2023-12-15[0.1.9] - EAV triplets for Clara Rules
40+
* https://github.com/clj-kondo/clj-kondo[clj-kondo] https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20231215[2023.12.15] - Static analyzer and linter for Clojure code that sparks joy
41+
* https://github.com/BetterThanTomorrow/joyride[joyride] https://github.com/BetterThanTomorrow/joyride/blob/master/CHANGELOG.md#0041---2023-12-13[0.0.41] - Making VS Code Hackable like Emacs since 2022
42+
* https://github.com/behrica/add-devcontainer[add-devcontainer] https://github.com/behrica/add-devcontainer/blob/main/CHANGELOG.md#03[0.3] - Babashka script which adds a devcontainer configuration to a clojure project in current folder
43+
* https://github.com/clj-commons/aleph[aleph] https://github.com/clj-commons/aleph/blob/master/CHANGES.md#070-rc1[0.7.0-rc1] - Asynchronous streaming communication for Clojure - web server, web client, and raw TCP/UDP
44+
* https://github.com/nextjournal/clojure-mode[clojure-mode] https://github.com/nextjournal/clojure-mode/blob/main/CHANGELOG.md#031[0.3.1] - Clojure/Script mode for CodeMirror 6
45+
* https://github.com/juji-io/datalevin[datalevin] https://github.com/juji-io/datalevin/blob/master/CHANGELOG.md#0825-2023-12-14[0.8.25] - A simple, fast and versatile Datalog database
46+
* https://github.com/squint-cljs/squint[squint] https://github.com/squint-cljs/squint/blob/main/CHANGELOG.md#v0482-2-23-12-14[0.4.82] - Light-weight ClojureScript dialect

content/reference/atoms.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,16 @@ user=> "Elapsed time: 941.445 msecs"
4242
4343
user=> "Elapsed time: 0.044 msecs"
4444
----
45+
46+
== Related functions
47+
48+
Create an Atom: https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/atom[atom]
49+
50+
Examine an Atom: https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/deref[deref] _(see also the +@+ <<reader#,reader>> macro)_
51+
52+
Change Atom state: https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/swap![swap!] https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/reset![reset!] https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/swap-vals![swap-vals!] https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/reset-vals![reset-vals!]
53+
54+
Validators: https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/set-validator![set-validator!] https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/get-validator[get-validator]
55+
56+
Watchers: https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/add-watch[add-watch] https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/remove-watch[remove-watch]
57+

content/reference/deps_and_cli.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ The resolve-deps args should be provided as an alias in one of deps sources and
472472

473473
== Prepare JVM environment
474474

475-
The JVM has many options and some programs also take configuration via Java system properties. JVM options can be passed on the command line for any execution specfier by prefixing with `-J`. If multiple options are specified, each must be prefixed.
475+
The JVM has many options and some programs also take configuration via Java system properties. JVM options can be passed on the command line for any execution specifier by prefixing with `-J`. If multiple options are specified, each must be prefixed.
476476

477477
Additionally, main execution can take a map with key `:jvm-opts`:
478478

0 commit comments

Comments
 (0)