At last, Scala in SA :)

99 views
Skip to first unread message

Cornel Masson

unread,
Feb 26, 2012, 2:41:53 PM2/26/12
to south-africa-s...@googlegroups.com
I asked this question quite some time ago on Quora, and was finally referred to this group today: for a while there I thought I was the only Scalar Saffer. 

I'm a Java architect/developer and have been using Java for > 10 yrs in enterprise computing, websites, database-driven commerce, etc. I want to retain the scalability & capability of Java, but dearly want to move to the beauty of the Scala language. I haven't programmed anything in Scala yet: would the following architecture make sense for a large system:
  • Scala as general language
  • Lift as web framework (AFAIK it also supports AJAX/HTML5/Javascript interfaces, as well as RESTful web services)
  • Circumflex for object/relational mapping (can it cope with complexity/performance tuning similar to Hibernate?)
  • Cake pattern for dependency injection (replacing use of a library like Spring)
  • Akka for remoting (if applications need to inter-communicate)
  • Scala-Redis interface if using Redis as centralised application cache
Thanks!

Cornel Masson
Stellenbosch

Pavel Tcholakov

unread,
Feb 26, 2012, 3:15:38 PM2/26/12
to south-africa-s...@googlegroups.com
Welcome! It's a pretty quiet list I'm afraid :-)

Mitchell Wong Ho

unread,
Feb 26, 2012, 4:34:51 PM2/26/12
to south-africa-s...@googlegroups.com
Welcome,

It's up to the group's members to stimulate discussion and grow support.
--
Regards,
Mitch
Email: oreomitch[at]gmail[dot]com

Gary Pampara

unread,
Feb 27, 2012, 12:33:10 AM2/27/12
to south-africa-s...@googlegroups.com
Just some perspectives from my personal experience:

1. Lift is ok. It is, however, one of those frameworks that you have
to fully embrace. Moving away from it is not really an option once you
start using it.
2. ORM is a bad idea, no matter the situation.
3. You are better off using some proper typing instead of the cake
pattern. Most of the time you end up in a "bakery of doom".
4. Akka is great :)
5. Redis integration is good.

Regards,
Gary

Guillaume Belrose

unread,
Feb 27, 2012, 4:01:34 AM2/27/12
to South Africa Scala User Group
Hi to the list as well.

I am not (yet) in South Africa, but I will be in the near future,
moving to Jo'burg sometimes in September.
I am currently using Scala on a small scale at my company (a
predominantly C++ shop).

Another advice I would give to someone learning the language is to
take the time to read Martin Odersky's book because it is a pretty
good one. The book is very well structured, starts quite simple and
gradually introduces more advanced topics.

Cheers,

Guillaume


On Feb 27, 5:33 am, Gary Pampara <gpamp...@gmail.com> wrote:
> Just some perspectives from my personal experience:
>
> 1. Lift is ok. It is, however, one of those frameworks that you have
> to fully embrace. Moving away from it is not really an option once you
> start using it.
> 2. ORM is a bad idea, no matter the situation.
> 3. You are better off using some proper typing instead of the cake
> pattern. Most of the time you end up in a "bakery of doom".
> 4. Akka is great :)
> 5. Redis integration is good.
>
> Regards,
> Gary
>
> On Sun, Feb 26, 2012 at 11:34 PM, Mitchell Wong Ho <oreomi...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Welcome,
>
> > It's up to the group's members to stimulate discussion and grow support.
>
> > On Sun, Feb 26, 2012 at 10:15 PM, Pavel Tcholakov <pchola...@gmail.com>

Ewald Horn

unread,
Feb 27, 2012, 12:54:44 PM2/27/12
to south-africa-s...@googlegroups.com
Great,

looks like I have some reading to do!

Best regards,
Ewald

Guillaume Belrose

unread,
Feb 27, 2012, 3:19:48 PM2/27/12
to south-africa-s...@googlegroups.com
I know books can be quite pricey in SA. There is a free online version of the first edition of Martin Odersky's book at http://www.artima.com/pins1ed/
It does not cover things that were are added in Scala 2.8 and after but it is a very good resource. The other one, also free is the book from Alex Payne who used to work at Twitter. The book is available at: http://ofps.oreilly.com/titles/9780596155957/
Happy reading.

Wilter du Toit

unread,
Feb 27, 2012, 3:26:51 PM2/27/12
to South Africa Scala User Group
You could look at:

* Scala
* Squeryl for ORM (if you are going to use a relational database, if
not look at AWS DynamoDB)
* Akka
* Play 2.0
* VIM

I specifically mention VIM since most of the tooling for Scala is not
great and using VIM will most likely be much more productive for you.
Scala is also succinct enough that you do not generally need an IDE.
The typesafe stack already comes with VIM support and there are
several alternatives available.

It is also worthwhile learning sbt in-depth since both the typesafe
stack and play use it as the underlying build system.

I also found that learning Haskell at the same time as Scala works
well since many of the FP concepts are explained in more depth in the
Haskell community/resources (e.g. learnyouahaskell.com ).

The learning curve is fairly steep and there has been some recent
articles about Scala being too complex, which I have found to be not
true. I can assure you that if you just keep going, it is well worth
it.

mnetship

