Live data from Hacker News

Using Clojure for Web Apps

github.com

101–110 of 122 posts

Re: Using Clojure for Web Apps

#101
post #97

Earlier quoted context omitted.

A slight tangent but are there really signals that indicate AWS Lambda style serverless is becoming a dominant way of making web backends? Especially since the AWS flavour is so developer hostile (APIGW, CloudFormation, highly divergent dev vs deployment setups complicating debugging, etc) It's fairly painful compared to a normal backend, and it seems like the serverless advocates are on the super high and super low…

Yes, I believe so. We've just passed the peak of inflated expectations on the technology hype curve, and the comments on HN reflect this. But in general - Do people manually deploy MySQL, Postgres, or MariaDB on EC2 servers? No, (most) people use RDS. The servers are still there, but the management is less. Do people manually deploy RabbitMQ? No, (most) people use SQS. Cloud providers have been working out of the sam…

Sure but RDS, SQS etc make your life simpler and easier, and they work fine with server-ful backend on eg Fargate. I think serverless is still far from providing the same net positive value.

Re: Using Clojure for Web Apps

#102
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…

Fulcro RAD is looking for contributions

Re: Using Clojure for Web Apps

#103
post #17

Earlier quoted context omitted.

IMO languages like Clojure (or Go) don’t need a fully powered batteries included web framework like Rails or Django. The approach to pick together what you actually need (router, db bits and pieces, etc) with composable libraries works really great

Are either commonly used in the way Rails, Spring, and Django are? Clojure is niche but Go is big and I don't see many webapps powered by Go like they are in Ruby/Java/Python with Rails/Spring/Django. In the web world most Go programs I see are API backends. Here's why I think "just use composable libraries" is a bad idea: First it isn't very friendly to new developers. You tell them to go out there and find their li…

This is in constant discussion in the Clojure community but some of the draw backs of frameworks are that you start seeing libraries and code that only work with the big framework

Even when they could have worked without it, and they over Shadow competitors in the space, why use that shiny new router library when my framework already has an one that's "easy" to reach

And then of course the worst thing to happen to a code base, the framework it's built on falls out of favour and you can't hire devs or get security patches for it anymore

"don't put your eggs in one basket", and "developers know the benefit of everything and the cost of nothing" applies here

I think if a framework is to be successful in Clojure it needs to not be intertwined with itself in the "simple made easy" sense

Additionally if the "interface" is data like you might get lucky enough that you get multiple implementations, like many cljs libraries support the react interface

With declarative programming we could certainly keep the intention of code the same whilst changing out the implementation but it would require careful coordination between library creators and a open data interface so that new requirements can be satisfied later down the line and even then multiple variants to serve completely different approaches

Re: Using Clojure for Web Apps

#104

Earlier quoted context omitted.

Yes, I believe so. We've just passed the peak of inflated expectations on the technology hype curve, and the comments on HN reflect this. But in general - Do people manually deploy MySQL, Postgres, or MariaDB on EC2 servers? No, (most) people use RDS. The servers are still there, but the management is less. Do people manually deploy RabbitMQ? No, (most) people use SQS. Cloud providers have been working out of the sam…

Sure but RDS, SQS etc make your life simpler and easier, and they work fine with server-ful backend on eg Fargate. I think serverless is still far from providing the same net positive value.

The value of serverless is in commodified operations: once you wrote the code, it’s your favorite cloud provider’s problem to run it. This lets you provide high-availability services without a 24/7 on-call rotation.

RDS and Fargate are not serverless, bc you still have to think about scaling strategies, appropriate network topologies and you might still have to wake up at night to tweak JVM or kernel settings in your containers.

Re: Using Clojure for Web Apps

#105

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...

sanitizing SQL queries is just as simple in Clojure as in any other language (maybe more so), even if it wasn't done in this example.

Re: Using Clojure for Web Apps

#106

Earlier quoted context omitted.

> Clojure’s slow startup time on the JVM makes it unfeasible for serverless functions GraalVM could totally change this.

