9 ms·
Scala Native
- melling 7y agoI briefly looked at Scala 9 years ago. Where does one begin these days? My books are outdated? Someone mentioned looking at Cats: https://typelevel.org/cats/ https://typelevel.org/cats/
- spir 7y agoScala 3 launches in 2020 after a new compiler was written over a five year period. The new compiler is named "Dotty". A Tour of Scala 3 https://www.youtube.com/watch?v=_Rnrx2lo9cw https://www.youtube.com/watch?v=_Rnrx2lo9cw Also, GraalVM's ahead of time compilation is somewhat of a competitor to Scala native https://www.graalvm.org/docs/reference-manual/aot-compilation/ https://www.graalvm.org/docs/reference-manual/aot-compilatio... Cat is great, this book is too http://underscore.io/books/scala-with-cats/ http://underscore.io/books/scala-with-cats/
- pjmlp 7y agoGraalVM's ahead of time compilation is not the sole competitor, most commercial JDKs do offer some kind of AOT support.
- coldtea 7y agoYes, you often mention them, but nobody [1] uses those, whereas GraalVM, due to coming Oracle and eventually being some kind of default (itself, not the AOT option per se), might do better. [1] Where nobody = roughly as many people use CL/Haskell in production, and in any case, not any number to write home about...
- pjmlp 7y agoApparently they have been in business since 2000's. It bet that they have much more deployments in production than CL/Haskell, given the embedded space.
- coldtea 7y agoProbably, just wanting to take a jab at you :-) My point really being that, yeah, JVM-AOT existed since forever, but they have always been niche in the grand scheme of things (especially since you need a commercial license for most, and in this industry, after 2000, that's almost a death kiss). If Sun had bundled the same option and made it easy to use, it would be a whole different story.
- pjmlp 7y agoYeah the typical wanted to be payed, but not wanting to pay for the work of others. Thankfully corporations business levels works a bit differently, hence the rise of dual licenses.
- dwohnitmok 7y agoI would not recommend looking at Cats without prior Scala experience unless you already have prior experience with a statically typed functional language (such as an ML or Haskell). Almost all educational material for Cats assumes at least a basic familiarity with Scala. Any of the books here will be fine: https://docs.scala-lang.org/books.html https://docs.scala-lang.org/books.html. A few are a bit old, but they all get the job done. There's a lack of good coverage for Scala 2.13 (the most recent version), but 2.13 is more or less compatible with 2.11 and 2.12. Its only big change is the collections library, but luckily 2.13's collections library is far simpler than 2.11 and 2.12's and its usage is mostly source compatible. So if you're learning Scala from a 2.12 or 2.11 book and want to make sure you're fine for 2.13, just don't try to understand any complicated CanBuildFrom machinery (which you never really needed to know for 2.11 and 2.12) and just trust that 2.13 has a much simpler approach.
- vturner 7y agoDoes anyone think the coursera courses are worth it? I signed up and am working through them in my free time.
- mark_l_watson 7y agoI took Martin’s Scala class years ago and it was awesome. He is a great lecturer.
- acjohnson55 7y agoI loved it years ago. To date, it's the only Coursera course I completed.
- cheriot 7y agoThese two are the most recommended where I work: https://www.manning.com/books/functional-programming-in-scala https://www.manning.com/books/functional-programming-in-scal... https://leanpub.com/fpmortals/read https://leanpub.com/fpmortals/read
- azinman2 7y agoI'm curious to know the target user. There's no JVM interop, so one of the main reasons to use Scala -- an evolution of Java the language -- is out. Plus with Kotlin even that reason is being outdated, especially as you lose all the type conversions between Java arrays and Scala arrays, etc. Their C struct example has a lot of awkward syntax, so it seems that it's a bit 'bolted on' versus inherently designed for this use case. We have both Swift and Rust as great higher-level languages that compile to native applications with C interop, with more robust ecosystems and faster progress (Scala moves at glacial paces in comparison)... both appealing for different use cases. I used to be a Scala enthusiast before these alternatives existed. What place does Scala now have in the world?
- jpgvm 7y agoIt's place is when you want a functional JVM language and would prefer not to use Clojure. As you accurately pointed out for a "better" Java you probably want Kotlin - which has better compatibility with Java, is supported by big players (JetBrains, Google) and because of being the blessed language for Android is growing in popularity very fast.
- zapzupnz 7y ago> It's place is when you want a functional JVM language and would prefer not to use Clojure. I think GP meant the place of Scala Native, where being a JVM language is irrelevant.
- dwohnitmok 7y agoMy take as a continuing regular Scala programmer: Scala's position in the standard JVM world hasn't changed too much. Kotlin has taken up some of the "better Java" part of Scala, but otherwise Scala still maintains its niche of statically typed FP (mixed in with OO) on the JVM. Scala on Android has withered (Kotlin really took off here). Scala Native unfortunately also has kind of withered too, but GraalVM picks up the slack there in allowing for native compilation. Scala.js (compiling Scala to Javascript) has become surprisingly mature.
- zmmmmm 7y ago
- xvilka 7y agoStill no 1.12[1] and 1.13[2] support, and many projects already migrated to it. Upcoming 0.4.0[3] should solve both though. But seems like project suffers from lack of developers. [1] https://github.com/scala-native/scala-native/issues/233 https://github.com/scala-native/scala-native/issues/233 [2] https://github.com/scala-native/scala-native/issues/1629 https://github.com/scala-native/scala-native/issues/1629 [3] https://github.com/scala-native/scala-native/milestone/21 https://github.com/scala-native/scala-native/milestone/21
- densh 7y ago> But seems like project suffers from lack of developers. This is indeed the case.
- mistrial9 7y agouninformed question: is not The Driver for Scala to interact with Apache Spark ? Secondly, it seems from comments here that Scala -> JS is a thing, so that is used for .. ? Third, is it the case that Scala 3 is taking the wind out of Scala 2 improvements, and the dev community is small enough such that, that is visible as 'not much happening' with Scala 2x ?
- sjrd 7y ago> is not The Driver for Scala to interact with Apache Spark ? A gateway drug? Perhaps. A driver? Perhaps. The only driver? Nope. For example Scala is used a lot for regular Web servers. > Secondly, it seems from comments here that Scala -> JS is a thing, so that is used for .. ? * For the frontend of Web applications, notably because it allows reuse of code across client and server; * For CLI applications based on Node.js (better startup time than with the JVM); * For server apps based on Node.js (for people who like the Node.js ecosystem better than the JVM's, or who have an existing codebase to integrate with); * For AWS Lambda apps (again, better startup time than the JVM); * For mobile apps through React Native; * For embedded applications, in cases where a JavaScript engine is available but no JVM; * For browser extensions; * For integration with any other kind of application that provides hooks in JavaScript (e.g., Google Sheets, see https://medium.com/@antoine.doeraene/make-your-google-spreadsheets-scala-ble-5695d9dd784f https://medium.com/@antoine.doeraene/make-your-google-spread...) * etc. > Third, is it the case that Scala 3 is taking the wind out of Scala 2 improvements, and the dev community is small enough such that, that is visible as 'not much happening' with Scala 2x ? No it is not the case. There are as many core contributors to Scala 2.x now than there were before the Scala 3 effort was launched. And there are many more external contributors, with numbers growing every year.
- dwohnitmok 7y agoThe machine behind Scala.js! Thank you for all you've done. Out of curiosity, what remaining features/bug fixes are you planning to target for v1?
- sjrd 7y ago
- cmrdporcupine 7y agoThis is interesting, and I could even see using it, though I haven't touched Scala in 10 years... but I guess I wonder what the provenance of their GC is? The JVM's has had three decades of tuning and optimization. EDIT: I see Boehm and their own home grown. And a "none" which I can see being useful if you have short running processes.
- sjrd 7y agoThe home grown GC is actually an Immix GC at the core. See the original paper at http://www.cs.utexas.edu/users/speedway/DaCapo/papers/immix-pldi-2008.pdf http://www.cs.utexas.edu/users/speedway/DaCapo/papers/immix-...
- densh 7y ago0.3 has our own variation of Immix algorithm [1] [2]. On current development snapshots we've also made it parallel and partially concurrent which is expected to bring major speedups over previous single-thread implementation on applications with medium to large-sized heaps [3]. [1] https://dl.acm.org/citation.cfm?id=1375586 https://dl.acm.org/citation.cfm?id=1375586 [2] https://dl.acm.org/citation.cfm?id=2660198 https://dl.acm.org/citation.cfm?id=2660198 [3] https://github.com/scala-native/scala-native/pull/1423 https://github.com/scala-native/scala-native/pull/1423