Re: [Algorithms] Complexity of new hardware
Brought to you by:
vexxed72
|
From: Philip T. <ex...@gm...> - 2009-04-28 13:55:05
|
On Tue, Apr 28, 2009 at 1:26 PM, Rachel Blum <r....@gm...> wrote: >> >> There's JavaScript, which has pretty huge adoption (outside of games), >> C-like syntax, closures, prototype-based inheritance, active >> communities working on the language spec and on implementations and on >> applications, is reasonably elegant and powerful (see some articles on >> http://www.crockford.com/javascript/), is quite small (the language >> itself, distinct from the web browser environment (with DOM and AJAX >> and all that stuff) it typically runs in), > > The downside: If you want to include additional JavaScript libraries you > have to (as far as I know) resort to the web browser as preprocessor. Which > kind of destroys any idea of modularity. There's no need to get a web browser involved; but you do need your embedding application to provide some functionality, since JS has no built-in API for accessing files or networks. (The core language does arrays, strings, regexps, dates, maths, etc, but little else.) That's pretty trivial - in SpiderMonkey it's a dozen lines of code to define a C function that reads your script library files and passes them to the script evaluation API, and to expose it to scripts so they can call it themselves to load other scripts. The language has no built-in support for concepts like namespacing, but you can use the same tricks that modern web scripting libraries use (e.g. wrapping files in anonymous functions so they don't pollute the global namespace, and then exporting everything as properties of a single namespace-like global value), and you can do some other tricks using the JS engine's embedding API. But I guess this is the wrong list for continuing discussion of such things... -- Philip Taylor ex...@gm... |