Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts
Log In
Found the internet!
Create an account to follow your favorite communities and start taking part in conversations.
Posts
Communities

Posts about Clojure

Subreddit Icon
r/Clojure
31.3k members
Clojure is a dynamic, general-purpose programming language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming.
Visit
r/clojure_ja
26 members
Clojure ๆ—ฅๆœฌ่ชžใ‚ตใƒ–ใƒฌ
Visit
Subreddit Icon
r/programming
5.6m members
Computer Programming
Visit
Subreddit Icon
r/lisp
37.5k members
A subreddit for the Lisp family of programming languages.
Visit
Subreddit Icon
r/ClojureJobsHiring
108 members
Job posts where Clojure skills are wanted
Visit
r/Clojurescript
3.1k members
Welcome to r/Clojurescript
Visit
Subreddit Icon
r/mit6824clojure
123 members
An online class area for mit6824clojure
Visit
Subreddit Icon
r/spacemacs
6.4k members
Subreddit for the [Spacemacs](https://github.com/syl20bnr/spacemacs) project
Visit
Subreddit Icon
r/emacs
66.8k members
The extensible, customizable, self-documenting real-time display editor.
Visit
Subreddit Icon
r/haskell
75.4k members
The Haskell programming language community. Daily news and info about all things Haskell related: practical stuff, theory, types, libraries, jobs, patches, releases, events and conferences and more...
Visit
r/playcljc
79 members
A place to discuss play-cljc, a Clojure and ClojureScript game library.
Visit
Subreddit Icon
r/generative
70.6k members
Generative art refers to art that in whole or in part has been created with the use of an autonomous system. This subreddit is for sharing and discussing anything generative (including music, design and natural phenomena), but especially art.
Visit
Subreddit Icon
r/scala
51.0k members
Welcome to r/scala
Visit
r/lispgamedev
331 members
Welcome to r/lispgamedev
Visit
Subreddit Icon
r/fulcro
113 members
Unofficial community for Clojure framework Fulcro http://fulcro.fulcrologic.com/
Visit
Subreddit Icon
r/functionalprogramming
22.3k members
A subreddit for functional programming related material.
Visit
Subreddit Icon
r/java
300k members
News, Technical discussions, research papers and assorted things of interest related to the Java programming language NO programming help, NO learning Java related questions, NO installing or downloading Java questions, NO JVM languages - Exclusively Java
Visit
Subreddit Icon
r/vim
160k members
The place for questions and conversation on the Vim editor
Visit
Subreddit Icon
r/ProgrammingLanguages
91.1k members
This subreddit is dedicated to the theory, design and implementation of programming languages.
Visit
r/learnprogramming
4.0m members
A subreddit for all questions related to programming in any language.
Visit
r/json
1.6k members
Welcome to r/json
Visit
Subreddit Icon
r/rust
248k members
A place for all things related to the Rust programming languageโ€”an open-source systems language that emphasizes performance, reliability, and productivity.
Visit
Subreddit Icon
r/ruby
80.8k members
Celebrate the weird and wonderful Ruby programming language with us!
Visit
r/Qi_Shen
76 members
Shen is a portable functional programming language that offers pattern matching, ฮป calculus consistency, macros, optional lazy evaluation, static type checking, an integrated fully functional Prolog, and an inbuilt compiler-compiler. http://shenlanguage.org
Visit
Subreddit Icon
r/Common_Lisp
6.9k members
Common Lisp is one of the main Lisp dialects. Developed from 1981 onwards it is still in use today. Major Common Lisp implementations are ABCL, Allegro CL, CCL, CLISP, CMUCL, ECL, GCL, LispWorks, SBCL. This subreddit is for Common Lisp developers.
Visit
r/whitespaceLisp
28 members
Notations for S-expressions, with fewer parentheses ... related to any Lisp dialect (Emacs Lisp, Common Lisp, Scheme, Racket, Clojure, Hy, ... ) ... i-expressions, sweet-expressions, Cirru, Wisp, Rhombus and other.
Visit
Subreddit Icon
r/adventofcode
98.3k members
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
Visit
Subreddit Icon
r/golang
217k members
Ask questions and post articles about the Go programming language and related tools, events etc.
Visit
r/gplcas
63 members
Computer Algebra Systems for General Purpose Languages
Visit
76
Subreddit Icon
โ€ขPosted byu/[deleted]3 months ago

After having written several small projects over the past 9 months I'm leaving this language and want to outline some reasons for that decision such that anyone inclined can work towards bettering this ecosystem.Long post incoming.

The Appeal

In August '22 I spent a month doing haskell after I got a recommendation by a professor.I was also already using emacs since January of that year.I enjoyed functional programming and was just familiar enough with the paradigm as well as the best supported editor to give it a shot.Highlights of the coming months would be the strong support for higher order pipelines through the ->> operator, as well as the well thought out core data structures, especially maps.Another big appeal was the premise of "write clojure everywhere".

On boarding

Initial on boarding with "Clojure for the brave and the true" was fine-ish.Definitely not as great as official resources from other languages such as the official python tutorial, the go tour or the rust book.But at the same time no worse than introductions to comparable languages, such as "Learn you a Haskell"

Going from the first few lines to the first few projects was okay-ish as well.Leiningen was well documented and introduced and libraries for most tasks exist.Some domains have several available libraries with no one bold enough to clearly mark one as the standard.This meant it took me a bit longer than it should to land on hickory for my html parser and cheshire for json, but it's fine in the grand scheme of things.

At some point I wanted to migrate to the official clojure cli.That experience was very rough and I'll go more into some details in the following section, but for now I must cite lack of well written tutorial / walk-through style documentation and lack of coherency.

Project Management

Leiningen is a perfectly reasonable tool. The official clojure cli is not.Every relevant language today just does name build,name run or name install where you replace name with the tool name.Now fasten your seat belts for the official way to run a clojure program: clj -M -m my-code.coreBut let's assume that I want to actually build a jar file, I now have to:

  1. add tools.build to my dependencies

  2. write a whole build.clj file

  3. add an alias to my deps.edn for actually building

Graalvm & babashka

So every once in a while I might want to write a program that doesn't take >1s to start.Both tools are probably about as good as they can reasonably be, given their ecosystem.Both are far from a drop-in replacement.

With babashka it's not too bad. Sure, many libraries aren't supported, but that's to no fault of borkdude. Not much needs to be rewritten and the things that do are not too painful.In an ideal case I wouldn't have to rewrite and could just choose it as my clojure implementation of choice, but it's tolerable.

Graalvm is way more of a mess. It took me weeks of occasional tinkering to get my application (a small cli youtube client) working with graalvm native image. If I hadn't accidentally used an older hickory version it probably would have never worked. I went on to go into the hickory codebase and bisect for the error, and at some point got contribution rights to hickory to upstream those changes. I also documented the issues for the next guy.Terrible experience.

Web Stuff

Clojure is supposed to be the best lisp for the web, the best functional language for the web even.Being able to compile to both the jvm and javascript is a unique trait that no other language I'm aware of has.Yet, after getting motivated to pursue a small web application, I was totally put off.

Descision fatigue everywhere, in fact decision fatigue that is only matched by the incredible churn in the javascript ecosystem. Python has Flask and Django, Elixir has Phoenix, Ruby has Rails, Go has their standard library.Here I'm supposed to pick all the little components myself and end up with 5-6 different libraries that hopefully synergise? No thanks.

And that isn't even the bad part, that's merely a non-strengh. The bad part is the assumed domain knowledge. In clojurescript there are about a dozen react wrappers. None of them prominently link to a good getting started tutorial. It's like the clojurescript guy is supposed to already have extensive experience in js before starting. The backend is only marginally better tbh.

In some hypothetical ideal clojure ecosystem there would be reagent, compojure and a nice, open source book written about each of them.

What to do about it?

Thankfully, there already exists a great talk on the matter that I do agree with: "How to Increase Clojure Awareness" by Artem Bramin at clojureU 2022 (link)
Especially that time to hello world needs to get seriously addressed if this language wants to have any hope of becoming relevant outside the FP niche.

tldr: Clojure is a beautiful language in a horrendous ecosystem. I'm out.
76
98 comments
583
583
261 comments
57
57
37 comments
33
Subreddit Icon
โ€ขPosted by3 months ago

My background is in Elm/Scala/TypeScript so it's natural for me to think about everything in terms of types. I am used to write code that models a domain using, ideally, a robust MH type system and where every function has well defined inputs and outputs. Code doesn't compile if the types don't line up.

I am captivated by Clojure/Lisp and the simplicity of representing everything as lists, but I don't understand how to do domain modeling in Clojure. I understand that there are a few type libraries, but I would like to really learn how to Clojure the way Clojure experts do it and write idiomatic code. I also don't believe the Clojure is "unsafe", because there's lots of people who really like writing code in it (the same applies to Elixir). Therefore I must conclude that there is a system of providing safe domain modeling that I don't understand, which I would like to.

Since type safety is most important in refactoring, here's an example from an actual codebase:

We recently had to refactor our medium-sized TypeScript codebase (~250K LOC) to account for a new integration. This involved changing the database schema of the bank_accounts table. In our codebase, each table is mirrored with an object that tracks its type. Throughout the codebase, there are dozens of function, most of them pure, that do some transformation involving a bank account as as input.

To facilitate this refactor, we changed the bank_account schema type in the codebase. The compiler alerted us to the location of the various functions, and we clicked through to each and refactored them. The code would not compile until we did so, which I believe prevented runtime crashes and NPEs if the code was allowed to ship as is

How would this be done in Clojure?

33
59 comments
652
652
213 comments
72
Subreddit Icon
โ€ขPosted byu/[deleted]6 months ago

Hello fellow Lispers,

I have now been writing clojure for about half a year and have been quite productive with it. Seems like a neat ecosystem with cider on emacs, some linters and clojuredocs.org open it's very productive. My problem is that my preferred domain of programming isn't well supported: web scraping.

What I dislike in clojure so far:
What makes me skeptical of common lisp:
  • CLOS: I like functional programming and it's idioms, relying on higher order functions to implement most of what I do. From various corners of the internet it seems like CLOS is just the way you do serious common lisp development.

  • Missing sly inspector: Cider has an inspector where I can have a detailed view of the last eval's result in a split. Very useful for traversing dom trees whenever I have to, as that doesn't fit in the message area. Did I miss it with sly? Is it maybe available in slime?

  • No good clojuredocs.org pendant: I have only found the cookbook so far, which is neat for an overview and certainly a better starting point than practical common lisp for someone that already somewhat knows what they're doing in lisp. Do you guys have some website with definitions of the builtin functions along community submitted notes and examples?

  • Linters: You guys don't have those? Don't like those? Seems weird to me that decades old lisp critic and some linter from the lem dev is all that gets indexed by my search engine of choice.

  • Library discovery: How do I find what I need?

I'd really appreciate some input on the matter, as it would likely take a week or two until I'd be as productive in common lisp as I am in clojure and I wouldn't want to make the switch on a whim.

Edit (after 2h): to clarify on linting, I'm primarily looking for a replacement of kibit. This linter tells you when you miss idioms. e.g. you use (first (next x)) when (fnext x) exists. Or you use (not (= x y)) when (not= x y) exists.A formatter would be nice too, but I can definitely forego clj-kondo or eastwood like linters

Edit (after 7h): loving the engagement on this. It seems as of now like a scheme would be more aligned with my programming style and preferences. I've been particularly impressed by the talk A Guiler's Year of Racket. It seems to me like scheme trades a price in versatility and raw power for quality and coherence when contrasted with common lisp, and for me that's a worthwhile tradeoff

Edit (after 22h): racket it is!

72
65 comments
82
82
55 comments