News for hackers. Stuff that matters.
Re:PyTorch is dead. Long live Jax by bob020202 on Friday August 16, 2024 @05:23PM (#41270520)
No, I said there's nothing that exists right now that's theoretically better. Typescript isn't. It'd be great if TS's type inference were smart enough that it basically takes no additional dev input vs JS, but until then, it's expensive to use. It's also bolted on awkwardly, but that's changing soon. Could also imagine JS getting some nice Py features like list comp.

Also, generally when people complain that JS won the web, it's not because they prefer TS, it's cause they wanted to use something else and can't.

Never used Elm, but... no variables, kinda like Erlang, which I've used. That has its appeal, but you're not going to find a consensus that this is better for web.

Re:PyTorch is dead. Long live Jax by dwattttt on Friday August 16, 2024 @06:11PM (#41270846)
I see this a lot, and I want to find the right words for it: I don't want the types automatically determined for what I write, because I write mistakes.

I want to write the type, and for that to reveal the mistake.

Re:PyTorch is dead. Long live Jax by bob020202 on Friday August 16, 2024 @06:20PM (#41270904)
If you explicitly mark types at lower levels, or just use typed libs, it's not very easy to pass the wrong type somewhere and have it still accidentally work. The most automatic type inference I can think of today is in Rust, which is all about safety, or maybe C++ templates count too.
Re:PyTorch is dead. Long live Jax by dwattttt on Friday August 16, 2024 @08:07PM (#41271431)
I actually write a fair bit of Rust, and there I'll still explicitly add types. Not always (in particular where I have an IDE that'll show me the inferred type & it's trivial), but in particular if any more complicated inference is happening I'll constrain it.
Re:PyTorch is dead. Long live Jax by kaoD on Saturday August 17, 2024 @03:04AM (#41272546)
TS has type inference on function return types while Rust forces you to type the whole function signature (for a good reason, TS's return type inference is a footgun).

Other than that, I haven't noticed their inference capabilities being any different.

So I don't get your point.

Can you give a single example where Rust has more automatic type inference compared with TS? (honest question, maybe I'm missing something)

Re:PyTorch is dead. Long live Jax by josephg on Friday August 16, 2024 @07:31PM (#41271280)
> No, I said there's nothing that exists right now that's theoretically better.

That might be what you meant, but its not what you said. Thanks for clarifying.