I’ve been working on a number of features the last couple of months. All are not done yet, but it’s time to release something even though it’s experimental. Most of the new features have been available in the 0.3.0-alpha* releases in the Playground, so you might have seen some of them already. Please try this new version out and report any bugs or problems.

The Language Reference is lagging behind a bit, I’ll update it as soon as possible to cover the protocols feature. Until then just ask on Twitter (@odenlang) if there’s anything you want to know.

Known Limitations / Future Improvements

These are some things that I know don’t work very well and that should be improved/implemented next. If you find more please report on GitHub. Any help is appreciated!

Record Extension

Record extension is not supported yet. You can only create record values using the { field1 = value1, field2 = value2, ..., fieldN = valueN } literal. An extension syntax like the one in Elm or PureScript would be nice to have.

Polymorphic Method Aliases

Protocol methods cannot be “aliased” if the alias is polymorphic. The following code cannot be compiled yet:

package main

protocol Foo(f) {
  Bar : f -> int
}

alias = Foo::Bar

impl Foo(int) {
  Bar(n) = n + 1
}

main() = {
  println(alias(1))
}

Directly referring to the method works:

package main

protocol Foo(f) {
  Bar : f -> int
}

impl Foo(int) {
  Bar(n) = n + 1
}

main() = {
  println(Foo::Bar(1))
}

Unqualified Method References

Currently one must qualify method references, like Foo::Bar in the example above. It would be nice if the compiler could accept just Bar as long as it’s unambigous. However, I think this works for now.

Various Protocol Validations

There’s probably a bunch of cases around protocols that should have validation to make sure they’re used correctly.

Protocols for Operator Overloading

Oden operators should be overloaded using protocols. No work has been done on this yet but I really look forward to getting it done!

Trying It Out

To run Oden you can either download a pre-built distribution from GitHub or just try it out in your browser at the Oden Playground.