TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ruby 3.2 preview 1 with support for WASM compilation

364 pointsby pvsukale3about 3 years ago

12 comments

freedombenabout 3 years ago
Timeouts for Regexp is quite interesting. The engineering purity in me saddens at such a thought, but indeed it seems highly practical.<p>The syntax feels a little rough although I have no ideas how to make it better:<p><pre><code> Regexp.timeout = 1.0 ... &#x2F;^a*b?a*$&#x2F; =~ &quot;a&quot; * 50000 + &quot;x&quot; </code></pre> I think I would favor the:<p><pre><code> long_time_re = Regexp.new(&quot;^a*b?a*$&quot;, timeout: 1.0) </code></pre> version instead but I use the `=~` almost entirely, so that would still be a big style change. Probably end up setting a global timeout per app and then overriding for individual checks as needed?
评论 #30948402 未加载
评论 #30948374 未加载
评论 #30965747 未加载
评论 #30948475 未加载
评论 #30949617 未加载
swlkrabout 3 years ago
One notable thing is the ruby apps in a single .wasm file. This may make ruby CLI apps easier, as well as eventually replacing things like docker or shipping your ruby code to a server.
评论 #30950026 未加载
评论 #30952245 未加载
评论 #30949819 未加载
评论 #30949404 未加载
eatonphilabout 3 years ago
This looks awesome! I&#x27;ve already played around with pyodide and coldbrew doing the same thing for CPython. I use it for an in-memory playground [0] of an open-source desktop app I build [1]. I&#x27;ve been waiting for Ruby, Julia, and R support to add them in too.<p>That said, I am not seeing a link in here about how to actually use this code. Is there a good tutorial&#x2F;example somewhere?<p>[0] app.datastation.multiprocess.io<p>[1] github.com&#x2F;multiprocessio&#x2F;datastation
评论 #30951639 未加载
syrusakbaryabout 3 years ago
This is super exciting!<p>They also created an awesome playground to try Ruby online [1]... all powered by Wasmer&#x2F;WASI [2]!<p>[1] <a href="https:&#x2F;&#x2F;try.ruby-lang.org&#x2F;playground&#x2F;" rel="nofollow">https:&#x2F;&#x2F;try.ruby-lang.org&#x2F;playground&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;wasmer.io" rel="nofollow">https:&#x2F;&#x2F;wasmer.io</a>
norman784about 3 years ago
What I can see here with WASM is that in the near future Ruby community could build their frontend frameworks so you can develop using 98% ruby in your app.<p>There were attempts in the past to use ruby in the frontend, by compiling it to JS (opalrb), so I looking forward to see how the ruby community exploits WASM.<p>While I don&#x27;t know how good it will be it still interesting the possibilities that WASM bring to the table, no more forced to use one language for the browser, use whatever language you like!
评论 #30955079 未加载
pvsukale3about 3 years ago
Here is IRB running in the browser by author of this feature<p><a href="https:&#x2F;&#x2F;irb-wasm.vercel.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;irb-wasm.vercel.app&#x2F;</a><p>No installation required :)
评论 #30955267 未加载
zamalekabout 3 years ago
What would really excite me is adding WASM support for native extensions. Installing gems in our CI for arm64&#x2F;M1 takes about 40 times longer than the actual build.
评论 #30955513 未加载
评论 #30953465 未加载
nomilkabout 3 years ago
Regarding WASM, what are the benefits to users? Is it that html&#x2F;js&#x2F;css loads 2-10 times faster?<p>Also, what&#x27;s the impact on a typical rails&#x2F;ruby dev? Do they have to learn anything new to enjoy improvements WASM brings, or will all the changes be &#x27;under the hood&#x27; (i.e. in ruby and&#x2F;or rails)?
评论 #30952740 未加载
marcus_cemesabout 3 years ago
I&#x27;ve been very attracted to learn Ruby a couple of times, being exhausted of the JS ecosystem. Everybody who&#x27;s used it seems to fall in love with it, but I can&#x27;t get over just how slow it is... It takes a fresh installation of Discourse over 10 minutes to start-up again on a small underpowered VM and uses 10x as much RAM as an alternative platform such as Flarum.
评论 #30950538 未加载
评论 #30951364 未加载
评论 #30951273 未加载
alberthabout 3 years ago
Does this imply that Rails apps could run as WASM server apps and receive a huge performance boost?
评论 #30949376 未加载
评论 #30949734 未加载
评论 #30949368 未加载
评论 #30949445 未加载
heavyset_goabout 3 years ago
Anyone know how large the compiled WASM is, for say, a hello world example?
评论 #30954263 未加载
k__about 3 years ago
Is it comparable to Opal?
评论 #30950148 未加载
评论 #30950458 未加载