Live data from Hacker News

Brand new Scala-lang.org

scala-lang.org

51–60 of 131 posts

Re: Brand new Scala-lang.org

#51
post #28
post #2

Nice to see the language page be as easy on the eyes as the language itself. There's almost no excuse not to use Scala if you're deploying on the JVM. On a related note, does anyone else see the Scala logo and confuse it for a symbol representing databases or hard disks? It just doesn't click with me

"There's almost no excuse not to use Scala if you're deploying on the JVM. " There is one incredibly good reason - possibly the most important reason. How easy is it to find a Scala developer if you need to expand your team compared to a Java developer? I'd put it the other way around: what excuse do you have for spending more per developer? (There are some excuses here, but they're far from clear cut.) In addition,…

[deleted]

Re: Brand new Scala-lang.org

#52
post #28

Earlier quoted context omitted.

"There's almost no excuse not to use Scala if you're deploying on the JVM. " There is one incredibly good reason - possibly the most important reason. How easy is it to find a Scala developer if you need to expand your team compared to a Java developer? I'd put it the other way around: what excuse do you have for spending more per developer? (There are some excuses here, but they're far from clear cut.) In addition,…

Do companies actually restrict themselves to people who already have experience in a certain language when hiring? I've never encountered this practice. It is fairly hard to find a good developer, but once you find one you can tell him or her to write Scala or Java or OCaml or whatever you like.

While I agree that the "how hard is it to find an X developer" complaint is overblown, I think you are going too far. I can't just find a "good developer" and have them start working on a haskell project. They need to learn a lot if they don't have haskell experience.

Re: Brand new Scala-lang.org

#53
post #6

The page loads quite slowly on my macbook air. I wonder how many 'reactive' Scala web technologies went into the creation of it! Scala is wonderful and all the hard work put into it is greatly appreciated. However, every Typesafe product targeting the web that I've tried has given my browser indigestion.

A billion useless nested divs will do that.

Re: Brand new Scala-lang.org

#54
post #2

Nice to see the language page be as easy on the eyes as the language itself. There's almost no excuse not to use Scala if you're deploying on the JVM. On a related note, does anyone else see the Scala logo and confuse it for a symbol representing databases or hard disks? It just doesn't click with me

Or Clojure.

Re: Brand new Scala-lang.org

#56
post #18

Earlier quoted context omitted.

Scala is statically typed while Clojure is dynamically typed. Comparing them is irrelevant. > There's almost no excuse not to use Scala if you're deploying on the JVM. s/deploying on the JVM/a Java developer/

It's a bit of a simplification to say that Clojure is dynamically typed - for instance, all of the builtin data structures conform to particular interfaces (for instance Seq) and operations over those abstractions are resolved statically. You can even make it into a parens-y Java with raw method calls, and tell it to warn you if it can't resolve a call statically (albeit you usually have to hint the initial input). T…

Protocol method references being resolved statically is just an optimization — it is not at all the same thing as a static type system like Scala has. There is no easy way in Clojure to say "This function takes an Address and a PhoneNumber" and have the compiler throw an error on compilation if Insufficiently Caffeinated You accidentally passes an integer in place of the PhoneNumber.

The typed module implements a static type annotation system and type checker on top of the dynamic language, which is nice, but that still doesn't mean Clojure is statically typed.

Re: Brand new Scala-lang.org

#57
post #48
post #2

Nice to see the language page be as easy on the eyes as the language itself. There's almost no excuse not to use Scala if you're deploying on the JVM. On a related note, does anyone else see the Scala logo and confuse it for a symbol representing databases or hard disks? It just doesn't click with me

> There's almost no excuse not to use Scala if you're deploying on the JVM - Poor tool support (refactoring regularly broken on both IDEA and Eclipse). - Terrible backward compatibility story (want to use CoolLibrary v1.0, which was compiled with Scala 2.9 and you're using Scala 2.10? You're out of luck, you need the library to be compiled with the same version of the compiler). - Very slow compilations, and getting…

