ANN: funkyweb 0.1.0 - The clojure webframework with route inference

12 views
Skip to first unread message

Patrik Hedman

unread,
Oct 6, 2010, 3:30:15 AM10/6/10
to clo...@googlegroups.com
I'm pleased to announce the 0.1.0 release of funkyweb, my ring based clojure webframework.

It provides the following main abstractions:

Controller: Controllers work somewhat like namespaces in that they define the base of the route so any actions defined under a controller will have routes generated that starts with the controller name.

Action: Actions looks like functions in that they take a name an argument list and a body and they generates routes and url helper functions based on their name and arguments.

More information can be found in the readme included with the source code at http://github.com/pmh/funkyweb

I would love to hear what you think about it.


- Patrik

Scott Jaderholm

unread,
Oct 6, 2010, 3:41:12 PM10/6/10
to clo...@googlegroups.com
Very nice. I really love the docs. Covers how to use almost everything with plenty of example code and short descriptions.

I like variadic args, type hints.

Doesn't cover how to test a handler (from code) and see response.

Maybe move query-string request docs up to where query-string params introduced.

I like integer and vector returns.

I'd like cookies-set to take :expires :never so user doesn't have to write a far future date out in that special format.

Wondering about lack of compojure style request destructuring in route. Does (request-get) return the request that you then destructure in a let in your action?

Cheers,
Scott


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Patrik Hedman

unread,
Oct 6, 2010, 6:04:48 PM10/6/10
to clo...@googlegroups.com
2010/10/6 Scott Jaderholm <jade...@gmail.com>
Very nice. I really love the docs. Covers how to use almost everything with plenty of example code and short descriptions.

Thanks, I'm happy they aren't too confusing :)
 
I like variadic args, type hints.

Doesn't cover how to test a handler (from code) and see response.

That's because at the moment there is no easy to do that without digging deep into the framework but it is definitely on my todo list.
 
Maybe move query-string request docs up to where query-string params introduced.
 
Maybe, though they are part of different sections which I don't want to break up but maybe move the helpers section up so it appears right after the url helpers section?

I like integer and vector returns.

I'd like cookies-set to take :expires :never so user doesn't have to write a far future date out in that special format.

That's a great idea
 
Wondering about lack of compojure style request destructuring in route. Does (request-get) return the request that you then destructure in a let in your action?

