Hacker News new | comments | show | ask | jobs | submit | lihaoyi's comments login

There's one in the slides linked from the talk

-----


What do you use it for?

-----


https://github.com/valvesoftware/steam-for-linux/issues/3671 is a nice motivating example of why I think this project is useful

-----


That's cool! We should probably join forces. After all, Martin Odersky has stated that moving people onto Haskell was the primary motivation for inventing Scala, which will soon be renamed Hascalator

https://twitter.com/myatlyuka/status/577625111575969792

At the same time, Typesafe is apparently being rename Reactive Banana, which is more evidence of the increased Haskell focus within the community

https://www.reddit.com/r/scala/comments/36ho4u/breaking_type...

EDIT: found a better slide for Hascalator

-----


My friends answered immediately: «Saying that Scala is a gateway drug to Haskell is like saying that poor-quality heroin cut with speed is а gateway drug to LSD».

-----


> 3. Incomprehensible API for XML handling.

If you think Scala has a better API for XML handling then you're in for a surprise...

-----


Never thought I'd see this up here. I wrote this, if anyone wants to ask anything about it

-----


I've seen a few of the really impressive projects you've done over the past several years. How do you manage to stay so productive in your spare time?

-----


Not related to the project, but have you got any suggestions on good materials for Scala learning?

Materials I've read / watched / done so far:

  - Martin Odersky's Functional Programming Coursera course
  - `Scala in Action`
  - 47 Degrees' Scala Koans
I'm currently reading `Scala in Depth`.

-----


I read through Scala for the Impatient when I was initially learning Scala a few years ago. It's relatively new and written for version 2.10. Scala is on 2.11, but compared to 2.09 → 2.10, the changes are minimal. The book itself cuts out a lot of the BS and gets down to what a user wants to know about the language (features, syntax, how it differs from Java, etc).

Most Scala books were written pre 2.10, which makes them outdated enough that it would be hard for many new adopters of the language to get much out of them.

First 1/3 of the book is free online. The entire book is only $20 or so on Amazon.

http://www.horstmann.com/scala/index.html

-----


Programming Scala, 2nd Edition http://shop.oreilly.com/product/0636920033073.do

-----


With so many features, and so many of them built mainly for library developers, learning the language by yourself can be very daunting. I wonder where I'd be if I had not done a whole lot of the learning from reading a lot of idiomatic code written by well known developers. It's way too easy to end up writing Java with functions, or falling into common pitfalls that make code very hard to maintain in the long run.

If you've done the first Odersky course in coursera, the one he does with Roland Kuhn and Erik Meier is a very natural progression that will be far more practical than the original.

There are good series of blogs out there that, although somewhat outdated at times, explain concepts far better than the IMO dreadful Typesafe documentation. The twitter school, for instance, will at the very least give you names for features that, if you saw in code, you'd not be able to easily search for, due to their very generic syntax: For instance, context bounds. Another good set of blog posts comes from Bill Venners in the Artima website.

Good luck with your quest!

-----


Note that Twitter's Scala School is very out of date, though I'm told an updated version is on its way.

-----


Functional Programming in Scala is amazing. Highly recommended even for non scala programmers.

Second, come check out the #scala channel on Freenode. It's fantastic, has a REPL bot so you can show everyone in your compiler issues and get realtime help, tons of people, always active, very beginner friendly. Give it a shot.

-----


> very beginner friendly

Unless somebody like Tony Morris needs to feel better about his day. The average IRCer is really nice but (at least when I was over there) there is an ugly and abusive side that almost burned me out on Scala.

-----


Lets not mince words; it's not "somebody like Tony Morris", it's just Tony Morris.

But yeah, it sucks and I wish the community would do something. We don't need a big policy / code of conduct / whatever, we need an adult recognition that one individual is a problem.

-----


He has partners in asshattery, but yeah, it's mostly him.

-----


1. Skala Koans https://bitbucket.org/dmarsh/scalakoansexercises/wiki/Home

2. "Functional Programming in Scala" http://www.manning.com/bjarnason/

3. stackoverflow.com

-----


Some good resources from Twitter: - http://twitter.github.io/scala_school/ - http://twitter.github.com/effectivescala/

-----


Echoing any recommendations for 'Scala for the Impatient' - it is a fantastic beginner/intermediate book that gets you productive pretty quickly, so much so that I'm planning on having an intern who has no Scala experience go through it this summer.

-----


Likewise, any tips for learning Scala without knowing/learning Java first?

-----


