Live data from Hacker News

Bringing functional to the frontend – Clojure and ClojureScript for the web

blog.getprismatic.com

61–64 of 64 posts

Re: Bringing functional to the frontend – Clojure and ClojureScript for the web

#61

Earlier quoted context omitted.

It may be the future for very skilled developers that have already familiarised themselves with frameworks and design patterns and are capable of moving past them. The majority of software developers benefit enormously from the conventions encouraged in a framework like Rails. If Clojure is going to be adopted widely (if that is a goal of the project at all), the community needs to work on better communicating best p…

Eh, even the least charitable would have to admit that frameworks enforce style. On a large project, this matters hugely. I don't care how good your devs are they DO have different opinions re: style.

I disagree -- frameworks enforce structure (especially of callbacks), not code style.

Unity of code style is something you can solve with standards, style guides, pairing with new developers, and following conventions from surrounding code.

Clojure is nice because the community, while having different opinions about how often you should use X technique vs Y, generally has core sensibilities about what makes for good, simple code that composes well and doesn't tangle concerns. (This is largely due to the influence of Rich Hickey.) This (and not "perfectly uniform code style") makes for an effective large team.

Re: Bringing functional to the frontend – Clojure and ClojureScript for the web

#62
post #48

If you're interested in a functional approach to UI code, check out functional reactive programming (FRP). It's a declarative way to specify UI logic which abstracts away much of the inherent messiness of using mutable state and callbacks. I've played around with FRP in Haskell, and have found it much nicer than the more standard approaches to implementing UI logic. Before using FRP, my main UI experience was with Ja…

I also believe that web development doesn't really benefit from functional programming. That said there are two good FRP projects out there:

Elm: http://elm-lang.org/ and to some extent Meteor: http://docs.meteor.com/#reactivity

Re: Bringing functional to the frontend – Clojure and ClojureScript for the web

#63
post #60

My biggest problem with ClojureScript is that is very hard to reason about code written in it if you are a beginner.

It's definitely a complicated language to learn since you have to learn the complexity of

(1) Clojure core itself and readjust to functional programming (2) Understand how ClojureScript is translated into JS in order to do interop which will absolutely be necessary for any real project (3) Understand Clojure on the JVM in order to understand/write macros

Re: Bringing functional to the frontend – Clojure and ClojureScript for the web

#64
post #53

Earlier quoted context omitted.

i don't think i'm confusing anything. Clojure programmers love their persistent data structures, and in a browser environment, the most important data structure - the document model object - is not persistent and cannot be made persistent in a performant manner because it is a native api. there is ongoing research into dom manipulaton in clojurescript - Conrad Barski presented one approach[1] at Conj 2012 where the d…

Characterizing side-effects as a series of supposedly functional transformations doesn't sound quite alright to me. That said I'm curious about such an approach.

Modeling side effects as transformations on data is what functional programmers do all day. I'm not talking about monads - simple things like inserting keys into a map and manipulating collections does not rely on side effects in functional languages.
Post reply on HN