开发者

Tiny javascript implementation? [closed]

开发者 https://www.devze.com 2023-02-19 07:01 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

Improve this question

I need an extremely tiny implementation of (maybe a subset of?) Javascript. Code size and memory usage are extremely important (speed isn't in the question, it can run as slow as it likes). It must be written in C (not C++), and that too, ANSI 开发者_开发问答C (GCC extensions are okay). If it runs on a VM would be best, because I will have to write a compiler for it. Any suggestions?

EDIT: Both of the responses I have seem good, except:

SpiderMonkey concentrates a lot on making it faster, I don't care if its fast at all.

Quad-Wheel sounds good, except the activity on it, and code comments are few (I will be porting this to another architecture if that helps).

So, any other responses would be great. Or, I could roll out my own simplified version of JS (but that doesn't sound fun at all)


Duktape is written in C, with a focus on portability and compact footprint: http://duktape.org/


I just discovered this ruby: https://github.com/gfwilliams/tiny-js

I've been looking quite some time for this, since spidermonkey/v8 usually is pretty big and comes with several dependancies. Tiny-js is a portable 'run make and your done'-linux c-class. Perfectly for if you are only looking for simple bindings and prefer javascript/c-syntax over lua/other awesome scriptinglanguages.


An ANSI-C engine for ECMA-262: http://code.google.com/p/quad-wheel/

Mozilla SpiderMonkey is written in C as well, but probably to complex and large for you?


SpiderMonkey is Mozilla's C implementation of JavaScript.

http://www.mozilla.org/js/spidermonkey/


muJS from Artifex Software might be another option for embedded JS/ES implementation.


You should look at Jsi, which was just released. It is very small, is a subset of javascript, and is in C (derived from quadwheel).


I think the jsi he's talking about is this: http://pdqi.com/cgi-bin/cgiwrap/pdqi/jsi.cgi/doc/tip/jsi/www/usingjsi.wiki

(Don't blame it is not... hehe)


http://jsish.org will redirect you to the host site.


https://github.com/cesanta/v7 is designed for embedded systems. Has very small footprint.


Have you looked at JerryScript?


If you are completely expect a full Node.js runtime at embeddable, ShadowNode might be a good for you.

https://github.com/Rokid/ShadowNode

0

精彩评论

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

关注公众号