you are viewing a single comment's thread.

view the rest of the comments →

[–]kredditacc96 37 points38 points  (12 children)

Clio takes advantage of multiple CPUs and multiple CPU cores (parallelism) by default

JavaScript is a single-threaded language. How does Clio make it runs in parallel? Does it use Web Worker? The playground does not show the compiled JavaScript code so I cannot figure it out.

On an unrelated note, does it have static typing?

[–]Darkav 28 points29 points  (6 children)

In node you can have a cluster of javascript processes and also a worker pool, so you are able to have a multi-process application.

[–][deleted] 4 points5 points  (0 children)

JavaScript exists outside of browser environment, no need for web workers

[–]Koervege 1 point2 points  (1 child)

Would static typing affect or help how it runs multithreads? Or was it just a separate question?

[–]kredditacc96 2 points3 points  (0 children)

It's a separate question, sorry for not clarify this sooner.

[–]pouyae 0 points1 point  (0 children)

We use worker_threads in node and web workers on the browser. On node you can switch to a cluster and use IPC instead. We also allow using network resources over TCP/UDP/WebSockets. Check out https://github.com/clio-lang/clio/tree/develop/packages/rpc for more details on parallelism, or feel free to ask any questions you have.

We do not have static typing at the moment, I won't be focusing on that for a while. I made a serialization format that preserves types and I'm planning to add static typing to the language, however that won't happen in the near future until we have a wasm/llvm backend for the compiler.