What makes Clojure Clojure?

479 views
Skip to first unread message

Didier

unread,
Mar 4, 2017, 6:51:51 PM3/4/17
to Clojure
The Specter post about if it should be made into core or not got me wondering what makes Clojure Clojure.

I'm trying to wrap my head around what is the most minimal set of things that uniquely make up Clojure.

Right now, in that set I've got:
  • The Clojure syntax and its semantics
  • The Clojure special forms and their semantics
  • The Clojure core libraries and their semantics
So if I implemented a compiler that worked with the above set, it would be a valid Clojure compiler.

Now, ClojureScript appears to me like it is not Clojure, but a dialect of it. I say that because it breaks some of the syntax semantics of Clojure, like not allowing macros in the same namespace as functions. It also breaks some of the core semantics, like def creating standard JS vars and not Clojure Vars. In this respect, a language like hy-lang is also a Clojure dialect, granted it shares even less of the Clojure set.

Is ClojureCLR a dialect of Clojure, or is it a true Clojure implementation?

One last thing that is interesting about Clojure versus other languages is that it does not provide standard IO. These two things make it so that it is kind of dependent on its host to complete its offering as a programming language, which means any Clojure compiler will need to provide a mechanism for IO. Those would always differ from Clojures to Clojures, so I don't think that's part of what makes Clojure Clojure.

What are others thoughts on this?

P.S.: There's no point to this thread, its mostly curiosity.

Alex Miller

unread,
Mar 4, 2017, 7:35:28 PM3/4/17
to Clojure
Rich considers ClojureScript and ClojureCLR to be dialects of Clojure, not different languages.

John Newman

unread,
Mar 4, 2017, 7:46:38 PM3/4/17
to Clojure
Yeah, only Rich can really answer that question, right? :) But for me, Clojure is increasingly becoming cljc. When a library advertises compatibility in both clj and cljs, it just looks shinier to me. Feels like a trend for Clojure libraries in general. And if agents and STM were on cljs, I'd probably reach of those tools more often on both platforms. 

On that note, if some Clojure concurrency magician would implement a lightweight threading library in cljc, which worked on both single-threaded cljs (offloading to webworkers where available) and JVM/CLR, allowing for STM on cljc... Hell, I'd throw down on a bounty for that. It would really bring cljs and clj into closer parity. And it would make cljs even more appetizing to js programmers. And it would reunite cljs with one of clj's original selling points - how immutability and persistent structures allow for unparalleled (lol) concurrency solutions.

I almost got a rudimentary pmap thing working in cljs on core.async with webworkers by using a binding-hack macro I found online somewhere. I couldn't find great docs out there though on how to implement a lightweight threading library.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Baldor

unread,
Mar 5, 2017, 11:50:14 AM3/5/17
to clo...@googlegroups.com
I feel like it should be obvious, but what are the acronyms (initialisms?) clj and cljc?

I'm assuming that cljs is ClojureScript.

Sent from my iPhone

Colin Yates

unread,
Mar 5, 2017, 12:13:03 PM3/5/17
to clo...@googlegroups.com
cljs = ClojureScript
clr = Clojure on the Common Language Runtime (aka .NET)
cljc = Something that can be interpreted in either clj and cljs (and
clr I assume?) using Clojure conditionals.

For more info on the excellent cljc read
https://clojure.org/guides/reader_conditionals.

If you haven't yet experienced an app with Clojure on the backend,
ClojureScript on the front end and the messaging logic using cljc,
transit and EDN then you should treat yourself and try it :-).

Alex Miller

unread,
Mar 5, 2017, 5:52:01 PM3/5/17
to Clojure
cljc is (nothing more than) a file extension (the extra c stands for "common") indicating a file that can be read in more than one Clojure platform.

cljc files also support reader conditionals by default on read (but they are of course not required if not needed).

Reply all
Reply to author
Forward
0 new messages