Clojure is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming.
6
votes
2answers
439 views
Could we build a functional computer?
As mush as FP has done, in the end, all our programs are structured.
That is, it doesn't matter how pure or functional we make a them - they are always translated to assembly,
so what actually runs ...
4
votes
1answer
229 views
How to write readable Clojure Code?
I am new to Clojure. I can understand the code I write but it becomes too difficult to understand it later.
It becomes difficult to match parentheses.
What's the generic conventions to follow ...
7
votes
5answers
609 views
Is Clojure's syntax really simpler than Scala's?
Argument which is always made in favour of Clojure is that.
The syntax is simpler and there is only one way of expressing code with no complicated rules.
However Scala has loads of different types ...
5
votes
2answers
337 views
Is Haskell/Clojure actually unsuited for dynamic systems such as particle simulation?
I've been told in previous questions that functional programming languages are unsuited for dynamic systems such as a physics engine, mainly because it's costly to mutate objects. How realistic is ...
5
votes
2answers
159 views
Are square brackets and curly braces in Clojure still S-expressions?
I am trying to learn Lisp and looking at all the Lisps out there and their differences.
I see that in some implementations of Scheme, you can use square brackets interchangeably with round brackets ...
0
votes
2answers
193 views
clojure/erlang/go for high volume server
I have a project that will need to handle 1000s of requests a second with a decent amount of processing for each. For the most part, the processing will be done on a list of items, basically ...
9
votes
4answers
992 views
In what programming language did “let” first appear?
I was wondering about the origins of the "let" used in Lisp, Clojure, and Haskell. Does anyone know which language it appeared in first?
1
vote
4answers
409 views
What are the practical benefits of LISP like syntax which Clojure uses over Java like syntax of Scala?
I spent couple of months learning Scala and got overwhelmed by number of different constructs it had,
After looking at partial functions, partially-applied functions, pattern matching, actor syntax,
I ...
9
votes
3answers
380 views
Byte code weaving vs Lisp macros
I have been reading about the libraries people have written for languages like Java and C# that make use of byte code weaving to do things like intercept function calls, insert logging code, etc. I ...
7
votes
1answer
103 views
Accessing the history of a `ref` in Clojure
The documentation for ref shows a :max-history option and states that "refs accumulate history dynamically as needed to deal with read demands." I can see that there is history at the REPL, but I ...
3
votes
1answer
315 views
Is Clojure a 3GL or a 4GL?
A bit of background (in case I'm mistaken)...
I think I understand that (it's an oversimplification):
manually entering codes into memory (or on a punchcard) is "first generation language"
using ...
11
votes
2answers
611 views
How will the new development of Java influence its interoperability with languages like Scala and Clojure?
As far as I understand, both Scala and Clojure have been designed as new languages that
depend on the JVM, and
easily integrate with Java code, in the sense that they allow to use Java classes ...
4
votes
2answers
128 views
Determinism of functions using PRNG in Clojure and functional languages
I'm a bit surprised by a sentence found in the book "Clojure Programming" (1st [and only as I write this!?] edition), page 78:
It should be obvious that it's impossible to deterministically test a
...
10
votes
3answers
2k views
What's so great about Clojure? [closed]
I've been taking a look at Clojure lately and I stumbled upon this post on Stackoverflow that indicates some projects following best practices, and overall good Clojure code. I wanted to get my head ...
7
votes
3answers
426 views
Why can't we write nested shorthand functions in Clojure?
I tried to evaluate a Clojure expression with nested shorthand functions today, and it wouldn't let me.
The expression was:
(#(+ % (#(+ % (* % %)) %)) 5) ; sorry for the eye bleed
The output was:
...
5
votes
2answers
496 views
Can Clojure's thread-based agents handle c10k performance?
I'm writing a c10k-style service and am trying to evaluate Clojure's performance. Can Clojure agents handle this scale of concurrency with its thread-based agents? Other high performance systems ...
5
votes
1answer
173 views
Setting up Clojure Project And Sub Projects
This is primarily a lein question about setting up a major project and its sub-projects, and is not intended to be a discussion question. Instead, I am interested in either a pointer to documentation ...
3
votes
2answers
184 views
Alternate method to dependent, nested if statements to check multiple states
Is there an easier way to process multiple true/false states than using nested if statements? I think there is, and it would be to create a sequence of states, and then use a function like when to ...
1
vote
1answer
149 views
Understanding clojure keywords
I'm taking my first steps with Clojure. Otherwise, I'm somewhat competent with JavaScript, Python, Java, and a little C.
I was reading this artical that describes destructuring vectors and maps. E.g.
...
0
votes
1answer
65 views
What does using (vec col) or (vector arg1 & args) cost?
I am working through some Lips exercises using Clojure. If I were to convert Lisp lists to Clojure vectors, solving some of the problems would be simpler, so here is my question:
Does using vec or ...
8
votes
9answers
1k views
OS choice for functional developing
I'm mainly a .NET developer so I normaly use Windows/VisualStudio (that means: I'm spoiled) but I'm enjoying Haskell and other (mostly functional) languagues in my spare time.
Now for Haskell the ...
8
votes
2answers
943 views
Is shipping a Clojure desktop app realistic?
I'm currently shipping a desktop Java application. It is a plain old Java 5 Java / Swing app and so far everything worked nicely. Java 5 was targetted because some users were on OS X version / ...
10
votes
1answer
525 views
Does Clojure have the continuation?
I started programming with Python. When using python, concepts like coroutine, closure made me really confusing.
Now I think I know them some superficial level, but I want to get the "enlightement" ...
3
votes
1answer
86 views
For csv database extracts, how do map keys not create a dependency?
A lot of my work is done with .csv extracts (reports) from databases. As I have been programming in Clojure, I've received comments that relying on vector indexes creates dependencies. I understand ...
21
votes
4answers
1k views
What limitations does the JVM impose on tail-call optimization
Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have ...
4
votes
3answers
286 views
Clojure state and persistence
I'm learning Clojure to see if it's something I can leverage at my current job, and more importantly, how I can convince my bosses that Clojure has a 'killer feature' over java that makes it worth the ...
5
votes
2answers
165 views
Can the Clojure set and maps syntax be added to other Lisp dialects?
In addition to create list using parentheses, Clojure allows to create vectors using [ ], maps using { } and sets using #{ }.
Lisp is always said to be a very extensible language in which you can ...
2
votes
2answers
357 views
What are examples of Lisp's accomplishments? [closed]
I've more than once heard that sometimes a few individuals come up with great accomplishments from using Lisp. What are those refering to? What are concrete examples of people using Lisp to create ...
1
vote
2answers
148 views
Is it bad form to stage a function's steps in intermediate variables (let bindings)?
I find I tend to need intermediate variables. In Clojure that's in the form of let bindings, like cmp-result-1 and cmp-result-2 in the following function.
(defn str-cmp
"Takes two strings and ...
3
votes
2answers
301 views
What is a dotted pair's analogy in other Lisp implementations?
What is Scheme's dotted pair construct analogous to in other Lisp implementations? I can make a vector or list quite easily, and understand those in Clojure, even though the syntax is a little ...
11
votes
3answers
984 views
Scala or Clojure Functional Programming best practices
I did a lot of self-study coding, got some experience with Parallel Programming Models: Actors, Software Transactional Memory, Data Flow.
When I am trying to apply these architectures to real life - ...
6
votes
2answers
206 views
Language that can statically ensure a map's fields are present
If data is simple and objects are complex, I'm curious if there are any existing statically typed languages that would be able to augment(?) a map type into a type with guaranteed fields. I realize ...
4
votes
1answer
425 views
Clojure: vars, atoms, and refs (oh my)
also: defs, java fields, agents
The clojure website has documentation for these concepts:
Vars
Atoms
Refs
Agents
I understand the words, but I don't conceptually get the purpose / meaning of ...
3
votes
1answer
193 views
Is re-defing idiomatic in clojure?
Simple example:
(def ticks 0)
(defn run-iteration []
(def ticks (inc ticks)))
Though the usual case involves things that don't change more than once every several hundred ms.
How to do this ...
3
votes
4answers
2k views
Using Clojure instead of Python for scalability (multi core) reasons, good idea?
After reading http://clojure.org/rationale and other performance comparisons between Clojure and many languages, I started to think that apart from ease of use, I shouldn't be coding in Python ...
-2
votes
2answers
283 views
How to create an abbreviation for words like `function` in Clojure where the obvious one (`fn`) is taken? [duplicate]
Possible Duplicate:
What do you do when your naming convention clashes with your language?
Edit: This was a bad question. Original:
For example, we talk about functions in Clojure but ...
9
votes
3answers
352 views
Making LISPs manageable
I am trying to learn Clojure, which seems a good candidate for a successful LISP. I have no problem with the concepts, but now I would like to start actually doing something.
Here it comes my ...
3
votes
2answers
1k views
Getting started with ClojureScript and Google Closure
I would like to investigate whether ClojureScript, with the associated Google Closure library is a reasonable tool to build modern, in-browser, Javascript applications.
My current Javascript stack ...
30
votes
13answers
1k views
Problems (such as maintenance) in development with unpopular language
I'm developing some application with clojure(lisp) alone in my team. It starts as small application. No problem. But as it's having features and extending the area, it's becoming important program.
I ...
12
votes
3answers
741 views
How independent is Clojure from Java?
I am quite new to the Clojure world. I appreciate the fact that one has easy access to all Java libraries via Clojure interop features, but I was wondering how much Clojure stands on its own legs.
Of ...
12
votes
6answers
2k views
Best practices in comment writing and documentation
Commenting nowadays is easier than ever. In Java, there are some nice techniques for linking comments to classes, and Java IDEs are good at making comment shells for you. Languages like Clojure even ...
2
votes
5answers
502 views
Programming language with native concurrency support for large graphs?
I'm currently looking for a new programming language to learn (currently working through some C++, know some C and Python), specifically one that has built-in concurrency support? I want to try to ...
8
votes
1answer
502 views
What are the essential Clojure libraries to learn beyond the basics of “core”
I am teaching myself Clojure. I've started using Leiningen, I'm working on Clojure Koans, plan to do LabREPL next, and will have a look at Noir.
My question is: what are the essential "must know" ...
12
votes
3answers
2k views
On the path to Enlightenment: Scheme, Common Lisp, Clojure? [closed]
A lot of people smarter than me keep writing about when you learn Lisp it makes you a better programmer because you "get it".
Maybe all I hear about Lisp(s) changing your life is just a big practical ...
18
votes
4answers
950 views
Why do some functional languages need software transactional memory?
Functional languages, by definition, should not maintain state variables. Why, then, do Haskell, Clojure, and others provide software transactional memory (STM) implementations? Is there a conflict ...
3
votes
1answer
204 views
Incanter for real world statistical projects
I'm interested in statistical computing. R is a leader platform obviously but what about Incanter?
Incanter is at the top of my list since I'm a Clojure and JVM guy.
Do you have any real world ...
16
votes
3answers
990 views
Why does the Lisp community prefer to accumulate all the parentheses at the end of the function?
Why does the Lisp community prefer to accumulate all the parentheses at the end of the function:
(defn defer-expensive [cheap expensive]
(if-let [good-enough (force cheap)]
good-enough
...
18
votes
3answers
2k views
Is Clojure, Scala and other restrained by the JVM vs CLR
The Java implementors seem slow to adopt language improvements, for example compare C# with full closures, expression trees, LINQ etc.. to Java, and even the push back of some stuff to Java 8 will ...
9
votes
3answers
1k views
How dependent on Rich Hickey is Clojure? [closed]
I was just asked this question by my company who is investing in a Clojure application and I did not have a good answer? Can anyone, in all seriousness tell me what would happen to Clojure if Rich ...
8
votes
1answer
254 views
Software Transactional Memory - Composability Example
One of the major advantages of software transactional memory that always gets mentioned is composability and modularity. Different fragments can be combined to produce larger components. In ...