Ferite
Encyclopedia
Ferite is a small robust 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...

 providing a straightforward application
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 integration, the ability for the API to be extended very easily. The design goals of Ferite are to make a clean, cross-platform language which is easy to embed and easy to extend and provides support for existing and upcoming standards.

The main influences for Ferite are: 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...

 for objects, C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 and PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

 for functions, Scheme for closures, 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...

 for block calling, and 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...

 for namespaces. Ferite also features a sane loose typing mechanism
Type system
A type system associates a type with each computed value. By examining the flow of these values, a type system attempts to ensure or prove that no type errors can occur...

 and a small set of Application programming interface
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

s (APIs). Overall Ferite should be considered a curly-brace language.

Examples

Basic "Hello World" program
Hello world program
A "Hello world" program is a computer program that outputs "Hello world" on a display device. Because it is typically one of the simplest programs possible in most programming languages, it is by tradition often used to illustrate to beginners the most basic syntax of a programming language, or to...

:


uses "console";
Console.println( "Hello World" );


Using closures/lambda functions:


// Define some numbers:
number x = 10, y = 15, z = 30;

// A closure to add those numbers:
object o = closure {
return x + y + z;
};

// Use the closure:
Console.println(o.invoke);

// Change the numbers:
x = 5; y = 10; z = 5;

// Use the closure again:
Console.println(o.invoke);


Iterating through an array:


Array.each( [ 1, 2, 3 ] ) using ( value ) {
Console.println( value * 5 );
};


These are just some of the beginners examples available.

External links

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