www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Possible New Purpose for D?

reply "Ryan" <dlang zipxap.com> writes:
The purpose of this post is to gage interest.  I honestly have no 
idea how many people would see a need for this.  I am open to any 
and all comments, but please begin your response with a 1 to 10 
number that indicates value/interest.

Summary:

We need a client-side embedded scripting language for 
applications written in the new world of cloud computing and 
heterogeneous client devices.

To prevent mischievous delinquent from being able to sabotage the 
host application or create cross-scripting attacks, this 
scripting language must not provide access to the underlying 
browser, through either JavaScript (eval!!) or the DOM.  It 
would, however, need to allow for controlled extensibility 
through JavaScript, so that application developers could make 
their web application client-side scriptable.

Another benefit is that classes could be compiled down to 
bytecode and sent to the client on demand using ajax.

A third benefit of this is that by maintaining a purely D 
language environment, it opens the possibility to easily porting 
standard libraries, including things like DWT, and using them in 
the browser.  Since HTML5 provides the ability to offline 
applications, etc, download size becomes less of a concern 
(although always a concern), since subsequent visits to the 
application would utilize a locally cached copy.

I wrote a VM and compiler a few years ago because I was playing 
with my own language.  I might consider porting it to JavaScript 
and then implement a D compiler if people thought it would open 
up new possibilities.

As an aside, I did a quick search to see if other VMs were 
available written in JavaScript.  There are many, including a 
full Linux VM!!! Here are two Python VMs I found:

http://www.skulpt.org/
http://www.brython.info/

The point is that I might be able to find much of the 
infrastructure from other open-source projects, although they all 
seem to want to provide JavaScript/DOM access.
Jan 17 2014
parent "JN" <666total wp.pl> writes:
There have been some discussions about similar stuff before, I'm 
sure you can find it. In general, the most likely way of getting 
D in browsers is by using emscripten - take a look here for a 
proof of concept http://d.hatena.ne.jp/ABA/20130331
Jan 17 2014