9,428 karma · joined Jul 10, 2015 (11y ago) · 3,276 submissions
comment 9y ago · link · parent
> Edit2: it's not me who needs to prove lisp is useful. At least, be honest with yourselves.
This is one of the great fallacies among the naive in their logic.
For example: I know for a fact that you never wear underwear. I don't have to prove this, because it is a fact. If you don't agree, then it is up to you to prove otherwise.
See how that reasoning works?
Thank goodness the criminal justice system in most Western nations doesn't rely on that logic.
comment 9y ago · link · parent
> Homoiconicity is practically useless
So many libraries in Clojure that lead to serious productivity benefits rely on macros, which in turn are possible because of homoiconicity. It's more than useful, it's a key ingredient in the power of the language. You can extend and embed the language or sub-languages or quickly write a particularly potent DSL in just a few lines of code in Clojure thanks to this feature.
Compare this to language that offer macros but without homoiconicity and the benefits are clear. The two different ways to write macros in C and C++ involve language semantics and syntax that are quite different from the regular syntax. In Clojure, the language is identical, you can actually control the compilation process using the same regular Clojure code that you use everywhere else. It's really quite amazing how far this gets you.
comment 9y ago · link · parent
I'm not sure what you mean by "never took off" but thousands of developers around the world, myself included, have made their living just writing Clojure code for many years. So, it has certainly taken off for them. And there are many, many companies using it all over the world. I live in a town of about half a million people, so not super big, and there are about 12 companies primarily operating on a Clojure codebase.
comment 9y ago · link · parent
Logic and precedence rules are two different things. I know plenty of Haskell devs who frequently consult not just the precedence but also the associativity (right/left) or operators or functions when reading or writing their code. C++ also has a very long list of precedence rules. It's not trivial and many find the lack of these added complexities an advantage in the simple lisp syntax.
> It won't, it'll just make the code monoton and harder to look at.
True, only if you haven't written much lisp.
I suspect you are trolling here, possibly, so maybe my feedback won't matter.
comment 9y ago · link · parent
(let [a 123
b 456
c 789]
...)
Clojure syntax was designed with a clear and deliberate attempt to remove many of the parenthesis from lisp syntax. This is just a part of the greater design goal of offering very concise and elegant syntax in general, which is one of the reasons I keep coming back to it.comment 9y ago · link · parent
This is true a lot of the time. Also, commas don't exist in Clojure.
So you might have this in a C-like language:
if ((foo > bar) && (bar > boo)) {
doSomething(a,b,c);
} else {
doSomethingElse(d,e,f);
}
And in Clojure: (if (> foo bar boo)
(doSomething a b c)
(doSomethingElse d e f))
Another interesting side effect is that in C-like lang, one my say that due to precedence rules, (foo > bar) does not need the parenthesis since && is lower precedence. Yet, if you weren't sure, you'd have to take a short break and go look that up to be certain. Most devs will just keep the parenthesis instead of take that little break, or they will write them in anyway for readability. In Lisp, precedence rules are never an issue because all operators and functions are applied the same way. So the parenthesis might seem cumbersome at first, but they quickly make syntax quite a lot simpler.comment 9y ago · link · parent
Clojure improves on this compared to other lisps because it uses brackets and squiggly braces instead of parenthesis for a lot of its syntax, making that aspect much easier to read.
Just stick with it, you will see it is a non-issue after you get started in earnest.
comment 9y ago · link · parent
For decades, there have been rumors about the death of dynamic languages in general. And yet the decades pass and not only do those languages continue to flourish, but others come along and get popular too.
Clojure just turned 10 years old and I see no signs of it slowing down. They did consolidate their 2 major conferences in the States into just one annual conference, so there's that (which may not mean anything). But I am in a large city and companies keep appearing and starting up with Clojure as their key language.
With Clojure, it's an oddball because it is very simple and very powerful. Oftentimes, simple languages are not so powerful, and powerful languages are not so simple. But with Clojure, you can very easily get yourself into the situation of having extremely dense logic in just a few lines, where another language might easily take 10x (or more) lines to accomplish the same. This leads to code that can indeed be difficult to read later, especially if you are on a team and others must help maintain it. The Clojure community has come up with some excellent solutions to this problem, most recently the Clojure.spec library which is gaining wide adoption, which not only makes such "cleverness" easier to understand when reading it, but also makes a codebase automatically testable with property generators, which is a major feature. But your point about readability is always going to exist with a language like Clojure if it isn't written with a team in mind. That doesn't take away from its power though, in my opinion.
However, there is one particularly indispensable tool that Clojure offers that I have not seen anything to meaningfully compete with for productivity, and that's ClojureScript. Writing a front end with Reagent or even the alternative libraries is such a major win over everything else I've tried. I've worked a bit with Elm, Typescript, Reason, Bucklescript -- I am so spoiled by the extremely fast turnaround and easy interaction with very powerful features like React in Clojurescript that I don't see anything on the horizon that will come close to replacing that workflow for now. Perhaps some day something will come along to shine an even brighter light on how front ends can be developed, but for now, ClojureScript remains one of the most significant contributions to the software industry in many, many years.
comment 9y ago · link · parent
comment 9y ago · link · parent
And the trend only continues, with the wave of virtual DOM technologies that have taken what used to be a static-based layout engine and made it quite dynamic.
As for popularity, is there any other competing medium that allows an app to pretty much instantly run anywhere regardless of platform without user installation? No. And for that reason, they will always remain an intriguing way to distribute software.
Just as many of the first apps for iphoneOS ten years ago were silly and stupid, a lot of it boils down to taste. Not all web apps are worth it, but so many are! Tastes will evolve for both users and developers.
comment 9y ago · link · parent
I kind of disagree. The web is no longer about a single consistent form of content. You have sites. And you have web apps. They are not the same thing. When people ask me what I do for a living, I say, "I write web apps." They often say, "oh, cool, I've been looking for a web designer." I say, "no, I don't really do web design for web sites, I build software applications that run on a web page." So maybe the world isn't entirely used to the concept yet, but that doesn't mean there isn't a valid separation. A web app should not be like an informational web site, and vice versa. But that doesn't mean one should disappear. That's up to designers to understand, not really for users to understand.
comment 9y ago · link · parent
If your goal is to teach just functional programming, then Haskell may be too much since the language is about a lot more than just functional programming.
Scheme or a light lisp (including Clojure) is often the way FP is initially taught, since you can focus directly on the functional aspects and leave the complexities of static typing out of it. This was the tradition at MIT for a long time (maybe still is).
comment 9y ago · link · parent