Kross (KDE)
Encyclopedia
Kross is the new scripting framework for KDE SC 4, the latest version of the KDE SC. Originally Kross was designed for use in Koffice
KOffice
Calligra Suite is a graphic art and office suite by KDE created from KOffice in 2010. It is available for desktop PCs, tablet computers, and smartphones...

 but eventually became the official scripting framework in KDE SC 4. Kross is designed to provide full scripting power for users of KDE applications, with a language of their own choice; and make it easy for developers targeting the KDE platform to enable their application with support for multiple scripting languages (without themselves needing to be proficient in any of them).

The Kross scripting framework is not a scripting language
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

 itself. It merely serves to plug into KDE the support for other, already existing scripting languages. Currently supported are: Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

, Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...

, JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 and the Falcon Programming Language
Falcon (programming language)
Falcon is an open source, multi-paradigm programming language. Design and implementation is led by Giancarlo Niccolai, a native of Bologna, Italy and Information Technology graduate from Pistoia....

. Addition of other scripting languages is made easy by the modular architecture of the framework.

Kross provides the following advantages over other approaches to enable scripting for desktop applications or desktop environments:
  • The user is free to pick and use his/her favorite language for the scripting efforts
  • The application developer does not need to know the specifics about a scripting language
  • Other scripting languages can be easily added by writing a module/plugin for Kross

SWIG: Simplified Wrapper and Interface Generator

  • Kross currently has fewer supported scripting languages.
  • Kross is built on top of Qt/KDE. This allows access to Qt/KDE things without needing extra effort to wrap them.
  • Applications supporting Kross do not require as much code as to support SWIG.
  • With SWIG, the set of supported scripting languages is determined at the time of compiling the application: each supported language must either have code in the application to invoke that language’s interpreter, and/or have a shared library specific to that application–language pair whereas Kross doesn't need to know until runtime.

AppleScript

Compared to AppleScript’s Open Scripting Architecture (OSA):
  • OSA can be used with IPC
    Inter-process communication
    In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

     (Apple events
    Apple events
    Apple events are the canonical message-based interprocess communication mechanism in Mac OS, first appearing in System 7 and supported by every version since then, including Mac OS X. Apple events describe "high-level" events such as "open document" or "print file", whereas earlier OS's had...

    ), allowing a script to be in a separate process, whereas Kross scripts always run in the same process as the main application. In practical terms, using IPC allows a script to interface between several already-running applications; Kross does not.
  • While Kross allows the scripter to write scripts in a language of their choice, AppleScript is one given language, though it can be called from within other (scripting) languages.
  • Kross always requires code added to the application explicitly for Kross, whereas many Mac OS X applications have basic scriptability just because of their choice of GUI toolkit (Cocoa
    Cocoa (API)
    Cocoa is Apple's native object-oriented application programming interface for the Mac OS X operating system and—along with the Cocoa Touch extension for gesture recognition and animation—for applications for the iOS operating system, used on Apple devices such as the iPhone, the iPod Touch, and...

    ) (see AppleScript in Mac OS X
    AppleScript
    AppleScript is a scripting language created by Apple Inc. and built into Macintosh operating systems since System 7. The term "AppleScript" may refer to the scripting system itself, or to particular scripts that are written in the AppleScript language....

    ). (Dogtail
    Dogtail
    Dogtail is an open source GUI testing tool and automation framework written in Python. It is Linux-based and is packaged with well known GNU/Linux distributions such as Fedora. It uses accessibility technologies to communicate with desktop applications...

     and other GUI testing/automation tools also have this property.) “Basic scriptability” here means at least being able to click on buttons and menus and access information provided to accessibility
    Computer accessibility
    In human-computer interaction, computer accessibility refers to the accessibility of a computer system to all people, regardless of disability or severity of impairment...

     software such as Screen reader
    Screen reader
    A screen reader is a software application that attempts to identify and interpret what is being displayed on the screen . This interpretation is then re-presented to the user with text-to-speech, sound icons, or a Braille output device...

    s.


Kross does not currently have any provision for running untrusted scripts, i.e. does not allow restricting what scripts can do. Kross developer Sauer suggests either using a language with good sandbox support (such as by using the experimental Java plugin) or using approaches to increase the trust in scripts, such as using signed scripts.

Applications using Kross

  • KDevelop
    KDevelop
    KDevelop is a free software integrated development environment for the KDE Platform on Unix-like computer operating systems. KDevelop includes no compiler. Instead, it uses an external compiler such as gcc to produce executable code....

  • Kexi
    Kexi
    Kexi is an integrated data management application, designed to fill the gap between spreadsheets and database solutions requiring more sophisticated development...

  • Kopete
    Kopete
    Kopete is a multi-protocol, free software instant messaging client. Although it can run in numerous environments, it was designed for and integrates with the KDE desktop environment...

  • Krita
    Krita
    Krita is the digital painting and illustration software included based on the KDE Platform and Calligra Suite libraries. Designed as a digital painting and illustration suite, Krita is free software and distributed under GNU General Public License...

  • KSpread
    KSpread
    Tables is a free software spreadsheet application that is part of Calligra Suite, an integrated graphic art and office suite by KDE.Among Tables's features are multiple sheets per document, assorted formatting possibilities, support for more than 300 built-in functions, templates, chart,...

  • KTorrent
    KTorrent
    KTorrent is a BitTorrent client written in C++ for KDE using the Qt user interface toolkit. It is maintained in the KDE Extragear.- Features :*Upload and download speed capping / throttling & scheduling...

  • KWord
    KWord
    Calligra Words is a free word processor, part of Calligra Suite and developed by KDE.The text-layout scheme in Words is based on frames, making it similar to FrameMaker by Adobe. These can be placed anywhere on the page, and can incorporate text, graphics and embedded objects...

  • Plasma
    Plasma (KDE)
    Plasma Workspaces is the umbrella term for all graphical environments provided by KDE.Three Plasma sub-projects are currently being developed: Plasma Desktop for traditional desktop PCs and notebooks, Plasma Netbook for netbooks, and Plasma Active for Tablet PCs, Nokia N900 style smartphones and...

  • SuperKaramba
    SuperKaramba
    SuperKaramba is a tool that allows one to easily create functionality enhancement modules on a KDE desktop. Currently, only Linux is officially supported, although it also works well on FreeBSD and NetBSD...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK