News for hackers. Stuff that matters.
Re:HTML Web Components by quickthrower2 on Monday November 13, 2023 @10:26PM (#38258696)
> 100% realistic and achievable in a dynamic language

Achievable by just removing automatic type coercion. Throw errors instead.

Would need to be feature flagged for backwards compatiability.

Re:HTML Web Components by andai on Tuesday November 14, 2023 @07:27AM (#38262472)
Exactly! You put that very elegantly. (I call that proposed flag "use sane")

I always thought JS needed static types to fix the insanity until I tried Python and realized that almost all the insane BS I get in JS are all runtime errors in Python.

There's a very good case to be made for reducing runtime errors, but it's a hell of a good start to at least have them!

Rather than what we have now, which is "assume the programmer is a beginner, who also never makes mistakes", and "given nonsensical commands, just do nonsense, and propagate garbage data throughout the entire program".