News for hackers. Stuff that matters.
Re:Why we choose Java instead of a polyglot stack by seivan on Thursday January 21, 2016 @04:27PM (#10948519)
Does Kotlin offer anything Rails like with batteries included? I'm steering away from Ruby. I love Rails but ruby becomes a monster when a project gets larger. I've looked at TypeScript and Express.js but I'm worried I gotta deal with type definitions a lot.
Re:Why we choose Java instead of a polyglot stack by lmm on Friday January 22, 2016 @07:06AM (#10952235)
Kotlin is pretty immature (and overhyped, IMO). Some people like Play and that's probably the closest JVM equivalent to Rails. I find the monolithic "batteries included" frameworks are part of the problem with large projects and it's better to have small well-encapsulated libraries that you can put together yourself.

I work in Scala and I use Wicket for HTML pages (technically a framework (though decoupled from any database access), but it gets out of your way a lot, has a very clean separation between the framework and your code (no magic)); it's probably the best example of good OO I've seen, in any language, with a component model that really works where all your pages are reusable components made of reusable components that are themselves made of reusable components, and there's a really clear separation between markup and logic.

If I'm writing a "web API" I use spray. It has this DSL that lets you write routing definitions which are as clear as a config file but are ordinary code obeying all the rules of the language, so you can safely refactor them the normal way. And it works very nicely with the scala type-system, letting you separate out cross-cutting concerns like logging or database transactions in ways that are low-overhead but visible and safe (and it's natively async, so can be incredibly high performance, not that I've ever needed that). For a "single page application" scenario I've used a TypeScript frontend (in angular) talking to a spray backend (I'd like to try out Scala.js soon).

Re:Why we choose Java instead of a polyglot stack by Mikeb85 on Friday January 22, 2016 @08:48AM (#10952628)
Just curious, how do you figure Kotlin is over-hyped? Seems to me it has good tooling support, incredibly easy Java interop, and seems to produce more or less the same JVM code as Java (so good performance). All the while being slightly more pleasant to work with.
Re:Why we choose Java instead of a polyglot stack by lmm on Friday January 22, 2016 @09:50AM (#10952975)
I think it's strictly worse than Ceylon - less mature, less featureful, and a lot less well designed.[1] And JetBrains have a bad habit of advertising features long before they're actually implemented, as well as talking up Kotlin for about a year and a half before it had any kind of stable release.

[1] And frankly if there's nothing it can do that Scala can't and the design isn't any cleaner than Scala (arguable, but I feel Kotlin is very ad-hoc and will look worse than Scala by the time it reaches the same age) then I'll just stick with Scala - whereas Ceylon can make at least some case for migrating from Scala.

Re:Why we choose Java instead of a polyglot stack by sotojuan on Thursday January 21, 2016 @04:51PM (#10948685)
Express isn't like Rails. It's more like Sinatra, but has probably even less stuff. There's no official or popular Rails for Node yet. People have made stuff like Sails but not many use it.
Re:Why we choose Java instead of a polyglot stack by edwinnathaniel on Thursday January 21, 2016 @04:58PM (#10948762)
Keep in mind Sails has stagnated and there's a fork called TrailJS now.

The NodeJS 3rd-party ecosystem is really really fragile at the moment.

Re:Why we choose Java instead of a polyglot stack by sotojuan on Thursday January 21, 2016 @05:15PM (#10948896)
Yeah that's what I meant. The Node ecosystem doesn't really care for Rails-like frameworks so they stagnate. Most Ruby companies run Rails. Most Node companies run Express, Hapi, or Koa. Not Sails.
Re:Why we choose Java instead of a polyglot stack by traviswebb on Saturday January 23, 2016 @08:47PM (#10961092)
For anyone who's interested, the github repo: https://github.com/trailsjs/trails
Re:Why we choose Java instead of a polyglot stack by seivan on Thursday January 21, 2016 @05:10PM (#10948847)
It's rails like through its middleware pipeline design. That's a requirement for me.

That allows Express third party middleware to add missing parts like Strong Params and easier HTTP Caching.

It would be nice to have batteries included but not at the cost of a giant box still design that I suspect Sails and other have. Pipeline design is important and Express does that really good.

Re:Why we choose Java instead of a polyglot stack by sotojuan on Thursday January 21, 2016 @05:14PM (#10948891)
Gotcha, thought you meant something else. Thanks for clearing it up. Have you looked into koa[1]?

[1] https://github.com/koajs/koa

Re:Why we choose Java instead of a polyglot stack by seivan on Thursday January 21, 2016 @08:33PM (#10950111)
Koajd has the same problem Express.js has, its batteries/middleware are not Omakase first class but third party. So I expect friction as things move forward in terms of updates. Ever dealt with RubyGems when upgrading Rails?

Imagine if your core app consisted of all different third party libs and you wanna update Express/Koa?

Then we have typedefinitions for all those libraries. Which why I'm looking for alternatives with typed languages.

You might have misunderstood my question or I'm getting things wrong again. :-)

Re:Why we choose Java instead of a polyglot stack by herval on Thursday January 21, 2016 @05:09PM (#10948842)
All the Java frameworks are usable in Kotlin. I don't know any specific that covers all the bases Rails does - what I usually see are patchworks and a lot of SpringCore/JPA/Hibernate.

Personally, my go-to choice is always something simpler (eg Netty, Vertx, Spark etc - those are more like Express.js or Sinatra than Rails).

There's also JavaLite, which explicitly tries to look like Rails (including database migrations, an ActiveRecord-style ORM, etc)

Re:Why we choose Java instead of a polyglot stack by mike_hearn on Thursday January 21, 2016 @05:14PM (#10948882)
Take a look at the Play Framework or Ninja Framework.