News for hackers. Stuff that matters.
Re:Moving from TypeScript to Rust / WebAssembly by masklinn on Thursday July 09, 2020 @05:49AM (#23778519)
> This really nails why languages like PHP and Ruby have won out over static typed

It really doesn't.

Languages like PHP and Ruby "have won out" over statically typed languages because the representatives of statically typed languages at the time were Java and C++, both of which were bad (they still are, but they were): verbose, difficult (and verbose) to leverage for type-safety, missing a bunch of tremendously useful pieces (type-safe enums to say nothing of full-blown sum types), nulls galore, …

As a result, the gain in expressiveness and terseness (even without trying to code-golf) of dynamically typed languages was huge, the loss in type-safety was very limited given the choice was "avoid leveraging the type system" or "write reams of code because the language is shit", and the fast increase in compute performances more than compensated for the language's loss in efficiency.

And that's before talking about the horror show that Java's web frameworks ecosystem was circa 2006.

> Languages that tend to work well with it are those that are highly flexible around the corner cases of these technologies, and allow you to quickly iterate through the process of gluing them together.

That's really complete hogwash outside of the client, which isn't what we're talking about here since neither php nor ruby run there. On the server you have clear interfaces between "inside" and "outside", and there's no inflexibility to properly taking care of cleaning up your crap at the edges. Quite the opposite, really.

Re:Moving from TypeScript to Rust / WebAssembly by treis on Thursday July 09, 2020 @11:02AM (#23781028)
I think this is spot on. IMHO, everyone that uses Rails knows it's flawed. The problem is that there's not a better option out there that:

(1) Is "batteries included"

(2) Has the gem/engine ecosystem where basically every problem is already solved.

(3) Expressive code like has_many :things

If we could get those things + static typing + performance everyone would switch. But that doesn't exist.

Re:Moving from TypeScript to Rust / WebAssembly by ryanianian on Thursday July 09, 2020 @12:06PM (#23781685)
That alternative in 2020 is Python 3.7+ with typing annotations.

Python is very "batteries included," and there is a large set of exisitng packages for most things. One can monkey-patch things and invent cute syntax, but most python is rarely hard to reason about what's actually going on.

It's easy to bag on parts of python (eg some syntax and terrible distribution story), but I feel much less crazy (and suspicious of every punctuation mark) when working on a modern python app than when working on a modern ruby app, especially in the presence of rails.

Re:Moving from TypeScript to Rust / WebAssembly by pjmlp on Thursday July 09, 2020 @01:52PM (#23782937)
.NET and Java have enough batteries, 20 years of libraries solving every problem, several expressive languages available, alongside AOT/JIT compilers.
Re:Moving from TypeScript to Rust / WebAssembly by treis on Thursday July 09, 2020 @02:08PM (#23783166)
.NET has the problem if being a MS product. It's only relatively recently that they've decided to be fully cross platform and open source. I'm not sure if it's all the way there yet, but it could be a viable option.

Java is fine as a programming language. Java as a web app more or less means Spring. And Spring means XML files and annotations which come with their own problems. Kind of an out of the pan and into the fire thing.

Re:Moving from TypeScript to Rust / WebAssembly by blandflakes on Friday July 10, 2020 @09:51AM (#23791443)
You can get away without using Spring and do quite fine, but there's definitely a risk that if you invest in the JVM ecosystem you'll get hired to work on Spring.

(alternatives like Vert.x, the less-annotation-heavy quarkus, etc).

For Java web dev I actually like Kotlin better - ktor is pretty nice.

Re:Moving from TypeScript to Rust / WebAssembly by pjmlp on Thursday July 09, 2020 @02:16PM (#23783280)
Plenty of companies don't care one second that it is a MS product, in fact it is a positive value on their eyes regarding product support and tooling.

First of all there is more to Java Web development than JEE and Spring, which in any case, other eco-systems don't have a mature answer for many of their deployment scenarios and cross system integrations.

XML is beautiful, there is yet a format that supports machine manipulation, IDE graphical tooling, comments, schema validation as XML.

Anyone that praises Rails will be right at home with XML and annotations magic.

Re:Moving from TypeScript to Rust / WebAssembly by cygx on Thursday July 09, 2020 @06:10AM (#23778599)
because the representatives of statically typed languages at the time were Java and C++

And Pascal, Ada, Haskell, Eiffel, Standard ML, ...

Re:Moving from TypeScript to Rust / WebAssembly by masklinn on Thursday July 09, 2020 @10:01AM (#23780313)
Operative concept: representative.

None of the language you mention had any sort of wide-spread visibility at that time, meaning they were not representative of the (overwhelming) majority experience with statically typed languages.

Re:Moving from TypeScript to Rust / WebAssembly by cygx on Thursday July 09, 2020 @03:12PM (#23783901)
As far as I'm aware, Pascal and Ada were still significant in the early 90s (ie when Python arrived). You're right that they where far less so when PHP entered the picture, but it's not as if they were dead (Borland Delphi and PHP 1.0 were realeased the same year).
Re:Moving from TypeScript to Rust / WebAssembly by masklinn on Friday July 10, 2020 @03:49AM (#23789156)
> Pascal and Ada were still significant in the early 90s (ie when Python arrived).

That is not the timeline we're talking about here. Dynamically typed languages started taking off at the turn of the millenium and really exploded in the second half of the aughts. Java didn't even exist in the early 90s.

Re:Moving from TypeScript to Rust / WebAssembly by cygx on Friday July 10, 2020 @06:21AM (#23789942)
But it's not as if the programming community collectively just forgot about these languages (and, as mentioned, Delphi and PHP are in fact contemporaries). The question remains, why did new dynamic languages rise, but already existing static languages decline? That requires an explanation.
Re:Moving from TypeScript to Rust / WebAssembly by zurn on Friday July 10, 2020 @08:04AM (#23790644)
Yep Delphi 1.0 was launched in the mid-90s and had a good run for some time after that.
Re:Moving from TypeScript to Rust / WebAssembly by mathw on Thursday July 09, 2020 @09:31AM (#23779941)
None of which really had mainstream visibility with the kind of people who actually made the decisions about what language your company would be using.
Re:Moving from TypeScript to Rust / WebAssembly by zurn on Thursday July 09, 2020 @06:25AM (#23778669)
Yep and on the dynamic side there were also Erlang, Python, Lua, Lisp, etc.