8 ms·
Scala Native with Denys Shabalin – Software Engineering Daily Podcast
- binarynate 9y agoI wasn't familiar with Scala prior to listening to this episode, so I enjoyed that it provided both a background on the traditional, JVM-based Scala, as well as the new Scala Native project, which I'm more inclined to use.
- walkingolof 9y agoThere is a third backend, Scala.js https://www.scala-js.org https://www.scala-js.org Based on the same principle as Scala Native, this one outputs javascript. I've written a couple of projects where both the backend and front end is written in Scala, using one project, with different sub-projects for frontend/backend. Scala.js will probably not convert Javascript developers en masse, but its very handy for Scala developers that prefer to write Scala to Javascript.
- thinkingkong 9y agoIm actually quite interested in why teams choose to use Scala if youre not fitting it into an existing JVM shop.
- whateveracct 9y agoThe only competing production-capable languages are Haskell, OCaml, and maybe F#
- pjmlp 9y agoAnd Swift if targeting Apple devices is enough.
- lmm 9y agoI'd include Rust on your list (if we're defining production-capable at a level where Scala Native qualifies), and maybe even Idris. I do think Scala still has advantages: higher-kinded type support which OCaml and F# don't have, strict evaluation unlike Haskell, and better IDE/tool support than any except F#.
- phazer 9y agoI wouldn't say Idris is "production ready" in terms of libraries and tooling. Unless dependent types is a must, I would choose Purescript instead if I wanted something Haskell'ish but strict and with nice JavaScript support.
- lmm 9y agoIs PureScript really any more production-ready than Idris? That wasn't the impression I got.
- phazer 9y agoIt seems a bit more mature, at least in terms of package management and available libraries (https://pursuit.purescript.org https://pursuit.purescript.org). I'm not very impressed with the editor/IDE support though.
- kod 9y agoEven if you aren't fitting it in to an existing JVM shop, the available libraries on the JVM beat anything else for variety and quality. There are specific niches (e.g. visualization of data) that you can find better options, but if you don't know exactly what your project is going to entail in advance, JVM is the safest choice.
- groceryheist 9y agoAny reason to use Scala native when Rust exists?
- pacala 9y agoGarbage collection.
- densh 9y agoYou can think of Scala Native as Go on steroids. We don’t try to compete with Rust at all.
- edko 9y agoI am not sure Akka already runs on Scala Native, but if/when it does, that would be my first reason.
- pjmlp 9y agoThe language is more powerful, Rust still doesn't have HKT support. The maturity of the eco-system. Not having to deal with the borrow checker. In any case, I would say in such cases OCaml and Haskell are also good candidates.
- bad_user 9y agoRust is in a different league altogether. Scala, Haskell, OCaml are garbage collected languages. This makes them easier to use, but some problems are out of reach. Embedded development, kernels, native apps requiring performance without frames dropped, real-time systems actually, including consumer stuff like decoding video, these have been the domain of C/C++. Of course, there are projects out there using these languages, pushing the boundaries, like MirageOS (https://mirage.io/ https://mirage.io/) which is built with OCaml. But those are like the exceptions confirming the rule.
- pjmlp 9y agoJava is doing quite well in such domains, including real time control of battleship weapon systems and missile radar controls. The ongoing NLL work proves ergonomics are still not there, and it doesn't cover all scenarios like internal references as done typically for callbacks in GUI widgets. It will surely improve, and the best thing for polyglot developers is that we can easily pick the best tool for the job.
- nerdponx 9y agoWhy would you compile Scala natively itself instead of compiling JVM bytecode?
- densh 9y agoJVM startup is really painful for short to medium time running apps, this is the niche we’re trying to address.
- nerdponx 9y agoI meant, "compile bytecode to machine code." The fact that nobody does it is a sign that it's not a good idea. I guess I was just wondering why.
- densh 9y agoScala is a relatively simple language in the end of the compiler pipeline. We just take lowered ASTs and emit our SSA representation from there because it’s easy it to implement it this way. You can totally do something similar from the bytecode.
- rpeden 9y agoExcelsior JET does it, and it works Scala. So you can already compile JVM targeted Scala to native code that way if you want to. JET is fairly expensive, though.
- pjmlp 9y agoLots of people do it. Besides ExcelsiorJET named in a sibling answer, the JDKs from Aicas, IBM, PTC, STMicroelectronics, Google with their ART implementation and a few smaller vendors for the embedded market. Also Oracle just added initial AOT on Java 9, with plans to extend it to other platforms, and eventually (long term plan) rewrite everything in Java as part of Project Metropolis. Oracle also had AOT compilers before Sun's acquisition, like JServe and JRockit. Why does it seem no one does it? Sun was religiously against AOT, leaving it to third party commercial vendors. And since the rise of FOSS most developers think it is outrageous to pay for compilers, only Fortune 500s buy such compilers.
- stewbrew 9y agoI remember that shortly after??? Scala native was first announced, Kotlin native made the news. How do these two compare today? Which one is better suited to create native executables now?
- bad_user 9y agoThe alternative Kotlin compilers are currently at the "proof of concept" stage, but aren't usable, or supported much by the community. Scala's JavaScript compiler (http://www.scala-js.org/ http://www.scala-js.org/) on the other hand is production ready and supported by the whole ecosystem, with plenty of libraries being cross-compiled to both the JVM and JS. Scala Native piggybacks on top of the work made for Scala.js — it's harder, due to not being able to piggyback on another platform this time, so they have to deal with things like concurrency or garbage collection, but it's progressing nicely. Scala Native isn't production quality yet, but it's at that stage where it's fun to play with it and the Gitter channel has some friendly folks you can interact with: https://gitter.im/scala-native/scala-native https://gitter.im/scala-native/scala-native
- xvilka 9y agoStill requires Java to build.
- ekrich 9y agoYes, that is true but eventually this could be lifted. There is ongoing work getting the compiler compiled with Scala Native as well as other work related to pulling the code related to build out of the sbt build that requires the JVM. This could make a native build chain possible.
- xvilka 9y agoThose are great news, thank you!
- bluesnowmonkey 9y agoWhy is the transcript a PDF? It's unreadable on mobile. Do they think people are going to print it out, like Knuth reading his email?
- terminado 9y agoAre you using a rooted Android phone? There are open PDF readers that you can flash as an apk into your rom image, if you’re trying to avoid spammy adware from the market. Apple supports PDF files on iPhones natively, by default.
- chii 9y agothere are various tools online to view PDFs without even downloading them. For example, google docs has one: https://docs.google.com/viewerng/viewer?url=https://softwareengineeringdaily.com/wp-content/uploads/2017/10/SED439-Scala-Native.pdf https://docs.google.com/viewerng/viewer?url=https://software...