Curl (programming language)

Curl is a reflective object-oriented programming language for interactive web applications whose goal is to provide a smoother transition between formatting and programming. It makes it possible to embed complex objects in simple documents without needing to switch between programming languages or development platforms. The Curl implementation initially consisted of just an interpreter, but a compiler was added later.

Curl combines text markup (as in HTML), scripting (as in JavaScript), and heavy-duty computing (as in Java, C#, or C++) within one unified framework. It is used in a range of internal enterprise, B2B, and B2C applications.

Curl programs may be compiled into Curl applets, that are viewed using the Curl RTE, a runtime environment with a plugin for web browsers. Currently, it is supported on Microsoft Windows, Linux, and macOS. Curl supports "detached applets", which is a web deployed applet which runs on the user's desktop independent of a browser window much as in Silverlight 3 and Adobe AIR.

Curl
Curl logo
Paradigmmulti-paradigm: object-oriented, markup
Designed bySteve Ward, MIT
DeveloperCurl, Inc., Sumisho Computer Systems Corp., SCSK Corporation
First appeared1998
Stable release
8.0.8 / 10 January 2018
Typing disciplinestrong
OSCross-platform: Windows, Linux, macOS
Websitewww.curl.com
Dialects
none
Influenced by
HTML, JavaScript, Lisp

Architecture

The Curl language attempts to address a long-standing problem: the different building blocks that make up any modern web document most often require wildly different methods of implementation: different languages, different tools, different frameworks, often completely different teams. The final — and often most difficult — hurdle has been getting all of these blocks to communicate with each other in a consistent manner. Curl attempts to side-step these problems by providing a consistent syntactic and semantic interface at all levels of web content creation: from simple HTML to complex object-oriented programming.

Curl is a markup language like HTML—that is, plain text is shown as text; at the same time, Curl includes an object-oriented programming language that supports multiple inheritance. Curl applications are not required to observe the separation of information, style, and behavior that HTML, Cascading Style Sheets (CSS), and JavaScript have imposed, although that style of programming can be used in Curl if desired.

While the Curl language can be used as an HTML replacement for presenting formatted text, its abilities range all the way to those of a compiled, strongly typed, object-oriented system programming language.[1] Both the authoring (HTML-level) and programming constructs of Curl can be extended in user code. The language is designed so Curl applications can be compiled to native code of the client machine by a just-in-time compiler and run at high speed. Curl applets can also be written so that they will run off-line when disconnected from the network (occasionally connected computing). In fact, the Curl IDE is an application written in Curl.

Syntax

A simple Curl applet for HelloWorld might be

 {Curl 7.0, 8.0 applet}
 {text
    color = "blue",
    font-size = 16pt,
    Hello World}

This code will run if the user has at least one of the Curl versions 7.0 or 8.0 installed.

Curl provides both macros and text-procedures in addition to anonymous procedures and named methods. An alternative using the text-procedure paragraph would be:

 {paragraph
    paragraph-left-indent=0.5in,
    {text color = "red", font-size = 12pt,
      Hello}
    {text color = "green", font-size = 12pt,
      World}}

Recently this style of layout has been adopted by "builders" in the Groovy language for the JVM, but is also familiar to users of CSS or Tcl/Tk. Most features for web applications now implemented through combinations of JavaScript libraries + HTML + CSS are already found within the Curl language, including features usually associated with Prototype + script.aculo.us such as accordion panes.

Curl sets callbacks in the manner also adopted by Groovy:

 {CommandButton width=100pt,
    height = 50pt,
    label = {center {bold Invokes an event handler when clicked}},
    control-color = "orange",
    || Attach the following event handler to this CommandButton
    {on Action do
        {popup-message
            title = "Your Message",
            "This is a user message dialog."
        }
    }}

Curl comments use the vertical bar in several variations. The simplest is as follows:

 {text A comment can be on a line by itself,
 || A comment on a line by itself
 or it can be at the end || A comment on the same line as code
 of a line.}

Curl as lightweight markup

Because Curl provides for both user-defined text procedures and stylesheets, Curl can be used readily as domain-specific lightweight markup. A major advantage over plain text HTML markup is that the text encoding can be set as, e.g., utf-8, and text entered in a Unicode-enabled editor without any escaping of characters (like JavaScript, Curl is Unicode friendly.) A poetry example would be:

 {poem || wraps entire poem
    {stanza  || first verse here in any language
    }
    {stanza  || another verse here in any language
    }
 }

which can initially be implemented by defining the poem and stanza markup as paragraph text formats. Stanza could be further refined to include a hidden navigation anchor for page navigation using the Curl {destination} which is itself a text procedure.

The same markup can be used for different results, as one can style text to be visible in one context and invisible in another. Curl also permits top-level file inclusion so that a source text in markup can be included in different parent files. In education, for example, one could create a source file of test questions, and include it in both a student and a teacher version of the text.

See also

  • Homoiconicity: Curl is both a programming language and a data format

References

  1. ^ M. Hostetter; D. Kranz; C. Seed; C. Terman; S. Ward. "Curl: A Gentle Slope Language for the Web". MIT Laboratory for Computer Science.

External links

Client-side persistent data

Client-side persistent data or CSPD is a term used in computing for storing data required by web applications to complete internet tasks on the client-side as needed rather than exclusively on the server. As a framework it is one solution to the needs of Occasionally connected computing or OCC.

A major challenge for HTTP as a stateless protocol has been asynchronous tasks. The AJAX pattern using XMLHttpRequest was first introduced by Microsoft in the context of the Outlook e-mail product.

The first CSPD were the 'cookies' introduced by the Netscape Navigator. ActiveX components which have entries in the Windows registry can also be viewed as a form of client-side persistence.

JavaFX

JavaFX is a software platform for creating and delivering desktop applications, as well as rich Internet applications (RIAs) that can run across a wide variety of devices. JavaFX is intended to replace Swing as the standard GUI library for Java SE, but both will be included for the foreseeable future. JavaFX has support for desktop computers and web browsers on Microsoft Windows, Linux, and macOS. JavaFX is no longer bundled with the latest Java, nor will be supported by Oracle, while it still is supported for the current long-term version Java SE 8 through March 2022.

Before version 2.0 of JavaFX, developers used a statically typed, declarative language called JavaFX Script to build JavaFX applications. Because JavaFX Script was compiled to Java bytecode, programmers could also use Java code instead. JavaFX applications could run on any desktop that could run Java SE or on any mobile phone that could run Java ME.JavaFX 2.0 and later is implemented as a "native" Java library, and applications using JavaFX are written in "native" Java code. JavaFX Script has been scrapped by Oracle, but development is being continued in the Visage project. JavaFX 2.x does not support the Solaris operating system or mobile phones; however, Oracle plans to integrate JavaFX to Java SE Embedded 8, and Java FX for ARM processors is in developer preview phase.On desktops, JavaFX supports Windows Vista, Windows 7, Windows 8, Windows 10, macOS and Linux operating systems. Beginning with JavaFX 1.2, Oracle has released beta versions for OpenSolaris. On mobile, JavaFX Mobile 1.x is capable of running on multiple mobile operating systems, including Symbian OS, Windows Mobile, and proprietary real-time operating systems.

Open-source JavaFXPorts works for iOS (iPhone and iPad) and Android and embedded (Raspberry Pi); and the related commercial software created under the name "Gluon" supports the same mobile platforms with additional features plus desktop. This allows a single source code base to create applications for the desktop, iOS, and Android devices.

JavaFX Script

JavaFX Script was a scripting language designed by Sun Microsystems, forming part of the JavaFX family of technologies on the Java Platform.

JavaFX targeted the Rich Internet Application domain (competing with Adobe Flex and Microsoft Silverlight), specializing in rapid development of visually rich applications for the desktop and mobile markets. JavaFX Script works with integrated development environments such as NetBeans, Eclipse and IntelliJ IDEA. JavaFX is released under the GNU General Public License, via the Sun sponsored OpenJFX project.

Markup language

In computer text processing, a markup language is a system for annotating a document in a way that is syntactically distinguishable from the text. The idea and terminology evolved from the "marking up" of paper manuscripts, i.e., the revision instructions by editors, traditionally written with a red or blue pencil on authors' manuscripts. In digital media this "blue pencil instruction text" was replaced by tags, which indicate what the parts of the document are, rather than details of how they might be shown on some display. This lets authors avoid formatting every instance of the same kind of thing redundantly (and possibly inconsistently). It also avoids the specification of fonts and dimensions, which may not apply to many users (such as those with varying-size displays, impaired vision, screen-reading software, and so on).

Early markup system typically included typesetting instructions, as troff, TeX and LaTeX do, while Scribe and most modern markup systems name components, and later processes use those names to apply formatting or other processing, as in XML.

Some markup languages, such as the widely used HTML, have pre-defined presentation semantics—meaning that their specification prescribes generally how to present the structured data on particular media. Others, such as XML and its predecessor SGML, permit but do not impose such prescriptions, and permit users to define any custom document components they wish.

HyperText Markup Language (HTML), one of the document formats of the World Wide Web, is an application of SGML and XML. Other applications such as DocBook, Open eBook, JATS, and others, are heavily used in the communication of work between authors, editors, and printers.

Occasionally connected computing

Occasionally connected computing (OCC) is a term used in computing for an architecture or framework which permits running some aspects of a web application when not connected to the Internet. This is sometimes a feature of a Rich Internet application (RIA).

Basic frameworks
Site-specific browsers

This page is based on a Wikipedia article written by authors (here).
Text is available under the CC BY-SA 3.0 license; additional terms may apply.
Images, videos and audio are available under their respective licenses.