This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-28
Channels
- # aleph (48)
- # announcements (3)
- # bangalore-clj (1)
- # beginners (131)
- # cider (30)
- # cljdoc (6)
- # cljs-dev (53)
- # cljsrn (24)
- # clojure (312)
- # clojure-austin (2)
- # clojure-europe (4)
- # clojure-finland (6)
- # clojure-nl (24)
- # clojure-spec (24)
- # clojure-uk (66)
- # clojurescript (185)
- # core-async (46)
- # cursive (10)
- # data-science (9)
- # datomic (15)
- # devcards (2)
- # emacs (50)
- # fulcro (28)
- # jobs (1)
- # jobs-discuss (2)
- # kaocha (11)
- # lein-figwheel (12)
- # nyc (1)
- # off-topic (105)
- # other-languages (80)
- # pedestal (6)
- # re-frame (50)
- # reagent (5)
- # reitit (1)
- # remote-jobs (2)
- # ring (10)
- # rum (1)
- # shadow-cljs (10)
- # spacemacs (19)
There was a discussion about a "universal programming language" here a few days ago. Just encountered a relevant aphorism from Alan Perlis: "There will always be things we wish to say in our programs that in all known languages can only be said poorly." Great, as usual 🙂
Wasm might get pretty far especially once WASI becomes a standard. But you won't be coding wasm directly.
@eric.d.scott recommended that I switch to spacemacs (evilmode). I love it. It’s awesome.
This is what finally got me trying Emacs; this and org-mode. If nothing else, it's a fantastic way to learn the basics of Emacs.
Ya, especially since I know vim
I think WASM will open up a can of worms with security. Especially since it gives lower level access to the machine.
I reads the post about it, looks amazing if it works. Applications like slack could be made cross-platform and much lighter than Electron.
I think Slack gets a lot of leverage from being able to use web technologies. I don’t think that WASM would necessarily have e.g. a native DOM for you to work with
I think it’s more interesting to think of WASI+WASM like a more secure JVM. you can deploy your application anywhere it exists, and consume any libraries that have been built for it; whether they were written in C, Java, Rust…. Clojure? 😛
the WASM garbage collector story is still ??? so who knows what kind of leverage higher level langs might get from it yet
Kotlin can compile to wasm with a build in garbage collector, causing it to be rather big I thought. I just used it with Rust, then it's 'free'. But there are plans to add garbage collection to WASM natively.
I would imagine it could potentially add friction to languages like Java / Kotlin / Clojure that depend heavily on the GC and use lots of tricks (even in user-land) to optimize for GC
I also wonder how the native WASM GC will be integrated. C/C++/Rust probably don't want to deal with it
sure? anytime you're thinking in your head about the JVM memory model as you're writing code
i remember hearing a cool plus for rust that it changed how you think about that with ownership. so it didn't need to provide differences of mutable transients.
Ya. I think I saw same talk. Rust allows shared memory threading but without locks.
A lot of people are complaining that Golang is using locked concurrency model. Golang is just easier to write than C.
Rust ownership is almost like the message passing idea of Elixir but Rust allows shared memory. Elixir does not allow shared memory.
Elixir is better for horizontal scaling. Clojure and Rust are built for large multi core servers.
js sucks, its runtime model is bad, how do people get excited about it spread from the client to the server (nodejs, wasi, etc)
:thinking_face: I thought that it could interact with the JS runtime, but that it was something substantially more limited low-level
in order for wasm to interact with js the way it does it has to bake js's model in to it
for example, as far as I know the only way to have multiple "threads" in wasm is still to use what are basically webworkers
like I’m interested in understanding more about the tradeoffs of WASM, so I’m all ears
like, there’s no thread API for WASM to interact with in the browser. but presumably there could be some sort of capability offered in a native WASI environment that allows WASM-compiled apps to use native threads? If i understand correctly
adding threads like those in a JVM to a runtime that never had them often becomes visible at the language spec level, or should if you want to write any kind of thread safe programs with multiple threads. Python still has the GIL despite many people's attempts to get rid of it.
"shared nothing" threads are significantly easier, of course, interacting only through things like message queues. Is that what webworkers are like today?
I guess it seems like WASI is specifically being introduced to decouple WASM from the browser runtime
that’s mainly how webworkers are used AFAICT. I believe there are APIs now to use special shared memory buffers + atomics
there was this recent announcement: https://developers.google.com/web/updates/2018/10/wasm-threads
Ya, I realized quickly with WASM... it is run in its own environment. No interaction with the DOM or JS.... as far as I can tell
Node JS and Ruby have both been trying to move to multi threading.
But Ruby 2.0 is still locked to 1 CPU
The best use case for WASM seems to be games... or maybe a custom UI element but you'd have to talk through a web socket to interact with the DOM
Any GC they try to bolt onto WASM is going to be very JS centric. Otherwise it'll be sorta pointless
I'm not sure webworker-based multithreading over wasm is going to be much less efficient than parallel workloads over the JVM. JS isolates just don't have interuptability, so that may or may not impact some parallel algorithm performance.
What does interuptibility mean? As in int interrupt on the bios?
Int 13 interrupt that mouse, keyboard use?
Ahh, threading
Does that mean V8 engine does not have interuptable threads?
The webworker isolates will not be exposing interruptibility. They run on threads or OS processes that have their own interrupt semantics.
I guess that fits the whole browser architecture
Async architecture
2. have all comms go through a switch panel where you can send an "interrupt" command prior to any "result" command
In other words, WASM won't be good for data processing, math
when a worker waits on a result, nothing else can interrupt its waiting on that one result, so technically, you could use that result channel to simulate interrupts.
But things like Clojure's STM sorta require interruptibility, so you can short-circuit logic on invalidated state.
Very interesting
Ya, like if a thread is processing a really long math call
But again, a result/interupt switchboard may mitigate that, but that may slow things down too much
Yeah, there's no checking in on that thread, unless it's chunking its steps and feeding out updates or checking some interrupt queue
So its best to use batches like the clojure partition of sequences?
Or you might have all threads maxed out on long running code?
I do have 1 ? I thought most CPU's limit the threads to 4 per core?
4 parallel threads... not talking about fake interleaving threading like node js does
Interruptibility with regard to clojure sequencing - or interruptibility in any regard - is not spoken to in any clojure semantics I'm aware of...
I think one a non-interruptible, parallel worker js load, you'd probably want to have a better understanding of the length of time each of your work chunks is going to take, true... But that won't necessarily mean less performance, depending on the situation.
Gotcha
I was reading how other languages are trying to add atomics... but Clojure STM is atomic by nature?
E.g. Golang
And that Clojure comes closest to non locking concurrency... and Rust too
Trying to figure out if STM or an actor model is better... maybe STM for data processing... And actors for distributed.
Clojure atoms are atomic, optimistic-best-effort-synchronous (they might retry) and are "uncoordinated" with respect to other atoms or reference types, where "coordinated" means consistent semantics maintained between them.
Agents hold a queue of actions and you issue work to them similarly to atoms, but act a bit more like the actor model, from what some people say
Then STM is sorta different, like a set of atoms/agents where you can ensure consistent semantics across the different refs.
Honestly, very few people have found a job for STM that a database doesn't usually end up taking care of anyway.
my hot take is that WASI is another thing to add to the stack of "technologies just now catching up to where Xerox PARC was 40 years ago" > "After literally decades of trying to add more and more features and not yet matching up to the software than ran on the machines the original browser was done on, they are slowly coming around to the idea that they should be safely executing programs written by others." - Alan Kay https://www.mail-archive.com/[email protected]/msg03823.html
I think WASM will add DOM support too. It will be a security nightmare. But at least I could avoid too much Javascript
E.g. Javascript payloads accessing WASM machine level code that burns a hole in your RAM
Yeah, Brannon Dorsey had a good writeup of what happens when designers fail at the "safely executing code written by others" bit: https://medium.com/@brannondorsey/browser-as-botnet-or-the-coming-war-on-your-web-browser-be920c4f718