Not to mention provisioned lambdas if you're on AWS.

Provisioned lambdas make sense if you set the capacity to your median load to save money. But you still want the snappy horizontal scaling of lambda for loads above the median.

Re: Using Clojure for Web Apps

#107
post #104

Earlier quoted context omitted.

Sure but RDS, SQS etc make your life simpler and easier, and they work fine with server-ful backend on eg Fargate. I think serverless is still far from providing the same net positive value.

The value of serverless is in commodified operations: once you wrote the code, it’s your favorite cloud provider’s problem to run it. This lets you provide high-availability services without a 24/7 on-call rotation. RDS and Fargate are not serverless, bc you still have to think about scaling strategies, appropriate network topologies and you might still have to wake up at night to tweak JVM or kernel settings in your…

Isn't tihs exactly the other way around in serverless vs container-based backends? Services like Fargate, GCE Cloud Run, App Engine, Heroku etc are good at "just running" your code and keeping it running. Serverless systems like Lambda, Azure Functions, etc need so much plumbing, devops, ci etc overhead around them that they are full time work for someone in a project.

Re: Using Clojure for Web Apps

#108
post #65
post #23

Earlier quoted context omitted.

> I know some folks sneer a little at Lisp I wonder why. Some developers I know and hold in high regard have almost venerated Lisp, so I've always thought there must be something to it. I just thought it wasn't something you could actually use IRL, but I was wrong. I found this out when I was recently motivated to learn Clojure, and now I am starting to grok their admiration.

I think the ideas spelled out in rationale are really what sets Clojure apart from all the other lisps. For decades, I got excited every time a new idea around lisp or functional programming and I'd play with them for weeks. Eventually, I'd get to the big question, how do I bring this idea into development environment that solves the hundreds of other ugly real-world problems I have to deal with to make a usable appl…

> Immutable data structures are great, but when it's the default, it's a huge win in cognitive-overhead. Maybe that feature isn't unique to Clojure but it's certainly not a prerequisite to being called a lips or a functional language.

Yes, indeed.

TBH, I developed in Erlang for 10 years and, as a result, developed a strong preference for "immutable data structures everywhere".

Unlike LISPs that I've seen (admittedly not that many), with Erlang there simply is no global data so no vars to change - it's all done via function parameters and tail recursion (Erlang has TCO baked in, btw).

Re: Using Clojure for Web Apps

#109

Earlier quoted context omitted.

Yes, I believe so. We've just passed the peak of inflated expectations on the technology hype curve, and the comments on HN reflect this. But in general - Do people manually deploy MySQL, Postgres, or MariaDB on EC2 servers? No, (most) people use RDS. The servers are still there, but the management is less. Do people manually deploy RabbitMQ? No, (most) people use SQS. Cloud providers have been working out of the sam…

Sure but RDS, SQS etc make your life simpler and easier, and they work fine with server-ful backend on eg Fargate. I think serverless is still far from providing the same net positive value.

I'd strongly disagree with that assessment after building on serverless platforms full time for 9 months. I'll never go back to a server-full backend.

Re: Using Clojure for Web Apps

#110
post #17

Earlier quoted context omitted.

I've used Luminus to fill that space, and I gotta say I don't think that's the best way to go for Clojure. Getting started with Luminus was fine, but it was often very confusing and I didn't understand a lot, whereas when I added things as I needed them and checked out a couple libraries, I had a lot easier time debugging what was wrong. What's going to make Coast different?

IMO languages like Clojure (or Go) don’t need a fully powered batteries included web framework like Rails or Django. The approach to pick together what you actually need (router, db bits and pieces, etc) with composable libraries works really great

One reason I like Elixir's Phoenix is that it's reasonably easy to leave out the heavy-weight batteries I might not want, specifically the DB library and and JS build pipeline. I also like that router is pretty simple, but can handle complex REST-y things when you need it to. It doesn't feel, to me, either bloated or bare-bones, which is nice.

all that to say, if there is in the Clojure ecosystem analogous, I'd like to hear about it.

Post reply on HN