From:  "ISHIKAWA, Chiaki" <>
Date:  20 Mar 2019 04:04:33 Hong Kong Time

Re: Choosing a programming language


On 2019/03/20 4:50, Mark Rousell wrote:
> On 19/03/2019 18:59, ISHIKAWA,chiaki wrote:
>> On 2019/03/20 1:21, Mark Rousell wrote:
>>> On 19/03/2019 08:59, ISHIKAWA,chiaki wrote:
>>>> PS: BTW, I hate JS due to its dynamically typed system.
>>> Have you looked at Typescript? It seems to be designed especially to
>>> address issues like this.
>> I know it exists. But given that mozilla uses built-in JS interpreter,
>> the chance of using Typescript is nil unless the built-in JS
>> interpreter is modified to support Typescript, isn't it?
>> (If it happens, it will be very nice for maintenance reason alone.)
>> Joshua probably didn't raise the prospect of better JS-like script
>> languages precisely because of this reason.
>> But I may be wrong.
> Typescript compiles to standard Javascript[1] so there's no need for
> Typescript-specific infrastructure within Mozilla/Thunderbird.
> How practical it would actually be to write Thunderbird UI in Typescript
> and compile to Javascript I don't know but, in theory, it should
> certainly work.

I see. This means we have to run through typescript code via TypeScript 
compiler, sort of, to produce clean JavaScript code and place it inside 
the source tree BEFORE creating the testable/release versions.

I think it is doable: whether the majority of developers would like the 
extra step or not is another question.
I, for one,  would go for TypeScript and other variants that enforce 
static type checking better than the current JS.

> Footnote:-
> 1: From "TypeScript compiles
> to clean, simple JavaScript code which runs on any browser, in Node.js,
> or in any JavaScript engine that supports ECMAScript 3 (or newer)."

It is ironic that node.js was, the last time I checked, a typical 
example of sloppy JS code in terms of typing. EsLint would have barfed 
on it. Of course, there was a reason. The developers of Node.js wanted 
to reduce the number of characters in the code as much as possible, and 
there are enough eyeballs to keep it in good shape.
The latter is quite the opposite of TB development community scene.