World Library  
Flag as Inappropriate
Email this Article

Curl (programming language)

Article Id: WHEBN0000042537
Reproduction Date:

Title: Curl (programming language)  
Author: World Heritage Encyclopedia
Language: English
Subject: Apache Flex, Rich Internet applications, Mixin, Chaplin.js, SproutCore
Publisher: World Heritage Encyclopedia

Curl (programming language)

Paradigm(s) multi-paradigm: object-oriented, markup
Designed by Steve Ward, MIT
Developer Curl, Inc., Sumisho Computer Systems Corp., SCSK Corporation
Appeared in 1998
Stable release 8.0.5 / 23 June 2014 (2014-06-23)
Typing discipline strong
Dialects none
Influenced by HTML, JavaScript, Lisp
OS Cross-platform: Windows, Linux, Mac OS X
Website .com.curlwww
  • Curl at Wikibooks

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.[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 are viewed using the Curl RTE, a runtime environment with a plugin for web browsers. 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.


A simple Curl applet for HelloWorld might be

{Curl 7.0, 8.0 applet}
   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:

   {text color = "red", font-size = 12pt,
   {text color = "green", font-size = 12pt,

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 + 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
           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.

See also

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


  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

  • MIT Curl Project, the results of the Curl research project at MIT's 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 SCSK Corporation a majority-owned unit of Sumitomo Corp.
  • InfoWorld review of Curl 6.0 by Martin Heller. InfoWorld awarded Curl its 2008 Technology of the Year award in the Rich Internet Application category.
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.