Previous entries in this series:
One of the big advantages of using an existing language like Purescript when building out typed support for Erlang, is the presence of existing tooling and libraries for the language (such as language servers, package management, syntax highlighting, etc - as well as libraries for all the normal maths, string manipulation, date times, testing and all that).
On top of that, one of the things we 'lack' in Purerl is the Aff monad. We (as far as we can tell so far) don't need it because we're just not writing code that way - or rather with the presence of various means of performing async actions in Erlang it simply isn't necessary. This does mean that any library that brings in Aff (such as some of the popular testing frameworks) will need porting to use sometihng else unless somebody feels like porting Aff? No I thought not.
On the face of it, there is nothing but Purescript in the repo and the tests are incredibly simple, however it has a dependency on purescript-unicode which whilst being entirely Purescript also, not only has a dependency on purescript-quickcheck which absolutely does have some Erlang in it, but also generates Erlang that breaks the Erlang compiler because of 'complexity'. (hard coded lists of unicode characters meant nested function calls all the way down).
Quickcheck needs the JS re-writing as Erlang, and then if you want to build unicode/parser independently and run their tests then they need their packages updating so they can pull the fork of quickcheck. Thankfully these libraries all (sensibly) have their tests written as a main :: Effect Unit rather than using a fancy testing library so the changes are very fast and easy to implement. As a result of running the test suite of course, some missing features were found in purescript-strings for which, thankfully built-in functions exist in Erlang so no hard work was required.
I guess what I'm trying to say is that there are yaks all the way down, and that all of these libraries kindly written by other people don't come for free. On the bright side because we've been actively writing Purescript for three years we've brought across a lot of them ourselves already. The complete list of packages ported to the id3as organisation at this time of writing is:
These will end up in the default package set over time so they can be referred to without needing to know where they are - but if you're venturing down the route of using Purescript and needing a package that doesn't exist, then check the Purerl org and the Id3as org to see if somebody hasn't already done the leg work!
2020 © Rob Ashton. ALL Rights Reserved.