TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Mruby – Ruby in your browser

77 点作者 NatW将近 12 年前

10 条评论

siong1987将近 12 年前
Since this project depends on webruby and webruby uses emscripten, it could get close to 2x native performance in browser(only firefox nightly) because of the awesome asm.js support.<p>I am a big supporter of asm.js after reading John Resig's post on it(<a href="http://ejohn.org/blog/asmjs-javascript-compile-target/" rel="nofollow">http://ejohn.org/blog/asmjs-javascript-compile-target/</a>).
gunn将近 12 年前
Nice to see! Some things are working very well:<p><pre><code> &#62;&#62; class Fixnum; def even?; self%2==0; end; end; &#62;&#62; (1..100).to_a.select{|i| i.even? } </code></pre> But some basic things are broken:<p><pre><code> &#62;&#62; n = 5 =&#62; 5 &#62;&#62; n =&#62; RuntimeError: arena overflow error</code></pre>
评论 #5816602 未加载
choxi将近 12 年前
Very cool. We wrote a post about different techniques to getting Ruby in the browser on our blog: <a href="http://blog.bloc.io/running-ruby-in-your-browser" rel="nofollow">http://blog.bloc.io/running-ruby-in-your-browser</a><p>Webruby (Mruby.js) was one of the options we considered but ultimately didn't use.
rtpg将近 12 年前
I was at a talk on mruby at a recent conference. It's some interesting stuff: the program size footprint is only something like 40k , and memory usage is around the same when running. It was initially meant for embedded systems, but seeing it here is also an interesting use case.
edwinyzh将近 12 年前
Cool! When I read the title I immediately thought - it must be done via emscripten, and it turned out that I was right :)
MrBra将近 12 年前
It'd be nice if someone could show an example of a webpage embedding some ruby code interacting with some js code/framework or something like html5 canvas. Just to see how they "communicate".
评论 #5809736 未加载
seivan将近 12 年前
I remember you could also get it into iOS. Perfect if you wanted to script some stuff in Ruby. I'm currently using JS for that, but Ruby should do as well.
评论 #5809806 未加载
coderhs将近 12 年前
Multiplying two large Fixnum, gives a float value.
评论 #5812017 未加载
adrianlmm将近 12 年前
This makes it crash<p>1000000.times{|i| puts "hello #{i}"}
txrx将近 12 年前
couple of tips:<p>jquery's $() is aliased to j() in ruby. Try:<p>j('body').css background: 'pink'<p>window is alias to w(). E.g.:<p>w.alert('hello from ruby')<p>puts w.prompt('saywhat?')