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.
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
04/2013. Version 0.9.8
released
(yeti-0.9.8.jar and
yeti-lib-0.9.8.jar).
- Array/hash references use simpler
table[key] syntax instead of the old
table.[key] (old syntax gives deprecation warning now).
- New stable module JVM ABI for better backward compatibility in future
(uses static methods for module fields instead of the multiple different
ways of access used previously).
- Compiler now rebuilds only modified dependencies.
- Modules required by load are compiled before type inference
to reduce memory use during compilation.
- Documented all modules except
yeti.experimental.json
- Documentation for with, opaque typedefs and shared typedefs by Chrisichris.
- Atomic references in standard library (
atomic function).
- The threadLocal function now takes initializer function instead of
simple value as argument.
- New generic
fetchURL function for making http/ftp requests
in yeti.lang.io module.
- Deprecated
linesOfReader and openTextUrl functions
in yeti.lang.io module.
- Avoid upper/lowercase dups on generated classes.
- Skip code generation, when only doc generation is requested.
- Use unique paths on module (re)compilation.
- Fixed full path script invocation (yeti /some/fubar/script.yeti).
- Pretty-print non-primitive Java arrays (patch by Chris Cannam).
- Help garbage collection of infinite lists by releasing references earlier.
- Some int value passing optimisations in generated bytecode.
- Lots of bugfixes.
11/2012. Version 0.9.7
released
(yeti-0.9.7.jar and
yeti-lib-0.9.7.jar).
- The
yeti.lang.std module is now documented.
- New
yeti.xml module for parsing and generating XML (DOM style API,
internally uses
Java
Streaming API for XML).
- Allow using the
as and unsafely_as cast operators as functions.
- Opaque typedef support:
typedef opaque foo<parameters...> = type expression
defines new opaque type foo. Values can be casted to opaque type using as
cast. This can be used to hide implementation types.
- Included jEdit
mode for Yeti syntax highlighting.
- Variant type tags are also shown in error messages and generated
documentation.
- Allow using static final class fields as constants in case patterns.
- New functions:
threadExit for terminating a thread and
runnable for creating java.lang.Runnable instances.
- Structure field names can be escaped like ``
weird field name``.
- Support grouping functions in YetiDoc using
Group: name directive.
- Some YetiDoc bugs fixed, including
var structure field handling.
- Parser fix for handling invalid typedef syntax.
- Fixed typedefs sometimes wrongly handled as non-polymorphic.
- Fixed handling of
undef_str parameters in IO functions.
- Fixed
as list<string> and as string not converting null's to undef_str.
- Implemented proper
hashCode() for structs.
- Workaround for case expression misbehaving on nested variants.
- Fixed an exception from pointless
deleteAll [1] [] call.
7/2012. Version 0.9.6
released
(yeti-0.9.6.jar and
yeti-lib-0.9.6.jar).
- New
\case of syntax for
function pattern matching
(similar to GHC lambda-case and OCaml function keyword).
- Fixed strRightOf function returning empty string.
- Patched asm library used by compiler to work with classes generated by Scala
compiler.
- Allow using
v as array<'a> to wrap Java arrays into Yeti arrays.
Deprecated wrapArray function.
- YetiDoc generates prettier documentation and allows Notes sections.
- More std module documentation written.
4/2012. Version 0.9.5
bugfix release
(yeti-0.9.5.jar and
yeti-lib-0.9.5.jar).
- Fix partial application of
str* family of yeti.lang.std module functions.
- Disallow invalid
is {} type declarations instead of giving confusing
compiler error.
- Fix NullPointerException in finalizeStruct when raising type mismatch error.
- Better error message on invalid mutable binding definitions like
var x := 1
- Fix generating operator-functions documentation.
- Some additional std module documentation.
2/2012. Version 0.9.4
released
(yeti-0.9.4.jar and
yeti-lib-0.9.4.jar).
- Support non-polymorphic typedef bindings using shared keyword,
for example:
typedef shared foo = 'a
- Try-catch literal closure optimisation bug fixed.
- Tail recursion optimisation bug fixes.
- Java char[] and boolean[] autoconversion fixes.
- A bit more std module documentation written.
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)