top | item 35187434 (no title) rr888 | 3 years ago I agree TS is great. Not really multi threaded kills it for me though. discuss order hn newest jdlshore|3 years ago Threads are a function of the environment, and are available in TS and other compiles-to-JS languages:Node.js: https://nodejs.org/api/worker_threads.htmlBrowser: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...However, threads are very rarely needed. The common use case in other languages is I/O, and JS environments handle that with async I/O—a superior choice, IMO. illiarian|3 years ago Neither of those are proper threads, and they have various limitations placed on them.And the language and the VM has been, and will be for any foreseeable future, single-threaded. load replies (1)
jdlshore|3 years ago Threads are a function of the environment, and are available in TS and other compiles-to-JS languages:Node.js: https://nodejs.org/api/worker_threads.htmlBrowser: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...However, threads are very rarely needed. The common use case in other languages is I/O, and JS environments handle that with async I/O—a superior choice, IMO. illiarian|3 years ago Neither of those are proper threads, and they have various limitations placed on them.And the language and the VM has been, and will be for any foreseeable future, single-threaded. load replies (1)
illiarian|3 years ago Neither of those are proper threads, and they have various limitations placed on them.And the language and the VM has been, and will be for any foreseeable future, single-threaded. load replies (1)
jdlshore|3 years ago
Node.js: https://nodejs.org/api/worker_threads.html
Browser: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...
However, threads are very rarely needed. The common use case in other languages is I/O, and JS environments handle that with async I/O—a superior choice, IMO.
illiarian|3 years ago
And the language and the VM has been, and will be for any foreseeable future, single-threaded.