Earlier quoted context omitted.
> Is it actually unsound if you perform no casting? Yeah, it is. At the very least, I know that function parameters are bivariant, which isn't sound: function foo(callback: (obj: Object) => void) { callback("not a bool"); } function main() { foo(function (bool: Boolean) { if (bool) window.console.log("!"); }); } This compiles without a type error but ends up assigning a string to a parameter of type bool.
I'm a Flow user rather than TS (and Flow complains about that code out of the box), but you are not telling us all: Since TS 2.6, if you enable all the optional " strict " mode checks than TypeScript does complain about that code. I see no disadvantage in those checks, e.g. "strictFunctionTypes", being optional, since you can always make them mandatory for your own project(s). To test it: - Go to the TS Playground at…
Towards Scala 3
241–250 of 383 posts
Re: Towards Scala 3
#242Earlier quoted context omitted.
> Why are people so intent to bash sombody else's language choices?! Partially it's simple tribalism. But part of it is also the rational awareness of the opportunity cost of investing in a language other than the author's preferred one. The more people using language X that I don't like, the fewer people using my preferred language Y. That means fewer libraries I can use, docs I can read, bugs that get fixed, etc. L…
That might be true to some extend, but many languages have completely different target audiences. People whose favourite language is Go, will probably not move to Scala (and vice versa). Kotlin vs Scala is an easier to understand competition. In any case, if people want other people to invest in "their language", they should focus on making that language and its ecosystem compelling to use, not bash other languages..…
Re: Towards Scala 3
#243Earlier quoted context omitted.
I'm a Flow user rather than TS (and Flow complains about that code out of the box), but you are not telling us all: Since TS 2.6, if you enable all the optional " strict " mode checks than TypeScript does complain about that code. I see no disadvantage in those checks, e.g. "strictFunctionTypes", being optional, since you can always make them mandatory for your own project(s). To test it: - Go to the TS Playground at…
Is that option documented somewhere? I imagine there are some tradeoffs with enabling it.
> TypeScript 2.6 introduces a new strict checking flag, --strictFunctionTypes.
> The --strictFunctionTypes switch is part of the --strict family of switches, meaning that it defaults to on in --strict mode.
> Under --strictFunctionTypes function type parameter positions are checked contravariantly instead of bivariantly.
> ...(etc.)
Re: Towards Scala 3
#244Just curious, what companies (or kinds of companies) are betting on Scala nowadays? It seems that the people wanting "better Java" all decided they like Kotlin, and the functional programming people now gravitate more towards either F# (for .NET ecosystem) or OCaml/Reason (for the more unixy world). And the academic/research/learning crowd seems to like Haskell more. Who's still in Scala boat? Are Google or Fb or oth…
Re: Towards Scala 3
#245Disclaimer : I'm nobody important, but I do have an opinion If scala team were to disavow sbt, that'd be the single best thing they could possibly do for the ecosystem. I used to write a lot of scala, and working with sbt was enough to eventually get under my skin. I really like some of the OOP aspects of scala, the left-to-right style of thinking matches how my brain works. Scala having a lot to offer can distract n…
Re: Towards Scala 3
#246Disclaimer : I'm nobody important, but I do have an opinion If scala team were to disavow sbt, that'd be the single best thing they could possibly do for the ecosystem. I used to write a lot of scala, and working with sbt was enough to eventually get under my skin. I really like some of the OOP aspects of scala, the left-to-right style of thinking matches how my brain works. Scala having a lot to offer can distract n…
> If scala team were to disavow sbt, that'd be the single best thing they could possibly do for the ecosystem. Seconded. Between http://www.lihaoyi.com/mill/ and https://bazel.build/ , there are plenty of alternatives.
Re: Towards Scala 3
#247Earlier quoted context omitted.
The reality is that a language lives or dies by its ecosystem - particularly when it comes to a language like Scala that's in a tightly symbiotic relationship with its IDEs (the next time someone tries to sell you a "visual programming language", look at Scala for a language that makes really effective use of the GUI for programming without compromising the things that make textual programming languages good - see e.…
As a fellow emigrant of `Scala is the best island` forced off for pragmatic reasons. I've been around scala long enough to see the rise and fall of multiple expeditions into the bowels of the OSGI eclipse cave of horrors (Sean McDirmid / Miles Sabin etc). Before switching horses and settling in Intellij for several years. So I understand where you are coming from. I've since jumped ship again to vscode (along with ty…
Re: Towards Scala 3
#248Earlier quoted context omitted.
I'm a Flow user rather than TS (and Flow complains about that code out of the box), but you are not telling us all: Since TS 2.6, if you enable all the optional " strict " mode checks than TypeScript does complain about that code. I see no disadvantage in those checks, e.g. "strictFunctionTypes", being optional, since you can always make them mandatory for your own project(s). To test it: - Go to the TS Playground at…
Is that option documented somewhere? I imagine there are some tradeoffs with enabling it.
Re: Towards Scala 3
#249Just curious, what companies (or kinds of companies) are betting on Scala nowadays? It seems that the people wanting "better Java" all decided they like Kotlin, and the functional programming people now gravitate more towards either F# (for .NET ecosystem) or OCaml/Reason (for the more unixy world). And the academic/research/learning crowd seems to like Haskell more. Who's still in Scala boat? Are Google or Fb or oth…
Re: Towards Scala 3
#250Earlier quoted context omitted.
Is that option documented somewhere? I imagine there are some tradeoffs with enabling it.
https://www.typescriptlang.org/docs/handbook/release-notes/t... > TypeScript 2.6 introduces a new strict checking flag, --strictFunctionTypes. > The --strictFunctionTypes switch is part of the --strict family of switches, meaning that it defaults to on in --strict mode. > Under --strictFunctionTypes function type parameter positions are checked contravariantly instead of bivariantly. > ...(etc.)