unread,
Feb 27, 2012, 3:55:01 PM2/27/12
to south-africa-s...@googlegroups.com
Hi,

Welcome, it is true this list is very quite, but it's something we can change.

Here is a list of resources that should get you started:

Scala Schools -> http://twitter.github.com/scala_school/
Programming in Scala (2nd Edition) Buy the book, you won't regret it. http://www.artima.com/shop/programming_in_scala

Scala Introduction from a Java Perspective ->  http://www.youtube.com/watch?feature=player_embedded&v=PKc5IwHG68k
Hilarious intro to Scala -> http://www.youtube.com/watch?v=LH75sJAR0hc

I currently working on a fun project using Akka, SBT, ScalaTest and Scalaz, I've ha.

Regarding your question:
Lift is a very mature Scala framework, but the community is moving towards Play! framework, it's part of the Typesafe stack.
For a new endevour i'd recommend using Play! instead of Lift. It also plays nicely with Akka (another Typesafe product).

I have used Hibernate + Spring within Scala, they tend to feel javaish but they are still good for the job.
A couple of gotchas : your bean properties must have setters & hence be vars. (you could use @BeanProperty for setters)
If you decide to use Circumflex tell me how it goes, i've never used it.

Cake is good if you want wiring during compile time. you may also want to check SUBCUT (Cake on steroids) https://github.com/dickwall/subcut

Scala Redis (I've never used this).

In Summary, this is what i'd recommend

Play! Framework http://www.playframework.org/
Akka http://www.akka.io
Hibernate + Spring
Scala Redis (If you are using Redis, it makes sense)
SBT https://github.com/harrah/xsbt/wiki (similar to Maven, with more scala power)

Hope this helps.


Kind Regards
Michael
I see the fun in functional

Guillaume Belrose

unread,
Feb 27, 2012, 4:17:11 PM2/27/12
to south-africa-s...@googlegroups.com, south-africa-s...@googlegroups.com
Hi,
For remoting, you can also take a look at Finagle from Twitter http://twitter.github.com/finagle/
For general knowlege of concurrency, I find ScalaSTM to be quite interesting http://nbronson.github.com/scala-stm/

Sent from my iPad 

Guillaume Belrose

unread,
Feb 28, 2012, 4:29:23 AM2/28/12
to south-africa-s...@googlegroups.com
@Wilter
Have you looked recently at both Eclipse and Intellij. The Scala support for both IDEs is many times better than what it used to be. 
I've not used VIM, but I have heard good things about it.

Wilter du Toit

unread,
Feb 29, 2012, 2:48:13 AM2/29/12
to South Africa Scala User Group
I have been following the improvements in the IDEs, mostly with
regards to refactoring. Once the refactoring support is compelling I
will most likely keep Vim as the editor and use an IDE when I need to
do larger refactoring.

Using the Scala REPL also further reduces the need for an IDE.

Cornel Masson

unread,
Mar 6, 2012, 3:17:05 AM3/6/12
to south-africa-s...@googlegroups.com
Thanks, guys, some interesting replies. Looks like it's not going to be possible to do  a complete Scala re-architecture for this next project, but I'm going to try and slip in a small side project as a tester. I'll keep you posted.

Jacobus Reyneke

unread,
Mar 8, 2012, 3:09:53 AM3/8/12
to south-africa-s...@googlegroups.com
Definitely have a look at Finagle or Play2-Mini for integration and REST. Lift is rock solid, but the Play2 Framework and Play2-Mini solves similar problems in a friendlier manner (that's my opinion at least)

To see how Finagle can be used as a bare bones REST server, have a look at this project: https://github.com/robi42/heroku-finagle-rogue
(If you end up looking into Finagle, then be sure to join the Finaglers google group.)

I found Finagle interesting for the huge amount of cool stuff it hides under the bonnet. It has a super-slick architecture, that allows you to expand by adding filters to support additional functionality rather than changing existing code. For example, to add JSON support to you REST service, you would simply add a JSON filter onto your existing service.

For general Scala questions and general advice, there is still nothing that beats StackOverflow.

Cheers,
Jacobus

Guillaume Belrose

unread,
Mar 8, 2012, 4:10:40 AM3/8/12
to south-africa-s...@googlegroups.com
If you work for an organization with a large amount of human capital
invested in Java code, it is worth pointing that Scala works very well
with Java libraries. Scala allows you to add your own sugar coating
around Java code quite easily. For example, for RESTFul web services
or DI you can use JAX-RS and Google Guice from Scala just as fine. The
code is still Java-ish but you can still use Scala features like type
inference. functions, traits, etc, to make it a lot more concise.

Cornel Masson

unread,
Mar 8, 2012, 5:06:44 AM3/8/12
to south-africa-s...@googlegroups.com
Wow, I've done a bit of research on the Play Framework, and it looks like a serious contender! I'm actually considering it very strongly for this big Java project of mine and, of course, it will be an ideal, low-risk route into Scala




On Sunday, 26 February 2012 21:41:53 UTC+2, Cornel Masson wrote:
On Sunday, 26 February 2012 21:41:53 UTC+2, Cornel Masson wrote:
On Sunday, 26 February 2012 21:41:53 UTC+2, Cornel Masson wrote:
Reply all
Reply to author
Forward
0 new messages