Live data from Hacker News

Using Clojure for Web Apps

github.com

51–60 of 122 posts

Re: Using Clojure for Web Apps

#51
post #15

If anyone is interested, there is an up and coming Clojure web framework called Coast, https://coastonclojure.com/ For those that aren’t as familiar with Clojure - there isn’t a rails or Django for web apps, so Coast is trying to fill that void.

From my brief look at Coast it reminds me of Compojure. https://github.com/weavejester/compojure

Re: Using Clojure for Web Apps

#52

Some of my favorite Clojure libraries in this space: - instaparse: takes EBNF (and other formats) as a string and gives you a parser instantly (!!!) https://github.com/Engelberg/instaparse - re-frame: React-Redux alternative that IMO is much easier to work with https://github.com/day8/re-frame - reagent: React wrapper https://reagent-project.github.io/ - ring https://github.com/ring-clojure/ring - fulcro https://gith…

I really like Figwheel Main (https://figwheel.org/) for live code reloading as well as a REPL for ClojureScript development.

Re: Using Clojure for Web Apps

#53

Some of my favorite Clojure libraries in this space: - instaparse: takes EBNF (and other formats) as a string and gives you a parser instantly (!!!) https://github.com/Engelberg/instaparse - re-frame: React-Redux alternative that IMO is much easier to work with https://github.com/day8/re-frame - reagent: React wrapper https://reagent-project.github.io/ - ring https://github.com/ring-clojure/ring - fulcro https://gith…

re-frame is seriously an awesome library, with incredible documentation to back it up. I remember spending a few days reading through all of it and coming out wildly impressed.

In case anyone is interested in its ideas but is stuck with JavaScript, you may be interested in a vanilla JavaScript port I've been (very sporadically) working on: https://github.com/davezuko/re-frame. It's incomplete, and definitely lacking in many areas (documentation being the obvious one), but perhaps somebody will find it useful or want to contribute back. I've personally been using it in some internal apps for a while now.

Re: Using Clojure for Web Apps

#54
post #44

Earlier quoted context omitted.

As someone who tries to use Clojure everywhere I can, its very hard to beat Rails for pushing out a webapp (many long Clojure timers share this opinion). Clojure shines for web services that require lots of data processing in the server and for integrating with parts of the Java ecosystem.

I have not investigated Coast yet. I know it aims to be a Rails for Clojure... maybe it is, and maybe it would meet my needs. But given the incredible power and expressiveness of Clojure, I find no reason to believe that the best rapid web development framework could be developed in Clojure if the right motivated people attempted to do so. I don't know how many people (Plataformatec?) were behind Phoenix, but even in…

I'm not denying that something better than Rails can be built with Clojure, just implying that it doesn't exist, so for quickly pushing out a CRUD webapp multiple times without repeating yourself again and again(avoiding all the trivial/tedious stuff), there is Rails.

Re: Using Clojure for Web Apps

#55
post #46

After some time with Clojure, I can not bear to look at any OO code. It's like I developed an allergic reaction to class-based programming.

Even if you decide to do OOP code, it's better in Clojure, I think. Being able to use Protocols and Multimethods and `extend-type` allows to write OOP code in a much cleaner and clearer way than something like Java...at least I think so.

Re: Using Clojure for Web Apps

#56
post #25

Earlier quoted context omitted.

It will depend on whom you talk to - perhaps how old they are, and certainly where they come from (experience wise, education wise, etc.) The usual easy excuse is about parens, but that complaint has been put to rest so many times that it's not worth replying to anymore. (And people said the same thing about Python whitespace, but now Python is at or near the top of the pile.)

Python has too few parentheses, Clojure has to many. There’s just no winning. Ultimately, these complaints are superficial and serve only to justify one’s laziness.

There's a huge difference.

The parens in lisps are significantly detrimental to its first impression, and 3rd, 4th ...

I have literally never met a developer I can show a lisp code sample to whose reaction isn't "what the hell is that?"

It looks totally alien compared to C-style langs, which is what most people learn.

With Python, that is not the case at all, basic Python can be interchanged with pseudo-code for the majority of developers from C-style backgrounds.

Pretending this problem doesn't exist, only exacerbates it, and really holds back lisp adoption in my opinion.

Re: Using Clojure for Web Apps

#57
post #47

Earlier quoted context omitted.

Python has too few parentheses, Clojure has to many. There’s just no winning. Ultimately, these complaints are superficial and serve only to justify one’s laziness.

Clojure has the same number of parens as Javascript, C/C++, Java, and similar languages have parens+squiggle-brackets. (print "foo") vs print("foo"). same same. There's so much more to it than this. I can say without reservation that people who do not take a couple/few weeks to learn a Lisp just do not know what they are missing, and their arguments against it are viewed as children who lack enough experience to know…

[deleted]

Re: Using Clojure for Web Apps

#59

I am more of Scheme guy and always feel Lisp is pretty overwhelming, but this looks quite clean. I like the little language for writing HTML.

But this looks like a sql injection awaiting to happen:

    (defn inc! [id]
      (kc/exec-raw (format "UPDATE articles SET count = count + 1 WHERE id = %s" id)))

(From https://github.com/tbsschroeder/clojure-webshop-app/blob/mas...) You don't need format it seems: https://github.com/korma/Korma/blob/master/src/korma/core.cl...

Re: Using Clojure for Web Apps

#60
post #46

After some time with Clojure, I can not bear to look at any OO code. It's like I developed an allergic reaction to class-based programming.

Even worse is having been through the enlightenment and then witnessing people talk about Javascript or Scala like it is still 1990. You just want to yell to them "You're all living in a cave!"
Post reply on HN