Have you used any imperative, statically typed language that's compiled, such as C#, C++ or Swift? Previous knowledge of a purely functional language would be useful as well, but not required. Knowing Java helps with debugging and working with libraries built from Java, which depending on what one is doing (Android for example or using JSoup for scraping), is inescapable. You'll end up having to semi learn Java along the way, at least from what a friend told me (I already knew Java previously, so cannot comment on that). Scala, like C#, has extension methods to make dealing with Java libraries easier though, but it still doesn't solve things like JDK annoyances (type erasure).

If you're only familiar with scripting languages, it's going to be sort of a leap into learning Scala and could be done I think, though probably not the language I would recommend starting with since it's easy to abuse. The syntax is nowhere the same, but Scala sort of reminds me of the "Perl of statically compiled languages" in that you can write some really obtuse code without even trying if you're not careful. I don't think that's a bad thing necessarily, because it's a language that gives you a lot of flexibility (and more than enough rope to hang yourself). If you work with someone else, be sure to discuss some sort of agreed upon standard to using Scala, else you'll end up with some messy code.

Scala looks a bit like Python in parts as well as Swift, but I consider it more closer to a progressive version of C# with F# mixed into it.

-----


Unfortunate given that my advice is sort of based on Java...

When I was learning Scala, I was intimidated by a lot of the syntactic sugar that it had. It's a calming effect to realize that all of that desugars into very simple, regular things. Java happens to be a very regular, unsurprising language.

So despite how surprising/special Scala may seem, under the hood it's just a bunch of methods.

There will be an acclimation period where you eschew the fancy stuff and stick with the Java style. But as you encounter the same structures and pain points, you will begin to see which Scala structures you like and will become comfortable with.

Find a style guide. Don't go crazy with point free. In general, it's a bad idea. (It's good if your DSL is super sexy/robust/easy to understand)

-----


Advice needed. If I don't have Java or .net background would you recommend f# or Scala? I heard Scala is much more complicated than f#. I only know scripting languages like python and ruby.

-----


Do you prefer to jump in at the deep end or to ramp up gently? F# is a more elegant language that will force you to go straight into functional style; Scala is a bit of a hodgepodge but you'll be able to write code that's very similar to Python, at least to start with.

-----


Scala can be pretty similar to Python, if you choose to program in that style. You can then gradually expand into using more features. It's the path of least resistance, if nothing else.

-----


F# is a better starting point, giving its ML syntax that you can easily transport to OCaml, Haskell, Swift.

I also like the language is functional first, meaning you are not forced to place functions inside companion objects or classes.

-----


Swift's syntax looks way more similar to Scala than to OCaml or Haskell.

-----


Between this, Scalatags, and the rest of the stuff you do, you stay impressively busy! I'm not sure what this would be useful for, but seems pretty awesome :)

-----


Did you thought about integrating it with JikesRVM or Graal?

-----


I personally think this is super cool. Keep up the good work and I can't wait to see more.

Thanks!

-----


Ammonite http://lihaoyi.github.io/Ammonite/#Ammonite-Ops provides a similar thing for Scala

-----


I totally transcribed it by hand. The transcribed sources (http://lihaoyi.github.io/workbench-example-app/raytracer-opt...) are completely readable

-----


Here's a high resolution pre-computed verison, in case anyone wants to see it but doesn't want to wait for it to render

https://www.dropbox.com/s/pmg84wj0eufb3ur/Screenshot%202014-...

-----


you might like to add your benchmark to this: https://github.com/kidoman/rays

-----


It uses normal Scala `Future`s. You get two `ExecutionContext`s: `queued` and `runNow`. You can't block on a `Future`. That covers just about all the ScalaJS specific stuff, the rest is plain Scala.

Take a look at [Scala.Rx](https://github.com/lihaoyi/scala.rx) or [uTest](https://github.com/lihaoyi/utest) if you want to see code examples of how `Future`s are used in ScalaJS, but I think you'll be disappointed: it's exactly the same code that gets run on Scala-JVM!

-----


You said:

> You can't block on a `Future`

Which answers my question. Thank you.

But then you also said:

> it's exactly the same code that gets run on Scala-JVM

That can't be exactly true, since "Awaitable" [1] doesn't appear anywhere in the scala-js codebase. So I guess as long as you don't mention that trait by name, or attempt to block on a future, then your effectively duck-typed Scala-JVM code will be able to run unmodified on Scala-JS.

[1]: http://www.scala-lang.org/files/archive/nightly/docs/library...

-----

More

Applications are open for YC Summer 2016

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: