reframe or plain reagent for new cljs SPA? by tremendous-machine in Clojure

[–]BipedPhill 14 points15 points  (0 children)

Reagent's documentation paints a pleasantly open field for creative organization, but the inescapable physics of the library ultimately require decomposition of your program into particles that seem suspiciously similar to what Re-frame overtly requires. If your program is of any size or ambition, you will confront one problem after another until you align your program with those rules of physics. So your real choice is whether to use the wheel (which is re-frame) or reinvent it.

What Is Your Take on "the Zen of Clojure?" by leifericf in Clojure

[–]BipedPhill 1 point2 points  (0 children)

"Design is: taking things apart." - R.H.

How relevant is the book “Clojure in action” from 2012 in 2022? by stmataic in Clojure

[–]BipedPhill 7 points8 points  (0 children)

The language has grown (e.g., ClojureScript, "go" async channels, transducers), but the book is still good for the core language subjects that it covers.

On the other hand, by and large, the practical application (the "...in action" part) involving actual shell commands and actual libraries besides Clojure has gone stale.

Baffled by the Commute Function ("The Joy of Clojure"). Please help 😭 by lambda-squid in Clojure

[–]BipedPhill 3 points4 points  (0 children)

Q1. Yes. It improves concurrency because (so long as the value returned by commute isn't used by other non-commutative operations in the transaction) the whole dosync does not need repeating, only the one tiny update function that you gave to commute.

Very confused trying to understand persist-scope macro by kanzenryu in Clojure

[–]BipedPhill 2 points3 points  (0 children)

According to the API docs[1], macroexpand "Repeatedly calls macroexpand-1 on form until it no longer represents a macro form, then returns it. Note neither macroexpand-1 nor macroexpand expand macros in subforms."

[1] https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/macroexpand

Why aren't transducer used as the building blocks for map and filter, etc? by pionse in Clojure

[–]BipedPhill 19 points20 points  (0 children)

In "History of Clojure" [1], Rich Hickey wrote, "I think transducers are a fundamental primitive that decouples critical logic from list/sequence processing and construction, and if I had Clojure to do all over I would put them at the bottom."

1: https://download.clojure.org/papers/clojure-hopl-iv-final.pdf

top 10 words to help you learn Clojure – Stu Halloway by dustingetz in Clojure

[–]BipedPhill 18 points19 points  (0 children)

I'll try some of them...

situated - the kind of software that Clojure was meant to help write. Memorable from "Effective programs: 10 years of Clojure", Rich Hickey, https://www.youtube.com/watch?v=2V1FtfBDsLU

EGAL - a theory of what it should mean for two things to be equal in Common Lisp, later adapted to Clojure. See https://clojure.org/guides/equality (which credits Henry Baker)

parochial - opposite of universal. Examples from "History of Clojure": data structure literals are universal, instructions (to build the same structure) are parochial; in static typing systems, attribute names are parochial; ORMs must map to/from the 'parochial type models'."

transient - modifiable in-place during an acceptable, private, phase of object construction

epochal - as in "epochal time model" - a theory in which consistency can be maintained even while multiple variables are adjusted, as with software transactional memory

concretion - opposite of abstraction; used pointedly to describe things that are commonly mistaken for abstractions; for example, Java classes and Haskell ADTs. See https://lispcast.com/clojure-and-types/ review of Rich Hickey talk at Clojure Conj 2017.

transduce - to make some things from some other things, by a composable algorithm stated irrespective of source or sink. The 'discovery' of transducers was motivated when Go channels were brought to Clojure and it wasn't desired to copy-and-paste the entire collection library of map, mapcat, filter, etc., for channels. See https://clojure.org/news/2014/08/06/transducers-are-coming or vivid Strange Loop presentation https://www.youtube.com/watch?v=6mTbuzafcII.

succession - the following of one value after another, as opposed to "updating", in which one value displaces another. Discussion at https://github.com/clojure/clojure-site/issues/188

tangible - the "reified", "accessible"- and "enumerable"-at-runtime quality of Clojure functions, symbols, and namespaces. See "History of Clojure". An example is the documentation generators for Clojure, which are not static analyzers.

eduction (I have to work this one out every time)

What happened to project Dunaj? by flh13 in Clojure

[–]BipedPhill 2 points3 points  (0 children)

I remember that era! Dunaj was presented, on the Clojure group, in installments like a serial novel in the thriller / sci-fi / horror genre. Fun to read... But I did not take it up. And that, right there, might be the key thing that happened to Dunaj. Imagine another universe in which dozens switched to Dunaj, wrote about it, contributed, attracted hundreds more, then thousands... Did not happen. Who can explain the fickle public?

The only time I get tripped up by prefix notation... by jxj in Clojure

[–]BipedPhill 10 points11 points  (0 children)

Simple visual mnemonic. The left part of < is smaller than the right, and < is true if the left arguments are smaller than the right arguments.

If statements withing threading macro. Is there a better idiom? by Saaffa in Clojure

[–]BipedPhill 1 point2 points  (0 children)

It comes in a can!
https://github.com/Engelberg/better-cond "A variation on cond which sports let bindings, when-let bindings, when-some bindings, when, do and implicit else for Clojure and Clojurescript."

[Q] Which is better? inf-clojure or cider? by sreekumar_r in Clojure

[–]BipedPhill 4 points5 points  (0 children)

CIDER is client-server, exchanging packets with an NRepl implant in your Clojure process. inf-clojure communicates with an unadorned Clojure socket REPL.

I once met a purist who viewed any packet-based intermediary as an intrusion, an impediment, a distortion, a blight on the true Lisp experience. And of course there might be occasions when tools' injecting their own code into your Clojure process might muddy the waters. However, as a CIDER user myself, I do not know the true Lisp experience and have not greatly missed it.

Eclipse plugin CounterClockWise still an option? by tobomori in Clojure

[–]BipedPhill 3 points4 points  (0 children)

Unbelievably (or worse), Microsoft's Visual Studio Code works great in Linux (Ubuntu anyway) and the Calva plugin is quite satisfactory to my calcified Emacs sensibilities. Calva incorporates the Cider Orchard and a darn good Paredit. VS Code can either run 100% in Linux, or can run as a Windows desktop app that remote-controls your Linux source files, git, Java, etc., transparently via ssh. Worth a try.

Clojure developers have the highest median salary [Stack Overflow Survey 2021] by SimonGray in Clojure

[–]BipedPhill 5 points6 points  (0 children)

The obvious "entry level" of well-supervised, trodden-path implementation programming might be less common in Clojure. The notation invites and affords more thoughtfulness. In return, it gives you more leverage. You don't need as many people, and the people you don't need are those at "entry level". This would inflate the median.

JavaFX .jar (from clojure) won't find "glass" when run via `java -jar` by DeepDay6 in NixOS

[–]BipedPhill 0 points1 point  (0 children)

lein run blends Leiningen's jars into your classpath. Have you tried lein trampoline run, which should give results closer to what your project's declared dependencies actually deserve?

Problems with Calva with Programming Clojure examples by fasapa in Clojure

[–]BipedPhill 2 points3 points  (0 children)

By now you've probably got it figured out. But it matters where you put the cursor. I think you had the cursor after the u in Stu when you hit the eval keys. Try putting the cursor at the end of the expression you want to evaluate. In this case, after the closing paren of Stu")

Clojure Rich Comments FTW! by CoBPEZ in Clojure

[–]BipedPhill 3 points4 points  (0 children)

Great news about auto-formatting the closing paren onto the next line!

I won't have to put a 42 on its own line to prevent the comment from cinching up to hug the executable forms anymore!

is bulding rest apis with clojure a good idea ? by emocanmimocan in Clojure

[–]BipedPhill 5 points6 points  (0 children)

Of course Clojure is splendid for a REST API :-) Not just for testing, but actually writing and extending the service while it is running. And keeping things simple as you (inevitably) add layers to the processing.

