Hacker News new | ask | show | jobs
by projectramo 2953 days ago
That is an interesting response.

I wonder if it were equally possible with any language.

Could a Python or Java programmer say the same? I think there are probably a handful of languages that you could use for "everything". The limiting constraint is the presence of a reliable javascript compiler, followed by data science libraries (I think).

2 comments

I think most languages could get close - see e.g. https://www.teamten.com/lawrence/writings/java-for-everythin... . Of course if you want to actually execute code in the browser then you need to compile to javascript, but I'm not convinced that's required as often as people think it is (Wicket offers a very interesting AJAX model where you re-render UI fragments on the server in response to changes - all the code that runs is Java, but the behaviour ends up very similar to if you had client-side javascript making a server call to fetch data). "Data science" means many things to many people; you wouldn't want to write actual linear algebra in Java (or any language without operator overloading), but again the cases where you can't reuse a prebuilt model from your language of choice are rarer than one might think.

Scala was explicitly designed as a "scalable language" with both the strong safety guarantees that you need for large-scale development and the lightweight syntax that you need for throwaway scripts. But a lot of modern language design is converging on the same set of features (e.g. static typing for safety but type inference for convenience, pattern matching for the safety of the visitor pattern but the convenience of an if/else) and would have the same abilities. E.g. in a Reddit post about Rust a couple of days ago people were talking about writing web services in Rust, and part of the rationale there is that while Rust may not be the perfect web service language, it's good enough that if you already have Rust in your stack you might well write web services in Rust rather than bringing in a new language. I haven't seen anyone doing data science in Rust yet, but I see no fundamental reason why the language couldn't be adapted for it.

Rust is better suited as universal language than Scala for me as I am writing also music applications, which really hate the garbage collector needed in Java/Scala, things that run on the JVM. I never really needed recursive types, but that's also something limiting on the JVM.
> Rust is better suited as universal language than Scala for me as I am writing also music applications, which really hate the garbage collector needed in Java/Scala, things that run on the JVM.

That's the conventional wisdom about GC, but I'm not sure how true it is these days - prototyping a video streaming program in a previous job we were surprised to discover that Haskell performed significantly better than C++ in that role. The JVM GC is quite tuneable and if you're willing to sacrifice throughput for latency you can get it quite low.

(Rust has a lot of good points but I won't be interested until it gets HKT).

> I never really needed recursive types, but that's also something limiting on the JVM.

What do you mean? Recursive types in the sense I'm used to work fine on the JVM; there is even e.g. a recursion-schemes like library for Scala (matryoshka).

> That is an interesting response.

It's a terrible idea. Writing and running scripts from Scala is incompatible with certain actions. Specifically provisioning and kernel configuration. There are lots of tasks that Scala is a bad tool.