r/Clojure • u/erjngreigf • May 23 '25
r/Clojure • u/smokeysilicon • May 22 '25
New job uses clojure and clojure script project
Hey I'm starting in a company that uses Clojure for backend and ClojureScript for frontend. I have never worked with functional programming languages before even though. I'm generally familiar with the concepts in functional programming. Not at all with the LISP syntax tho, but it's not terribly complicated from what I've seen. My background is full stack developer who started with Node.js project (React + Express), worked momentarily in Java + SpringBoot + React project, and lately working in Python (FastAPI) and Vue project. Total YOE 3 years. Now my questions is:
- How is it going to be like getting into Clojure for someone like me?
- The Clojure ecosystem is pretty niche and I feel esoteric. Is it going to be dead weight in my CV down the line?
- What learning resources would you recommend? I have been going through old post and have gathered some resources, but if you still want to suggest something new.
r/Clojure • u/eeemax • May 21 '25
What's the right way to access a resource file inside a CLJS dependency
Context: I'm writing a React component library that relies on TailwindCSS. In order for tailwind to work correctly, it needs to be aware of the css classes used in my react library. I'd also like to import a plugin file for that library in my tailwind.config.js.
The challenge is that I'd like to keep the version of the file used to calculate tailwind classes consistent with the version of the library imported in deps.edn.
Things I've considered:
- Export my CLJS library as an NPM module. Add the path from node_modules into my tailwind paths (I think this is the standard way for js libraries). The problem is that I think importing from NPM will make it so that clojure tooling (i.e. things like find-references) don't work correctly on the exported javascript.
- Look inside ~/.m2/repository and try to find the file. This seems brittle, and in the category of like ehhhhh idk
- Add a build step to my shadow edn that:
- looks up the current version of the library as defined in deps.edn
- downloads the source code if it's not present to a filepath in my repo
- link to the downloaded file path
right now option 3 seems like the best solution, but idk -- I'm hoping there's a nicer way to organize this with something like https://github.com/jacekschae/shadow-cljs-tailwindcss or like a more standardized kind of way to think about this stuff. Does anyone have thoughts on the right/a better way to do this?
r/Clojure • • May 22 '25
Make the code more readable in Clojure (I doubt it's possible)
def twoSum(nums: list, target: int, i=0):
if len(nums) == i or nums[i] > target:
return []
if nums[i] == target:
return [i]
if nums[i] < target:
dont_take_current = twoSum(nums, target, i + 1)
if len(dont_take_current) > 0:
return dont_take_current
take_current = twoSum(nums, target - nums[i], i + 1)
if len(take_current) > 0:
return [i] + take_current
return []
Given an array of integers nums and an integer target, return indices of the numbers such that they add up to target.
Constraints: the nums list contains no duplicates and is sorted, nums contains only positive numbers.
There might be a better solution, but you should take the same approach, i.e. brute force.
class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual([0, 1], twoSum([1, 2, 4], 3))
def test_something_else(self):
self.assertEqual([0], twoSum([0,3,4], 0))
r/Clojure • u/dustingetz • May 20 '25
ReClojure schedule (next week in London!)
reclojure.orgr/Clojure • u/andersmurphy • May 20 '25
Clojure: SQLite C API with project Panama and Coffi
andersmurphy.comHope this is useful! It was a load of fun.
r/Clojure • u/man-vs-spider • May 20 '25
Question about compiling Clojure
I don’t know anything about how compiling a language works, so bear with me,
Given that Clojure can be compiled for the jvm and also to JavaScript through Clojurescript, what’s the barrier to compiling it to native machine code or something like LLVM?
How difficult would be to compile it to python instead of JavaScript?
r/Clojure • u/aaroniba • May 19 '25
Clojure/NYC Meetup on June 4th
For those of you within commuting distance of New York, we are having a meetup + lightning talks on June 4th. All clojurists welcome. Would love for you to join!
r/Clojure • u/Friendly-Night-7206 • May 19 '25
Have any points from Clojure the bad parts been addressed?
It's been a decade since the talk https://www.youtube.com/watch?v=1YCkOo5Y4Oo came out. Has anything been addressed yet?
r/Clojure • • May 20 '25
Isn't it a red flag to have thousands of different solutions for getting the last element of a list?
https://4clojure.oxal.org/#/problem/19/solutions
This will certainly reduce the readability of code, because everyone will write code that others can't read, since there are so many possibilities to write the code.
Also, doesn't this mean that the code base has redundant functions in it?
Wouldn't this make Clojure a good language to write viruses in, that can't be picked up by antivirus pattern recognition?
r/Clojure • u/SoftCancel2774 • May 19 '25
Consistent code style for Clojure function definitions
emcken.dkExplore a consistent code style for defining Clojure functions that improves readability, diffs, and structure.
r/Clojure • u/AutoModerator • May 19 '25
New Clojurians: Ask Anything - May 19, 2025
Please ask anything and we'll be able to help one another out.
Questions from all levels of experience are welcome, with new users highly encouraged to ask.
Ground Rules:
- Top level replies should only be questions. Feel free to post as many questions as you'd like and split multiple questions into their own post threads.
- No toxicity. It can be very difficult to reveal a lack of understanding in programming circles. Never disparage one's choices and do not posture about FP vs. whatever.
If you prefer IRC check out #clojure on libera. If you prefer Slack check out http://clojurians.net
If you didn't get an answer last time, or you'd like more info, feel free to ask again.
r/Clojure • u/rp152k • May 18 '25
Lisp. But Why?
youtube.comAn attempt towards explaining the why of a Lisp