Curl
The Curl programming language is a reflective objectoriented programming language designed for interactive Web content, such as Rich Internet applications. It combines text markup as in HTML, scripting as in JavaScript, and heavyduty computing as in Java, C#, or C++ within one unified framework. It is used in a range of internal enterprise, BB, and BC applications.Curl is a markup language like HTML, that is, plain text is shown as text at the same time, Curl includes an objectoriented programming language that supports multiple inheritance. Curl applications are not required to observe the separation of information, style, and behavior that HTML, 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 capabilities range all the way to those of a compiled, strongly typed, objectoriented system programming language from MIT Curl Projects white paper. Both the authoring HTMLlevel 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 justintime 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 Macintosh.
Curl has had a feature of detached applets for several years, which is a web deployed applet which can run independently of a browser window, similarly to Adobe AIR. Curl applets can also be written so that they will run when disconnected from the network. In fact, the Curl IDE is an application written in Curl.Marketing of CurlCurl, Inc. is headquartered in Cambridge, Massachusetts and is a wholly owned a subsidiary of Sumisho Computer Systems Corp.. The largest number of over commercial Curl customers are currently in Japan and other Asian countries, but Curl is also available in the Western world.Curl is free to use for noncommercial and some commercial uses see licensing. A Pro version is available which provides additional enterprise class capabilities.Basic syntaxThe Icon language is derived from the ALGOLclass of structured programming languages, and thus has syntax similar to C or Pascal. Icon is most similar to Pascal, using = syntax for assignments, the procedure keyword and similar syntax. On the other hand, Icon uses Cstyle brackets for structuring execution groups, and programs start by running a procedure called main.
procedure doSomethingaString
In many ways Icon also shares features with most scripting programming languages variables do not have to be declared, types are cast automatically, and numbers can be converted to strings and back automatically. Another feature common to many scripting languages, but not all, is the lack of a lineending character in Icon, lines not ended by a semicolon get ended by an implied semicolon if it makes sense.Procedures are the basic building blocks of Icon programs, and although they use Pascal naming they work more like C functions and can return values there is no function keyword in Icon.procedure doSomethingaString writeaStringendedit Goaldirected executionOne of Icons key concepts is that control structures are based on the success or failure of expressions, rather than on boolean logic, as in most other programming languages. Under this model, simple comparisons like if a < a =" read" a =" read">
Generators

Icon refers to this concept as goaldirected execution, referring to the way that execution continues until some goal is reached. In the example above the goal is to read the entire file the read command continues to succeed while there is more information to be read, and fails when there isnt. The goal is thus coded directly in the language, instead of using statements checking return codes or similar constructs.edit GeneratorsExpressions in Icon often return a single value, for instance, x < towritey=","> yAnother simple generator is the to, which generates lists of integers every write to will do exactly what it seems to. The bang syntax generates every item of a list every write!aString will output each character of aString on a new line.To demonstrate the power of this concept, consider string operations. Most languages include a function known as find or indexOf that returns the location of a string within another. Considers = All the worlds a stage.
And all the men and women merely playersi = indexOfthe, sThis code will return , the position of the first occurrence of the word the. To get the next instance of the an alternate form must be used, i = indexOfthe, s, , the at the end saying it should look from position on. In order to extract all the occurrences of the, a loop must be used...s = All the worlds a stage. And all the men and women merely Under Icon the find function is a generator, and will return the next instance of the string each time it is resumed before finally failing after it passes the end of the string. The same code under Icon can be writtens = All the worlds a stage. And all the men and women merely playersevery writefindthe,s
Of course there are times where you deliberately
find will return the index of the next instance of the each time it is resumed by every, eventually passing the end of the string and failing. As in the prior example, this will cause write to fail, and the oneline every loop to exit.Of course there are times where you deliberately want to find a string after some point in input, for instance, you might be scanning a text file containing data in multiple columns. Goaldirected execution works here as well, and can be used this waywrite < k =" i" i =" findpattern,">
History
Writefindthe is a short form of the examples shown earlier. In this case the subject of the find function is placed outside the parameters in front of the questionmark. Icon functions are deliberately as opposed to automatically written to identify the subject in parameter lists and allow them to be pulled out in this fashion.edit Other structuresIcon strings are simply lists of characters, similar to their partners in C. Icon also allows the user to easily construct their own lists or arraysaCat = muffins, tabby, , The items within a list can be of any sort, including other structures. To quickly build larger lists, Icon includes the list generator i = list, word generates a list containing copies of word.Like arrays in other languages, Icon allows items to be looked up by position weight = aCat. Also remember the bangsyntax, every write!aCat will print out four lines, each with one element. Icon includes stacklike functions, push and pop to allow them to form the basis of stacks and queues.Icon also includes functionality for sets and tables known as hashes, associative arrays, dictionaries, etc.
symbols = tablesymbolsthere = symbolshere = this code creates a table that will use zero as the default value of any unknown key. It then adds two items into it, with the keys there and here, and values and .edit ReferencesThe definitive work is The Icon Programming Language third edition by Griswold and Griswold, ISBN . It is out of print but can be downloaded in PDF form.Icon also has coexpressions, providing nonlocal exits for program execution. Please see The Icon Programming language and also Shamim Mohameds article Coexpressions in Icon. This topic should probably be expanded.OverviewThe TclJava projects goal is to make integrating the Java platform and the Tcl scripting language as easy as possible. The project actually consists of two distinct packages, called Tcl Blend and Jacl. It is important to understand what each package provides and in what situations one might choose to use Jacl or Tcl Blend.Jacl is a selfcontained implementation of a Tcl interpreter, written entirely in Java. Jacl also includes features that facilitate communication between a Java interpreter and a Tcl interpreter. Jacl is typically used to incorporate scripting functionality into an existing Java application. Jacl is the ideal solution for users that want to add Tcl scripting to a Java application, but dont want to deal with the complexities of native code that come with Tcl Blend.
No comments:
Post a Comment