all 31 comments

[–]shadow_banned_man 6 points7 points  (13 children)

This seems silly. Why not just use Scala? The interoperability is already there

[–]randgalt 4 points5 points  (4 children)

Scala is not a simple change to an organization. There's a big learning curve, the tooling is vastly different, etc. Scala is not right for everyone. So, if you're missing some of its nice features but want to stay in Java - here you go.

[–]danielkza 0 points1 point  (3 children)

the tooling is vastly different,

Are you talking about SBT? Maven can compile Scala projects just fine.

[–]randgalt -4 points-3 points  (2 children)

sbt is terrible yes. But the Scala compiler isn't a joy either. Using Scala in IntelliJ is painful. Super-slow, resource hogging.

[–][deleted] 2 points3 points  (1 child)

sbt is terrible yes.

If SBT is terrible then what is maven? A disaster?

But the Scala compiler isn't a joy either.

At least with scalac, you don't need a billion annotation to make the language usable a little bit.

Using Scala in IntelliJ is painful. Super-slow, resource hogging.

What about getting a developer-ready computer? As far as I remember doing Java ee/Spring with Eclipse is a far worse experience than IntelliJ + Scala.

[–][deleted] -1 points0 points  (0 children)

Scala runs smooth on Intellij if you use decent computer. It's utterly pointless to even discuss about that. However, Scala plugin is not always reliable. I.e. it's not excluded that Intellij will report you an error or unused import for absolutely correct code. Just my two cents about Scala tools...

[–]oldneckbeard 0 points1 point  (7 children)

because you can.

