Yeti |
... and the slime became the worm and the worm the serpent, the serpent became the yeti of the mountain forests and the yeti became man. |
Yeti is
ML style
functional programming language, that runs on the
JVM.
- Binary jar archive: yeti.jar
(occasionally updated and built from development snapshots).
- Binary jar containing only Yeti standard library:
yeti-lib.jar
- Source is available through git and svn (ant is needed for building):
git clone git://github.com/mth/yeti.git
svn co http://svn.github.com/mth/yeti.git
(BSD licensed)
- Read the tutorial (also available as
PDF).
- Vim syntax hilighting and filetype plugin.
Save these files as ~/.vim/syntax/yeti.vim and
~/.vim/ftplugin/yeti.vim accordingly, and add
au BufNewFile,BufRead *.yeti setlocal filetype=yeti ts=8 sw=4 sts=4 expandtab
into your ~/.vimrc.
- Netbeans and Notepad++ support.
- Emacs mode for Yeti.
- Help can be asked from the
mailing list.
Please report any bugs you find.
- Chrisichris has some interesting posts about Yeti.
The goal of the Yeti is to have a clean and minimal expressive language on the JVM that allows functional style programming, has static type inference and interfaces well with Java code.
Some of the features:
- Type inference using the Hindley-Milner algorithm. The types are
statically inferred at compile time without a need for explicit type
declarations.
- Polymorphic structure and
variant types. Using those resembles
duck typing from the dynamic languages - for example, when a value is used as
a structure having a field foo, which gives string value, then any structure
with string field foo will be good enough.
- Property fields in structures (access goes through function calls).
- Lazy lists
- Pattern matching on values
- Comfortable string regex support
- Easy to call existing Java code
- Interactive REPL environment for experimenting
- Compiles directly to Java bytecode
- Fast compilation and quite fast execution
Status
The core language and existing standard library API should be fairly
stable now. The development focus is currently on fixing bugs when
someone finds those and writing documentation (as it's needed for
the 1.0 release).
Updates
12/2011. Version 0.9.3
bugfix release
(yeti-0.9.3.jar and
yeti-lib-0.9.3.jar).
- Class field closures fix (patch by Dr. Erdi Gergo).
- Some std module documentation added.
11/2011. Version 0.9.2
released
(yeti-0.9.2.jar and
yeti-lib-0.9.2.jar).
- YetiDoc support. Give -doc dir command line option or docdir="..."
to ant task to generate module documentation automatically.
- Improved deep struct/variant mismatch error messages - only parts
of outer structures/variants relevant to the type mismatch are shown,
which makes it easier to spot the actual problem.
- New
argument |> function application operator similar
to the one found in F#, so applications can be expressed as piping data
through functions.
- The string concatenation operator
^ now requires the arguments
to really be strings to catch more errors. You can always embed expressions
into string literals like "\(a)\(b)" to get a result equivalent to
the old behaviour of ^ operator.
- Temporary fix for Win32 paths in compilation.
- Fix circular dependencies between initialisation of modules and Java
classes in those modules.
- Fix loop closure scoping (each loop iteration creates new closure).
- Fix optimised non-value function references in class closures.
- Old http module removed.
9/2011. Version 0.9.1
bugfix release
(yeti-0.9.1.jar and
yeti-lib-0.9.1.jar).
- Less/greater list/array cross-comparisions fixed.
- Class-cast exception when constructing
Java class closures of method-optimised function bindings fixed.
- Typing errors on hidden struct depth type variables fixed.
- Old repl module removed.
8/2011. Version 0.9 released
(yeti-0.9.jar and
yeti-lib-0.9.jar).
You should probably still use the development snapshots to get latest
bug fixes, unless you need that nothing changes.
Main changes and bugfixes since last update:
- Using relaxed value restriction (sometimes it's safe to allow
application result to be polymorphic).
- New yeti.lang.compiler.eval module replaces the old repl module.
- Typedefs are used when printing type names in error messages (and it's
also useful for yetidoc). This should improve readability of type error
messages involving complex types, given that matching typedefs exist
in the code. Additionally typedefs are now shown in -type and -doc output.
- Module type not fully defined message shows the offending type variables.
- Support super references in Java classes defined in Yeti code.
- Support module deprecation (
module foo: deprecated;).
- Require typedef names to start with lower-case letter to avoid
conflict with variant constructors (you couldn't anyway use a
type whose name started with upper-case letter).
- More constant value optimisations (static fields, constant bindings
in some closures).
- Fix duplicate field naming errors.
- Fix serialVersionUID declaration in classes.
- Fix primitive array autoconversions.
- Yeti string can be used now where ~java.lang.CharSequence is required.
- Standard library fixes.
- The yeti.http module is deprecated,
and openTextUrl function is merged into yeti.lang.io module.
4/2011. Bunch of bugfixes and some new features:
- Faster structures and structure related bugfixes.
The with operator allows extending existing structure object with additional
fields and/or overriding fields in the original. This can be used among other
things to do prototype style OO (and based on that also to emulate
class-based OO). Should write a HOWTO about that. ;)
- Few additional constant optimisations.
- Triple-quoted strings for longer string templates.
- Some new documentation by Christian Essl.
- Emacs syntax hilighting by Brian McKenna.
- Some work on yetidoc support in the compiler (not here yet, but closer).
4/2010. Bugfixes, like always. New features:
- Verify regex constants at compile time.
- Thread-local variable support in standard library.
- Invoking Yeti compiler from in-memory compiled Yeti code works now.
- Multiple Java classes can be imported from a package using one import
statement (like
import java.io: File, FileInputStream;).
- Renamed asm3 library packages included in yeti.jar
(to avoid conflicts with other asm library usage).
- Optimize functions into simple static methods,
if there are no other references than full application.
- Mixed Yeti/Java source compilation in Yeti compiler,
supports circular references between Yeti and Java source files.
Better type mismatch error messages and documentation generation
from comments are partially implemented (means doesn't work yet).
8/2009. Bugfixes, case pattern matching should work now better.
Mixed Java/Yeti build task enchasements.
5/2009. Some bugfixes, allowed partial variant match in case,
recursive type definitions.
12/2008. Some bugfixes and .[] can now be used for accessing Java array
elements too. Also added some smart auto-casting for Java arrays.
10/2008. Java class definitions are
supported now. Additionally bunch of bugfixes and optimisations have been done.
9/2008. Some bugfixes here and there have happened (you can read the git log).
Java classes are probably next thing to be implemented
(actually the syntax is decided and parser support already exists).
(put yeti into subject)