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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

The Glimmer VM: Boots Fast and Stays Fast

292 点作者 lowonkarma大约 8 年前

12 条评论

MatthewPhillips大约 8 年前
I love technical articles about how libraries are built. This is really great!<p>I don&#x27;t follow the last part of the article though. Specifically this part:<p>&gt; We accomplish this by (under the hood) allowing every bit of data that goes into a template to separate the process of computing its current value from the process of determining whether the value might have changed.<p>When you say &quot;bit of data&quot;, what exactly do you mean? I assume you mean some field that is bound to a template. Like a property on glimmer component. Using KVO this would be a compute of some kind, that triggers an event when its value changes.<p>Perhaps you&#x27;re doing something totally different, but I don&#x27;t see how? Breaking it down, we have an object like:<p><pre><code> { &quot;foo&quot;: &quot;bar&quot; } </code></pre> I think you&#x27;re saying that you don&#x27;t observe this object (using some kind of obj.set(&#x27;foo&#x27;, &#x27;baz&#x27;) convention) but rather determine that the value changed by some other means. If that is so, what is the other means?
评论 #14052473 未加载
chubot大约 8 年前
What IS the glimmer VM? I didn&#x27;t see any links on the page. Is this it?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;glimmerjs&#x2F;glimmer-vm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;glimmerjs&#x2F;glimmer-vm</a><p>It is JavaScript code or native code?
评论 #14053770 未加载
评论 #14051744 未加载
评论 #14053327 未加载
mwcampbell大约 8 年前
What is the advantage of implementing your own bytecode VM rather than generating JavaScript code and using eval()? It seems to me that the latter would be more efficient, since you wouldn&#x27;t have a VM within a VM.
评论 #14051397 未加载
评论 #14051520 未加载
评论 #14051261 未加载
评论 #14051267 未加载
评论 #14064431 未加载
评论 #14051870 未加载
mercer大约 8 年前
Apologies ahead of time if this is a stupid question. I am pretty much the walking stereotype of a web developer with very little experience with anything below javascript&#x2F;ruby&#x2F;python&#x2F;php.<p>Considering that Glimmer goes quite far in optimizing stuff, at which point would it perhaps make more sense to just emulate HTML elements on a pixel-level?<p>Or am I vastly underestimating how complex the standard UI elements really are? Or overestimating how much effort went into Glimmer? And if so, as perhaps a more constructive question: are there any areas of &#x27;web&#x27; where someone feels a shortcut <i>should</i> be taken?<p>(On the latter, I&#x27;m inclined to feel that WYSIWYG textareas and CSS above class-scope are ripe for &#x27;shortcuts&#x27;, but perhaps that&#x27;s opening some cans of whole other worms...)
评论 #14052104 未加载
评论 #14052217 未加载
评论 #14052396 未加载
评论 #14054323 未加载
评论 #14055224 未加载
dlcmh大约 8 年前
Based on some of the comments about what a VM actually is, I think this 2-part series might help those who are wondering (me included) about the technicalities of building one&#x27;s own VM:<p>- (Part 1) <a href="https:&#x2F;&#x2F;www.codeproject.com&#x2F;Articles&#x2F;43176&#x2F;How-to-create-your-own-virtual-machine" rel="nofollow">https:&#x2F;&#x2F;www.codeproject.com&#x2F;Articles&#x2F;43176&#x2F;How-to-create-you...</a> - (Part 2) <a href="https:&#x2F;&#x2F;www.codeproject.com&#x2F;Articles&#x2F;61924&#x2F;How-to-create-your-own-virtual-machine-Part" rel="nofollow">https:&#x2F;&#x2F;www.codeproject.com&#x2F;Articles&#x2F;61924&#x2F;How-to-create-you...</a>
bluepnume大约 8 年前
I&#x27;m a big fan of what I&#x27;m seeing in Glimmer so far. I had fun adding support for xcomoponent yesterday, making Glimmer components work as cross-domain components.<p><a href="https:&#x2F;&#x2F;medium.com&#x2F;@bluepnume&#x2F;introducing-support-for-cross-domain-glimmer-components-with-xcomponent-21287c9f91f1" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@bluepnume&#x2F;introducing-support-for-cross-...</a><p>I&#x27;d love it if it were a little more flexible to get started with though. Rather than fire up ember-cli, I&#x27;d love to just be able to:<p>1. Load glimmer.js from a CDN<p>2. Extend glimmer.Component<p>3. Render my component into an element<p>I know ember-cli solves this problem for a lot of users, but I&#x27;d love for the number of steps to get a &quot;hello world&quot; working to be as simple as the above. I think that&#x27;s one of the reasons React has been so successful: it&#x27;s stupid-simple to get started with, and it draws you in from there.
评论 #14053622 未加载
conradk大约 8 年前
How does Vue.js compiled templates compare to Glimmer ?
bozonil大约 8 年前
Is Glimmer VM actually a virtual machine?<p>The term suggests some kind of Turing complete language with sandboxing and memory management.<p>Without these features &quot;domain-specific language&quot; would be more precise description.
pier25大约 8 年前
I wonder why the author ignored other big players in those benchmarks such as Angular or Vue.
qaq大约 8 年前
Someone needs to make a lightweight framework with MobX and Glimmer
analognoise大约 8 年前
Isn&#x27;t this just re-solving a decades old problem, with the (unnecessary) constraints caused by modern web systems?
评论 #14051764 未加载
评论 #14057107 未加载
评论 #14051801 未加载
评论 #14052695 未加载
评论 #14053200 未加载
评论 #14054510 未加载
iamleppert大约 8 年前
It&#x27;s not correct to call this a VM. It&#x27;s an optimized template language&#x2F;renderer.<p>I&#x27;d like to see an example of the same static gzipped HTML content delivered to the browser and a template rendered with this.<p>I have doubts this is any more efficient than the browser&#x27;s built-in gzip decoder on a time basis nor do I think it beats gzip in terms of space efficiency.<p>It&#x27;s hard to take seriously those who claim to be optimizing things when they don&#x27;t have any measurements on what they are trying to improve vs. the new method.
评论 #14056422 未加载