Live data from Hacker News

Brand new Scala-lang.org

scala-lang.org

71–80 of 131 posts

Re: Brand new Scala-lang.org

#71
post #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 e…

Great write up! One small picky thing: > Scala: def test = {"hello world"} Can be actually def test = "hello world" :) p.s. you can play with Scala code live in the browser here: http://scalatutorials.com/tour/ (work in progress)

To get parity with his PHP & Java snippets, you probably want one of several variants below -

    scala> def test1 = println ("hello world")
    scala> def test2(f: =>Unit) = println ("hello world")
    scala> def test3(f:Unit) = println ("hello world")
    scala> test1
    hello world
    scala> test2()
    hello world
    scala> test3()
    hello world
    scala> val t = test2 _
    scala> t apply Unit
    hello world
    scala> t()
    hello world
    scala> t(())
    hello world
I will leave it as an exercise to the reader to distinguish between these thunks :)

Re: Brand new Scala-lang.org

#72
post #11

Earlier quoted context omitted.

> There's almost no excuse not to use Scala if you're deploying on the JVM. Well, there are many excuses. Scala is a messy language* and I have Clojure which IMHO is a better alternative for JVM development. I used both Scala and Clojure and settled with Clojure since it fits functional programming better. Scala is OOP with a bit of FP. Clojure if FP with OOP in case you need it desperately. * "messy" as in "let's th…

Coming from a haskell background, I found scala + scalaz fits all my needs. Is there a reason I should still try clojure?

As a Clojure guy currently learning Haskell since I'm curious about working with a good static type system, I'm interested in why you're using Scala instead of sticking with Haskell?

Re: Brand new Scala-lang.org

#73
post #11

Earlier quoted context omitted.

> There's almost no excuse not to use Scala if you're deploying on the JVM. Well, there are many excuses. Scala is a messy language* and I have Clojure which IMHO is a better alternative for JVM development. I used both Scala and Clojure and settled with Clojure since it fits functional programming better. Scala is OOP with a bit of FP. Clojure if FP with OOP in case you need it desperately. * "messy" as in "let's th…

I would take some issue with that. I think if you see the dual goal of creating a very strong, pervasive type system and trying to maintain OO compatibility, the features that are “thrown in” make a great deal of sense as a cohesive whole. It's certainly a complex language, but there is a coherent vision behind the features it has, IMO. That said, Scala certainly ain't perfect. It's certainly got its warts. And I'm n…

I just think that dual goal is messy and not really a good goal. Can anyone comment on how possible it is to just ignore any OO stuff in Scala and just treat it like a normal statically typed functional language that happens to be on the JVM?

Re: Brand new Scala-lang.org

#74
post #71

Earlier quoted context omitted.

Great write up! One small picky thing: > Scala: def test = {"hello world"} Can be actually def test = "hello world" :) p.s. you can play with Scala code live in the browser here: http://scalatutorials.com/tour/ (work in progress)

To get parity with his PHP & Java snippets, you probably want one of several variants below - scala> def test1 = println ("hello world") scala> def test2(f: =>Unit) = println ("hello world") scala> def test3(f:Unit) = println ("hello world") scala> test1 hello world scala> test2() hello world scala> test3() hello world scala> val t = test2 _ scala> t apply Unit hello world scala> t() hello world scala> t(()) hello wo…

:)

See also this question: http://stackoverflow.com/questions/8303817/nine-ways-to-defi...

It can go quite crazy on function definition styles:

    val add:(Int,Int)=>Int = _ + _ 
