
Spark – A small web framework for Java - javinpaul
http://sparkjava.com/readme.html
======
mbell
Spark still has the same problem (or feature depending on your tilt): It
exists only to avoid annotations.

In my opinion Spark:

    
    
        get("/hello",(request, response) -> {
             return "Hello World!";
          };
    

is still uglier than jax-rs:

    
    
        @GET @Path("/hello")
        String hello() {
          return "Hello World!";
        }

~~~
benjiweber
The main difference is Spark is just Java. No need for reflective annotation
scanning or any other magic.

~~~
meddlepal
I've been pondering the performance implications of JAX-RS recently. All that
reflection cannot be good for raw performance.

I love how simple it is, but my company is at the point where squeezing every
ounce out of our API servers is necessary. I've been fiddling around with
Vert.x a little; but another option is just to use raw Servlets.

~~~
norswap
It could use annotation processing (aka compiler plugins) instead. Not sure
how easy that is to bundle and deploy however (it's not hard to do by hand, by
don't know if you can include that kind of stuff in a maven dependency for
instance).

~~~
meddlepal
Are you suggesting something like Lombok for RESTful services? I am not
familiar with using annotations at compile time to produce code; so while I
guess it is totally possible, I feel like I would be doing it all from
scratch.

~~~
norswap
AFAIK Lombok plugs into Eclipse APIs, it doesn't use annotation processing.

Read this to get some idea of what can be achieved with annotation processing:
[http://scg.unibe.ch/archive/projects/Erni08b.pdf](http://scg.unibe.ch/archive/projects/Erni08b.pdf)

They do use so compiler API which are not stable interfaces, but even without
that, you can go surprisingly far.

------
hnriot
this is a really confusingly named project. I immediately thought that the
scala for Apache Spark ("Lightning-fast cluster computing") had been rewritten
in java!

~~~
rxin
I had the same thought! Apache Spark 1.0 is actually going to support lambda
functions in Java 8. A pretty big deal for making Java programmers' life easy.

~~~
tathadas
Maybe we should replace Jetty inside Apache Spark with SparkJava and ...

[http://i.imgur.com/yhwhF5J.jpg](http://i.imgur.com/yhwhF5J.jpg)

~~~
mahmud
Spark requires jetty to run in standalone mode, otherwise a servlet container.

Also, no memes on HN :-)

------
bilalq
This is great! Now that the verbose syntax is out of the way, I can see myself
using this as a gateway to web development for those that have never done any
programming outside of java for school assignments.

------
dang
A dupe of
[https://news.ycombinator.com/item?id=6372255](https://news.ycombinator.com/item?id=6372255).