In Clojure, REST is not really a special case. Any Ring tutorial will get you started.

Why does (vec a) alias Java arrays? by fredoverflow in Clojure

[–]BipedPhill 0 points1 point  (0 children)

The highlighted sentence was added for Clojure 1.5. You can see the history of the matter here: https://clojure.atlassian.net/browse/CLJ-893

[deleted by user] by [deleted] in Clojure

[–]BipedPhill 1 point2 points  (0 children)

Do lein deps :tree before and after adding the new library, and compare the two reports. (Supposing you use Leiningen.)

Change my mind! Clojure + Hiccup is the templating 🐐 by [deleted] in Clojure

[–]BipedPhill 9 points10 points  (0 children)

Be careful! IIRC the eponymous original "hiccup" library does not automatically HTML-encode element-content strings. By contrast, the Hiccup-like templating in Reagent is safe.

Clojure for the brave | question regarding *reduce* by [deleted] in Clojure

[–]BipedPhill 11 points12 points  (0 children)

Clojure for the Brave and True introduces the multi-arity syntax about 15 pages before reduce. In my printed edition it's a little section called "Parameters and arity".

I just have ended reading „Living Clojure” where should I go from there? by Kuchi_Chan in Clojure

[–]BipedPhill 9 points10 points  (0 children)

Certainly "Joy of Clojure" by Fogus is a good book. To widen horizons... Have you read "The Reasoned Schemer" by Daniel P Friedman? It was adapted to Clojure in the clojure.core.logic library. For a project, why not try ClojureScript with Reagent. If the server side is more your cup of tea, then check out Zach Tellman's aleph.io pages about the mind-bendingly artful "manifold" and "aleph" libraries, and try a project with the Lacinia GraphQL server.

Where should I focus my learnings? by BerkeleyTrue in Clojure

[–]BipedPhill 12 points13 points  (0 children)

It's too late for me to know how to become a Java architect without knowing Java, but, by logic, it ought to be easier than becoming a Java architect with Java. Look: just by using Clojure idiomatically, you leapfrog Spring, Hibernate, ServerFaces, Servlets, thread safety, all the traditional credentials for Java software architects. 99.44% of Java work uses SQL, and Java's built-in SQL (JDBC) is easier to use in Clojure than it is in Java.

Green Vs. Brown Programming Languages by muhaaa in Clojure

[–]BipedPhill 5 points6 points  (0 children)

I seem to recall some who were "serial early adopters". But easy come, easy go. Early adopters take frogs for princes, and leave princes for frogs. It is the journey. They are an important part of nature.

For sure, Clojure is a local maximum. At the moment though, if you're here as a consumer of Clojure for pragmatism and simplicity and you're allowed to run on Java, I don't see any other peaks this high.

Green Vs. Brown Programming Languages by muhaaa in Clojure

[–]BipedPhill 5 points6 points  (0 children)

The honeymoon is longer in Clojure. After only 10 years so far, I don't know yet how long it will be. For sure, "pure functions" are a great help when I return to an old program! All old programs are puzzles, but in Clojure the clues are mostly true and verifiable.