(from http://scalatutorials.com/tour/12_tour_of_scala_anonymous_fu...)

Re: Brand new Scala-lang.org

#75
post #11

Earlier quoted context omitted.

> There's almost no excuse not to use Scala if you're deploying on the JVM. Well, there are many excuses. Scala is a messy language* and I have Clojure which IMHO is a better alternative for JVM development. I used both Scala and Clojure and settled with Clojure since it fits functional programming better. Scala is OOP with a bit of FP. Clojure if FP with OOP in case you need it desperately. * "messy" as in "let's th…

I would take some issue with that. I think if you see the dual goal of creating a very strong, pervasive type system and trying to maintain OO compatibility, the features that are “thrown in” make a great deal of sense as a cohesive whole. It's certainly a complex language, but there is a coherent vision behind the features it has, IMO. That said, Scala certainly ain't perfect. It's certainly got its warts. And I'm n…

(Disclaimer: I'm pretty much a n00b at Scala)

My biggest problem with Scala, to date, is all the optional syntax. On one hand, making things optional sounds nice, and it can be handy... but in Scala, you can have a line of code where there are 3 or 4 different ways to write it. Sorry, don't have a good example handy, I'd have to go through my "learning Scala" workspace to dig something up and I don't have that stuff nearby. Anyway, the point is, I sometimes feel like Scala can easily lead to a situation where one is writing "write only" code. I do not relish the idea of taking a large base of Scala code, written by somebody else, and trying to understand it well enough to work on it.

Re: Brand new Scala-lang.org

#76
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…

That comment reminds me of this: http://www.techdirt.com/articles/20130722/17503523891/telco-...

Re: Brand new Scala-lang.org

#77
post #69

Earlier quoted context omitted.

Yes, Android's Garbage Collector is a one legged mule. Slow, crippled and needy. Scala, on the other hand, generates a ton of little objects. I'm a full time Scala dev but if I were doing Android I'd probably for the foreseeable future work in... dare I say it? Java.

Scala creates a ton of little objects? Are you aware that primitive types are only converted to objects in Scala, if they are used as objects?

Sure but every anonymous function call creates new objects, as do each call to the collections library methods (often many objects), for comprehensions, tuple creation, lazy vals, pattern matching, futures, options etc. all create objects.

If you are programming in a functional paradigm you will be throwing off garbage, often when you wouldn't expect to from a cursory glance at the code.

You can mitigate it, but often to do so you have to resort to writing scala as java (which is still better than java as java).

Re: Brand new Scala-lang.org

#78
post #73

Earlier quoted context omitted.

I would take some issue with that. I think if you see the dual goal of creating a very strong, pervasive type system and trying to maintain OO compatibility, the features that are “thrown in” make a great deal of sense as a cohesive whole. It's certainly a complex language, but there is a coherent vision behind the features it has, IMO. That said, Scala certainly ain't perfect. It's certainly got its warts. And I'm n…

I just think that dual goal is messy and not really a good goal. Can anyone comment on how possible it is to just ignore any OO stuff in Scala and just treat it like a normal statically typed functional language that happens to be on the JVM?

Why wouldn't you be able to? That's sort of what they're getting at when they say (if you follow the link) right under the headline: "Or anything in-between."

Your discriminated unions would be "in drag" as case classes, of course. You would want to be aware of the OO parts of the language, but there's little that obligates you to use them.

Re: Brand new Scala-lang.org

#79
post #73

Earlier quoted context omitted.

I would take some issue with that. I think if you see the dual goal of creating a very strong, pervasive type system and trying to maintain OO compatibility, the features that are “thrown in” make a great deal of sense as a cohesive whole. It's certainly a complex language, but there is a coherent vision behind the features it has, IMO. That said, Scala certainly ain't perfect. It's certainly got its warts. And I'm n…

I just think that dual goal is messy and not really a good goal. Can anyone comment on how possible it is to just ignore any OO stuff in Scala and just treat it like a normal statically typed functional language that happens to be on the JVM?

Quite easy with a couple of caveats: 1. You don't care about working with java libraries. 2. You don't care about generating tons of memory overhead.

Personally, if you don't have dependencies on java and if your goal is to do a pure functional application, I would stay away from the JVM as it just wasn't built for it.

Re: Brand new Scala-lang.org

#80
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

Scala means "stairs" in Italian (and perhaps Spanish; I forget.) As another person noted, the logo is based on the stairs at the birthplace of Scala, EPFL.

It also means "scale able language".
Post reply on HN