Honestly interested to know: Is there any added value for a Python developer in learning and using Scala? I love Python, especially because of its ecosystem, its widespreadedness, and of course because of Pandas, Numpy, Matplotlib. But I miss functional constructs from Mathematica or Scheme. Scala seems to be much more systematic and profound, but again: For everyday usage, is it overkill?
Hands-on Scala Programming
71–80 of 108 posts
Re: Hands-on Scala Programming
#72Re: Hands-on Scala Programming
#73Earlier quoted context omitted.
Scala has a very wide surface area, and it can be as simple or complex as you want it to be. Written in a certain way, it's that different from writing Python 3 with PEP-484 type annotations. You can easily write Python-like code and just get things done. :) Concurrency-wise, you can implement any concurrency model you want on top of it, and, personally, I find immutability + Task-like implementations (Monix, ZIO, IO…
I think that's the main problem. Everyone writes Scala differently. In Go pretty much everything is quite similar. In JavaScript people also write things differently, like any other language really, but in Scala it is compounded. Is there a concrete example of the Python-like code vs the more complex ones? I appreciate the help. I'm thinking what language next should I pick up. It is either OCaml or Scala.
Scala is a pretty great investment for services, big data, etc. It has a robust ecosystem.
However, the compiler is slow, and startup time can be slow (and Graal and Scala Native just aren't options yet), and if I want to make some tool that gets called fast in a loop or deploys as a "small", native binary, OCaml is nice alternative which I prefer to the only other compelling entry in this area, Go.
Re: Hands-on Scala Programming
#74Some context for people who have limited knowledge of Scala. Lihaoyi is one of the most prolific coder's, not just in Scala, but in any language. He looks like he is much to humble and modest to claim so himself, so I will do it for him. Here is a by no means exhaustive list of projects - A buildtool - A bash replacement that speaks Scala - A test framework - A parsing library - Ports of several python libraries in S…
I think your argument here is counterproductive. Lihaoyi is a prolific coder but most coder like me are average Joe. How can Scala be useful and make average Joe like me productive. The fact that Lihaoyi is a prolific coder in any language does not help selling Scala.
The remaining piece of the puzzle is that Lihaoyi's libraries and general approach is exactly what a joe average coder would want. There is minimal use of advanced features, it is all quite straightforward and simple.
There are other productive contributors in Scala, but among them I would rate Lihaoyi to be among the least "magical". The fact that he is both practical and productive is what makes him unique. I guess my point was that there is a lot to be learned from that. For some nice examples of what it looks like in practice see his series of blogposts titled "how to work with x in scala".
Re: Hands-on Scala Programming
#75scala blows, use kotlin
Re: Hands-on Scala Programming
#76I didn't post this, but cool to see this up here! The full book is ~400 pages and will be released Summer 2020 (i.e. soon!). If you're interested in being notified when it comes out, there's a mailing list link on the page and I'll let you know when it's out. There will be both E-Books as well as paperbacks & hardcovers (assuming the supply-chains are still open in this COVID-19 global environment...) The first 5 cha…
I can vouch for lihaoyi. He is one of the more prolific people in the scala community writing top notch stuff. The best part about most of the stuff be writes is they are extremely ergonomic, even by scala standards. Look at either scala-tags or even better his parsing library. The parsing library is actialy so good you'll feel like finding more problems to solve. Its a breeeze to get started with (even in repl). Sca…
Given how much work I’ve obsessively put into that effort over many years, the final library damn well better be good to use!
Re: Hands-on Scala Programming
#77Honestly interested to know: Is there any added value for a Python developer in learning and using Scala? I love Python, especially because of its ecosystem, its widespreadedness, and of course because of Pandas, Numpy, Matplotlib. But I miss functional constructs from Mathematica or Scheme. Scala seems to be much more systematic and profound, but again: For everyday usage, is it overkill?
As to what you get going to Scala, it depends what matters to you.
Does 50x faster compute matter to you, for the code that’s CPU bottlenecked but inconvenient to rewrite in C?
How about easy parallelism, to trivially and fully utilize multiple cores without clunky subprocess management?
How about easy packaging? One builtin command to package your program as a single file that can run anywhere with a JVM, no other global installs required?
You do give up some things using Scala: compile times are slower than iterating on Python scripts, the JVM runtime takes a second or two to warm up when launched, and you don’t have quite the same numpy/scipy machine-learning ecosystem. Whether that is worth it is up to you!
Re: Hands-on Scala Programming
#78I didn't post this, but cool to see this up here! The full book is ~400 pages and will be released Summer 2020 (i.e. soon!). If you're interested in being notified when it comes out, there's a mailing list link on the page and I'll let you know when it's out. There will be both E-Books as well as paperbacks & hardcovers (assuming the supply-chains are still open in this COVID-19 global environment...) The first 5 cha…
Could you compare your book to ``Scala for the impatient´´?,
- S4tI goes into a lot more detail into language features: custom extractors, abstract overrides, annotations, higher kinded types, custom operators. Hands-on Scala skips all of that. Most developers do not need to know this stuff to get stuff done professionally.
- Hands-on Scala spends its pages working on fun use cases instead! As far as I can tell, S4tI doesn't cover use cases at all. Sure it's great you know about structural/compound/existential types, but it's setting up webserver, mangling a database, or scraping someone's website that gets you paid a salary.
- S4tI is a bit out of date (at least the preview copy I have) and covers things like Delimited Continuations, XML processing, and the scala-parser-combinators and scala-actors libraries which you shouldn't really be using any more
- S4tI doesn't really use third party libraries AFAIK; that means things like working with files uses the `java.io` or `scala.io` APIs, which are strictly worse than the modern alternatives. In fact, it is only due to the modern collection of libraries such as Requests-Scala, OS-Lib, Cask, Quill, etc. that allows Hands-on Scala to cover as much ground as it does in a tiny amount of code. Hands-on Scala leverages this ability to the fullest!
Re: Hands-on Scala Programming
#79Earlier quoted context omitted.
Unfortunately like you say the pure FP crowd are extremely vocal online and that seeps into the culture of any company that uses Scala. Most of the visible members of the community value and advocate for fp purity and 100% type-safety at any cost, and that has a large effect on who gets attracted to learn Scala in the first place, what they consider to be good or bad code, etc. The resulting culture of firms using Sc…
I agree with your evaluation that parts of the FP community are extremely vocal and extremely smug, and this can and does have a bad effect on a community. This is a problem. Dealing with this problem requires leadership . In particular a project leader typically has to decide (in a Scala context) whether to go FP or imperative, because mixing both is often a problem. Similar to e.g. using message passing or shared m…
Re: Hands-on Scala Programming
#80I didn't post this, but cool to see this up here! The full book is ~400 pages and will be released Summer 2020 (i.e. soon!). If you're interested in being notified when it comes out, there's a mailing list link on the page and I'll let you know when it's out. There will be both E-Books as well as paperbacks & hardcovers (assuming the supply-chains are still open in this COVID-19 global environment...) The first 5 cha…
As someone who really like reading your blog articles, I'm super happy to see this :) I'll probably purchase it, as a part of my strategy to make my friends and colleagues start scala :) I'm looking forward to a "advanced scala programming" follow up ;)