Concepts

Events

This means that for every named function or method, any number of callbacks may
be hidden behind it, each of which accepts its own arguments and spits out its
own return values. This makes it really easy to extend existing code without
breaking things.

Inheritance

Ferret features a unique inheritance system in which all
values are objects, each of which can inherit from any number of other objects.

Runtime

Ferret's transparent runtime makes it easy to manage I/O, timers, asynchronous
operations, and more – all without implementing your own event loop.

If asynchronous operations are occurring at any given moment, a Ferret program
continues processing until those operations are complete. Ferret also
effortlessly makes use of system-optimized polling methods for I/O.

delay(5) {
say("it's been five seconds!")
}
say("starting timer...")

Compiled

Ferret currently compiles exclusively to Perl, a
high-level language. It might therefore be classified as a very-high-level
language (VHLL). In other words, Ferret has many novel features, often at the
cost of considerable overhead.

say("Hello World!")

Interpretable

While Ferret is a compiled language, its compiler and
runtime are both written in an interpreted language. On top of that, the
standard library provides an interface to the compiler. This allows Ferret to
offer some features of interpreted languages such as compilation and
evaluation during runtime.

Configuration

After cloning the repository, Ferret requires a configuration. It's truly as
simple as specifying where on your system the repository exists.

Using a systemwide configuration

Copy ferret.conf.example to /etc/ferret.conf. In it,
set the $ferret_root variable to the absolute path of this repository.

sudo cp ferret.conf.example /etc/ferret.conf

Make sure that all users have read permission.

sudo chmod 755 /etc/ferret.conf

After that, try running the compiler from the repository root directory to
compile the standard library.

./ferret

Configuration elsewhere

If you cannot write to /etc/ferret.conf, you can store your configuration
elsewhere. Just set the environment variable $FERRET_CONFIG to the absolute
path of your configuration file. To set it semi-permanently, add it to your
~/.bash_profile or the like.

export FERRET_CONFIG="/path/to/my/ferret.conf"

Writing

Once you have the compiler working, you're ready to write some code. The easiest
way is to make a sandbox directory within this repository tree. Name your
files with .frt. Then compile.

Compiling

Compile with the ferret executable, passing file paths as arguments. If no
file paths are provided, it searches the current directory and all
subdirectories for .frt and .frtdoc files. Unchanged files are ignored.
See ./ferret -h for all flags. The entire standard library is compiled like
so:

./ferret

After updating the repository, the compiler may have changed. You might want to
run ferret with the -n flag to force all source files to recompile.

./ferret -n

Running

Run files with the -r flag:

./ferret -r test/1-hello-world.frt

You can also run Ferret files directly if they are executable and include the
hashbang #!/usr/bin/env ferret -r (assuming the ferret bin is in your PATH):

cd test/35-irc-new
./bot

Troubleshooting

There are bugs. There is much work to be done. Some problematic scenarios are
not handled properly or do not provide helpful error messages. But there are
things you can try.

If you encounter an error while compiling, see
troubleshooting in Compilation.