Skip to content
Risa123 edited this page Oct 20, 2022 · 15 revisions

FPL

The language name is an acronym for Function Processing Language. As the name suggests, I was originally based on lisp. However, the end result is different. At the beginning of the comment, the one-line comment begins with a hashtag (#). Multiline comment is defined by single parentheses. Syntactically, as in lisp, the code is divided into leaves and atoms. An identifier is an unbroken string of characters that does not meet the requirements for another type of atom. As with smalltak, the character literal is in the $ character format. Numbers are handled in the same way as in other languages, except that in order for a literal to be interpreted as a byte or short, the numbers must end in B or S. The character (both long and float) must upper-case letters. Text strings are the same as in other languages. The last are the so-called special atoms. They are atoms, they are; (in code as END_ARGS), (ARG_SEPARATOR) and: (CLASS_SELECTOR). There are two types of command lists in the language, which are defined by the beginning and end of a line. The second type is block, which is "surprisingly" inside curly braces. Unless otherwise processed, each identifier and literal is considered a function. This includes true, false, nil and variables. A function can treat all the code that follows it in the command sheet as its arguments. This allows you to build most of the language from the functions.

Code with all syntactic phenomena

main{
print "Hello World!" #comment
(multi line one)
some_func "string", $ c #arguments are two expressions (interpreted as a command sheet) separated by ARG_SEPARATOR
math_func 1,0x0,1F, 1D, var0 + var1 #function var0 with argument which is identifier +, which considers as its argument var1
some_class: getInstanceSize # CLASS_SELECTOR as an argument causes a call to the static getInstanceSize method
some_instance getObjectSize
}

Project structure

project directory

  • src - copy the std directory here to use standard library.
  • output (for c files created by compiler)
  • build.properties

Build file format

output file = (name of output file)
gcc = (gcc installation directory)
mainModule = (name of module with main function written in "module.submodule etc." format)
(optional) ccArgs = (arguments for gcc)

Clone this wiki locally