News for hackers. Stuff that matters.
Re:Understanding UI Components in Elm by Existenceblinks on Wednesday June 08, 2022 @09:56AM (#31667419)
Typescript people pretend to love type system and its benefits while ignoring languages like this which has type designed from ground up. If Elm had some ways to easily preserve object reference (something like `mut` something or reference type like in Webassembly), that would unlock a lot of js interop stories rather than just `port`.
Re:Understanding UI Components in Elm by GiorgioG on Wednesday June 08, 2022 @10:40AM (#31668055)
No, we ignore Elm because it has a bus-factor of one.
Re:Understanding UI Components in Elm by hobofan on Wednesday June 08, 2022 @11:21AM (#31668693)
The way it is maintained it more or less has a bus factor of 0.
Re:Understanding UI Components in Elm by lucamug on Tuesday June 14, 2022 @06:36PM (#31746885)
Using Elm in production for years. Still waiting for the bus :-)
Re:Understanding UI Components in Elm by bananarchist on Wednesday June 08, 2022 @12:28PM (#31669802)
This is a rather bizarre claim. Is the risk of loss truly so terrifying as to always avoid joy?
Re:Understanding UI Components in Elm by GiorgioG on Wednesday June 08, 2022 @01:01PM (#31670332)
If you're tinkering, joy > risk. If you're building a business/product then yes, it does matter.
Re:Understanding UI Components in Elm by nsonha on Wednesday June 08, 2022 @09:32PM (#31676636)
Why does elm need to exist? If I want the "ground up type system", I'd go for haskell, something more user friendly or UI oriented then F# with fable. A functional language just for UI is too niche, waste of brain space.
Re:Understanding UI Components in Elm by TheMatten on Sunday June 12, 2022 @07:54AM (#31713824)
Well, you can't easily use Haskell on web, at least not yet. But there's Purescript, which comes with both anonymous records and Haskell2010-ish type system with some extensions and may be an interesting choice.
Re:Understanding UI Components in Elm by Existenceblinks on Thursday June 09, 2022 @11:45AM (#31682657)
Because value / cost is lower, it's much simpler, yet powerful. However, it's unfortunate that its social cost is higher.
Re:Understanding UI Components in Elm by dvdhnt on Wednesday June 08, 2022 @02:43PM (#31672150)
Personally, I just don't enjoy writing Elm and much prefer TypeScript. For me, TS is great because of the community, tooling, and its self-documenting nature.
Re:Understanding UI Components in Elm by Existenceblinks on Thursday June 09, 2022 @11:43AM (#31682625)
It's great for keeping status quo, anything is great if it's already there. Community and tooling is the result of that, things that exist for a while. But if we want to move forward, advancing tech, TS is just ok-ish (at some point it's not though)
Re:Understanding UI Components in Elm by martpie on Wednesday June 08, 2022 @10:43AM (#31668107)
TypeScript has always been very explicit it's trading soundness for productivity. And don't assume "typescript people" only do TypeScript.

I've introduce TypeScript to multiple teams already, and if the transitions were not frictionless, they were always extremely fruitful in the end.

And I can guarantee using a more sound (and more complex) type system like Elm or Rust would have never succeeded, because people using high-level languages don't want to know about low-level CPU/memory details, they just need to build things and have something that is "fast-enough" (and safe-enough, if possible).

Re:Understanding UI Components in Elm by cardanome on Wednesday June 08, 2022 @11:18AM (#31668625)
> And I can guarantee using a more sound (and more complex) type system like Elm or Rust would have never succeeded

Both Rust and Elm have a much simpler type system than TS.

Well, for Rust it can maybe be argued to have its complexities but Elm is dead simple. In fact the most common criticism of Elm is that it it lacks more complex features that people from the Haskell world are used to.

Allowing for the gradual typing of a dynamic language like JS is extremely challenging requiring stuff like structural typing which is not at all common in most mainstream programming languages. I don't thing there are many mainstream languages that have a more complex type system.

The value TS offers is ease of gradual adoption and access to the huge JS-ecosystem and for that you absolutely pay a price in complexity. It is absolutely trivial to design a language with a much simpler, sound type system that offers higher productivity and a smaller learning curve than TS but that wouldn't have much value for most people as the access to the JS stuff and gradual adoption.

Re:Understanding UI Components in Elm by horsawlarway on Wednesday June 08, 2022 @01:30PM (#31670951)
> I don't thing there are many mainstream languages that have a more complex type system.

I both agree and disagree with this. I think if you're coming from a statically typed language, and you're familiar with features in those language - Typescript is a very complex type system, where it can often be difficult or frustrating to express common paradigms.

That said... if you're coming from something like Ruby/JS, typescript has a pretty simple path to convert your existing code, and it doesn't get too fussy about letting you punt on the problem for a bit (start with very loose rules and lots of "any" - get more strict over time).

Re:Understanding UI Components in Elm by cardanome on Wednesday June 08, 2022 @02:25PM (#31671897)
Agreed but that does not contradict anything I wrote.

There is a confusion on terminology though. You are arguing about ease of use which is a different measure from complexity. That might have caused a misunderstanding.

Complexity is an objective measure while ease of use is subjective and based on your previous experience. For example the language Brainfuck is very simple (conceptually) but very difficult to use for most humans.

TS is objectively complex but also easier to use for Ruby/JS devs as you wrote.