The Fine Print: The following comments
are owned by whomever posted them.
( Reply )
|
Javascript?
by Simon on Thursday 27/Sep/2001, @03:53
|
Perhaps Javascript would be a good default scripting langauge.
* It was designed as scripting language in the first place.
* It's quite easy to use/learn.
* It's supports Objects and OO in a simple/natural way. (Unlike Perl for example).
* KDE already has a Javascript interpreter.
* Many people know it already, thanks to the web.
* It's C style syntax won't freak out the unix types too much.
Perfect candidate IMHO.
Also developers need to add DCOP interfaces that power users can use for day-to-day scripting.
It would also be nice if you could launch scripts from a menu inside every KDE program (well, at least the major apps). Kind of like how most Amiga apps would let you run ARexx scripts without leaving the app.
--
Simon
|
[
Reply To This | View ]
|
Python?
by David Walser on Thursday 27/Sep/2001, @05:18
|
I thought I heard something about making Python the standard scripting language for KDE a while back. Doesn't some of KOffice already use it?
|
[
Reply To This | View ]
|
Re: Javascript?
by Peter "proc" Rockai on Thursday 27/Sep/2001, @05:45
|
The best way IMHO is to make DCOP interface accessible from as many languages as possible and leave the actual choice on user.
|
[
Reply To This | View ]
|
Re: Javascript?
by Peter on Thursday 27/Sep/2001, @05:54
|
No, no, ruby is far better...
See, there is a big problem what default should be. What I think would be pretty cool, are some standard bindigs which are connected to all major scripting languages.
This way everybody can chose whatever fits best. I'm not sure how this can be realised. Perhaps somebody could tell me if and how this is possible.
Peter
|
[
Reply To This | View ]
|
Re: Javascript?
by Morty on Thursday 27/Sep/2001, @06:04
|
Look in kdebindings.
Java and Python are already there, and
Perl maybe even Ruby.
|
[
Reply To This | View ]
|
Re: Javascript?
by Carbon on Thursday 27/Sep/2001, @08:56
|
Problem with JS is that it's (iirc) closed source.
|
[
Reply To This | View ]
|
Re: Javascript?
by David Joham on Thursday 27/Sep/2001, @09:19
|
Both Konqueror and Mozilla have open-source implementations of JavaScript...
David
|
[
Reply To This | View ]
|
Re: Javascript?
by Richard Moore on Thursday 27/Sep/2001, @10:17
|
It's certainly true that embedding KJS (Konq's javascript engine) is easy - I wrote some code last week which embeds it, and it only took an hour. I've since added a bridge that lets the scripts access the properties of any QObject (like the Qt-DCOP bridge). It would even be easy enough to write a plugin that uses this stuff (I already made a KPart) and this lets it extend existing apps thanks to KParts.
There are plenty of other decent script engines and embedding perl or python is no harder than javascript, and people want to use these too. The big advantage of using DCOP for scripting, is that you can use any language you want to (or even mix several languages). In addition, the Qt-DCOP bridge lets you access the the interfaces of objects that the developer did not specifically expose for scripts.
Rich.
|
[
Reply To This | View ]
|
Re: Javascript?
by Simon Edwards on Thursday 27/Sep/2001, @11:58
|
You wouldn't even have to embed it per se. You could just put the JS interpretter in an external prog and have programs start it themselves and also pass the name of the script to run and maybe the name of the calling program (for convinenence). By keeping stuff out of process mem you could have as many different interpretters as you wanted, but without any extra library/startup overhead.
--
Simon
|
[
Reply To This | View ]
|
Re: Javascript?
by Richard Moore on Thursday 27/Sep/2001, @12:29
|
There are advantages and disadvantages to both approaches, the nice thing is we have the choice (and you can even use both in the same app).
Rich.
|
[
Reply To This | View ]
|
How about recording?
by Oliver Stieber on Tuesday 02/Nov/2004, @05:38
|
Did you notice if it would be easy to get all the dcop events to be sent to another application/object so that they could be recorded.
This would be great for scripting and producing 'tutorials' for applications instead of just the plain old docbook help.
|
[
Reply To This | View ]
|
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)
|
[
Reply To This | View ]
|
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 ]
|
|
Re: Scrip language, Rexx port for KDE / DCOP?
by Johnny Andersson on Monday 01/Oct/2001, @14:06
|
I've also been missing ARexx. I never really gave DCOP much thought; however, having read these tutorials, I understand it's a lot more versatile than I thought.
|
[
Reply To This | View ]
|
Re: Scrip language, Rexx port for KDE / DCOP?
by Johnny Andersson on Monday 01/Oct/2001, @14:07
|
I've also been missing ARexx. I never really gave DCOP much thought; however, having read these tutorials, I understand it's a lot more versatile than I thought.
|
[
Reply To This | View ]
|
Re: Scrip language, Rexx port for KDE / DCOP?
by Alec Smith on Friday 12/Sep/2003, @08:20
|
You can use ANY language, if you use the XMLRPC daemon to talk to DCOP
http://developer.kde.org/documentation/library/kdeqt/kde3arch/xmlrpc.html
|
[
Reply To This | View ]
|
The Fine Print: The previous
comments are owned by whomever posted them.
( Reply )
|
|