Mina
Mina is my main focus at the moment.
Mina is a statically-typed functional programming language for the Java Virtual Machine.
Existing statically-typed functional languages such as Scala, Haskell and OCaml originated in academic environments. They contain decades worth of experimentation with language features.
This is a wonderful thing that has led to countless interesting new ways of writing programs.
However, these features often interact poorly together and offer too many different ways to solve the same problems.
The intention of Mina is to be a minimal programming language with features curated specifically for learning and teaching functional programming.
At the time of writing, the Mina compiler can compile simple programs featuring:
- The primitive data types of the JVM
- String literals
- Functions
- Conditional expressions
- Pattern matching
- Algebraic data types
- Parametric polymorphism
Type inference is implemented using the algorithm described in Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism.
A Gradle plugin is included, enabling Mina programs to be compiled by the Gradle build tool.
There is also a nascent language server in the repository that interoperates with a build server for Gradle, enabling Gradle to communicate about Mina builds with language server clients.
The language server support is very sparse: it has taken a substantial step back in functionality as part of the attempt to integrate with a build tool rather than compiling programs directly in the language server.
Mina progresses very slowly around my day job and other commitments, but it's a project that I am very attached to.
I have been working on Mina and its previous incarnation inc since 2018, and previous iterations of this idea date back as far as 2016.
Here's an example of some Mina code:
namespace Mina/Examples/List -> Some(head)
}
let lastOption(list: List): Option =
match list with -> None()
case} -> Some(head)
case} -> lastOption(tail)
}
}
yvette
yvette is a diagnostic reporting library for Java.
It is a barebones port of Kat Marchán's lovely miette library for Rust.
yvette exists because I could not find a library similar to miette, ariadne or codespan-reporting in the Java ecosystem, and I wanted to be able to produce well-presented and readable compiler diagnostics for Mina users.
At present I am in the middle of reworking yvette so that it uses prettier4j for printing diagnostic messages, which should make it easier to print diagnostics at various terminal widths.
prettier4j
prettier4j is a pretty-printing library for Java.
It is a port of Philip Wadler's A prettier printer to Java, as inexplicably it doesn't seem like any such library exists in the Java ecosystem.
prettier4j exists because I needed a way to pretty-print types in Mina compiler diagnostics.
Later I extended it to support ANSI escape code sequences, text wrapping and parameter markers in documents.
These features are designed to support laying out diagnostic messages in the Mina compiler.
sbt-tpolecat
I developed the sbt-tpolecat build tool plugin for the Scala build tool sbt, which configures the Scala compiler to use a recommended baseline set of options.
This was inspired by Rob Norris's blog posts Useful Scalac Flags and Recommended Scalac Flags for 2.12.
This project was initially little more than a hat-tip to one of the developers who inspired me the most while I was learning to use Scala, but it has ended up being the most enduring and most widely-used open source project that I have initiated.
I am not very active in the Scala community any more for various reasons and it is now much more capably and consistently maintained by the Typelevel Scala contributors.