jreicherI really don't know what to me make of js, ts, and wasm. So many people seem to think they are "competitive" now, and without any firsthand experience I'm left wondering "how is that possible"?
bluets is js with types. wasm is a different beast, popularised by the web, but not limited to it. consider it an abstraction. many languages can compile *to* it, and the web (as in browsers, and also runtimes), can it
blueyou can write a c program, compile it to a .wasm file, then load and run it in a browser, or in node
bluefor c, gcc does not directly compile to wasm, so you usually use an additional tool call emscripten, `emcc`. but that's a gcc stupidity; clang has a wasm32 target
bluefor go, rust or zig, they have wasm as a target
bluenext to wasm, there is also wasi. when people started to run wasm code on runtimes, so on servers, they realised wasm doesn't have apis to interact with the operating system, i.e. IO/FS
blueenter wasi, Web Assembly System Interface, aka POSIX for wasm
jreicherI know what it "is". But I don't know what its place in the world is.
jreicherOr rather I should say I know what they are.
jreicherFrom what I can tell the only thing that distinguishes them is the historical browser runtime. And that's historical accident, no?
jreicherI don't understand the technical merits, if any.
bluedistinguishes what?
blueI just told you what its place in the world is. the typical use can is cpu-intensive stuff running in the browser. you'd write it in another lanugage, then load it in the browser. that's a perf/interoperability gain
blueuse case*
jreicherWhy js/ts/wasm/wasi should be preferred over more elegant languages and runtimes.
bluethat is a chain of dependencies
bluejs should be preferred because it's the only language browsers understand natively. they don't understand python or ruby or php
bluets should be preferred because it's a types-based superset of js
jreicherThat is what I've always suspected, but I can't help wondering what would happen if browsers support another runtime. Care to speculate?
bluewasm should be preferred for the first reason as well, combined with you wanting to execute NON-js code in the browser, for whatever reason. the emergent reason is performance, another is people wanting to run any of the languages I mentioned in the browser
phalethif browsers supported anything better than JS then JS would be slowly but surely abandoned
bluewasi is people trying to bridge the gap between wasm and server runtimes, so you can use wasm usefully on the server as well. what the use case there is, is yet to be revealed. some cloud providers support run wasm functions, that would bea use case
bluebrowsers will never natively support another runtime, they have no reason to, and if they did, wasm killed off that reason
phaleththe only reason JS is pervasive is cause of alot of people don't want to struggle with two languages on client and server and also cause web browser is way too convenient client
bluebrowsers have no incentive structure to do, jreicher. js has been optimised in the last 10 years (v8, jsc) to run almost as fast as native code. and wasm now provides a good escape for cases it doesn't
blueto do so*
phaleththere are far better runtimes than the JS ones that can utilize hardware resources in a much better way than JS allows
jreicherWhat I'm trying to get at is something like this: if a wasm-ish runtime was designed for browsers from scratch now, would it still look like wasm, and if not, what would it look like?
bluethere are, but the cost of bringing them to the browser isn't justifiable
jreicherI'm trying to separate history from technical merit.
jreicherJust for my own understanding.
blueit's hard to tell, jreicher. wasm is intentionally a very simple language with I believe like four primitive types. this is a bit like you asking, if x86 webassembly were redesigned today, how would it look like. I don't believe wasm has been specifically designed with js as the host/client language in mind, but I may be mistaken
phalethwasm's goal is to be streamable and compilable at the same time, but so far a lot of it's uscases are not for the web, neither wasm is assembly, so the web assembly name is not very fitting
phaleththe problem wasm can solve is the so called long cold starts of services
jreicherThat's a good point. I should probably make some time to look at wasm while making a conscious effort to forget the branding
bluehow jreicher, your question is not without merit. let me ask a question in return. if I want to run react today, and also benefit from things like SSR, but I want the server to be ruby, what are my options?
blues/how/now/
phalethwasm modules can be thought of as being scalable down to zero, due to the wasm service can just be started quickly so it can also remain shut down when not needed
phalethbut there is of course orchestration around that is required
blueso if you told me, "just take ruby on rails", I'd tell you, then I lose react SSR
jreicherblue: Yeah the larger ecosystem most definitely makes a difference. That's one of the reasons I'm implementing my language in Java. I don't have an easy answer. I'm just trying to understand the landscape.
bluewhat I'm trying to hint at it, that wasm is a nice abstraction for creating one application that can still use all the perks of js frameworks like react/svelte/vue, which need both a JS server and a JS client
blueand also have a server running ruby code
jreicherHint taken. I need to look at wasm again with that context in mind.
bluethis is something ruby on rails can't do for ruby, or django for python, or spring for java, or any php framework for php
bluebut it is something that primate does (for ruby/python/go; not yet for java/php)
bluejreicher, you should look into people that want to run things like laraval but with react. it's very weird and complicated
blue(they end up needing to run two servers)
bluewasm solves that elegantly
jreicherInteresting. Ta.
phalethwasm is just an overengieered way to allow faster number crunching in web browsers, remember that all numbers in JS are 64 bit floats
blueThis is also why I'm so excited about Java 25; with its native wasm compilation, it could be well supported by primate as backend. I just haven't got to it yet
blue(designing the API is actually harder than wiring it)
phalethwasm mvp (1.0) is 32 bit, the support for 64 was added to web browsers only recently
bluephaleth forget wasm in the browser, it's not interesting there at all imho :P
bluewasm is most interesting on the server because there I suddenly get access to the entire world of the programming language
phalethalso the problem with JS is the required conversion to UTF-16 that has to be done all the time
blueutf-16 strings?
blueya
blueI guess the point I'm trying to make is, perhaps interesting wasm/wasi use cases haven't arisen yet. primate is trying to change that
phalethwasm was never meant to make runtimes multilingual, most of the widely used languages have their own GC and will never be able to cleanly tap into wasm's gc
phalethbecause of that there are new languages being created and the ecosystem is being split further for the sake of hype and overengineering
blueya well, that always happens
phalethon the other hand wasm can unify the codebase of a project and solve problems with some of the so called native targets by allowing say kotlin to compile to wasm
blueremember the mushroms-after-the-rain-framework cumbrian explosion after bun released?
phalethand so a kotlin project can target mobile
phalethblue: nope
bluethings like honojs or elysiajs that are specifically bunonly
bluetotal dumpster fire abandonware
phalethalso Java has JS runtimes of it's own, no need to worry about wasm
bluehonojs supports deno too I believe, but now deno is dead so it's effectively a bunonly framework
phalethyeah, but hono is at least pushing performance boundaries of express and the likes
phalethit's all hype perf and shit so people can rewrite for eternity
blueya we should stop that
blueit's easy to optimise correct stuff, it's hard to correct optimised nonsense
phaleththere are dev teams forming foundations around new software tools and then people calling them douchebags for one reason or another so out of frustration new tools are created and new teams form
bluedreamreal: idea for repopack. `rp verify <path-to-bin>`; gets sha256 of an exe, queries repopack, and shows you data about the bin, if published on repopack. date, publisher, status (if revoked)
bluethis also is an idea in the direction of the "known-unknown" problem. if repopack always records the sha256 of every artifact it publishes, then this is a forward mechanism by design
blue(regardless of the artifact itself has such a mechanism)
blueregardless if*
dreamrealyeah, makes sense
* skillnews quit (Remote host closed the connection)
* skillbot quit (Remote host closed the connection)
* skillbot joined #primate
* skillnews joined #primate
* phaleth quit (Quit: phaleth)
bluedreamreal: I'd like your input on something
blueso repopack has stacks. stacks are code dependencies. if I stack 256 on 255, then it doesn't rebase onto master, but onto 255. the idea is to have work that builds up on other work, and to avoid too many merge conflicts and rebasing after merging onto master
bluegenerally, if I have a clean stack 1 -> 2 -> 3 -> 4, and all of them are reviewed and approved, then they will merge cleanly in order
bluethe issue I'm facing are *non-linear* stacks
blueconsider this:
blueparent
blue- child 1
blue- child 2
bluein this case, both children stack on parent, but they are independent of each other. they can merge in either order, and often merging one will introduce conflicts that need to be resolved in the other
bluethey can have children of their own also, and so on
blueso here's the thought:
blueA) are non-linear (shared 'upstream' history) stacks useful at all? what use cases?
blueB) if not, does it make sense to reject stacking more than one child on a parent?
blueC) if yes, does it still make sense to allow an *opt-in* project setting "Only linear stacks"
bluefin
blue(so a 'use case' for non-linear stack is this: parent introduces necessary base work; then two children introduce two *independent* features that base on this work; but it doesn't sound like a very useful use case to me)