Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: chrisjj on December 16, 2016, 08:24:50 AM

Title: Javascript
Post by: chrisjj on December 16, 2016, 08:24:50 AM
How about it? :-)

E.g. based on https://github.com/espruino/Espruino .
Title: Re: Javascript
Post by: __builtin on December 16, 2016, 04:42:47 PM
There's nothing that prevents anyone from starting a port, apart from maybe licensing, at least on the technical side of things. However some practical questions remain, such as the utility of such a port. I fail to see any practical uses of a JS interpreter. Also, the question of finding someone willing to do it remains. You would either have to find and convince a developer to do it for you, or do it yourself.
Title: Re: Javascript
Post by: chrisjj on December 16, 2016, 05:11:54 PM
I fail to see any practical uses of a JS interpreter.

Allowing Rockbox programs to be written in a well-known language more powerful than those currently available.

Also, the question of finding someone willing to do it remains. You would either have to find and convince a developer to do it for you, or do it yourself.

Yeah, I figured that :-)
Title: Re: Javascript
Post by: __builtin on December 16, 2016, 11:08:49 PM
There is already a perfectly good lua port. If you want to write a plugin, it'd be much easier to just do it in C or lua than to port a whole JS interpreter. Also, most plugins are already written in C, which I'd classify as a well-known and powerful language.
Title: Re: Javascript
Post by: chrisjj on December 16, 2016, 11:16:11 PM
There is already a perfectly good lua port. If you want to write a plugin, it'd be much easier to just do it in C or lua than to port a whole JS interpreter.

Oh, yes I know that. But if RB had JS, then I wouldn't need to port the JS interpreter! I'd just dive right in and program in JS.

Also, most plugins are already written in C, which I'd classify as a well-known and powerful language.

I said "more powerful than those currently available". C is one of the most primitive languages still in general use. JS's additional power includes object orientation, dynamic memory allocation, local functions, closures, pattern matching etc.
Title: Re: Javascript
Post by: Bilgus on December 17, 2016, 11:58:51 AM
and lots of overhead for those features
Title: Re: Javascript
Post by: chrisjj on December 17, 2016, 12:09:25 PM
and lots of overhead for those features

Indeed. Lots to keep CPU and memory employed :)