NAME
Language::Farnsworth - A Turing Complete Language for Mathematics
SYNOPSIS
use Language::Farnsworth;
my $hubert = Language::Farnsworth->new();
my $result = $hubert->runString("10 km -> miles");
my $result = $hubert->runFile("file.frns");
print $result;
DESCRIPTION
THIS IS A BETA RELEASE, perpetually so! There are typos in the error messages and in the POD. There are also probably plenty of bugs. It is being released early because there have been a number of people who have shown interest in having it released. Not every feature is documented yet and a future release will have that cleaned up along with some of the hairier parts of the internal API. Language::Farnsworth is a programming language originally inspired by Frink (see http://futureboy.homeip.net/frinkdocs/ ). However due to creative during the creation of it, the syntax has changed significantly and the capabilities are also different. Some things Language::Farnsworth can do a little better than Frink, other areas Language::Farnsworth lacks.
PREREQUISITS
Modules and Libraries you need before this will work
The PARI library
-
The following are optional
For the Google Translation library
-
For the currency support
Finance::Currency::Convert::XE
NOTE: For the currency units to work you currently need to call C<updatecurrencies[]> before they will be available, this will change
METHODS
ALL of the methods here call die
whenever something doesn't go right. This means that unless you want bad input to them to cause your program to fail you should wrap any calls to them with eval {}
. When they call die
they will give you back a message explaining what went wrong, this is useful for telling a user what they have done.
runString
This method takes a string (or multiple strings) and executes them as Language::Farnsworth expressions. For more information on making Language::Farnsworth expressions, see Language::Farnsworth::Docs::Syntax.
runFile
This takes a file name and executes the entire file as a single Language::Farnsworth expression.
prettyOut
This takes a Language::Farnsworth::Value and turns it into a string for perl to be able to display. This method WILL disappear in a future version.
EXPORT
None by default.
KNOWN BUGS
At the moment all known bugs are related to badly formatted output, this will be rectified in a future release. And there are a number of unfinished error messages, and a few issues with the way arrays work.
There is also a known issue with the size of scopes. I do not know if I will be able to fix it, and until then i recommend NOT using recursive algorithms because it will cause everything to balloon way up in memory usage.
MISSING FEATURES
The following features are currently missing and WILL be implemented in a future version of Language::Farnsworth
Better control over the output
Adjustable precision of numbers (this includes significant digits!)
Better defaults for certain types of output
Syntax tree introspection inside the language itself
Better Documentation
Objects!
SEE ALSO
Language::Farnsworth::Docs::Syntax Language::Farnsworth::Docs::Functions
Please use the bug tracker available from CPAN to submit bugs.
AUTHOR
Ryan Voots <simcop@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2010 by Ryan Voots
This library is free software; It is licensed exclusively under the Artistic License version 2.0 only.