We used Scala in production at my previous job. It was great for the most part, but upgrading from 2.9 to 2.10 was a massive, massive pain. I think I spent nearly a week on the refactor. We didn't even have that much code (relatively speaking); the majority of the time was spent on finding substitutes for the libraries which were irreparably broken, and rewriting client code against the new API. That's pretty damning, but we could have avoided the upgrade if the team had better communication, so I see this also partly as a human issue.

That being said, I would be willing to use it again. I didn't have an issue with compilation speed, and the size/flexibility of the language wasn't really a problem; we wrote in what I believe is the idiomatic Scala style (immutable objects, FP). Going back to Java now, I SORELY miss lightweight lambda expressions, pattern matching, native Option type (that people actually use), and the emphasis on immutability.

Re: Brand new Scala-lang.org

#58
post #16

I recently installed Scala. I'm a PHP Dev, who plays around with Clojure on the side, but wants to be converted into the static typing camp. I also wanted to keep things functional (hence my love of Clojure, and my PHP code keeps things as immutable as possible), but also have a language that is usable if I were to go and get another programming job. Scala seemed a perfect fit. Until I looked at job boards for Brisba…

>Play as a framework looked very heavy for my usage.

Try Scalatra.

Re: Brand new Scala-lang.org

#59
The new homepage gives Scala a very classy feel! Nice!!

This comes as a (personal) advise to all my fellow startups here.

Dear dudes and dudettes,

I've been a long and hard fan of the 'Get shit done' mentality and I still am. From my past experience running Rails and Scala, I'm going to tell you what exactly you should do for your startup:

1) If you KNOW FOR SURE your startup will face a lot of page views, requests etc. before hand (Example - Real estate portals like Airbnb, Trulia, etc), then you should not make the serious mistake of ignoring high performance frameworks beforehand. This could literally be anything, but the alternative I personally recommend is something Scala based [Read section 4 for WHY].

2) As usual, use Rails (or django/similar) ALWAYS to build your v1 prototype. I say always because you will be incredibly surprised to see how much rails gets stuff done for you. While this is a huge advantage initially, this can also become a nightmare, later. Hence, I suggest you use rails only initially and not forever.

When you build your app with rails initially, you're overcoming the most irritating pain point (or I'm just too lazy) - Building the database. Building the database with the required fields manually can be tiresome, if not slightly dangerous (assuming you are inexperienced). So, I suggest you install devise:

    gem install devise
And implement authentication through it. Why? Because Rails+Devise will create some useful columns for you auto-magically - created_at, updated_at, sign_in_count, etc. (to name a few).

3) Now, you NEED to understand what's happening underneath devise as this is one of the core portions of your app. For this I suggest this rails cast:

http://railscasts.com/episodes/250-authentication-from-scrat...

Now that you understand how the most important part of your app works, you should start to build a clone of your v1 on your desired high-performance framework of choice. I use Scala personally (and I would recommend you too).

4) So, Why Scala?

#Scala has a decent minimal syntax compared to Java, PHP and the rest.

    Scala:
    def test = {"hello world"}
    
    PHP:
    

    Java:
    class HelloWorldApp {
    public static void main(String[] args) {
    System.out.println("Hello World!");
    }
    }
    
# Generally, on an average, 1 line of Scala = 10 lines of Java. That's less maintainable LOC (it can be argued otherwise, but just assume it's a good thing)

# Performance. Now this is where Scala really shines. Scala's base performance is almost near Java's in most real world scenarios. You get the benefit of Java without actually using it. How fast is Scala in contrast to Ruby? Well:

1 JVM = 10 thins ("Rails is meant for a toy blog engine" - Soundcloud)

Source: http://www.slideshare.net/pcalcado/from-a-monolithic-ruby-on...

Approximately 20-40x faster: http://www.techempower.com/benchmarks/#section=data-r5

#Inter-operability with JAVA. This is a HUGE plus. While everyone loves to bash Java, you should not forget that it's a tried and battle-tested enterprise backed language. It's horrible (arguable), but reliable. So, this means, you can use that high performance image-processing function written in Java you always wanted by calling it from within your scala code NORMALLY. Now that's why I prefer Scala over newer languages like Go (It's really good, but the library support is still growing). Don't under-estimate this use case. Some secure functions used for authentication are available on various implementations on the Java land, compared to Go, etc.

