Submit

Back to the channels

#primate

  1. phaleth yet another TS runtime https://github.com/are-we-dodo-yet/dodo
  2. phaleth https://1clickimpact.com/website-carbon/bytecode.news
  3. jreicher phaleth: "TS" runtime?
  4. jreicher You mean typescript?
  5. phaleth yup
  6. blue ddf
  7. blue deno dumpster fire :P
  8. jreicher I 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"?
  9. blue ts 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
  10. blue you can write a c program, compile it to a .wasm file, then load and run it in a browser, or in node
  11. blue for 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
  12. blue for go, rust or zig, they have wasm as a target
  13. blue next 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
  14. blue enter wasi, Web Assembly System Interface, aka POSIX for wasm
  15. jreicher I know what it "is". But I don't know what its place in the world is.
  16. jreicher Or rather I should say I know what they are.
  17. jreicher From what I can tell the only thing that distinguishes them is the historical browser runtime. And that's historical accident, no?
  18. jreicher I don't understand the technical merits, if any.
  19. blue distinguishes what?
  20. blue I 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
  21. blue use case*
  22. jreicher Why js/ts/wasm/wasi should be preferred over more elegant languages and runtimes.
  23. blue that is a chain of dependencies
  24. blue js should be preferred because it's the only language browsers understand natively. they don't understand python or ruby or php
  25. blue ts should be preferred because it's a types-based superset of js
  26. jreicher That is what I've always suspected, but I can't help wondering what would happen if browsers support another runtime. Care to speculate?
  27. blue wasm 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
  28. phaleth if browsers supported anything better than JS then JS would be slowly but surely abandoned
  29. blue wasi 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
  30. blue browsers will never natively support another runtime, they have no reason to, and if they did, wasm killed off that reason
  31. phaleth the 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
  32. blue browsers 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
  33. blue to do so*
  34. phaleth there are far better runtimes than the JS ones that can utilize hardware resources in a much better way than JS allows
  35. jreicher What 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?
  36. blue there are, but the cost of bringing them to the browser isn't justifiable
  37. jreicher I'm trying to separate history from technical merit.
  38. jreicher Just for my own understanding.
  39. blue it'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
  40. phaleth wasm'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
  41. phaleth the problem wasm can solve is the so called long cold starts of services
  42. jreicher That's a good point. I should probably make some time to look at wasm while making a conscious effort to forget the branding
  43. blue how 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?
  44. blue s/how/now/
  45. phaleth wasm 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
  46. phaleth but there is of course orchestration around that is required
  47. blue so if you told me, "just take ruby on rails", I'd tell you, then I lose react SSR
  48. jreicher blue: 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.
  49. blue what 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
  50. blue and also have a server running ruby code
  51. jreicher Hint taken. I need to look at wasm again with that context in mind.
  52. blue this is something ruby on rails can't do for ruby, or django for python, or spring for java, or any php framework for php
  53. blue but it is something that primate does (for ruby/python/go; not yet for java/php)
  54. blue jreicher, you should look into people that want to run things like laraval but with react. it's very weird and complicated
  55. blue (they end up needing to run two servers)
  56. blue wasm solves that elegantly
  57. jreicher Interesting. Ta.
  58. phaleth wasm is just an overengieered way to allow faster number crunching in web browsers, remember that all numbers in JS are 64 bit floats
  59. blue This 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
  60. blue (designing the API is actually harder than wiring it)
  61. phaleth wasm mvp (1.0) is 32 bit, the support for 64 was added to web browsers only recently
  62. blue phaleth forget wasm in the browser, it's not interesting there at all imho :P
  63. blue wasm is most interesting on the server because there I suddenly get access to the entire world of the programming language
  64. phaleth also the problem with JS is the required conversion to UTF-16 that has to be done all the time
  65. blue utf-16 strings?
  66. blue ya
  67. blue I 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
  68. phaleth wasm 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
  69. blue jreicher: https://primate.run/docs/backend
  70. nevet Primate — Backends
  71. phaleth because of that there are new languages being created and the ecosystem is being split further for the sake of hype and overengineering
  72. blue ya well, that always happens
  73. phaleth on 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
  74. blue remember the mushroms-after-the-rain-framework cumbrian explosion after bun released?
  75. phaleth and so a kotlin project can target mobile
  76. phaleth blue: nope
  77. blue things like honojs or elysiajs that are specifically bunonly
  78. blue total dumpster fire abandonware
  79. phaleth also Java has JS runtimes of it's own, no need to worry about wasm
  80. blue honojs supports deno too I believe, but now deno is dead so it's effectively a bunonly framework
  81. phaleth yeah, but hono is at least pushing performance boundaries of express and the likes
  82. phaleth it's all hype perf and shit so people can rewrite for eternity
  83. blue ya we should stop that
  84. blue it's easy to optimise correct stuff, it's hard to correct optimised nonsense
  85. phaleth there 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
  86. blue ya
  87. dreamreal nevet now has actual extension points :D
  88. dreamreal had them, really, but now they're being used
  89. dreamreal (safecracker is now an extension and is no longer in the streampack repository)
  90. blue great
  91. blue dreamreal: 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)
  92. blue this 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
  93. blue (regardless of the artifact itself has such a mechanism)
  94. blue regardless if*
  95. dreamreal yeah, makes sense
  96. blue dreamreal: I'd like your input on something
  97. blue so 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
  98. blue generally, 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
  99. blue the issue I'm facing are *non-linear* stacks
  100. blue consider this:
  101. blue parent
  102. blue - child 1
  103. blue - child 2
  104. blue in 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
  105. blue they can have children of their own also, and so on
  106. blue so here's the thought:
  107. blue A) are non-linear (shared 'upstream' history) stacks useful at all? what use cases?
  108. blue B) if not, does it make sense to reject stacking more than one child on a parent?
  109. blue C) if yes, does it still make sense to allow an *opt-in* project setting "Only linear stacks"
  110. blue fin
  111. 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)

Search posts