Ryan Voots


Language::Farnsworth - A Turing Complete Language for Mathematics


        use Language::Farnsworth;
        my $hubert = Language::Farnsworth->new();
        my $result = $hubert->runString("10 km -> miles");
        my $result = $hubert->runFile("file.frns");
        print $result;


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. While it is not ready for production use, it is most certainly usable as a toy and to see a pure interpreter written in perl. Not every feature is documented yet (This 0.7.x series will be striving to fix that) and a future release will fix the hairier parts of the internal API (scheduled for 0.8.x).


Modules and Libraries you need before this will work


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.


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.


This takes a file name and executes the entire file as a single Language::Farnsworth expression.


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.


None by default.


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.


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!


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. And while ostensibly the language may appear to be named in a similar vein after another cartoon professor that brings good news to everyone, it is in fact named after the famous physicist Philo T. Farnsworth.


Language::Farnsworth::Docs::Syntax Language::Farnsworth::Docs::Functions

Please use the bug tracker available from CPAN to submit bugs. There are also things to be


Ryan Voots <simcop@cpan.org>


Copyright (C) 2010 by Ryan Voots

This library is free software; It is licensed exclusively under the Artistic License version 2.0 only.