---------

5) So if you use Scala, there's a lot of alternatives for frameworks out there. The most popular ones are Play, Lift and Scalatra.

Play - Claims to be Rails like, but not even close to it. You need to work out everything on your own. Some stuff is still buggy and some are still scary (implementation of security functions). Stateless.

Scalatra - Sinatra for scala. Minimal, super-fast, awesome. (I personally recommend this). Stateless.

Lift - Tried and battle tested, used in production by so many popular guys (Foursquare for example). HUGE learning curve and too heavy for a framework. A hell lot of stuff is done automatically for my taste (like generating it's own login boxes with forgot password links, for example).

Performance comparison of all three frameworks here:

http://www.techempower.com/benchmarks/#section=data-r5

Note: Scalatra is the fastest (for most use cases) of them all.

6) Now, write a clone of your app in your framework of choice. Use the v1 Rails prototype initially to get your investors, clients, etc. But, by v2, ship out the code on Scala. This means,

#Reduced costs (1 app server vs 10 app servers)

#More time to focus on business activities and a LOT more time before you need to start worry about scaling (the framework)

Pls note: The above point isn't true if your app is db constrained.

Database suggestions:

Please ignore the noSQL hype. noSQL is DAMN GOOD for prototypes (use it for your v1) and for specific production use-cases. 99% of the use cases are covered by SQL. And the noSQL hipsters have created a terrible image for SQL databases that they don't scale, etc. But it simply isn't really true. Even something as basic as MYSQL scales pretty well. As documented by Quora's founder here:

http://www.quora.com/Quora-Infrastructure/Why-does-Quora-use...

Also, noSQL isn't a golden solution: http://blog.engineering.kiip.me/post/20988881092/a-year-with...

Some popular questions:

1) Scala engineers are difficult to find and hire

This is partially (in)correct. If you face issues with your Scala code OR if your scala code is the bottleneck (highly unlikely), then you can always hire a good Java developer and have that particular function/code module re-written in JAVA. Java developers aren't difficult to find. Also, If you made the transition from Ruby to Scala, so can anybody else.

2) The productivity gain vs Performance gain

If you write your app in rails, you get a lot of productivity benefits, at the cost of performance. If you write your code in Scala, you lose your productivity at the gain of extra performance. So which one should you choose?

There is no doubt that Rails scales really well. But, out of the box, it is slow. Imagine it this way:

There are two ways to make a sculpture - Using plastic (Rails) and using metal (Scala/Go/etc). Sculpting a metallic structure is hard (ignore molding techniques). Sculpting plastic is easy.

But if you stress the plastic sculpture, it simply breaks out. There are lots of commercially available metallic coatings for your plastic sculpture that will promise you of no breakage etc. (SOA, Scalable PaaS like Heroku, etc.)

But they are expensive, and they don't eliminate your pain points as promised. At some point you or an engineer is going to worry about the code. Better be it you and now than someone else, later.

It is important you understand what goes under a framework's Magic (like authentication, database calls, etc) than just blindly believe it to be magic. This will not only make you a better developer, it will also help you from being taken advantage of by your outsourced companies or your engineers.

--------

I just poured out everything from a personal stand point. Frameworks are a matter of personal choice - You choose whatever that resonates with your philosophy. So, at the end of the day, be sure to go with whatever makes you happy (and confident).

All the best.

Re: Brand new Scala-lang.org

#60
post #2

Nice to see the language page be as easy on the eyes as the language itself. There's almost no excuse not to use Scala if you're deploying on the JVM. On a related note, does anyone else see the Scala logo and confuse it for a symbol representing databases or hard disks? It just doesn't click with me

"There's almost no excuse not to use Scala if you're deploying on the JVM."

There's a good reason, actually - library maturity, especially when trying to get data in and out. Try and do some inner joins with typesafe slick and you'll know what I mean when you see the SQL it generates.

Or try and use Play Framework's json de/serialization, and be prepared to punch your monitor in the face.

I think these critical libraries can get there, but the lack of resources on these projects has me thinking we'll be waiting awhile.

Post reply on HN