Javascript has GC and tail calls, and I don't think WASM is getting either anytime soon.
Re:Interview with Douglas Crockford
by jillesvangurp on Tuesday July 19, 2022 @01:35PM
(#32155178)
The experimental Kotlin WASM uses some experimental GC related flags in chrome. That stuff is working right now and will no doubt stop being experimental at some point. Tail calls might take a bit longer but there are probably people working on that too. But there are probably ways around that. WASM is already useful today and will incrementally get more useful over the next few years.
Re:Interview with Douglas Crockford
by johnfarrelldev on Tuesday July 19, 2022 @02:25PM
(#32155897)
I'm not sure about other engines but V8 the most popular JS engine does not implement tail calls.
Re:Interview with Douglas Crockford
by dragonwriter on Tuesday July 19, 2022 @02:27PM
(#32155927)
Isn't not efficiently implementing tail calls a current JS standard (in that implementing them means your implementation is technically broken) specifically to prevent software from relying on that optimization?
Someone should tell Ecma then: https://tc39.es/ecma262/multipage/ecmascript-language-functi...
I was wrong, though, tail calls are in ES14, and eliminating them is probably not implemented anywhere yet.
Edit: Wrong again, tail-call optimizations are in WebKit; iOS has had them since iOS 12 according to this: https://kangax.github.io/compat-table/es6/#test-proper_tail_...
Re:Interview with Douglas Crockford
by kwertyoowiyop on Tuesday July 19, 2022 @02:01PM
(#32155574)
He has said that a good language avoids exposing the programmer to choices that they can make incorrectly. He probably sees some added features in Javascript as creating such choices.
I think that's a pretty interesting statement from somebody like Douglas Crockford. Not disagreeing; but still ...
I think there are two ways of looking at recent changes in Javascript. Either it's progress or it's just not enough progress. I think what he is saying here is that there it has too much baggage and that there are newer and more interesting languages now. That's not such a strange thing to say for somebody that has been involved with trying to create new languages.
My personal view is that browser Javascript is mostly a compilation target these days, including for Javascript itself, and that we now have a better compilation target in the form of WASM that is less awkward to target for a lot of languages as well. The question is what languages people will be using in the next years that target that. I'd say there are some interesting alternatives to choose from already and there are likely to be more in the next few years.