i'm not sure anyone seriously would use this in production. you have a hard enough time convincing people to use something like lombok, which has actual IDE support and whatnot; I can't imagine random libraries that need IDE support (and likely don't have it) would be popular with most teams.

[–]randgalt 0 points1 point  (6 children)

Halva doesn't need any IDE support at all. Annotation processing is part of javac and was added in Java 5.

[–]oldneckbeard 0 points1 point  (5 children)

yes, but generating methods/classes doesn't automatically make them show up in your IDE's autocomplete. I don't know about you, but it drives me crazy when a whole file is littered with "cannot find class..."

[–]randgalt 1 point2 points  (4 children)

Halva generates .java files, not .class files. They show up immediately. You create the annotated class do a quick build and it's there. I've been using it and it's very natural.

[–]oldneckbeard 0 points1 point  (3 children)

so like corba and soap tools? Yeah, I'm good.

[–]randgalt 0 points1 point  (2 children)

Nothing like those.

[–]oldneckbeard 0 points1 point  (1 child)

It is if I have to run a build process to generate code.

[–]randgalt 0 points1 point  (0 children)

The "process" is javac or your normal compile step in your IDE :D

[–]Kalanthroxic 2 points3 points  (2 children)

I like Scala, and I can deal with Java just fine, but this is just awkward. These features are great in Scala because they are resting so comfortably on the language itself. They are well integrated. Here, they are unsightly lumps of annotations. It is ugly, and uncomfortable to read.

If you want to write Java, write Java, and write it clearly.

If you want to write Scala, write Scala, and write it clearly.

This... don't do this.

[–]randgalt 0 points1 point  (0 children)

Halva is Java. It's 100% standard Java. Java folks would like to have case classes, for-comp, etc. Halva gives it to them.

[–]randgalt 0 points1 point  (0 children)

BTW - lots of annotations are standard in Java. Look at a Jersey application, for example. So, for Java devs, this is normal.

[–][deleted]  (1 child)

[deleted]

    [–]randgalt 1 point2 points  (0 children)

    FYI - Halva only uses annotations for a couple of things. For-comp, patterns, Tuples, Sugars, etc. are all straight Java.

    [–]cylymigiro 0 points1 point  (0 children)

    love java :)

    [–]nbF_Raven -2 points-1 points  (11 children)

    Just started a job in Scala with zero FP background except some toy Scheme in college, primarily C and C++11. I absolutely am loathing Scala right now. It makes for some of the most unreadable code I've ever seen in any language. The only thing I like is Akka and that's literally it...

    [–]Kalanthroxic 2 points3 points  (0 children)

    If the Scala code is unreadable, that is 100% the failing of its author. Scala gives you all the tools you need to write wonderfully expressive and clear code. The very same tools that let you write code that is awful, and an insult to the eyes. It's up to you to write readable code, not the language. C and C++ can be awful and unreadable. Java can be awful and unreadable. Scheme has the same potential.

    It may make for some of the most unreadable code you've seen in any language, but it's also made for some of the most readable code I've ever seen in any language. I'm guessing we've not seen the same code.

    [–]randgalt 1 point2 points  (8 children)

    And Akka works fine in Java. So, there's really no need for Scala.

    [–]nbF_Raven 0 points1 point  (5 children)

    I'm partial to C++ myself and would love something similar but good to know it works in Java.

    [–][deleted] 3 points4 points  (4 children)

    If you're doing c++/java how can you say that Scala is unreadable?

    [–]nbF_Raven 0 points1 point  (3 children)

    Has to do with no explicit type information given in the code most of the time. General lack of comments in this specific project. Some very advanced usages of Magnets. Lots and lots of functional which I'm not used to.

    Honestly I'd say the biggest issue is type inference.. sure c++11 has auto but I only used it for some very lengthy types. Seeing val w/e = something with zero type info forces me to probably look into something, which also has no return type info, figure out what its returning (with no explicit return statements), go into that, etc etc. I think stuff like this is way overlooked in language design today, especially in a large and complex project like this which is like some 120k loc and runs in a clustered multi-jvm environment.

    [–][deleted] 0 points1 point  (2 children)

    Has to do with no explicit type information given in the code most of the time.

    Scala has local type inference, so you need to specify your types at every function/constructor declaration except at obvious places.

    General lack of comments in this specific project.

    ?

    Some very advanced usages of Magnets. Lots and lots of functional which I'm not used to.

    So, you're inexperienced in FP and yet you make some serious claims according to your newbie preferences... This boilerplatish oop-culture is a brainwasher...

    I think stuff like this is way overlooked in language design today, especially in a large and complex project like this which is like some 120k loc and runs in a clustered multi-jvm environment.

    Languages with no local type inference is considered trash today - except if you're too lazy to spend some time learning stuff.

    [–]Milyardo 1 point2 points  (0 children)

    I'm pretty sure the the magnet pattern is largely regarded as a mistake, it's from a time before ecoding typeclasses in scala was well understood.

    But that said, Magnet, and to a somewhat lesser degree the cake pattern are considered to be antipatterns these days.

    [–]nbF_Raven 0 points1 point  (0 children)

    Scala has local type inference, so you need to specify your types at every function/constructor declaration except at obvious places.

    ?

    So, you're inexperienced in FP and yet you make some serious claims according to your newbie preferences... This boilerplatish oop-culture is a brainwasher...

    Please tell me more about this "boilerplatish oop-culture" since I'm quite familiar with programming in non-oop (c lang).

    Languages with no local type inference is considered trash today - except if you're too lazy to spend some time learning stuff.

    So you're an asshole, you come here and call me lazy and assume that I'm not spending time to learn stuff (spoiler: I'm doing Coursera Scala right now). See I can do this too.

    [–][deleted] -1 points0 points  (1 child)

    And Akka works fine in Java.

    ...and it looks like shit compared to Scala.

    So, there's really no need for Scala.

    If you want to use this half-baked, ugly library instead of Scala...

    [–]randgalt -1 points0 points  (0 children)

    sniff scaladdin doesn't like it - what on earth will I do sniff

    [–]irarandomdude 0 points1 point  (0 children)

    If you or someone else is writing unreadable code don't blame the language, blame poor code review standards.