Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I suggest to dig in some web framework for functional programming. One example would be Snap for Haskell. http://snapframework.com/


Does it make sense to have to learn Haskell and a Haskell framework just to understand Clojure? Because I'm already sold on the idea that Clojure is the best language™, being a lisp, portable, with a great community, already with a mature library for everything (because it has access to the JVM), and with some dirty shortcuts for convenience.

But the frameworks are lacking. The only web framework available got dissolved, and I don't have the energy to wire everything myself in a new language and paradigm that I don't even fully understand).


I don't get it; you say you're sold to Clojure for it (among other reasons) "being a lisp" but at the same time you "still don't get functional programming"? If you don't get functional programming, why is it being a Lisp a good thing to your eyes?


I can relate to being frustrated with the lack of "real" io-examples when learning lisp, while at the same time seeing the benefits of functional programming, macros etc.

With something like clojure, you at least have a pretty clear deployment story (make a jar, drop jar in a container) -- but it's still not clear how you would best go about writing something like berklydb in clojure - never mind in SBCL (come to think of it, even implementing a couple of text handling utilities like grep or cat is pretty hard to wrap your mind around when working with "old school" lisps).

All that said, I'm pretty excited about racket, and somewhat hopeful that I'll eventually get around to doing some "real" functional programming in the not too distant future.


I don't yet "get" functional programming, but the reason I am reading this thread is that for years I have read about Lisp being a good thing (a language I have always intended to learn when I get the time). I think there was some (famous?) essay that talked about an enlightenment when you finally "get it" as a language.

Clojure seems to be a modern Lisp implementation. Runs on the JVM, has lots of libraries available.

How else will you "get it" without learning a functional language?

That's why I want to learn Clojure without "getting functional programming" yet.


> Does it make sense to have to learn Haskell and a Haskell framework just to understand Clojure?

I have a strong feeling that once you understand either Haskell or Clojure, it will be a breeze to learn other.

My point was to get framework for functional programming that deals with a lot of I/O and side-effects and see docs for real-life examples of usage.


In my personal experience having learned Clojure before diving deeply into Haskell, it helps but there is long path between them still. Hs types are incredible and completely missing in Clj.


> I have a strong feeling that once you understand either Haskell or Clojure, it will be a breeze to learn other.

Does Clojure use lazy evaluation?


It also isn't statically typed.


Not everywhere, but most of the sequence functions like map/filter return lazy sequences.


> The only web framework available got dissolved,

Rather, turned from a framework into a library. I only recently started with Clojure and found Luminus pretty easy to pick up. It just generates a simple scaffolding project which cherry-picks some good libraries into a project.clj file and gives you a basic "Hello world" web page to get started. Primarily it uses lib-noir on top of Compojure, so pretty much anything that was in Noir, you get here (I guess, I never used Noir directly). Luminus has a pretty good tutorial to cover basic notions of handlers, databases, etc.

No, it's not Rails or Django, and no it doesn't do anything you could do yourself from scratch pretty easily. It is, however, a nice starting point and may help you get over the "I have to wire everything together myself" hump.

http://www.luminusweb.net


Does it make sense to have to learn Haskell and a Haskell framework just to understand Clojure?

Haskell is a very different language from Clojure and learning it will teach you different lessons. Haskell takes an uncompromising approach to purity which can sometimes be frustrating to manage. Haskell's type system is an incredible piece of work, one which some may dearly miss in other languages (Clojure's core.typed does help a lot in this regard).

But the frameworks are lacking.

From what I gather, the Clojure community (and the functional style and community in general) abhors frameworks. Small, reusable, composable libraries are the order of the day.


>Does it make sense to have to learn Haskell and a Haskell framework just to understand Clojure?

No, but it makes sense to learn haskell to understand functional programming, which is what you asked. Clojure's emphasis on purity is essentially useless without a type system to go with it. The type system is what separates the pure functions from the impure ones.


bullshit. Referential transparency is the only requirement. Purity has nothing to do with the type system.


I don't understand what you are trying to say.


Do you not understand what referential transparency is?

You can write "pure" functions in imperative languages. Any function which returns the same result for the same arguments is a pure function. You could write an entire pure functional program in C if you wanted.


>Do you not understand what referential transparency is?

Yes. I also understand what a petulant child throwing a tantrum is. Nothing you have said is relevant to my post, it is just misguided anger.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: