Showing posts with label scala. Show all posts
Showing posts with label scala. Show all posts

Tuesday, February 18, 2014

What I do not like about Scala

Here I will be focused on problems of Scala only, Scala have number of benefits too but that will be in other post. I look at Scala from Java experience.

Problems:

- Strict in type but loose in syntax ( meaning of syntax is unpredictable )

- Recursive functions could not be transformed by tail recursion, see blog of Rich Dougherty

- lists append , you need to remember to keep first list smaller then second to avoid performance problems

- scala is like a math formula, great when all is logical and all understand math easily, but real live is far from math.

- synax is unreadable sometime, it is like perl.

- syntax meaning is depends on linked libraries

- implicit converts from perspective of human investigation of code, so IDE have to be smart. Example Stting to StringOps.

-what is the reason to use in maps ++ instead of addAll.

-switching from val to var could make immutable set haver operators like +=.

- Great !!! Paul Phillips is a co-founder of Typesafe and the most prolific committer to Scala. His talk is about  Scala problems: http://www.slideshare.net/extempore/a-scala-corrections-library



to be continued ....

Thursday, October 17, 2013

Scala Books

List of books is here: http://www.scala-lang.org/documentation/books.html

I highly recommend to read "Programming in Scala Second edition" book , first edition could be find easily for free download.
This book is much better then "Scala for the Impatient" and "Scala in Depth" as it describe in details functional patterns and basics and have very good history of Scala language and show from where Scala grab ideas and why syntax enhancements are not in Java and .... .

Monday, October 7, 2013

Meetup with Scala IDEA plugin team leader


It was sad to see that JetBrains team leader use Windows for development:

How to create Checkstyle analog for Scala in IDEA IDE:

video will be there: https://thenewcircle.com/s

Thursday, September 12, 2013

Scala Lift steps how to compile and run


Lift: http://liftweb.net/download
Examples: https://github.com/dpp/simply_lift

git clone https://github.com/dpp/simply_lift
cd simply_lift/samples/http_rest
./sbt
> update
> jetty-run

But this project use old version of scala and lift and sbt

to do Project from scratch with all explanations: http://cookbook.liftweb.net/#InstallAndRunning
just Rest example: http://simply.liftweb.net/index-5.3.html#toc-Section-5.3

Experiments:
#udpate sbt-launch.jar from http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html to latest version

# remove old file to activate changes
rm project/build.properties

#register eclipse plugin https://github.com/typesafehub/sbteclipse/
echo "addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")" > simply_lift/samples/http_rest/project/plugins.sbt


Deploy (jetty, tomact ):
#create a war in target folder
sbt package

#deploy war to Java application server (jetty, tomcat, ...)
https://groups.google.com/forum/#!topic/liftweb/503eibvCvV4

#examples of prod configurations
https://www.assembla.com/spaces/liftweb/wiki/Deployment

Scala vs Nodejs: http://blog.nelsonsilva.eu/2010/12/14/go-vs-scala-vs-nodejs/index.html#disqus_thread

Monday, September 9, 2013

Scala meetup at Netflix office 2013-09-09

How to run scala as script

1. Through interpreter
$ cat script.scala
println("Hello, World!")

Run:
scala script.scala

2. Thought a Scala script

$ cat script.scala
#!/usr/bin/scala!#
println("Hello, World!")

Run as:
$ ./script.scala

3. Compile and then run compiled class
, source.

$ cat script.scala
object Greeting {
    def main(args: Array[String]) = println("Hello world!")
}

Run as:
$ scalac script.scala
$ scala Greeting


Happy scripting!