faq
flatforty
contribute
subscribe
configure
search
rdf
main
parent
thread
|
Re: Javascript?
by Olivier LAHAYE on Saturday 29/Sep/2001, @01:39
|
I think that would be a realy great thing for KDE. I had an Amiga in the past, and using AREXX from a math program that uses DPaint to draw its results was wonderfull.
But I agree very much that javascript is a perfect candidate. More over, I think that it would help find more bugs (because of more complex usages and different contexts)
I've seen some other posts speaking about other languages. Of course, it could be cool (more programmers), but at last, it may confuse the user. Imagine that you have to use a javascript lib-package from a pyton plugin. ("What a mess").
Or imagine just a pyton package for emacs that uses lisp libs... somewhat strange. More over, it can add bugs.
If you look at internet explorer: it can be scripted in javascript and in vbscript. So bugs are double, because you have javascript-engine bugs and vbscript-engine bugs. Behaviours are differents if you choose one or another language. (for example: regexp doesn't behave the same in ie6 :-( ). If you had an enhancement in one language, or if you change a behaviour in one language, you have to report it in the others (ex: regexp, security, ...). I think it could be difficult to synchronise such "big details".
And finaly, concerning the implementation devel speed. If one language is better implemented than another, other teams working on others languages implementation will have less developpers and become marginal. At the end, this could be a big lost of time, and I think that dividing efforts is not good at this time.
A last point I don't know is: can vbscript be easily converted into javascript?
1) yes => one language is good, and you can import M$ Office docs with scripting
2) No => we are forced to implement multilanguage like KBasic or other vblike.
(IMHO) |
|
|
The Fine Print: The following comments
are owned by whomever posted them.
( Reply )
|
Re: Javascript?
by Bernd Gehrmann on Saturday 29/Sep/2001, @09:29
|
There is no point in using a "javascript-lib-package",
simply because there *aren't* libraries for JavaScript.
JavaScript was made to script web pages, not more, not
less. It is not designed as a general purpose language,
and it doesn't have standard techniques for extensions.
In contrast, general purpose languages like Python and
Tcl are designed for extending applications from the
beginning. In particular, Python is extensible to the
bone, there is no difference between an extension class
and a Python class. Look at the scripting engine of
KDevelop in the HEAD branch. It makes DCOP objects fully
transparently available.
From the Python programmer's point of view, a DCOP object
looks exactly like a Python object. He can also connect
arbitrary DCOP signals to a Python function. From the
application programmer's point of view, there is no Python
at all. He just writes DCOP interfaces with methods and
signals. It is irrelevant from which language they are used.
You could also write a bridge for Tcl that does the same.
|
[
Reply To This | View ]
|
Re: Javascript?
by Olivier LAHAYE on Sunday 30/Sep/2001, @04:37
|
javascript can use libs just like serverside javascript does, and you can include new javascript objects. You can create some objects and classes just like java.(even in html you can do that by including .js files defining classes using the <SCRIPT SRC="xxx.js"></SCRIPT> syntax)
Concerning dcop or otherthing access, it would be done the same way you access activeX objects or java applet. The extention extends the local DOM with objects and functions.
let suppose we want to load a new document called "foo.doc" in kword
then a document.open("foo.doc") would do the job.
you could also let the user choose the document with the following line:
document.menu.file.open.select();
or you could rename that menu:
document.menu.open.rename("Open a File");
Now let say you want to include a picture:
oMyPic=document.createElement("IMG")
oMyPic.src="foo.png";
document.appendChild(oMyPic);
Now, more complex thing: you want to include a speadsheet:
oMyEmbedSpreadSheet=document.createElement("EMBED");
oMyEmbedSpreadSheet.src="foo.xls";
document.appendChild(oMyEmbedSpreadSheet);
Now you want to create an empty embeded kspread object:
oMyEmptySheet=new Kspread("Sheet1","Sheet2");
oMyEmbedEmptySheet=document.createElement("EMBED");
oMyEmbedSpreadSheet.nodeValue=oMyEmptySheet;
document.appendChild(oMyEmbedEmptySheet);
Now you want to set the background of the 1st cell of the first sheet to red:
oMyEmptySheet.sheet[0].cells[0][0].style.background="red";
As you see, oMySpreadSheet would just behave as a standard html object with datas and methods.
And by that way, exporting thoses pages to the net with scripting would be possible.
Javascript also include security concepts.
that was just my 2 cents.
PS: don't try to think in terms of netscrape 4.x javascript, its DOM is so poor that of cours almost nothing complex is possible and most of its usage is reserved to string computation and document.write().
|
[
Reply To This | View ]
|
Re: Javascript?
by Olivier LAHAYE on Sunday 30/Sep/2001, @04:44
|
javascript can use libs just like serverside javascript does, and you can include new javascript objects. You can create some objects and classes just like java.(even in html you can do that by including .js files defining classes using the <SCRIPT SRC="xxx.js"></SCRIPT> syntax)
Concerning dcop or otherthing access, it would be done the same way you access activeX objects or java applet. The extention extends the local DOM with objects and functions.
let suppose we want to load a new document called "foo.doc" in kword
then a document.open("foo.doc") would do the job.
you could also let the user choose the document with the following line:
document.menu.file.open.select();
or you could rename that menu:
document.menu.open.rename("Open a File");
Now let say you want to include a picture:
oMyPic=document.createElement("IMG")
oMyPic.src="foo.png";
document.appendChild(oMyPic);
Now, more complex thing: you want to include a speadsheet:
oMyEmbedSpreadSheet=document.createElement("EMBED");
oMyEmbedSpreadSheet.src="foo.xls";
document.appendChild(oMyEmbedSpreadSheet);
Now you want to create an empty embeded kspread object:
oMyEmptySheet=new Kspread("Sheet1","Sheet2");
oMyEmbedEmptySheet=document.createElement("EMBED");
oMyEmbedSpreadSheet.nodeValue=oMyEmptySheet;
document.appendChild(oMyEmbedEmptySheet);
Now you want to set the background of the 1st cell of the first sheet to red:
oMyEmptySheet.sheet[0].cells[0][0].style.background="red";
As you see, oMySpreadSheet would just behave as a standard html object with datas and methods.
Note that you could also have acces to a DCOP object and its methods and variables in the same way. (although, the purpose of a scripting language is maily to automatize things that can often be do by hand. I think it would be a bad idea to write plugins with it (even if possible). Just look at msword or other scriptable programs. Scripts are only used to automatize the behaviour of the document. I've never seen a vbscript that extends M$ Word behaviour)
By that way, exporting thoses pages to the net INCLUDING scripting would be less difficult.
Javascript also include security concepts.
that was just my 2 cents.
PS: don't try to think in terms of netscrape 4.x javascript, its DOM is so poor that of cours almost nothing complex is possible and most of its usage is reserved to string computation and document.write().
|
[
Reply To This | View ]
|
|
The Fine Print: The previous
comments are owned by whomever posted them.
( Reply )
|
|