Why Scala, Why do you recommend it?


#1

Why should we use Scala? Linkedin uses Scala because it uses it? Why did you create? It because you recommend it?


#2

For me, it’s the best balance between expressiveness and practicality. Plain and simply, I don’t think it would have been possible to create my little garage startup in any other language: it simply would have been too much work. But having full access to all of the JVM libraries (and, in the browser, JS libraries), with a language that is so intensely maintainable, I’ve been able to build an insanely ambitious startup largely by myself…


#3

Can I see your startup made with scala ?


#4

It’s linked above. (That link is to the documentation, which is itself written in Querki.)


#5

Oh – if you meant the source code, it can be found here. I often use it in examples of Scala, Akka, Play or Scala.js.


#6

I am using Scala to develop a far-term concept for automated air traffic control. This article provides an overview for anyone that might be interested:

Like jducoeur, I use Scala for its expressiveness. Once you learn the basics, Scala facilitates simplicity and elegance. Unlike Java, you don’t need “getters” and “setters”, for example. And say goodbye to semicolon litter in your code! Those features alone justifies it’s use, but there is much more.

I like the simplicity, elegance, and convenience of case classes. Immutable case classes and immutable collections make code safer and easier to understand. They also simplify parallel processing, which my application uses to cut what would be a one-day job to less than an hour. Immutable case classes also simplify serialization because the constructor arguments determine the contents of the class, so no internal fields have to be serialized.

I also like default arguments and passing by keyword, which Java does not have (although many other languages do).

My software has extensive plotting capabilities for visualization, and I have made use of implicit classes to keep the plotting code separate from the code that would be used in an actual operational ATC system. That keeps the primary code uncluttered with all the plotting functions yet allows those functions to be used seemlessly for testing and analysis.


#7

Ok but is a scientific paper…


#8

Do you really think that air traffic can be automated ?


#9

Tank you very much


#10

“Do you really think that air traffic can be automated ?”

Yes, it can be automated, but the hardest part is dealing with non-conformance and off-nominal situations. In some ways it is easier than developing a self-driving car, and in some ways it is harder. You don’t have to worry about avoiding pedestrians on a rainy night. But unlike cars, conventional airplanes can’t just hit the brakes and stop at any time. Think about how hard it would be to drive without brakes!


#11

I think you can not entrust the lives of so many people to something like that … autonomous driving has caused victims …


#12

<sarcasm>Of course, human driving has never caused any victims.</sarcasm>

Pretty much every technology that has ever been created has some form of victim. The question is how a technology compares to what is done without it.


#13

So if you have to do this thing that I think is impossible as autonomous driving, so I do not take those planes


#14

I wonder how much attention you have paid to autonomous driving. Waymo has a fleet of cars that has driven millions of miles and currently shuttles people around in Phoenix with no human drivers in the car. Those cars have a better safety record than humans do. So if you really care about safety, it is only logical to push for such a system to do most of the driving and to remove the humans from the equation.

Personally, I can’t wait until Waymo is available in my city. Bringing this back in line with the board, I don’t believe that Waymo uses Scala for much of their work. I really wish that they did. It would make them an even more interesting place to work, IMO.


#15

I do not believe can we see a video? it is impossible that self-driving cars are safe they are too vulnerable and there are too many variables you will see that sooner or later a slaughterhouse will succeed, in Italy it is unthinkable to start such a thing


#16

but does this have anything to do with Scala? Scala is used for autonomous driving? Was not it just an impossible idea for air traffic alone?


#17

And I wish the aviation world would use more Scala as well, especially for R&D, but that isn’t happening on a large scale as far as I know.


#18

Why would I recommend Scala 3?

I don’t really think language really matters. I’m open to using any multi-paradigm production language, with a firm grounding in academia, as long as its strict, strongly typed, has immutable and imperative facilities, garbage collection, compound pure-value types, type inference, multiple inheritance, proper variance, first class functions, higher kinded types, multiversal equality, type parameter - type member unification, refinement types (but I certainly feel no need for type refinement), singleton types, type unions, type intersections, dependant types, opaque types, implicit parameters, repeat parameters, default parameters, partial application, optional lazyness and HLists and compiles to Jvm, Javascript and Native.


#19

That’s quite a list of requirements. Which languages other than Scala have all those features? Or was that a roundabout way of saying Scala 3?


#20

It was both a joke and totally serious. Scala 3 won’t have compound pure-value types ( I haven’t looked at the latest from Valahalla). I haven’t personally felt the need for singleton types, but then they are just a special case of refinement types (again not to be confused with type refinement), which I do want and they seem pretty valuable to the eco system.

I certainly make no claim to have mastered all those features, but yes I do want them all, I would be very unhappy to lose the any of the ones we have in Scala 2.12 and I’m frustrated by the lack of the one we don’t have. It was partly a response to John De Goes talk and his suggestion that if we want OO we can programme in Python or Java, which to me is like saying if you want functional you can make do with LISP.

I’m not happy with the term OO. I’m not sure what it means. I certainly don’t agree with “everything is an object”. I wish we could get rid of “Any”. I do want to be able to use multiple inheritance, garbage collected smart-objects, with run time dispatch but I also want to be able use dumb data when appropriate.

I think Scala’s grounding in Academia and quest for theoretical coherence, while taking itself seriously as a production language is a good thing and has payed off over the long term. I think I can say with out hyperbola that Scala 3 is the language that I have been waiting for.