request-get let's you grab specific keys out of the request, which you could then destructure in a let provided that the key points to a data structure, but it does not return the entire request itself. If you need access to the complete request map it's available through funkyweb.helpers.request/*request*
 

Cheers
- Patrik

Cédric Pineau

unread,
Oct 6, 2010, 5:17:01 PM10/6/10
to clo...@googlegroups.com

 Looks nice indeed ! Very REST oriented, isn't it ?

 One thing : I'm new to clojure and gathering information about the whole ecosystem, including web frameworks, but find it hard to figure what to choose. It would help to have clues of funkyweb's "positioning" regarding other frameworks such as compojure, compojure-rest, fleet, or even ring. Are they supposed to be used together and how, if not is funkyweb just a matter of taste or does it really provide the-tomorrow-approach-you-don't-want-to-miss, is it a hobby/learning/personnal/short-lived project or do you intend to make it stay and shine for long ?

 And also, I didn't get what was the scope of Flash set.get ? Is this a per thread/request cache ?

--
Cédric

Michael Ossareh

unread,
Oct 6, 2010, 6:40:33 PM10/6/10
to clo...@googlegroups.com


2010/10/6 Cédric Pineau <cedric...@gmail.com>
 One thing : I'm new to clojure and gathering information about the whole ecosystem, including web frameworks, but find it hard to figure what to choose.

This has been raised quite a few times recently. Is this a sign of some critical mass starting to form?
 
It would help to have clues of funkyweb's "positioning" regarding other frameworks such as compojure, compojure-rest, fleet, or even ring. Are they supposed to be used together and how, if not is funkyweb just a matter of taste or does it really provide the-tomorrow-approach-you-don't-want-to-miss, is it a hobby/learning/personnal/short-lived project or do you intend to make it stay and shine for long ?

As far as I understand, and I'm very far from an expert on this as I'm only 2 (solid) months into it, Ring is the common layer which many of the routing solutions operate on top of. Ring abstracts a lot of the grungy "turn a HTTPServletRequest/Response into a map" work that we'd have to do otherwise.

 

 And also, I didn't get what was the scope of Flash set.get ? Is this a per thread/request cache ?

--
Cédric

James Reeves

unread,
Oct 6, 2010, 7:50:18 PM10/6/10
to clo...@googlegroups.com
2010/10/6 Cédric Pineau <cedric...@gmail.com>:

> One thing : I'm new to clojure and gathering information about the whole
> ecosystem, including web frameworks, but find it hard to figure what to
> choose. It would help to have clues of funkyweb's "positioning" regarding
> other frameworks such as compojure, compojure-rest, fleet, or even ring.

The Clojure web ecosystem currently looks like this:

At the bottom, you have Ring. Ring provides a standard interface to
talk to web servers, and a set of libraries for handling things like
sessions and file uploads.

On top of Ring sit web frameworks like Compojure, Moustache, Conjure
or funkyweb. These provide a nice high-level interface that is suited
for defining the routes and controller logic of a web application.

Once you've written your controllers, you need a way of creating some
HTML to display. Hiccup, Fleet and Enlive are examples of libraries
designed to dynamically generate HTML pages.

Finally, there are libraries that don't fit into any of the above
categories, such as Sandbar or Compojure-Rest.

- James

Patrik Hedman

unread,
Oct 7, 2010, 6:39:26 AM10/7/10
to clo...@googlegroups.com


2010/10/6 Cédric Pineau <cedric...@gmail.com>


 Looks nice indeed ! Very REST oriented, isn't it ?

Thank you :) Yes, I try to keep it as RESTful as possible
 
 One thing : I'm new to clojure and gathering information about the whole ecosystem, including web frameworks, but find it hard to figure what to choose. It would help to have clues of funkyweb's "positioning" regarding other frameworks such as compojure, compojure-rest, fleet, or even ring. Are they supposed to be used together and how, if not is funkyweb just a matter of taste or does

I'd say it's mainly a matter of preference, funkyweb gives you a higher level of abstraction while compojure gives you more flexibility. Also keep in mind that compojure is more mature and is used in production apps while funkyweb isn't quite ready for production yet. As for the ecosystem as a whole James Reeves' answer sums it up well.
 
it really provide the-tomorrow-approach-you-don't-want-to-miss, is it a hobby/learning/personnal/short-lived project or do you intend to make it stay and shine for long ?
 
It actually started out as a learning project and it is the first thing I've done with Clojure other than trying out snippets from books in the repl. But even though it started that way it's based on an idea I've had for a while and I intend to use it in real applications.

 And also, I didn't get what was the scope of Flash set.get ? Is this a per thread/request cache ?

The flash is a special thing that's available to the next request in the current session and is then automatically deleted so it's well suited for displaying user notifications. For example, say you have a create action that saves something to a database and then does a redirect to a show action then that action can access the the flash message you set in the create action and display it, but after a page refresh or page change the message dissapears. I hope this makes any sense :)
 
--
Cédric

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Cheers
- Patrik

Cédric Pineau

unread,
Oct 7, 2010, 8:43:42 AM10/7/10
to clo...@googlegroups.com

That's make things clearer to me, and especially James' summary which is simple when exposed but time-consuming to figure out by yourself :-)

As for Flash, I've never met such thing in my everyday java world, but it's a nice idea.

Thanks to all of you !


--
Cédric

Jacek Laskowski

unread,
Oct 7, 2010, 9:24:19 AM10/7/10
to clo...@googlegroups.com
2010/10/7 Cédric Pineau <cedric...@gmail.com>:

> As for Flash, I've never met such thing in my everyday java world, but it's
> a nice idea.

The flash scope is quite popular in web frameworks like Seam Framework
or Grails (which I believe inherited it from Spring MVC). It then
popped up in other web frameworks in Java EE land.

Jacek

--
Jacek Laskowski
Notatnik Projektanta Java EE - http://jaceklaskowski.pl

Sean Corfield

unread,
Oct 7, 2010, 11:54:17 AM10/7/10
to clo...@googlegroups.com
2010/10/7 Cédric Pineau <cedric...@gmail.com>:

> As for Flash, I've never met such thing in my everyday java world, but it's
> a nice idea.

It's pretty standard in web frameworks. I see it in nearly every MVC
framework in CFML and Grails / Rails do it too - as well as several
Java web frameworks.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Patrik Hedman

unread,
Oct 7, 2010, 2:27:23 PM10/7/10
to clo...@googlegroups.com
Yes, this is by no means unique to funkyweb. In fact, under the hood it uses the flash middleware provided by ring which is available to all ring based framework.

Cheers
- Patrik

2010/10/7 Sean Corfield <seanco...@gmail.com>

Cédric Pineau

unread,
Oct 7, 2010, 7:18:11 PM10/7/10
to clo...@googlegroups.com

 Flash just can't be so wide spread in the java world. No it can't.

 It does ??? Oh please, please !!.. ok shame on me :-/ !

 Cédric, learning java stuff on clojure's mailing lists :-) !

Reply all
Reply to author
Forward
0 new messages