A small hint for all the #Elixir users out there.

I don't know about you, but I always cringed at how dirty mix is when it comes to installing third party toolchain dependencies.

Twelve years into using it, I learned that you can actually localise third-party installations!

Here's a snippet from my #direnv.

```sh
mkdir -p .nix-mix .nix-hex
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-mix
[ -z "$(ls -A .nix-mix)" ] && mix local.hex
[ -z "$(ls -A .nix-mix)" ] && mix local.rebar
```

This can make your #Nix builds pure without faking HOME!

#TIL #ElixirLang #NixOS #GooLang #Goo

@florin putting that into #GooLang prelude! :D

QT: https://social.doma.dev/@goo/109922182018482441

What we decided to do instead is to define two macros on the side. `defprod` is `defdata` that doesn't generate default constructors. It should be compatible with `defsum` out of the box, but we, for the time being, have the "no-new" counterpart called `defunion`.

Because unions are cool.

This way we don't break existing code, but allow easy to write smart constructors that don't upset #dialyzer.

The code is already live in the #GooLang #Algae fork: https://github.com/doma-engineering/algae-goo

Goo Programming Language (@[email protected])

Attention #Algae users. Functionality of generating `new` functions based on default values is staying, **but**, make sure to never write your own `new` functions yourself. Please write your constructors as `def mk`. If you used rose tree[1] implementation, you'll be hit with a breaking change as `rose.ex` moves to this convention. #Witchcraft #Elixir #Goo #MyElixirStatus #MyGooStatus https://en.wikipedia.org/wiki/Rose_tree

Doma Social