Re: Proposal: Static Typing

2019-03-25 Thread Naveen Chawla
Yes the real value of strict types, in my view, is at development time, not at run time. However I would be curious to know if anybody has a usage for them at run time, and an example of such a case... Otherwise, yes a "toolchain" that allows strict typing using JavaScript without having to "use

Re: Re: Proposal: Static Typing

2019-03-25 Thread Aliaksandr Zasim
What about performance? Would strict types improve JIT compilation? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: Static Typing

2019-03-25 Thread Andrea Giammarchi
I am having hard time understanding the counter argument "you need a transpolar anyway". That's been the case since ES2015 landed with breaking syntax that has been required mandatory transpilation to keep it backward compatible, with things also not really transpilble such as classes with built-i

Re: Proposal: Static Typing

2019-03-25 Thread Andrea Giammarchi
the day I'll disable autocorrect everywhere will be always too late ... transpolar => transpilers trample => transpile On Mon, Mar 25, 2019 at 10:13 AM Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > I am having hard time understanding the counter argument "you need a > transpolar

Re: Proposal: Static Typing

2019-03-25 Thread Bergi
Hi, I am having hard time understanding the counter argument "you need a transpiler anyway". Sorry, I agree it's a bad argument, I should have just omitted it. It was meant to support "If you are only looking for development-time benefits, you have to install a static toolchain anyway - which

Re: Proposal: Static Typing

2019-03-25 Thread Andrea Giammarchi
> WASM interoperability and optimiser efficiency instead of developer productivity. I've personally always seen types useful **only** for typed languages interoperability and/or optimization/performance hints to engines/runtimes, but since many developers apparently experience some productivity bo

Re: Proposal: Static Typing

2019-03-25 Thread Andrea Giammarchi
* trough (gz) On Mon, Mar 25, 2019 at 11:41 AM Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > > WASM interoperability and optimiser efficiency instead of developer > productivity. > > I've personally always seen types useful **only** for typed languages > interoperability and/o

Re: Re: Proposal: Static Typing

2019-03-25 Thread ViliusCreator
> Hello, to play the devils advocate: why does JavaScript need static typing? > Your proposal doesn't really answer that. Sure, it mentions tooling and IDEs > that can provide you with type hints and complain on mistakes I actually did. It keeps unwanted type mutations and bad values away. For e

Re: Re: Proposal: Static Typing

2019-03-25 Thread guest271314
```js let a: number = 10 a += ‘1’ // Error, cannot convert type string to type number.``` What if ```"101"``` is the expected result? Would Strict mode for scripts > To invoke strict mode

Re: Proposal: Static Typing

2019-03-25 Thread Randy Buchholz
I recently started doing a lot of ES, coming from C# and really missed "typings" at first. But once I learned to think more in es, they became less necessary - even cumbersome in some ways. The question for me on this really comes down to what is a "type" and what value does it bring. As I see

Re: Proposal: Static Typing

2019-03-25 Thread Ranando King
Doesn't V8 already use such a concept to manage optimization? When a reference's structure mutates, V8 generates a new type by extending the previous one with the changes, then kills any affected optimizations around the mutated object, forcing re-optimization. Static types would essentially provid