开发者

Can Javascript be Bootstrapped?

开发者 https://www.devze.com 2023-01-05 13:01 出处:网络
Will Javascript on the rapid rise and it being adapted for all sorts of things, my question is: Can Javascript be bootstrapped? More specifically, would a JS parser written in JS be fast enough to be

Will Javascript on the rapid rise and it being adapted for all sorts of things, my question is: Can Javascript be bootstrapped? More specifically, would a JS parser written in JS be fast enough to be useful at all?

What are the design decisions that go into deciding whether or not to bootstrap a language?

This questions comes after seeing this: http://www.skulpt.org/ - an开发者_运维问答 implementation of python running entirely in the browser using Javascript.


It's Turing complete, so yes. Slow is relative, assembly programs could be called slow because they're abstracted in machine code rather than "hardwired". CPython is currently slower than C on the order of a magnitude, but it typically isn't a problem.


You might be interested in Mozilla's Narcissus:

Narcissus is a JavaScript interpreter written in pure JavaScript (i.e., a meta-circular evaluator), using the SpiderMonkey engine.

Originally a proof-of-concept by Brendan Eich, Narcissus is being revived as a test-bed for rapidly prototyping new language features for the JavaScript language (as well as the ECMAScript standard).

Though it's presumably much slower than the actual JavaScript engines used in browsers, it appears to be useful enough as an aid in developing JS language features.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号