Curl programming language
Encyclopedia
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 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 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 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. 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 are viewed using the Curl RTE, a runtime environment with a plugin for web browser
s. Currently, it is supported on Microsoft Windows
, Linux
, and Mac OS X
.
Curl has had a feature of detached applets for several years, 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. See also site-specific browser
. 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.
{Curl 5.0, 6.0, 7.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 5.0, 6.0, or 7.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 + Scriptaculous 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.}
{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.
Reflection (computer science)
In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior at runtime....
object-oriented programming language
Object-oriented programming language
This is a list of object-oriented programming programming languages.-Languages with object-oriented features:*ABAP*Ada 95*AmigaE*BETA*Blue*Boo*C++*C#*COBOL*Cobra*ColdFusion*Common Lisp*COOL*CorbaScript*Clarion*CLU*Curl*D*Dylan*E*Eiffel...
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 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
HTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
to complex object-oriented programming
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...
.
Curl combines text markup (as in HTML
HTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
), scripting (as in 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 heavy-duty computing (as in Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...
, C#, or C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...
) within one unified framework. It is used in a range of internal enterprise, B2B
Business-to-business
Business-to-business describes commerce transactions between businesses, such as between a manufacturer and a wholesaler, or between a wholesaler and a retailer...
, and B2C applications.
Curl is a markup language
Markup language
A markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...
like HTML
HTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
—that is, plain text is shown as text; at the same time, Curl includes an object-oriented programming language that supports multiple inheritance
Multiple inheritance
Multiple inheritance is a feature of some object-oriented computer programming languages in which a class can inherit behaviors and features from more than one superclass....
. Curl applications are not required to observe the separation of information, style, and behavior that HTML, Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
(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. 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
Just-in-time compilation
In computing, just-in-time compilation , also known as dynamic translation, is a method to improve the runtime performance of computer programs. Historically, computer programs had two modes of runtime operation, either interpreted or static compilation...
and run at high speed.
Curl applets are viewed using the Curl RTE, a runtime environment with a plugin for web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...
s. Currently, it is supported on Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
, Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...
, and Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
.
Curl has had a feature of detached applets for several years, 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. See also site-specific browser
Site-specific browser
A site-specific browser is a software application that is dedicated to accessing pages from a single source on a computer network such as the Internet or a private intranet. SSBs typically simplify the more complex functions of a web browser by excluding the menus, toolbars and browser chrome...
. 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 5.0, 6.0, 7.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 5.0, 6.0, or 7.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 + Scriptaculous 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 both for 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.
External links
- MIT Curl Project, the results of the Curl research project at MIT'sMassachusetts Institute of TechnologyThe Massachusetts Institute of Technology is a private research university located in Cambridge, Massachusetts. MIT has five schools and one college, containing a total of 32 academic departments, with a strong emphasis on scientific and technological education and research.Founded in 1861 in...
Laboratory for Computer Science. - Curl, Inc. and Curl International Corp. develop and distribute a suite of commercial products which are based on the results of the MIT research. Owned by Sumisho Computer Systems Corp. a majority-owned unit of Sumitomo Corp.
- InfoWorld review of Curl 6.0 by Martin Heller. InfoWorldInfoWorldInfoWorld is an information technology online media and events business operating under the umbrella of InfoWorld Media Group, a division of IDG...
awarded Curl its 2008 Technology of the Year award in the Rich Internet ApplicationRich Internet applicationA Rich Internet Application is a Web application that has many of the characteristics of desktop application software, typically delivered either by way of a site-specific browser, via a browser plug-in, independent sandboxes, extensive use of JavaScript, or virtual machines...
category.