What is MLStyle.jl?¶
MLStyle.jl is a Julia package that provides multiple productivity tools from ML (Meta Language) like pattern matching which is statically generated and extensible, ADTs/GADTs (Algebraic Data Type, Generalized Algebraic Data Type) and Active Patterns.
Think of MLStyle.jl as a package bringing advanced functional programming idioms to Julia.
Motivations¶
Those used to functional programming may feel limited when they don’t have pattern matching and ADTs, and of course I’m one of them.
When making this package I didn’t want to make a trade-off by using some alternatives that don’t have enough features or are not well-optimized. Just like why those greedy people created Julia, I’m also greedy. I want to integrate all those useful functional programming features into one language, and make all of them convenient, efficient and extensible.
In recent years I was addicted to extending Python with metaprogramming and even internal mechanisms. Although I made some interesting packages like pattern-matching, goto, ADTs, constexpr, macros, etc., most of these implementations are also disgustingly evil. Fortunately, in Julia, these features could be achieved straightforwardly without using any black magic. At last, some of these ideas come into existence with MLStyle.jl.
Finally, we have such a library that provides extensible pattern matching for julia.