|
Ferite is an object-oriented programming language inspired by several other programming languages. Ferite is a "clean" language with several influences: A programming paradigm is a paradigmatic style of programming (compare with a methodology, which is a paradigmatic style of doing software engineering). ...
Object-oriented programming (OOP) is a programming paradigm that uses objects to design applications and computer programs. ...
Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. ...
A software developer is a person who is concerned with one or more facets of the software development process, a somewhat broader scope of computer programming or a specialty of project managing. ...
A software release refers to the creation and availability of a new version of a computer software product. ...
January 7 is the seventh day of the year in the Gregorian calendar. ...
For the Manfred Mann album, see 2006 (album). ...
Java is an object-oriented applications programming language developed by Sun Microsystems in the early 1990s. ...
C++ (pronounced see plus plus, IPA: ) is a general-purpose, high-level programming language with low-level facilities. ...
C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. ...
Scheme can refer to: The Scheme programming language. ...
Ruby is a reflective, dynamic, object-oriented programming language. ...
PHP (PHP:Hypertext Preprocessor) is a reflective programming language originally designed for producing dynamic web pages. ...
An operating system (OS) is a set of computer programs that manage the hardware and software resources of a computer. ...
A cross-platform (or platform independent) programming language, software application or hardware device works on more than one system platform (e. ...
A website (or Web site) is a collection of web pages, images, videos and other digital assets and hosted on a particular domain or subdomain on the World Wide Web. ...
Object-oriented programming (OOP) is a computer programming paradigm in which a software system is modeled as a set of objects that interact with each other. ...
A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. ...
- Objects from Java/C++
- Functions from C/PHP
- Closures from Scheme
- Block calling from Ruby
- Namespaces from C++
Ferite was created in 2000 by Chris Ross. As the developers note, it has its own "sane loose typing mechanism, polymorphic type and set of nice APIs."[1] Ferite aims to provide a platform for rapidly building and deploying programs that are clean and easy to maintain. Ferite reached 1.0 in the second quarter of 2005. It can be used under a BSD-style licence. Data Types
- boolean
- A boolean has a value of either 'true' or 'false', when initialized they default to 'false'.
- number
- This type encapsulates all integer and floating point numbers within the 64bit IEEE floating-point standard and will automatically handle issues regarding overflow and conversion. In layman terms that means that they can store really big numbers and will convert between integer numbers and floating point numbers. Once the conversion has taken place, the number will remain a floating point number.
- string
- Strings are specified using double quotes and contain a string of characters. It is possible to embed variables and expressions within a string to make complex string construction easier (such as generating XML). To access individual characters within a string you can use square brackets along with an index or range. There are a number of control characters that can be used within a string to provide various formatting options such as a tab or new line character.
- array
- An array allows the sequential or random storage of data that can be retrieved at any point. They can grow as you need them and are able to store any type of data within them; they are not limited to a specific type meaning that numbers, string, objects and even arrays can be stored side by side. To access the contents of an array you need to use an index operator.
- object
- Variables of type object either point to an object or they point to null. Null allows you to see if an object variable points to something. All object variables, when declared, are initialized to null. To check if an object variable points to null; it is only necessary to check for equality to null. Pointing to an object is done in two ways: the new operator, which creates a new instance of a class, or by assigning it the value that another object points to. Although this is covered later, it is important to note that two different object variables can point to the same object and that an object variable can point to any type of allocated object.
- void
- The void type is ferite's semi-polymorphic type; only semi-polymorphic because once it has morphed into a specific type it remains that type. What this means in simpler terms is that the void variable can be seen as a place holder type. Assigning a value to a variable of type void will cause it to change to that type; for instance, declaring a variable of type void and assigning a numerical value to it will cause it to become a number. This allows you to write dynamic code that does not depend on a specific type. It is important to note that a variable declared at the beginning of a function will remain a type for the duration that function is running and will be reset when it is next called. If it is an object's instance variable, it will remain that type for that object for the duration of the object's life time.
The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is the most widely-used standard for floating-point computation, and is followed by many CPU and FPU implementations. ...
Hello World The usual Hello World code example for Ferite is: A hello world program is a computer program that prints out Hello, world! on a display device. ...
uses "console"; Console.println( "Hello World" ); Examples In this example we use the String.blocks function splits the string into an array of characters, then the Array.each function loops through the array invoking the closure which uses the String.charToNum to convert each character to a number. array test = "abcdefg".blocks( 1 ); test.each() using ( test ) { Console.print( test.charToNum() ); }; // 979899100101102103 Now we create a new namespace called Example and a class A which has a variable and function named 'test'. Because the variable 'test' is marked as final you can set its value directly, otherwise you'd need to use a constructor to set its value. Both the variable and function are static, so you don't have to create an object from the class to call them. namespace Example { class A { static final string test = "Testing..."; static function test() { Console.println( .test ); } } } Example.A.test(); This is one of the best techniques available in Ferite, using a directive you can modify a class without relying on inheritance. Here we use a directive to modify the 'Obj' class, which is the base for all classes, so you can apply the directive to any class. We then add a directive called 'print', which adds a function called print to any class which the directive is applied to. Lastly, we invoke the directive and pass the first parameter "hello". uses "console", "reflection"; class modifies Obj { directive print( string source ) { eval(" class modifies ${Class.name( self )} { static function print() { Console.println('${source}'); } } "); } } class Example { [print "hello"]; } Example.print(); // hello External links |