diff --git a/_includes/top.html b/_includes/top.html index 13ecc8304..45a2f2a59 100644 --- a/_includes/top.html +++ b/_includes/top.html @@ -38,7 +38,7 @@ - + diff --git a/_layouts/redirect.html b/_layouts/redirect.html index 464f54e82..66ee7a8f8 100644 --- a/_layouts/redirect.html +++ b/_layouts/redirect.html @@ -1,14 +1,14 @@ - + - +

Redirecting...

- Click here if you are not redirected. - + Click here if you are not redirected. + diff --git a/_posts/2012-05-25-elixir-v0-5-0-released.markdown b/_posts/2012-05-25-elixir-v0-5-0-released.markdown index a5701a60d..3889f1b2a 100644 --- a/_posts/2012-05-25-elixir-v0-5-0-released.markdown +++ b/_posts/2012-05-25-elixir-v0-5-0-released.markdown @@ -10,7 +10,7 @@ excerpt: We have finally released Elixir v0.5.0! This marks the first release si We have finally released [Elixir](/) v0.5.0! This marks the first release since the language was rewritten. In this blog post, we will discuss what we achieved during this time and what are the next steps! -If you don't care about any of these, you can go straight to our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html). If you do, keep on reading! +If you don't care about any of these, you can go straight to our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html). If you do, keep on reading! ## Looking back @@ -46,4 +46,4 @@ In parallel, we will improve our [documentation generation tool](https://github. Finally, we will continue improving the Standard Library. Although Elixir's goal is to rely on Erlang the most as possible, we also want to provide a small Standard Library which makes better use of Elixir semantics. For the next weeks, we will focus on improving the IO and File manipulation modules. New data types may also appear, for example, ranges come to my mind. -Check out our [home page](/) and the [getting started guide](https://hexdocs.pm/elixir/introduction.html) for more information. Welcome aboard and grab a cup of Elixir, because you are certainly going to enjoy the ride! +Check out our [home page](/) and the [getting started guide](https://elixir.hexdocs.pm/introduction.html) for more information. Welcome aboard and grab a cup of Elixir, because you are certainly going to enjoy the ride! diff --git a/_posts/2012-08-01-elixir-v0-6-0-released.markdown b/_posts/2012-08-01-elixir-v0-6-0-released.markdown index becafdf7c..5ae592b90 100644 --- a/_posts/2012-08-01-elixir-v0-6-0-released.markdown +++ b/_posts/2012-08-01-elixir-v0-6-0-released.markdown @@ -25,4 +25,4 @@ Our interactive shell (IEx) also had many improvements, thanks to the Elixir dev That's it. For the next months, we will continue improving Elixir (you can see some ideas floating around in the [issues tracker](https://github.com/elixir-lang/elixir/issues)) but we will start to focus on other tools and libraries for the community. -Thank you and don't forget to [give Elixir a try](https://hexdocs.pm/elixir/introduction.html)! +Thank you and don't forget to [give Elixir a try](https://elixir.hexdocs.pm/introduction.html)! diff --git a/_posts/2012-10-20-elixir-v0-7-0-released.markdown b/_posts/2012-10-20-elixir-v0-7-0-released.markdown index d2f181612..b2784e35a 100644 --- a/_posts/2012-10-20-elixir-v0-7-0-released.markdown +++ b/_posts/2012-10-20-elixir-v0-7-0-released.markdown @@ -16,4 +16,4 @@ This release also includes some backwards incompatible changes, but the majority For more information, read out the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.7.0/CHANGELOG.md). -Thank you and don't forget to [give Elixir a try](https://hexdocs.pm/elixir/introduction.html)! +Thank you and don't forget to [give Elixir a try](https://elixir.hexdocs.pm/introduction.html)! diff --git a/_posts/2012-11-18-elixir-v0-7-1-released.markdown b/_posts/2012-11-18-elixir-v0-7-1-released.markdown index 113bcd31f..92ade906a 100644 --- a/_posts/2012-11-18-elixir-v0-7-1-released.markdown +++ b/_posts/2012-11-18-elixir-v0-7-1-released.markdown @@ -16,7 +16,7 @@ During this time traveling around, we have spoken at many conferences, as [Stran In case you missed any of those conferences, [the talk I presented at Øredev is available and you can watch it now](https://vimeo.com/53221562). The slides are also available below. -If you want to hear more about Elixir at a conference or an event, please let us know. Thank you and don't forget to [give Elixir a try](https://hexdocs.pm/elixir/introduction.html)! +If you want to hear more about Elixir at a conference or an event, please let us know. Thank you and don't forget to [give Elixir a try](https://elixir.hexdocs.pm/introduction.html)! diff --git a/_posts/2012-12-04-elixir-v0-7-2-released.markdown b/_posts/2012-12-04-elixir-v0-7-2-released.markdown index b4ec972c7..aa767fb41 100644 --- a/_posts/2012-12-04-elixir-v0-7-2-released.markdown +++ b/_posts/2012-12-04-elixir-v0-7-2-released.markdown @@ -51,4 +51,4 @@ under some circumstances when using records. Lastly, but not least importantly, I'd like to mention that we're very excited about how the community around Elixir is building up. Thank you all for being around and supporting us! -[Learn more about Elixir](https://hexdocs.pm/elixir/introduction.html)! +[Learn more about Elixir](https://elixir.hexdocs.pm/introduction.html)! diff --git a/_posts/2013-01-27-elixir-v0-8-0-released.markdown b/_posts/2013-01-27-elixir-v0-8-0-released.markdown index 9f6236b10..c20d78166 100644 --- a/_posts/2013-01-27-elixir-v0-8-0-released.markdown +++ b/_posts/2013-01-27-elixir-v0-8-0-released.markdown @@ -19,7 +19,7 @@ And applications can be started directly from the command line as well: elixir --app my_app -We have written a whole [guide chapter about creating OTP applications, supervisors and servers](https://hexdocs.pm/elixir/supervisor-and-application.html). Give it a try! +We have written a whole [guide chapter about creating OTP applications, supervisors and servers](https://elixir.hexdocs.pm/supervisor-and-application.html). Give it a try! ## Improved Unicode support @@ -31,7 +31,7 @@ String.capitalize("fiN") #=> "Fin" The example above contains a string with only two codepoints, [the codepoint fi](http://www.fileformat.info/info/unicode/char/FB01/index.htm) and [the codepoint n](http://www.fileformat.info/info/unicode/char/006E/index.htm). Look how Elixir properly capitalizes the string, returning a new string made of three codepoints (all ascii letters). -Learn more about [Unicode support with the String module](https://hexdocs.pm/elixir/String.html). +Learn more about [Unicode support with the String module](https://elixir.hexdocs.pm/String.html). ## AST metadata @@ -71,11 +71,11 @@ When some code call the `unless` macro above, in previous Elixir versions, it wo Elixir v0.8 ensures that the `unless` macro above will expand to the same `if` macro available when quoted, guaranteeing different libraries can integrate easily without imposing hidden requirements. -You can read more about [macros in the getting started guide](https://hexdocs.pm/elixir/case-cond-and-if.html) or [go deep into the quote macro docs](https://hexdocs.pm/elixir/Kernel.SpecialForms.html#quote/2). +You can read more about [macros in the getting started guide](https://elixir.hexdocs.pm/case-cond-and-if.html) or [go deep into the quote macro docs](https://elixir.hexdocs.pm/Kernel.SpecialForms.html#quote/2). ## A new way to manipulate pathnames -Elixir v0.8 contains a bit of house cleaning too. We have created [the Path module](https://hexdocs.pm/elixir/Path.html) to accommodate functions used to manipulate filesystem paths and have also added functions like [`System.tmp_dir` and `System.user_home`](https://hexdocs.pm/elixir/System.html) which are meant to work across different operating systems and are very handy when scripting. +Elixir v0.8 contains a bit of house cleaning too. We have created [the Path module](https://elixir.hexdocs.pm/Path.html) to accommodate functions used to manipulate filesystem paths and have also added functions like [`System.tmp_dir` and `System.user_home`](https://elixir.hexdocs.pm/System.html) which are meant to work across different operating systems and are very handy when scripting. ## The new HashDict @@ -101,4 +101,4 @@ We continue actively working on Elixir and this release is the [result of our ef Also, we previously announced Elixir is going to be released frequently, every 2 to 4 weeks. We have made a small detour to get v0.8.0 out of the door, but we are back to our regular schedule as of today! -[Celebrate with us and give Elixir a try](https://hexdocs.pm/elixir/introduction.html)! +[Celebrate with us and give Elixir a try](https://elixir.hexdocs.pm/introduction.html)! diff --git a/_posts/2013-04-29-elixir-v0-8-2-released.markdown b/_posts/2013-04-29-elixir-v0-8-2-released.markdown index fea64d566..5cbe32904 100644 --- a/_posts/2013-04-29-elixir-v0-8-2-released.markdown +++ b/_posts/2013-04-29-elixir-v0-8-2-released.markdown @@ -45,6 +45,6 @@ defmodule MathTest do end ``` -You can learn more about [doctests on our documentation page](https://hexdocs.pm/ex_unit/ExUnit.DocTest.html) and get more information about our latest release [on the CHANGELOG](https://github.com/elixir-lang/elixir/blob/ed27611f48ba150404c95fe15f1d6058a4287330/CHANGELOG.md). +You can learn more about [doctests on our documentation page](https://ex-unit.hexdocs.pm/ExUnit.DocTest.html) and get more information about our latest release [on the CHANGELOG](https://github.com/elixir-lang/elixir/blob/ed27611f48ba150404c95fe15f1d6058a4287330/CHANGELOG.md). -If you are new to Elixir, [it's easy to get started with](https://hexdocs.pm/elixir/introduction.html)! +If you are new to Elixir, [it's easy to get started with](https://elixir.hexdocs.pm/introduction.html)! diff --git a/_posts/2013-05-23-elixir-v0-9-0-released.markdown b/_posts/2013-05-23-elixir-v0-9-0-released.markdown index edee304e1..7fb2b5d07 100644 --- a/_posts/2013-05-23-elixir-v0-9-0-released.markdown +++ b/_posts/2013-05-23-elixir-v0-9-0-released.markdown @@ -124,11 +124,11 @@ A special thanks to [Eric Meadows-Jonsson](https://github.com/ericmj) for implem We have also many other smaller improvements: * Our CLI now supports `--hidden` and `--cookie` flags which are useful for distributed modes; -* Our test framework, ExUnit, is now able to capture all the communication that happens with a registered IO device, like `:stdio` and `:stderr`, via [`ExUnit.CaptureIO`](https://hexdocs.pm/ex_unit/ExUnit.CaptureIO.html). This is very useful for testing how your software reacts to some inputs and what it prints to the terminal; +* Our test framework, ExUnit, is now able to capture all the communication that happens with a registered IO device, like `:stdio` and `:stderr`, via [`ExUnit.CaptureIO`](https://ex-unit.hexdocs.pm/ExUnit.CaptureIO.html). This is very useful for testing how your software reacts to some inputs and what it prints to the terminal; * `IEx` now allows files to be imported into the shell with `import_file` and also loads `~/.iex` on startup for custom configuration; * The `String`, `Enum` and `Dict` modules got more convenience functions that goes from checking unicode character validity to taking values out of a dictionary; * And many, many more! A huge thank you to our community for sending bug reports, providing bug fixes and contributing all those amazing features. And when are **you** joining us? :) -Give Elixir a try! You can start with our [getting started guide](https://hexdocs.pm/elixir/introduction.html), or [check this 30 minute video from PragProg](https://www.youtube.com/watch?v=a-off4Vznjs&feature=youtu.be) or buy the beta version of [Programming Elixir](https://pragprog.com/book/elixir/programming-elixir). +Give Elixir a try! You can start with our [getting started guide](https://elixir.hexdocs.pm/introduction.html), or [check this 30 minute video from PragProg](https://www.youtube.com/watch?v=a-off4Vznjs&feature=youtu.be) or buy the beta version of [Programming Elixir](https://pragprog.com/book/elixir/programming-elixir). diff --git a/_posts/2013-07-13-elixir-v0-10-0-released.markdown b/_posts/2013-07-13-elixir-v0-10-0-released.markdown index c00858ea8..e7e0263cc 100644 --- a/_posts/2013-07-13-elixir-v0-10-0-released.markdown +++ b/_posts/2013-07-13-elixir-v0-10-0-released.markdown @@ -55,11 +55,11 @@ Stream.repeatedly(fn -> :random.uniform end) |> Enum.take(3) #=> [0.4435846174457203, 0.7230402056221108, 0.94581636451987] ``` -`Stream.repeatedly/1` returns an infinite stream but that's ok we just need its first three elements. You can learn more about [stream and related functions in `Stream` module documentation](https://hexdocs.pm/elixir/Stream.html). +`Stream.repeatedly/1` returns an infinite stream but that's ok we just need its first three elements. You can learn more about [stream and related functions in `Stream` module documentation](https://elixir.hexdocs.pm/Stream.html). ## Sets -This release also adds [the Sets API](https://hexdocs.pm/elixir/Set.html) to Elixir and a HashSet implementation. The HashSet implementation follows [the same design goals as the HashDict implementation](/blog/2013/01/27/elixir-v0-8-0-released/) released at the beginning of this year, starting with a compact representation and expanding and contracting as needed. +This release also adds [the Sets API](https://elixir.hexdocs.pm/Set.html) to Elixir and a HashSet implementation. The HashSet implementation follows [the same design goals as the HashDict implementation](/blog/2013/01/27/elixir-v0-8-0-released/) released at the beginning of this year, starting with a compact representation and expanding and contracting as needed. This feature was a contribution from [Joseph Wilk](https://github.com/josephwilk) and he talks about its implementation and provides some benchmarks [on his blog](http://blog.josephwilk.net/elixir/sets-in-elixir.html). @@ -67,7 +67,7 @@ This feature was a contribution from [Joseph Wilk](https://github.com/josephwilk Another addition to this release is pretty printing. The pretty printing started as an implementation of the [Wadler paper](http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf) by [Jonns Mostovoys](https://github.com/manpages) which was then improved by [Gustavo Brunoro](https://github.com/brunoro) under his Google Summer of Code project as described in [Lindig's _Strictly Prettier_ paper](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.2200). -As soon as you upgrade to Elixir v0.10.0 and start IEx, you will get pretty printing for all data structures provided by Elixir. We have also added documentation to the `Inspect` module about [adding pretty printing to your own structures](https://hexdocs.pm/elixir/Inspect.html) as well as [using the document algebra for any other kind of formatting](https://hexdocs.pm/elixir/Inspect.Algebra.html). +As soon as you upgrade to Elixir v0.10.0 and start IEx, you will get pretty printing for all data structures provided by Elixir. We have also added documentation to the `Inspect` module about [adding pretty printing to your own structures](https://elixir.hexdocs.pm/Inspect.html) as well as [using the document algebra for any other kind of formatting](https://elixir.hexdocs.pm/Inspect.Algebra.html). ## Other improvements @@ -79,8 +79,8 @@ Other notable improvements are: * We are also working hard on Windows support, improving its command-line tools and working towards a green test suite, thanks to [Tom Jansens](https://github.com/tojans); -* Meta-programming in Elixir was also improved by the addition of the `binding/0` and `binding/1` macros plus the additions of `Macro.expand_once/2` and `Macro.expand_all/2` to the [`Macro` module](https://hexdocs.pm/elixir/Macro.html); +* Meta-programming in Elixir was also improved by the addition of the `binding/0` and `binding/1` macros plus the additions of `Macro.expand_once/2` and `Macro.expand_all/2` to the [`Macro` module](https://elixir.hexdocs.pm/Macro.html); There are also improvements to typespecs, error messages, many bug fixes and some backwards incompatible changes. We have posted a detailed [upgrade instructions on the mailing list](https://groups.google.com/forum/?fromgroups#!topic/elixir-lang-talk/ksrefrgK1eY). For a general overview, [check out the CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.10.0/CHANGELOG.md). -Give Elixir a try! You can start with our [getting started guide](https://hexdocs.pm/elixir/introduction.html), or check out our sidebar for other learning resources. +Give Elixir a try! You can start with our [getting started guide](https://elixir.hexdocs.pm/introduction.html), or check out our sidebar for other learning resources. diff --git a/_posts/2013-08-08-elixir-design-goals.markdown b/_posts/2013-08-08-elixir-design-goals.markdown index 5959dab92..47fa06cf1 100644 --- a/_posts/2013-08-08-elixir-design-goals.markdown +++ b/_posts/2013-08-08-elixir-design-goals.markdown @@ -203,9 +203,9 @@ Enum.map set, fn(x) -> x * 2 end #=> [2, 4, 6] ``` -Not only that, any developer can **extend** the `Enum` module to work with any data type as long as the data type implements [the `Enumerable` protocol](https://hexdocs.pm/elixir/Enumerable.html) (protocols in Elixir are based on Clojure's protocol). This is extremely convenient because the developer needs to know only the `Enum` API for enumeration, instead of memorizing specific APIs for sets, lists, dicts, etc. +Not only that, any developer can **extend** the `Enum` module to work with any data type as long as the data type implements [the `Enumerable` protocol](https://elixir.hexdocs.pm/Enumerable.html) (protocols in Elixir are based on Clojure's protocol). This is extremely convenient because the developer needs to know only the `Enum` API for enumeration, instead of memorizing specific APIs for sets, lists, dicts, etc. -There are many other protocols exposed by the language, like [the `Inspect` protocol](https://hexdocs.pm/elixir/Inspect.html) for pretty printing data structures and [the `Access` protocol](https://hexdocs.pm/elixir/Access.html) for accessing key-value data by key. By being extensible, Elixir ensures developers can work **with** the language, instead of **against** the language. +There are many other protocols exposed by the language, like [the `Inspect` protocol](https://elixir.hexdocs.pm/Inspect.html) for pretty printing data structures and [the `Access` protocol](https://elixir.hexdocs.pm/Access.html) for accessing key-value data by key. By being extensible, Elixir ensures developers can work **with** the language, instead of **against** the language. ## Summing up @@ -213,4 +213,4 @@ The goal of this post was to sumarize the language goals: compatibility, product We also hope to have clarified what Elixir brings to the Erlang VM, in particular, meta-programming through macros, polymorphic constructs for extensibility and a data-focused standard library with extensible and consistent APIs for diverse types, including strict and lazy enumeration, unicode handling, a test framework and more. -Give Elixir a try! You can start with our [getting started guide](https://hexdocs.pm/elixir/introduction.html), or check out our sidebar for other learning resources. +Give Elixir a try! You can start with our [getting started guide](https://elixir.hexdocs.pm/introduction.html), or check out our sidebar for other learning resources. diff --git a/_posts/2013-11-05-elixir-v0-11-0-released.markdown b/_posts/2013-11-05-elixir-v0-11-0-released.markdown index 1a668262c..669b41fe3 100644 --- a/_posts/2013-11-05-elixir-v0-11-0-released.markdown +++ b/_posts/2013-11-05-elixir-v0-11-0-released.markdown @@ -23,7 +23,7 @@ In this new release, IEx also supports a very simple debugging mechanism called ![IEx pry example](/images/contents/iex-pry.png) -In Elixir, your code runs in many processes that talk to each other and the Elixir shell is no different. `IEx.pry` allows another process to take over the shell, allowing the developer to inspect the binding and halt the execution of the process being "pried" (i.e. the one that invoked `IEx.pry`). We called this feature `pry` as a gentle reminder that you can only inspect existing information, you cannot change the binding over a pried process. For more information, check the docs for [`IEx.pry/1`](https://hexdocs.pm/iex/IEx.html#pry/1). +In Elixir, your code runs in many processes that talk to each other and the Elixir shell is no different. `IEx.pry` allows another process to take over the shell, allowing the developer to inspect the binding and halt the execution of the process being "pried" (i.e. the one that invoked `IEx.pry`). We called this feature `pry` as a gentle reminder that you can only inspect existing information, you cannot change the binding over a pried process. For more information, check the docs for [`IEx.pry/1`](https://iex.hexdocs.pm/IEx.html#pry/1). ## ExUnit @@ -60,14 +60,14 @@ fun.(1..3) #=> true ``` -You can learn more about the [new capture operator in our docs](https://hexdocs.pm/elixir/Kernel.SpecialForms.html#&/1). +You can learn more about the [new capture operator in our docs](https://elixir.hexdocs.pm/Kernel.SpecialForms.html#&/1). -We have also pushed improvements to [the String module](https://hexdocs.pm/elixir/String.html), including new APIs. In particular, in order to know that `String.length("josé")` has length 4 (even though it takes 5 bytes to be represented in UTF-8), we need to use some algorithms defined by the Unicode Standard. These have been implemented as specified in the [extended grapheme cluster algorithm, defined in the version 6.3.0 of the Unicode Standard](http://www.unicode.org/reports/tr29/). +We have also pushed improvements to [the String module](https://elixir.hexdocs.pm/String.html), including new APIs. In particular, in order to know that `String.length("josé")` has length 4 (even though it takes 5 bytes to be represented in UTF-8), we need to use some algorithms defined by the Unicode Standard. These have been implemented as specified in the [extended grapheme cluster algorithm, defined in the version 6.3.0 of the Unicode Standard](http://www.unicode.org/reports/tr29/). In the optimization front, we have pushed the first iteration of a [feature called Protocol consolidation](https://groups.google.com/forum/#!topic/elixir-lang-core/RoXAUtoyjk4), which speeds up the polymorphic dispatch done by protocols, sometimes reducing the dispatching time to 10% of the original time. We will continue working in upcoming releases to integrate protocol consolidation as a regular part of the developer workflow. And finally, a minor but frequently asked feature has finally arrived into Elixir: variables follow the same rules as other identifiers in the language, which means developers can now name their variables `is_atom?`. For a general overview, [check out the CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.11.0/CHANGELOG.md). -Give Elixir a try! You can start with our [getting started guide](https://hexdocs.pm/elixir/introduction.html), or check out our sidebar for other learning resources. +Give Elixir a try! You can start with our [getting started guide](https://elixir.hexdocs.pm/introduction.html), or check out our sidebar for other learning resources. **PS:** We have just released v0.11.1 which addresses a regression in Mix and improves the dependencies update process. diff --git a/_posts/2013-12-15-elixir-v0-12-0-released.markdown b/_posts/2013-12-15-elixir-v0-12-0-released.markdown index fe8a349e3..c5ed5b8be 100644 --- a/_posts/2013-12-15-elixir-v0-12-0-released.markdown +++ b/_posts/2013-12-15-elixir-v0-12-0-released.markdown @@ -50,4 +50,4 @@ Eric is also maintainer of both [Ecto](https://github.com/elixir-ecto/ecto) and There were other small changes, like additions to the `Float` module and improvements the to the typespec syntax. To see the full list, please [see the CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.12.0/CHANGELOG.md). -Give Elixir a try! You can start with our [getting started guide](https://hexdocs.pm/elixir/introduction.html), or check out our sidebar for other learning resources. +Give Elixir a try! You can start with our [getting started guide](https://elixir.hexdocs.pm/introduction.html), or check out our sidebar for other learning resources. diff --git a/_posts/2014-04-21-elixir-v0-13-0-released.markdown b/_posts/2014-04-21-elixir-v0-13-0-released.markdown index 995e4d68c..2d9c09b32 100644 --- a/_posts/2014-04-21-elixir-v0-13-0-released.markdown +++ b/_posts/2014-04-21-elixir-v0-13-0-released.markdown @@ -29,13 +29,13 @@ In a nutshell, here is what new: * Elixir v0.13 also provides structs, an alternative to Elixir records. Structs are more flexible than records, provide faster polymorphic operations, and still provide the same compile-time guarantees many came to love in records; -* The [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) was rewritten from scratch. The previous guide was comprised of 7 chapters and was about to become 2 years old. The new guide features 20 chapters, it explores the new maps and structs (which are part of this release), and it goes deeper into topics like IO and File handling. It also includes an extra guide, still in development, about [Meta-Programming in Elixir](https://hexdocs.pm/elixir/quote-and-unquote.html); +* The [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) was rewritten from scratch. The previous guide was comprised of 7 chapters and was about to become 2 years old. The new guide features 20 chapters, it explores the new maps and structs (which are part of this release), and it goes deeper into topics like IO and File handling. It also includes an extra guide, still in development, about [Meta-Programming in Elixir](https://elixir.hexdocs.pm/quote-and-unquote.html); -* Elixir v0.13 provides a new comprehension syntax that not only works with lists, but with any [`Enumerable`](https://hexdocs.pm/elixir/Enumerable.html). The output of a comprehension is also extensible via the [`Collectable`](https://hexdocs.pm/elixir/Collectable.html) protocol; +* Elixir v0.13 provides a new comprehension syntax that not only works with lists, but with any [`Enumerable`](https://elixir.hexdocs.pm/Enumerable.html). The output of a comprehension is also extensible via the [`Collectable`](https://elixir.hexdocs.pm/Collectable.html) protocol; * Mix, Elixir's build tool, has been improved in order to provide better workflows when compiling projects and working with dependencies; -* There are many other changes, like the addition of [StringIO](https://hexdocs.pm/elixir/StringIO.html), support for [tags and filters in ExUnit](https://hexdocs.pm/ex_unit/ExUnit.Case.html) and more. Please check the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.13.0/CHANGELOG.md) for the complete list. +* There are many other changes, like the addition of [StringIO](https://elixir.hexdocs.pm/StringIO.html), support for [tags and filters in ExUnit](https://ex-unit.hexdocs.pm/ExUnit.Case.html) and more. Please check the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.13.0/CHANGELOG.md) for the complete list. Even with all those improvements, Elixir v0.13.0 is backwards compatible with Elixir v0.12.5 and upgrading should be a clean process. @@ -69,7 +69,7 @@ iex> %{"other" => value} = map A map pattern will match any map that has all the keys specified in the pattern. The values for the matching keys must also match. For example, `%{"hello" => world}` will match any map that has the key `"hello"` and assign the value to `world`, while `%{"hello" => "world"}` will match any map that has the key `"hello"` with value equals to `"world"`. An empty map pattern (`%{}`) will match all maps. -Developers can use the functions in the [`Map` module](https://hexdocs.pm/elixir/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](https://hexdocs.pm/elixir/keywords-and-maps.html). Elixir Sips has also released two episodes that cover maps ([part 1](http://elixirsips.com/episodes/054_maps_part_1.html) and [part 2](http://elixirsips.com/episodes/055_maps_part_2.html)). +Developers can use the functions in the [`Map` module](https://elixir.hexdocs.pm/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](https://elixir.hexdocs.pm/keywords-and-maps.html). Elixir Sips has also released two episodes that cover maps ([part 1](http://elixirsips.com/episodes/054_maps_part_1.html) and [part 2](http://elixirsips.com/episodes/055_maps_part_2.html)). Maps also provide special syntax for creating, accessing and updating maps with atom keys: @@ -180,13 +180,13 @@ The `__struct__` field is also used for polymorphic dispatch in protocols, addre It is interesting to note that structs solve both drawbacks we have earlier mentioned regarding records. Structs are purely data and polymorphic dispatch is now faster and more robust as it happens only for explicitly tagged structs. -For more information on structs, check out the [Structs chapter in the getting started guide](https://hexdocs.pm/elixir/structs.html) (you may also want to read the new [Protocols chapter](https://hexdocs.pm/elixir/protocols.html) after it). +For more information on structs, check out the [Structs chapter in the getting started guide](https://elixir.hexdocs.pm/structs.html) (you may also want to read the new [Protocols chapter](https://elixir.hexdocs.pm/protocols.html) after it). ## Maps, structs and the future With the introduction of maps and structs, some deprecations will arrive on upcoming releases. First of all, the `ListDict` data structure is being deprecated and phased out. Records are also being deprecated from the language, although it is going to be a longer process, as many projects and Elixir itself still use records in diverse occasions. -Note though only Elixir records are being deprecated. Erlang records, which are basically syntax sugar around tuples, will remain in the language for the rare cases Elixir developers need to interact with Erlang libraries that provide records. In particular, the [Record](https://hexdocs.pm/elixir/Record.html) has been updated to provide the new Record API (while keeping the old one for backwards compatibility). +Note though only Elixir records are being deprecated. Erlang records, which are basically syntax sugar around tuples, will remain in the language for the rare cases Elixir developers need to interact with Erlang libraries that provide records. In particular, the [Record](https://elixir.hexdocs.pm/Record.html) has been updated to provide the new Record API (while keeping the old one for backwards compatibility). Finally, structs are still in active development and new features, like `@derive`, should land in upcoming Elixir releases. For those interested, the [original maps and structs proposal is still available](https://gist.github.com/josevalim/b30c881df36801611d13). @@ -223,7 +223,7 @@ iex> for <>, c != ?\s, into: "", do: <> "helloworld" ``` -Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the [`Collectable` protocol](https://hexdocs.pm/elixir/Collectable.html). +Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the [`Collectable` protocol](https://elixir.hexdocs.pm/Collectable.html). For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can implement an echo terminal that returns whatever is typed into the shell, but in upcase, using comprehensions: @@ -276,8 +276,8 @@ That said, in the next months we plan to: * Integrate applications configuration (provided by OTP) right into Mix; * Provide an Elixir logger that knows how to print and format Elixir exceptions and stacktraces; -* Properly expose the functionality provided by Applications, Supervisors, GenServers and GenEvents and study how they can integrate with Elixir. For example, how to consume events from GenEvent as a [stream of data](https://hexdocs.pm/elixir/Stream.html)? +* Properly expose the functionality provided by Applications, Supervisors, GenServers and GenEvents and study how they can integrate with Elixir. For example, how to consume events from GenEvent as a [stream of data](https://elixir.hexdocs.pm/Stream.html)? * Study how patterns like tasks and agents can be integrated into the language, often picking up the lessons learned by libraries like [e2](http://e2project.org/erlang.html) and [functionality exposed by OTP itself](http://www.erlang.org/doc/man/rpc.html); * Rewrite the Mix and ExUnit guides to focus on applications and OTP as a whole, rebranding it to "Building Apps with Mix and OTP"; -You can learn more about Elixir in our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) and download this release in the [v0.13 announcement](https://github.com/elixir-lang/elixir/releases/tag/v0.13.0). We hope to see you at [ElixirConf](http://elixirconf.com/) as well as pushing your packages to [hex.pm](https://hex.pm/). +You can learn more about Elixir in our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) and download this release in the [v0.13 announcement](https://github.com/elixir-lang/elixir/releases/tag/v0.13.0). We hope to see you at [ElixirConf](http://elixirconf.com/) as well as pushing your packages to [hex.pm](https://hex.pm/). diff --git a/_posts/2014-06-17-elixir-v0-14-0-released.markdown b/_posts/2014-06-17-elixir-v0-14-0-released.markdown index cfa23e5ca..e7a431f66 100644 --- a/_posts/2014-06-17-elixir-v0-14-0-released.markdown +++ b/_posts/2014-06-17-elixir-v0-14-0-released.markdown @@ -41,7 +41,7 @@ Structs allow us to provide default values for a map fields. Structs also valida #=> ** (CompileError) iex:2: unknown key :unknown for struct User ``` -We say structs are *raw* because they do not implement any of the protocols that are implemented for maps by default. For instance, we can call `Enum.each/2` for a map, which uses the [`Enumerable`](https://hexdocs.pm/elixir/Enumerable.html) protocol: +We say structs are *raw* because they do not implement any of the protocols that are implemented for maps by default. For instance, we can call `Enum.each/2` for a map, which uses the [`Enumerable`](https://elixir.hexdocs.pm/Enumerable.html) protocol: ```elixir Enum.each %{foo: :bar}, fn {k, v} -> @@ -135,19 +135,19 @@ update_in dungeon.rooms[room_id].users[user_id].device_codes, &Set.delete(&1, co put_in dungeon, [:rooms, room_id, :users, user_id, :username], "new username" ``` -You can read more information about nested access in [the Access protocol documentation](https://hexdocs.pm/elixir/Access.html) and in the docs for [`get_in/2`](https://hexdocs.pm/elixir/Kernel.html#get_in/2) and friends. +You can read more information about nested access in [the Access protocol documentation](https://elixir.hexdocs.pm/Access.html) and in the docs for [`get_in/2`](https://elixir.hexdocs.pm/Kernel.html#get_in/2) and friends. ## Mix and OTP OTP is a set of libraries that ships with Erlang. Erlang developers use OTP to build robust, fault-tolerant applications. -In v0.14.0, Elixir closely integrates with OTP by providing modules for building [servers](https://hexdocs.pm/elixir/GenServer.html), [supervisors](https://hexdocs.pm/elixir/Supervisor.html) and [applications](https://hexdocs.pm/elixir/Application.html). +In v0.14.0, Elixir closely integrates with OTP by providing modules for building [servers](https://elixir.hexdocs.pm/GenServer.html), [supervisors](https://elixir.hexdocs.pm/Supervisor.html) and [applications](https://elixir.hexdocs.pm/Application.html). -We have also introduced the concepts of [agents](https://hexdocs.pm/elixir/Agent.html) and the idea of [tasks](https://hexdocs.pm/elixir/Task.html), which can be supervised and distributed. Application configuration has been made first class in Mix, allowing developers to configure their dependencies, sometimes even using different configurations per environment (dev, test or prod by default). +We have also introduced the concepts of [agents](https://elixir.hexdocs.pm/Agent.html) and the idea of [tasks](https://elixir.hexdocs.pm/Task.html), which can be supervised and distributed. Application configuration has been made first class in Mix, allowing developers to configure their dependencies, sometimes even using different configurations per environment (dev, test or prod by default). -This functionality is at the core of building applications in Erlang and Elixir. For this reason we have published a new guide called [Mix and OTP](https://hexdocs.pm/elixir/introduction-to-mix.html) where we build a distributed key-value store to help explore all concepts mentioned above. The guide is quite fresh, so please do submit pull requests for typos and mistakes. Feedback is also welcome! +This functionality is at the core of building applications in Erlang and Elixir. For this reason we have published a new guide called [Mix and OTP](https://elixir.hexdocs.pm/introduction-to-mix.html) where we build a distributed key-value store to help explore all concepts mentioned above. The guide is quite fresh, so please do submit pull requests for typos and mistakes. Feedback is also welcome! -Note "Mix and OTP" is our most advanced guide so far and it expects you to have read our introductory guide. In case you haven't yet, you can [get started here](https://hexdocs.pm/elixir/introduction.html). +Note "Mix and OTP" is our most advanced guide so far and it expects you to have read our introductory guide. In case you haven't yet, you can [get started here](https://elixir.hexdocs.pm/introduction.html). ## What's next? @@ -155,12 +155,12 @@ With v0.14.0 we have reached many of the milestones [we have set in the previous * Provide an Elixir logger that knows how to print and format Elixir exceptions and stacktraces. Work has already started on this front as Elixir already prints errors coming from the application startup nicely; -* Continue the work of cleaning up the [Kernel module](https://hexdocs.pm/elixir/Kernel.html). In v0.14.0, we added alternatives for conversion functions, like `integer_to_binary/1` to `Integer.to_string/1`, now they must be properly deprecated and removed; +* Continue the work of cleaning up the [Kernel module](https://elixir.hexdocs.pm/Kernel.html). In v0.14.0, we added alternatives for conversion functions, like `integer_to_binary/1` to `Integer.to_string/1`, now they must be properly deprecated and removed; * Support mix aliases, allowing developers to easily define Mix shortcuts for their favorite tasks; * Solve all remaining [open issues](https://github.com/elixir-lang/elixir/issues?state=open). We have always kept the issues tracker tidy and there is little work left to solve the existing issues. Note we have also listed all [upcoming backwards incompatible changes](https://github.com/elixir-lang/elixir/issues?labels=Note%3ABackwards+incompatible&page=1&state=open). Many of those changes will actually be deprecated first and developers should be able to follow along without breaking changes in minor releases, but they are breaking changes in the sense they work in v0.14.0 but will work differently by the time v1.0 is released; -That's all for now! Elixir developers can see [a summary of all changes in v0.14.0 in the release notes](https://github.com/elixir-lang/elixir/releases/tag/v0.14.0). In case you are new around here, you can get started with Elixir by reading [our Getting Started guide](https://hexdocs.pm/elixir/introduction.html). +That's all for now! Elixir developers can see [a summary of all changes in v0.14.0 in the release notes](https://github.com/elixir-lang/elixir/releases/tag/v0.14.0). In case you are new around here, you can get started with Elixir by reading [our Getting Started guide](https://elixir.hexdocs.pm/introduction.html). We hope to see you all this July at [ElixirConf](http://elixirconf.com/)! diff --git a/_posts/2014-08-07-elixir-v0-15-0-released.markdown b/_posts/2014-08-07-elixir-v0-15-0-released.markdown index 32b579555..7d2dab643 100644 --- a/_posts/2014-08-07-elixir-v0-15-0-released.markdown +++ b/_posts/2014-08-07-elixir-v0-15-0-released.markdown @@ -17,7 +17,7 @@ If you are interested in the specific details for this release, [please check ou ## Logger -Elixir now ships with a new application called logger. This application provides [the Logger module](https://hexdocs.pm/logger/Logger.html), which is the main API developers will use for logging: +Elixir now ships with a new application called logger. This application provides [the Logger module](https://logger.hexdocs.pm/Logger.html), which is the main API developers will use for logging: ```elixir require Logger @@ -71,7 +71,7 @@ Function: #Function<20.90072148/0 in :erl_eval.expr/5> As soon as we started working on Logger, we realized we could go further than simply translating Erlang messages and provide a fully featured logger library. At this moment, Logger also supports: * 4 log levels: debug, info, warn and error - * Custom formatting: you can specify a format string that tells exactly how messages should be logged. The default string is: "$time $metadata[$level] $message\n" but [many attributes are supported](https://hexdocs.pm/logger/Logger.Formatter.html) + * Custom formatting: you can specify a format string that tells exactly how messages should be logged. The default string is: "$time $metadata[$level] $message\n" but [many attributes are supported](https://logger.hexdocs.pm/Logger.Formatter.html) * Custom translators: so you can translate log messages coming from any Erlang application into Elixir syntax * Metadata: metadata allows developers to store information in the current process that will be available to all logged messages. For example, a web application can generate a `request_id`, store it as metadata, and all messages logged during that request will be properly identified with `request_id=...` in the log @@ -137,7 +137,7 @@ In other words, aliases can be three different structures: 2. An anonymous function (that is invoked passing the task arguments) 3. A list containing strings or anonymous functions -You can find more information about aliases by reading the [Mix documentation](https://hexdocs.pm/mix/) (there is a section about Aliases around the middle). +You can find more information about aliases by reading the [Mix documentation](https://mix.hexdocs.pm/) (there is a section about Aliases around the middle). We also would like to thank [Anthony Grimes](https://github.com/raynes) for the support and [Phil Halgelberg](https://github.com/technomancy) for [the work on Lein](https://github.com/technomancy/leiningen) which Mix borrows a lot from. @@ -163,4 +163,4 @@ Alexei is also interested in how we can extend our tooling to the Erlang ecosyst We are very close to launch Elixir v1.0! All planned features are already in Elixir's codebase and at the moment there are only [four open issues in our tracker tagged with the v1.0 milestone](https://github.com/elixir-lang/elixir/issues?q=is%3Aopen+is%3Aissue+milestone%3Av1.0). -Our estimated date for the first release candidate for Elixir v1.0 is August 30th. This means there is no better time to learn Elixir than now! If you haven't started yet, you can get started with Elixir by reading [our Getting Started guide](https://hexdocs.pm/elixir/introduction.html) or by checking one of the many "Learning Resources" on the sidebar. +Our estimated date for the first release candidate for Elixir v1.0 is August 30th. This means there is no better time to learn Elixir than now! If you haven't started yet, you can get started with Elixir by reading [our Getting Started guide](https://elixir.hexdocs.pm/introduction.html) or by checking one of the many "Learning Resources" on the sidebar. diff --git a/_posts/2014-09-18-elixir-v1-0-0-released.markdown b/_posts/2014-09-18-elixir-v1-0-0-released.markdown index 72929864c..c79b2cd0f 100644 --- a/_posts/2014-09-18-elixir-v1-0-0-released.markdown +++ b/_posts/2014-09-18-elixir-v1-0-0-released.markdown @@ -23,12 +23,12 @@ Elixir will follow [semantic versioning](http://semver.org), which means code wr Elixir is composed of 6 applications, all under the same versioning constraints: - * [Elixir](https://hexdocs.pm/elixir/) - the Elixir compiler, runtime and the standard library - * [EEx](https://hexdocs.pm/eex/) - Elixir's templating library, useful for generating any kind of document dynamically - * [ExUnit](https://hexdocs.pm/ex_unit/) - Elixir's unit test library, with support for concurrent testing, custom formatters, filters and much more - * [IEx](https://hexdocs.pm/iex/) - Elixir's interactive shell with code reloading, auto-complete, and easy access to documentation, typespecs and more - * [Logger](https://hexdocs.pm/logger/) - the latest addition to the group, Logger provides reliable logging and configurable backends (with syslog, file and many other backends provided by the community) - * [Mix](https://hexdocs.pm/mix/) - Elixir's build tool that generates, compiles and tests projects as well as manages your dependencies + * [Elixir](https://elixir.hexdocs.pm/) - the Elixir compiler, runtime and the standard library + * [EEx](https://eex.hexdocs.pm/) - Elixir's templating library, useful for generating any kind of document dynamically + * [ExUnit](https://ex-unit.hexdocs.pm/) - Elixir's unit test library, with support for concurrent testing, custom formatters, filters and much more + * [IEx](https://iex.hexdocs.pm/) - Elixir's interactive shell with code reloading, auto-complete, and easy access to documentation, typespecs and more + * [Logger](https://logger.hexdocs.pm/) - the latest addition to the group, Logger provides reliable logging and configurable backends (with syslog, file and many other backends provided by the community) + * [Mix](https://mix.hexdocs.pm/) - Elixir's build tool that generates, compiles and tests projects as well as manages your dependencies With v1.0, we are providing a stable platform for the community to leverage and extend, and we are extremely excited with the projects and possibilities that are ahead of us! @@ -54,7 +54,7 @@ These expectations also apply to future releases under the v1 branch, except for ## Learn more -You can get started with Elixir via our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html). There are quite some Elixir books out there too, now getting sent to the presses, quite a few can be found in the sidebar, which also includes screencasts and other resources. +You can get started with Elixir via our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html). There are quite some Elixir books out there too, now getting sent to the presses, quite a few can be found in the sidebar, which also includes screencasts and other resources. You can also learn more about Elixir by checking out [the videos from ElixirConf 2014](http://www.confreaks.com/events/elixirconf2014), the first (and so far the best) Elixir conference ever! You can learn more about [the language history](http://www.confreaks.com/videos/4134-elixirconf2014-keynote-elixir), [how Elixir can change the way you code](http://www.confreaks.com/videos/4119-elixirconf2014-opening-keynote-think-different) or [even hear stories of how Elixir is being used in production](http://www.confreaks.com/videos/4131-elixirconf2014-otp-in-production-the-nitty-gritty-details-of-game-servers). diff --git a/_posts/2015-09-28-elixir-v1-1-0-released.markdown b/_posts/2015-09-28-elixir-v1-1-0-released.markdown index 5adecea87..f81a53293 100644 --- a/_posts/2015-09-28-elixir-v1-1-0-released.markdown +++ b/_posts/2015-09-28-elixir-v1-1-0-released.markdown @@ -21,7 +21,7 @@ Mix also provides faster re-compilation times. Every time you compile your Elixi We have also seen great progress on areas that go beyond the source code. In particular, we have added a [CODE\_OF\_CONDUCT.md](https://github.com/elixir-lang/elixir/blob/v1.1/CODE_OF_CONDUCT.md) to guarantee our community continues to grow into a safe and welcoming place for everyone. -We have also released a new ExDoc version. It provides a [beautiful, clean and readable way to navigate the Elixir documentation](https://hexdocs.pm/elixir/1.1.0) and it is available to any Elixir project. The latest version includes initial support for User Guides and we have more features and improvements coming on the way. +We have also released a new ExDoc version. It provides a [beautiful, clean and readable way to navigate the Elixir documentation](https://elixir.hexdocs.pm/1.1.0) and it is available to any Elixir project. The latest version includes initial support for User Guides and we have more features and improvements coming on the way. The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.1.0). Don't forget to check [the Install section](/install.html) to get Elixir installed. diff --git a/_posts/2016-01-03-elixir-v1-2-0-released.markdown b/_posts/2016-01-03-elixir-v1-2-0-released.markdown index 1b8a7efd8..1639dca74 100644 --- a/_posts/2016-01-03-elixir-v1-2-0-released.markdown +++ b/_posts/2016-01-03-elixir-v1-2-0-released.markdown @@ -9,7 +9,7 @@ excerpt: Elixir v1.2 brings enhancements, bug fixes, performance improvements an v1.2 brings enhancements, bug fixes, performance improvements and more into Elixir. Elixir v1.2 relies on many features in Erlang 18, requiring at least Erlang 18+. Upgrading to Erlang 18 is therefore necessary before upgrading Elixir. -To celebrate this release and the new year, we have also reviewed both the [Getting Started](https://hexdocs.pm/elixir/introduction.html) and [Mix & OTP](https://hexdocs.pm/elixir/introduction-to-mix.html) guides, bringing it up to date and exploring new functionalities added since Elixir v1.0. +To celebrate this release and the new year, we have also reviewed both the [Getting Started](https://elixir.hexdocs.pm/introduction.html) and [Mix & OTP](https://elixir.hexdocs.pm/introduction-to-mix.html) guides, bringing it up to date and exploring new functionalities added since Elixir v1.0. ## Erlang 18 support @@ -113,6 +113,6 @@ These are great additions on top of the faster compilation times we have achieve With Rebar 3 gaining more adoption in the Erlang community, Mix is now able to fetch and compile Rebar 3 dependencies. This feature is currently experimental and therefore opt-in: if you have a Rebar 3 dependency, you can ask Mix to use Rebar 3 to compile it by passing the `manager: :rebar3` option. Once configured, Mix will prompt you to install Rebar 3 if it is not yet available. -The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.2.0). Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.2.0). Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Happy coding! diff --git a/_posts/2016-06-21-elixir-v1-3-0-released.markdown b/_posts/2016-06-21-elixir-v1-3-0-released.markdown index 3ee45d0e0..e6a63616c 100644 --- a/_posts/2016-06-21-elixir-v1-3-0-released.markdown +++ b/_posts/2016-06-21-elixir-v1-3-0-released.markdown @@ -283,6 +283,6 @@ By restricting hierarchies in favor of named setups, it is straight-forward for ## Summing up -The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.3.0). Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.3.0). Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Happy coding! diff --git a/_posts/2016-07-14-announcing-genstage.markdown b/_posts/2016-07-14-announcing-genstage.markdown index 7a853d043..72e3cbcd7 100644 --- a/_posts/2016-07-14-announcing-genstage.markdown +++ b/_posts/2016-07-14-announcing-genstage.markdown @@ -9,7 +9,7 @@ excerpt: GenStage is a new Elixir behaviour for exchanging events with back-pres Today we are glad to announce the official release of GenStage. GenStage is a new Elixir behaviour for exchanging events with back-pressure between Elixir processes. In the short-term, we expect GenStage to replace the use cases for GenEvent as well as providing a composable abstraction for consuming data from third-party systems. -In this blog post we will cover the background that led us to GenStage, some example use cases, and what we are exploring for future releases. If instead you are looking for a quick reference, [check the project source code](https://github.com/elixir-lang/gen_stage) and [access its documentation](https://hexdocs.pm/gen_stage/Experimental.GenStage.html). +In this blog post we will cover the background that led us to GenStage, some example use cases, and what we are exploring for future releases. If instead you are looking for a quick reference, [check the project source code](https://github.com/elixir-lang/gen_stage) and [access its documentation](https://gen-stage.hexdocs.pm/GenStage.html). ## Background @@ -46,7 +46,7 @@ File.stream!("path/to/some/file") |> Enum.to_list() ``` -By using `File.stream!` and `Stream.flat_map`, we build a lazy computation that will emit a single line, break that line into words, and emit such words one by one without building huge lists in memory when enumerated. The functions in the [Stream module](https://hexdocs.pm/elixir/Stream.html) just express the computation we want to perform. The computation itself, like traversing the file or breaking into words in `flat_map`, only happens when we call a function in the `Enum` module. We have covered [the foundation for Enum and Streams](https://dashbit.co/blog/introducing-reducees) in another article. +By using `File.stream!` and `Stream.flat_map`, we build a lazy computation that will emit a single line, break that line into words, and emit such words one by one without building huge lists in memory when enumerated. The functions in the [Stream module](https://elixir.hexdocs.pm/Stream.html) just express the computation we want to perform. The computation itself, like traversing the file or breaking into words in `flat_map`, only happens when we call a function in the `Enum` module. We have covered [the foundation for Enum and Streams](https://dashbit.co/blog/introducing-reducees) in another article. The solution above allows us to work with large datasets without loading them all into memory. For large files, it is going to provide much better performance than the eager version. However, the solution above still does not leverage concurrency. For a machine with more than one core, which is the huge majority of machines we have available today, it is a suboptimal solution. @@ -193,7 +193,7 @@ Process.sleep(:infinity) By simply starting multiple consumers, the stage `B` will now receive demand from multiple stages and dispatch events to those stages which are now running concurrently, always picking the stage that is able to process more items. We can also leverage concurrency from the opposite direction: if the producer is the slow stage in a pipeline, you can start multiple producers and have each consumer subscribe to them. -In order to know which consumer should receive a particular event, producer stages depend on a behaviour called [`GenStage.Dispatcher`](https://hexdocs.pm/gen_stage/Experimental.GenStage.Dispatcher.html). The default dispatcher is the `GenStage.DemandDispatcher` we have briefly described above: it will collect the demand from different consumers and dispatch to the one with highest demand. This means if one consumer is slow, maybe because we increased its sleeping time to 10 seconds, it will receive less items. +In order to know which consumer should receive a particular event, producer stages depend on a behaviour called [`GenStage.Dispatcher`](https://gen-stage.hexdocs.pm/Experimental.GenStage.Dispatcher.html). The default dispatcher is the `GenStage.DemandDispatcher` we have briefly described above: it will collect the demand from different consumers and dispatch to the one with highest demand. This means if one consumer is slow, maybe because we increased its sleeping time to 10 seconds, it will receive less items. ### GenStage for data-ingestion @@ -205,9 +205,9 @@ During the Elixir London Meetup, I have live-coded a short example that shows ho ### GenStage for event dispatching -Another scenario where GenStage can be useful today is to replace cases where developers would have used [GenEvent](https://hexdocs.pm/elixir/GenEvent.html) in the past. For those unfamiliar with GenEvent, it is a behaviour where events are sent to an "event manager" which then proceeds to invoke "event handlers" for each event. GenEvent, however, has one big flaw: the event manager and all event handlers run in the same process. This means GenEvent handlers cannot easily leverage concurrency without forcing developers to implement those mechanisms themselves. Furthermore, GenEvent handlers have very awkward error semantics. Because event handlers are not separate processes, we cannot simply rely on supervisors restarting them. +Another scenario where GenStage can be useful today is to replace cases where developers would have used [GenEvent](https://elixir.hexdocs.pm/GenEvent.html) in the past. For those unfamiliar with GenEvent, it is a behaviour where events are sent to an "event manager" which then proceeds to invoke "event handlers" for each event. GenEvent, however, has one big flaw: the event manager and all event handlers run in the same process. This means GenEvent handlers cannot easily leverage concurrency without forcing developers to implement those mechanisms themselves. Furthermore, GenEvent handlers have very awkward error semantics. Because event handlers are not separate processes, we cannot simply rely on supervisors restarting them. -GenStage solves those problems by having a producer as the event manager. The producer itself should be configured to use [`GenStage.BroadcastDispatcher`](https://hexdocs.pm/gen_stage/Experimental.GenStage.BroadcastDispatcher.html) as its dispatcher. The broadcast dispatcher will guarantee events are dispatched to all consumers in a way that does not exceed the demand of any of the consumers. This allows us to leverage concurrency and having the "event manager" as a producer gives us much more flexibility in terms of buffering and reacting to failures. +GenStage solves those problems by having a producer as the event manager. The producer itself should be configured to use [`GenStage.BroadcastDispatcher`](https://gen-stage.hexdocs.pm/Experimental.GenStage.BroadcastDispatcher.html) as its dispatcher. The broadcast dispatcher will guarantee events are dispatched to all consumers in a way that does not exceed the demand of any of the consumers. This allows us to leverage concurrency and having the "event manager" as a producer gives us much more flexibility in terms of buffering and reacting to failures. Let's see an example of building an event manager as a producer: @@ -295,7 +295,7 @@ Such guarantees that, if a supervised `EventHandler` crashes, the supervisor wil With the release of GenStage v0.3.0, we have reached an important milestone as `GenStage` can be used as both event managers and a way to exchange events between processes, often external data sources, with back-pressure. -The v0.3.0 release also includes the [`GenStage.stream`](https://hexdocs.pm/gen_stage/Experimental.GenStage.html#stream/1) function, which allows us to consume data from a GenStage as a stream, and [`GenStage.from_enumerable`](https://hexdocs.pm/gen_stage/Experimental.GenStage.html#from_enumerable/2) which allows us to use an enumerable or a stream, like `File.stream!`, as a producer. Closing the gap between stages and streams. +The v0.3.0 release also includes the [`GenStage.stream`](https://gen-stage.hexdocs.pm/Experimental.GenStage.html#stream/1) function, which allows us to consume data from a GenStage as a stream, and [`GenStage.from_enumerable`](https://gen-stage.hexdocs.pm/Experimental.GenStage.html#from_enumerable/2) which allows us to use an enumerable or a stream, like `File.stream!`, as a producer. Closing the gap between stages and streams. However, we are far from done! @@ -320,7 +320,7 @@ File.stream!("path/to/some/file") |> Enum.to_list() ``` -While the above is helpful when working with large or infinite collections, it still does not leverage concurrency. To address that, we are currently exploring a solution named [`GenStage.Flow`](https://hexdocs.pm/gen_stage/Experimental.Flow.html), that allows us to express our computations similarly to streams, except they will run across multiple stages instead of a single process: +While the above is helpful when working with large or infinite collections, it still does not leverage concurrency. To address that, we are currently exploring a solution named [`GenStage.Flow`](https://gen-stage.hexdocs.pm/Experimental.Flow.html), that allows us to express our computations similarly to streams, except they will run across multiple stages instead of a single process: ```elixir alias Experimental.GenStage.Flow @@ -351,7 +351,7 @@ File.stream!("path/to/some/file", read_ahead: 100_000) # NEW! |> Enum.to_list() ``` -Flow will look at the computations we want to perform and start a series of stages to execute our code while keeping the amount of data being transferred between processes to a minimum. If you are interested in `GenStage.Flow` and how the computations above are spread across multiple stages, [we have written some documentation based on the prototypes we have built so far](https://hexdocs.pm/gen_stage/Experimental.Flow.html). The code itself is coming in future GenStage releases. We will also have to consider how the `GenStage.Flow` API mirrors the functions in `Enum` and `Stream` to make the path from eager to concurrent clearer. +Flow will look at the computations we want to perform and start a series of stages to execute our code while keeping the amount of data being transferred between processes to a minimum. If you are interested in `GenStage.Flow` and how the computations above are spread across multiple stages, [we have written some documentation based on the prototypes we have built so far](https://gen-stage.hexdocs.pm/Experimental.Flow.html). The code itself is coming in future GenStage releases. We will also have to consider how the `GenStage.Flow` API mirrors the functions in `Enum` and `Stream` to make the path from eager to concurrent clearer. For the word counting problem with a fixed data, early experiments show a linear increase in performance with a fixed overhead of 20%. In other words, a dataset that takes 60s with a single core, takes 36s on a machine with 2 cores and 18s in one with 4 cores. All of those gains by simply moving your computations from streams to Flow. We plan to benchmark on machines with over 40 cores soon. diff --git a/_posts/2017-01-05-elixir-v1-4-0-released.markdown b/_posts/2017-01-05-elixir-v1-4-0-released.markdown index f110bb07e..aa818a916 100644 --- a/_posts/2017-01-05-elixir-v1-4-0-released.markdown +++ b/_posts/2017-01-05-elixir-v1-4-0-released.markdown @@ -13,7 +13,7 @@ In this post we will cover the main additions. The complete [release notes](http ## Registry -The [`Registry`](https://hexdocs.pm/elixir/Registry.html) is a new module in Elixir's standard library that allows Elixir developers to implement patterns such as name lookups, code dispatching or even a pubsub system in a simple and scalable way. +The [`Registry`](https://elixir.hexdocs.pm/Registry.html) is a new module in Elixir's standard library that allows Elixir developers to implement patterns such as name lookups, code dispatching or even a pubsub system in a simple and scalable way. Broadly speaking, the Registry is a local, decentralized and scalable key-value process storage. Let's break this in parts: @@ -130,6 +130,6 @@ It is also possible to install escripts and archives by providing a Git/GitHub r ## Summing up -The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.4.0). Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.4.0). Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Happy coding! diff --git a/_posts/2017-07-25-elixir-v1-5-0-released.markdown b/_posts/2017-07-25-elixir-v1-5-0-released.markdown index c4f38f788..13c63772a 100644 --- a/_posts/2017-07-25-elixir-v1-5-0-released.markdown +++ b/_posts/2017-07-25-elixir-v1-5-0-released.markdown @@ -29,7 +29,7 @@ saudação = "Bom dia!" Elixir follows the recommendations in [Unicode Annex #31](http://unicode.org/reports/tr31/) to make Elixir more accessible to other languages and communities. Identifiers must still be a sequence of letters, followed by digits and combining marks. This means symbols, such as mathematical notations and emoji, are not allowed in identifiers. -For a complete reference on Elixir syntax, see the [Syntax Reference](https://hexdocs.pm/elixir/1.5/syntax-reference.html). For technical details on Unicode support, see [Unicode Syntax](https://hexdocs.pm/elixir/1.5/unicode-syntax.html). +For a complete reference on Elixir syntax, see the [Syntax Reference](https://elixir.hexdocs.pm/1.5/syntax-reference.html). For technical details on Unicode support, see [Unicode Syntax](https://elixir.hexdocs.pm/1.5/unicode-syntax.html). ## IEx helpers and breakpoints @@ -118,7 +118,7 @@ children = [ The modules `Agent`, `Registry`, `Task`, and `Task.Supervisor` have been updated to include a `child_spec/1` function, allowing them to be used directly in a supervision tree similar to the examples above. `use Agent`, `use GenServer`, `use Supervisor`, and `use Task` have also been updated to automatically define an overridable `child_spec/1` function. -Finally, child specifications are now provided as maps (data-structures) instead of the previous `Supervisor.Spec.worker/3` and `Supervisor.Spec.supervisor/3` APIs. This behaviour also aligns with how supervisors are configured in Erlang/OTP 18+. See the updated [`Supervisor`](https://hexdocs.pm/elixir/1.5/Supervisor.html) docs for more information, as well as the new `Supervisor.init/2` and `Supervisor.child_spec/2` functions. +Finally, child specifications are now provided as maps (data-structures) instead of the previous `Supervisor.Spec.worker/3` and `Supervisor.Spec.supervisor/3` APIs. This behaviour also aligns with how supervisors are configured in Erlang/OTP 18+. See the updated [`Supervisor`](https://elixir.hexdocs.pm/1.5/Supervisor.html) docs for more information, as well as the new `Supervisor.init/2` and `Supervisor.child_spec/2` functions. ## @impl @@ -176,4 +176,4 @@ Overall, using `@impl` has the following advantages: The full list of changes is available in our [release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.5.0). There are many other exciting changes, such as compiler enhancements that reduces compilation times by 10%-15% on averages. When taken into account with the compiler improvements in Erlang/OTP 20 itself, some applications have seen gains up to 30% in compilation times. -Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. diff --git a/_posts/2018-01-17-elixir-v1-6-0-released.markdown b/_posts/2018-01-17-elixir-v1-6-0-released.markdown index 99bc8c441..7f743f30c 100644 --- a/_posts/2018-01-17-elixir-v1-6-0-released.markdown +++ b/_posts/2018-01-17-elixir-v1-6-0-released.markdown @@ -11,25 +11,25 @@ Elixir v1.6 includes new features, enhancements, and bug fixes. The main feature ## Code formatter -The big feature in Elixir v1.6 is the addition of [a code formatter](https://hexdocs.pm/elixir/Code.html#format_string!/2) and an accompanying `mix format` task that adds automatic formatting to your projects. +The big feature in Elixir v1.6 is the addition of [a code formatter](https://elixir.hexdocs.pm/Code.html#format_string!/2) and an accompanying `mix format` task that adds automatic formatting to your projects. The goal of the formatter is to automate the styling of codebases into a unique and consistent layout used across teams and the whole community. Code is now easier to write, as you no longer need to concern yourself with formatting rules. Code is also easier to read, as you no longer need to convert the styles of other developers in your mind. The formatter also helps new developers to learn the language by giving immediate feedback on code structure, and eases code reviews by allowing teams to focus on business rules and code quality rather than code style. -To automatically format your codebase, you can run the [new `mix format` task](https://hexdocs.pm/mix/Mix.Tasks.Format.html). A `.formatter.exs` file may be added to your project root for rudimentary formatter configuration. The mix task also supports flags for CI integration. For instance, you can make your build or a Pull Request fail if the code is not formatted accordingly by using the `--check-formatted` flag. We also recommend developers to check their favorite editor and see if it already provides key bindings for `mix format`, allowing a file or a code snippet to be formatted without hassle. +To automatically format your codebase, you can run the [new `mix format` task](https://mix.hexdocs.pm/Mix.Tasks.Format.html). A `.formatter.exs` file may be added to your project root for rudimentary formatter configuration. The mix task also supports flags for CI integration. For instance, you can make your build or a Pull Request fail if the code is not formatted accordingly by using the `--check-formatted` flag. We also recommend developers to check their favorite editor and see if it already provides key bindings for `mix format`, allowing a file or a code snippet to be formatted without hassle. The Elixir codebase itself [has already been fully formatted](https://github.com/elixir-lang/elixir/issues/6643) and all further contributions are expected to contain formatted code. We recommend existing codebases to be formatted in steps. While the formatter will correctly handle long lines and complex expressions, refactoring the code by breaking those into variables or smaller functions as you format them will lead to overall cleaner and more readable codebases. ## Dynamic Supervisor -Supervisors in Elixir are responsible for starting, shutting down, and restarting child processes when things go wrong. Most of the interaction with supervisors happens through [the `Supervisor` module](https://hexdocs.pm/elixir/Supervisor.html) and it provides three main strategies: `:one_for_one`, `:rest_for_one` and `:one_for_all`. +Supervisors in Elixir are responsible for starting, shutting down, and restarting child processes when things go wrong. Most of the interaction with supervisors happens through [the `Supervisor` module](https://elixir.hexdocs.pm/Supervisor.html) and it provides three main strategies: `:one_for_one`, `:rest_for_one` and `:one_for_all`. However, sometimes the children of a supervisor are not known upfront and are rather started dynamically. For example, if you are building a web server, you have each request being handled by a separate supervised process. Those cases were handled in the Supervisor module under a special strategy called `:simple_one_for_one`. Unfortunately, this special strategy changed the semantics of the supervisor in regards to initialization and shutdown. Plus some APIs expected different inputs or would be completely unavailable depending on the supervision strategy. -Elixir v1.6 addresses this issue by introducing [a new `DynamicSupervisor` module](https://hexdocs.pm/elixir/DynamicSupervisor.html), which encapsulates the old `:simple_one_for_one` strategy and APIs in a proper module while allowing the documentation and API of the `Supervisor` module to focus on its main use cases. Having a separate `DynamicSupervisor` module also makes it simpler to add new features to the dynamic supervisor, such as the new `:max_children` option that limits the maximum number of children supervised dynamically. +Elixir v1.6 addresses this issue by introducing [a new `DynamicSupervisor` module](https://elixir.hexdocs.pm/DynamicSupervisor.html), which encapsulates the old `:simple_one_for_one` strategy and APIs in a proper module while allowing the documentation and API of the `Supervisor` module to focus on its main use cases. Having a separate `DynamicSupervisor` module also makes it simpler to add new features to the dynamic supervisor, such as the new `:max_children` option that limits the maximum number of children supervised dynamically. ## `@deprecated` and `@since` attributes @@ -60,7 +60,7 @@ end `%User{age: age}` is matching on a `User` struct with an age field and `when age >= 16` is the guard. -Since only a handful of constructs are [allowed in guards](https://hexdocs.pm/elixir/guards.html#content), if you were in a situation where you had to check the age to be more than or equal to 16 in multiple places, extracting the guard to a separate function would be [less than obvious and error prone](https://github.com/elixir-lang/elixir/issues/2469). To address those issues, [this release introduces `defguard/1` and `defguardp/1`](https://hexdocs.pm/elixir/Kernel.html#defguard/1): +Since only a handful of constructs are [allowed in guards](https://elixir.hexdocs.pm/guards.html#content), if you were in a situation where you had to check the age to be more than or equal to 16 in multiple places, extracting the guard to a separate function would be [less than obvious and error prone](https://github.com/elixir-lang/elixir/issues/2469). To address those issues, [this release introduces `defguard/1` and `defguardp/1`](https://elixir.hexdocs.pm/Kernel.html#defguard/1): ```elixir defguard is_old_to_drive(age) when age >= 16 @@ -82,11 +82,11 @@ Finally, the breakpoint functionality added [in Elixir v1.5](https://elixir-lang iex> break! SomeFunction.call(:foo, _, _) ``` -For more information, see [`IEx.break!/4`](https://hexdocs.pm/iex/IEx.html#break!/4). +For more information, see [`IEx.break!/4`](https://iex.hexdocs.pm/IEx.html#break!/4). ## mix xref -[`mix xref`](https://hexdocs.pm/mix/Mix.Tasks.Xref.html) is a task added in Elixir v1.3 which provides general information about how modules and files in an application depend on each other. This release brings many improvements to `xref`, extending the reach of the analysis and helping developers digest the vast amount of data it produces. +[`mix xref`](https://mix.hexdocs.pm/Mix.Tasks.Xref.html) is a task added in Elixir v1.3 which provides general information about how modules and files in an application depend on each other. This release brings many improvements to `xref`, extending the reach of the analysis and helping developers digest the vast amount of data it produces. One of such additions is the `--include-siblings` option that can be given to all `xref` commands inside umbrella projects. For example, to find all of the callers of a given module or function of an application in an umbrella: @@ -146,7 +146,7 @@ mix xref graph --format stats --label compile Those improvements will help developers better understand the relationship between files and reveal potentially complex parts of their systems. -Other improvements in Mix include [better compiler diagnostics](https://hexdocs.pm/mix/Mix.Task.Compiler.html) for editor integration, support for [the `--slowest N` flag in `mix test`](https://hexdocs.pm/mix/Mix.Tasks.Test.html) that shows the slowest tests in your suite, and a new [`mix profile.eprof` task](https://hexdocs.pm/mix/Mix.Tasks.Eprof.html) that provides time based profiling, complementing the existing [`mix profile.cprof` (count based)](https://hexdocs.pm/mix/Mix.Tasks.Profile.Cprof.html) and [`mix profile.fprof` (flame based)](https://hexdocs.pm/mix/Mix.Tasks.Profile.Fprof.html). +Other improvements in Mix include [better compiler diagnostics](https://mix.hexdocs.pm/Mix.Task.Compiler.html) for editor integration, support for [the `--slowest N` flag in `mix test`](https://mix.hexdocs.pm/Mix.Tasks.Test.html) that shows the slowest tests in your suite, and a new [`mix profile.eprof` task](https://mix.hexdocs.pm/Mix.Tasks.Eprof.html) that provides time based profiling, complementing the existing [`mix profile.cprof` (count based)](https://mix.hexdocs.pm/Mix.Tasks.Profile.Cprof.html) and [`mix profile.fprof` (flame based)](https://mix.hexdocs.pm/Mix.Tasks.Profile.Fprof.html). ## Summing up @@ -154,4 +154,4 @@ The full list of changes is available in our [release notes](https://github.com/ Work on Elixir v1.7 has already started. We still welcome developers to try out the [previously announced StreamData library](https://elixir-lang.org/blog/2017/10/31/stream-data-property-based-testing-and-data-generation-for-elixir/), that aims to bring data generation and property-based testing to Elixir. The other [features scheduled for v1.7 can be found in the issues tracker](https://github.com/elixir-lang/elixir/issues). -Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Don't forget to check [the Install section](/install.html) to get Elixir installed and our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. diff --git a/_posts/2018-07-25-elixir-v1-7-0-released.markdown b/_posts/2018-07-25-elixir-v1-7-0-released.markdown index 51e8f7a66..8e44c1521 100644 --- a/_posts/2018-07-25-elixir-v1-7-0-released.markdown +++ b/_posts/2018-07-25-elixir-v1-7-0-released.markdown @@ -26,11 +26,11 @@ Metadata can be given to `@moduledoc`, `@typedoc` and `@doc`. We have updated [the ExDoc tool](https://github.com/elixir-lang/ex_doc) to start leveraging metadata in order to provide better documentation for developers. Some of the improvements include: - * Deprecated modules, functions, callbacks and types have a warning automatically attached to them. [See the deprecated `Behaviour` module as an example](https://hexdocs.pm/elixir/Behaviour.html) + * Deprecated modules, functions, callbacks and types have a warning automatically attached to them. [See the deprecated `Behaviour` module as an example](https://elixir.hexdocs.pm/Behaviour.html) - * Functions, macros, callbacks and types now include the version in which they were added. For example, [see the top right corner of the `defguard` docs](https://hexdocs.pm/elixir/Kernel.html#defguard/1) + * Functions, macros, callbacks and types now include the version in which they were added. For example, [see the top right corner of the `defguard` docs](https://elixir.hexdocs.pm/Kernel.html#defguard/1) - * Future Elixir versions will [include its own section for guards in the documentation and in the sidebar](https://hexdocs.pm/elixir/main/Kernel.html#guards). We are currently exploring ways to [generalize this feature in ExDoc itself](https://github.com/elixir-lang/ex_doc/issues/876) + * Future Elixir versions will [include its own section for guards in the documentation and in the sidebar](https://elixir.hexdocs.pm/main/Kernel.html#guards). We are currently exploring ways to [generalize this feature in ExDoc itself](https://github.com/elixir-lang/ex_doc/issues/876) Elixir's interactive shell, IEx, has also been updated to print metadata: @@ -40,7 +40,7 @@ While Elixir allows any metadata to be given, those tools currently exhibit only Those improvements are not exclusive to the standard library, they are available to every Elixir library and application. We hope one day they will be available to all applications running on the Erlang VM too. -To access the new documentation format, developers should use [`Code.fetch_docs/1`](https://hexdocs.pm/elixir/Code.html#fetch_docs/1). We have always been proud of treating documentation as a first-class citizen and the ability to add structured information to the documentation is a further step in this direction. +To access the new documentation format, developers should use [`Code.fetch_docs/1`](https://elixir.hexdocs.pm/Code.html#fetch_docs/1). We have always been proud of treating documentation as a first-class citizen and the ability to add structured information to the documentation is a further step in this direction. ## The `__STACKTRACE__` construct @@ -100,7 +100,7 @@ config :logger, ## ExUnit improvements -[ExUnit](https://hexdocs.pm/ex_unit/) is Elixir's unit testing library. ExUnit has always leveraged Elixir macros to provide excellent error reports when a failure happens. For example, the following code: +[ExUnit](https://ex-unit.hexdocs.pm/) is Elixir's unit testing library. ExUnit has always leveraged Elixir macros to provide excellent error reports when a failure happens. For example, the following code: ```elixir assert "fox jumps over the lazy dog" == "brown fox jumps over the dog" @@ -116,7 +116,7 @@ However, sometimes we need to write assertions such as `assert some_function(exp ![ExUnit Bare Assertion Diff](/images/contents/exunit-bare-assertion-diff.png) -We have also [added coloring and diffing to doctests](https://hexdocs.pm/ex_unit/ExUnit.DocTest.html#content). +We have also [added coloring and diffing to doctests](https://ex-unit.hexdocs.pm/ExUnit.DocTest.html#content). While ExUnit is our test framework, Mix is our build tool. Developers typically run their tests by calling `mix test`. @@ -154,4 +154,4 @@ We have also seen important developments in other areas not directly related to Finally, don't forget [ElixirConf US](https://elixirconf.com/) is coming soon, in Bellevue, WA, September 4-7. Last year my keynote focused on the last 5 years with Elixir. This year we are ready to look into the 5 years ahead. -Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. diff --git a/_posts/2019-01-14-elixir-v1-8-0-released.markdown b/_posts/2019-01-14-elixir-v1-8-0-released.markdown index 6da84a7dc..1ffb27e03 100644 --- a/_posts/2019-01-14-elixir-v1-8-0-released.markdown +++ b/_posts/2019-01-14-elixir-v1-8-0-released.markdown @@ -78,6 +78,6 @@ There is only one last major feature planned for upcoming Elixir versions, which During [my keynote at ElixirConf 2018 US](https://www.youtube.com/watch?v=suOzNeMJXl0), I talked about the next five years for Elixir and much of the emphasis is put on the community. Elixir was designed to be an extensible language and therefore the work on the language itself is meant to reduce with time, which we have seen in the last two releases. We trust the community to continue building on this solid foundation, bringing new challenges to the ecosystem and taking the language to new domains. -Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Your turn. :) \ No newline at end of file diff --git a/_posts/2019-02-25-mint-a-new-http-library-for-elixir.markdown b/_posts/2019-02-25-mint-a-new-http-library-for-elixir.markdown index 3868b94e6..272893459 100644 --- a/_posts/2019-02-25-mint-a-new-http-library-for-elixir.markdown +++ b/_posts/2019-02-25-mint-a-new-http-library-for-elixir.markdown @@ -47,7 +47,7 @@ If the response body is larger than a single packet `stream/2` may return multip Note that if you send concurrent requests on a HTTP/2 connection responses can be returned interleaved from the requests using HTTP/2's stream multiplexing. Additionally, responses can be spread over multiple messages so we may need to continually receive messages and pass them to `stream/2`. -See more examples on how to use Mint in the [documentation](https://hexdocs.pm/mint). +See more examples on how to use Mint in the [documentation](https://mint.hexdocs.pm). ## Why process-less? diff --git a/_posts/2019-06-24-elixir-v1-9-0-released.markdown b/_posts/2019-06-24-elixir-v1-9-0-released.markdown index b1b72fd4c..55f98a42c 100644 --- a/_posts/2019-06-24-elixir-v1-9-0-released.markdown +++ b/_posts/2019-06-24-elixir-v1-9-0-released.markdown @@ -15,7 +15,7 @@ Now let's take a look at what's new in this new version. ## Releases -The main feature in Elixir v1.9 is the addition of releases. A release is a self-contained directory that consists of your application code, all of its dependencies, plus the whole Erlang Virtual Machine (VM) and runtime. Once a release is assembled, it can be packaged and deployed to a target as long as the target runs on the same operating system (OS) distribution and version as the machine running the [`mix release`](https://hexdocs.pm/mix/Mix.Tasks.Release.html) command. +The main feature in Elixir v1.9 is the addition of releases. A release is a self-contained directory that consists of your application code, all of its dependencies, plus the whole Erlang Virtual Machine (VM) and runtime. Once a release is assembled, it can be packaged and deployed to a target as long as the target runs on the same operating system (OS) distribution and version as the machine running the [`mix release`](https://mix.hexdocs.pm/Mix.Tasks.Release.html) command. Releases have always been part of the Elixir community thanks to Paul Schoenfelder's work on [Distillery](https://github.com/bitwalker/distillery) (and EXRM before that). Distillery was announced in July 2016. Then in 2017, [DockYard](https://dockyard.com/) hired Paul to work on improving deployments, an effort that would lead to [Distillery 2.0](https://dockyard.com/blog/2018/08/23/announcing-distillery-2-0). Distillery 2.0 provided important answers in areas where the community was struggling to establish conventions and best practices, such as configuration. @@ -71,13 +71,13 @@ Releases also provide built-in hooks for configuring almost every need of the pr * `rel/env.sh.eex` and `rel/env.bat.eex` - template files that are copied into every release and executed on every command to set up environment variables, including ones specific to the VM, and the general environment -We have written [extensive documentation on releases](https://hexdocs.pm/mix/Mix.Tasks.Release.html), so we recommend checking it out for more information. +We have written [extensive documentation on releases](https://mix.hexdocs.pm/Mix.Tasks.Release.html), so we recommend checking it out for more information. ## Configuration We also use the work on releases to streamline Elixir's configuration API. A new `Config` module has been added to Elixir. The previous configuration API, `Mix.Config`, was part of the Mix build tool. However, since releases provide runtime configuration and Mix is not included in releases, we ported the `Mix.Config` API to Elixir. In other words, `use Mix.Config` has been soft-deprecated in favor of `import Config`. -Another important change related to configuration is that `mix new` will no longer generate a `config/config.exs` file. [Relying on configuration is undesired for most libraries](https://hexdocs.pm/elixir/library-guidelines.html#avoid-application-configuration) and the generated config files pushed library authors in the wrong direction. Furthermore, `mix new --umbrella` will no longer generate a configuration for each child app, instead all configuration should be declared in the umbrella root. That's how it has always behaved, we are now making it explicit. +Another important change related to configuration is that `mix new` will no longer generate a `config/config.exs` file. [Relying on configuration is undesired for most libraries](https://elixir.hexdocs.pm/library-guidelines.html#avoid-application-configuration) and the generated config files pushed library authors in the wrong direction. Furthermore, `mix new --umbrella` will no longer generate a configuration for each child app, instead all configuration should be declared in the umbrella root. That's how it has always behaved, we are now making it explicit. ## Other improvements @@ -97,6 +97,6 @@ First of all, Elixir is built on top of Erlang/OTP and we simply leverage all of Second, Elixir was designed to be an extensible language. The same tools and abstractions we used to create and enhance the language are also available to libraries and frameworks. This means the community can continue to improve the ecosystem without a need to change the language itself, which would effectively become a bottleneck for progress. -Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. We have also updated our [advanced Mix & OTP](https://hexdocs.pm/elixir/introduction-to-mix.html) to talk about releases. If you are looking for a more fast paced introduction to the language, see the [How I Start: Elixir](http://howistart.org/posts/elixir/1/index.html) tutorial, which has also been brought to the latest and greatest. +Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. We have also updated our [advanced Mix & OTP](https://elixir.hexdocs.pm/introduction-to-mix.html) to talk about releases. If you are looking for a more fast paced introduction to the language, see the [How I Start: Elixir](http://howistart.org/posts/elixir/1/index.html) tutorial, which has also been brought to the latest and greatest. Have fun! diff --git a/_posts/2020-01-27-elixir-v1-10-0-released.markdown b/_posts/2020-01-27-elixir-v1-10-0-released.markdown index f2eac58ce..aef828ec5 100644 --- a/_posts/2020-01-27-elixir-v1-10-0-released.markdown +++ b/_posts/2020-01-27-elixir-v1-10-0-released.markdown @@ -31,7 +31,7 @@ See the [full release notes for more improvements](https://github.com/elixir-lan ## Improvements to sort-based APIs in Enum -[`Enum.sort/1`](https://hexdocs.pm/elixir/Enum.html#sort/1) in Elixir by default sorts from lowest to highest: +[`Enum.sort/1`](https://elixir.hexdocs.pm/Enum.html#sort/1) in Elixir by default sorts from lowest to highest: ```elixir iex> Enum.sort(["banana", "apple", "pineapple"]) @@ -139,7 +139,7 @@ In previous Elixir versions, Elixir would compile a database of cross references Although this database was not public, developers would still use it to run their own checks against their projects. With time, developers would request more data to be included in the database, which was problematic as Elixir itself did not have a use for the additional data, and the database was not meant to be used externally in the first place. -In Elixir v1.10, we have addressed these problems by [introducing compiler tracing](https://hexdocs.pm/elixir/Code.html#module-compilation-tracers). The compiler tracing allows developers to listen to events as they are emitted by the compiler, so they can store all of the information they need - and only the information they need. +In Elixir v1.10, we have addressed these problems by [introducing compiler tracing](https://elixir.hexdocs.pm/Code.html#module-compilation-tracers). The compiler tracing allows developers to listen to events as they are emitted by the compiler, so they can store all of the information they need - and only the information they need. Elixir itself is using the new compiler tracing to provide new functionality. One advantage of this approach is that developers can now disable undefined function warnings directly on the callsite. For example, imagine you have an optional dependency which may not be available in some cases. You can tell the compiler to skip warning on calls to optional modules with: @@ -150,11 +150,11 @@ Previously, this information had to be added to the overall project configuratio ### Other enhancements -Elixir's calendar data types got many improvements, such as sigil support for third-party calendars, as well as the additions of [`DateTime.now!/2`](https://hexdocs.pm/elixir/DateTime.html#now!/2), [`DateTime.shift_zone!/3`](https://hexdocs.pm/elixir/DateTime.html#shift_zone!/3), and [`NaiveDateTime.local_now/0`](https://hexdocs.pm/elixir/NaiveDateTime.html#local_now/0). +Elixir's calendar data types got many improvements, such as sigil support for third-party calendars, as well as the additions of [`DateTime.now!/2`](https://elixir.hexdocs.pm/DateTime.html#now!/2), [`DateTime.shift_zone!/3`](https://elixir.hexdocs.pm/DateTime.html#shift_zone!/3), and [`NaiveDateTime.local_now/0`](https://elixir.hexdocs.pm/NaiveDateTime.html#local_now/0). -There are many improvements related to Elixir's AST in this release too. [`Code.string_to_quoted/2`](https://hexdocs.pm/elixir/Code.html#string_to_quoted/2) has two new options, `:token_metadata` and `:literal_encoder`, that give more control over Elixir's parser. This information was already available to the Elixir code formatter and has now been made public. These changes alongside compiler tracing means tools like [Credo](https://github.com/rrrene/credo), [Boundary](https://github.com/sasa1977/boundary), and IDE integrations have an even better foundation to analyze the source code. +There are many improvements related to Elixir's AST in this release too. [`Code.string_to_quoted/2`](https://elixir.hexdocs.pm/Code.html#string_to_quoted/2) has two new options, `:token_metadata` and `:literal_encoder`, that give more control over Elixir's parser. This information was already available to the Elixir code formatter and has now been made public. These changes alongside compiler tracing means tools like [Credo](https://github.com/rrrene/credo), [Boundary](https://github.com/sasa1977/boundary), and IDE integrations have an even better foundation to analyze the source code. -[ExUnit](https://hexdocs.pm/ex_unit), our test framework, ships two small but important improvements: `ExUnit.CaptureIO` can now be used by tests that run concurrently and we have added "pattern-matching diffing". To understand the last feature, take this code: +[ExUnit](https://ex-unit.hexdocs.pm), our test framework, ships two small but important improvements: `ExUnit.CaptureIO` can now be used by tests that run concurrently and we have added "pattern-matching diffing". To understand the last feature, take this code: ```elixir assert %{"status" => 200, "body" => %{"key" => "foo"}} = json_payload @@ -166,6 +166,6 @@ Finally, this release also adds two new guards, `is_struct/1` and `is_map_key/2` To learn what else is new, you can read the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.10.0). -Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Have fun! diff --git a/_posts/2020-10-06-elixir-v1-11-0-released.markdown b/_posts/2020-10-06-elixir-v1-11-0-released.markdown index 7aaaefefb..fe6b1e0b9 100644 --- a/_posts/2020-10-06-elixir-v1-11-0-released.markdown +++ b/_posts/2020-10-06-elixir-v1-11-0-released.markdown @@ -15,7 +15,7 @@ For now, let's focus on what's new in Elixir v1.11. ## Tighter Erlang integration -On the footsteps of v1.10, we have further integrated with Erlang's new logger by adding four new log levels: `notice`, `critical`, `alert`, and `emergency`, matching all log levels found in the Syslog standard. The `Logger` module now supports structured logging by passing maps and keyword lists to its various functions. It is also possible to specify the log level per module, via the [`Logger.put_module_level/2`](https://hexdocs.pm/logger/Logger.html#put_module_level/2) function. Log levels per application will be added in future releases. +On the footsteps of v1.10, we have further integrated with Erlang's new logger by adding four new log levels: `notice`, `critical`, `alert`, and `emergency`, matching all log levels found in the Syslog standard. The `Logger` module now supports structured logging by passing maps and keyword lists to its various functions. It is also possible to specify the log level per module, via the [`Logger.put_module_level/2`](https://logger.hexdocs.pm/Logger.html#put_module_level/2) function. Log levels per application will be added in future releases. IEx also has been improved to show the documentation for Erlang modules directly from your Elixir terminal. For example, here is a clip of me accessing the documentation for [Erlang's gen_server module](erlang.org/doc/man/gen_server.html): @@ -182,7 +182,7 @@ Elixir v1.9 introduced a new configuration file called `config/releases.exs`. Ho This new configuration file was considered a very useful addition to releases. Therefore, we are also introducing `config/runtime.exs`, which is executed after the code compilation on all environments (dev, test, and prod) - for both Mix and releases. Our goal is to provide a better runtime configuration experience to developers, in contrast to our current configuration system which has been mostly compile-time centric. -`config/runtime.exs` works the same as any other configuration file in Elixir. However, given `config/runtime.exs` is meant to run in production systems, where our `Mix` build tool is not available, developers must not use [`Mix.env()`](https://hexdocs.pm/mix/Mix.html#env/0) or [`Mix.target()`](https://hexdocs.pm/mix/Mix.html#target/0) in `config/runtime.exs`. Instead, they must use the new `config_env()` and `config_target()`, which have been added to the [`Config`](https://hexdocs.pm/elixir/Config.html) module. +`config/runtime.exs` works the same as any other configuration file in Elixir. However, given `config/runtime.exs` is meant to run in production systems, where our `Mix` build tool is not available, developers must not use [`Mix.env()`](https://mix.hexdocs.pm/Mix.html#env/0) or [`Mix.target()`](https://mix.hexdocs.pm/Mix.html#target/0) in `config/runtime.exs`. Instead, they must use the new `config_env()` and `config_target()`, which have been added to the [`Config`](https://elixir.hexdocs.pm/Config.html) module. While `config/releases.exs` will continue to be supported, developers can migrate to `config/runtime.exs` without loss of functionality. For example, a `config/releases.exs` file such as this one @@ -208,18 +208,18 @@ end If both files are available, releases will pick the now preferred `config/runtime.exs` instead of `config/releases.exs`. -To wrap it all up, `Mix` also includes a new task called [`mix app.config`](https://hexdocs.pm/mix/Mix.Tasks.App.Config.html). This task loads all applications and configures them, without starting them. Whenever you write your own Mix tasks, you will typically want to invoke either `mix app.start` or `mix app.config` before running your own code. Which one is better depends if you want your applications running or only configured. +To wrap it all up, `Mix` also includes a new task called [`mix app.config`](https://mix.hexdocs.pm/Mix.Tasks.App.Config.html). This task loads all applications and configures them, without starting them. Whenever you write your own Mix tasks, you will typically want to invoke either `mix app.start` or `mix app.config` before running your own code. Which one is better depends if you want your applications running or only configured. ## Other improvements Elixir v1.11 adds the `is_struct/2`, `is_exception/1`, and `is_exception/2` guards. It also adds support for the `map.field` syntax in guards. -The Calendar module ships with a new [`Calendar.strftime/3`](https://hexdocs.pm/elixir/Calendar.html#strftime/3) function, which provides datetime formatting based on the `strftime` format. The [`Date`](https://hexdocs.pm/elixir/Date.html) module got new functions for working with weeks and months, such as `Date.beginning_of_month/1` and `Date.end_of_week/2`. Finally, all calendar types got conversion functions from and to gregorian timestamps, such as `Date.from_gregorian_days/2` and `NaiveDateTime.to_gregorian_seconds/1`. +The Calendar module ships with a new [`Calendar.strftime/3`](https://elixir.hexdocs.pm/Calendar.html#strftime/3) function, which provides datetime formatting based on the `strftime` format. The [`Date`](https://elixir.hexdocs.pm/Date.html) module got new functions for working with weeks and months, such as `Date.beginning_of_month/1` and `Date.end_of_week/2`. Finally, all calendar types got conversion functions from and to gregorian timestamps, such as `Date.from_gregorian_days/2` and `NaiveDateTime.to_gregorian_seconds/1`. -Finally, to bring visibility to the compiler tracking improvements described in previous sections, we have also added new features to [`mix xref`](https://hexdocs.pm/mix/Mix.Tasks.Xref.html). `mix xref` is a task that describes cross-references between files in your projects and can be helpful to diagnose large compilation cycles in projects. +Finally, to bring visibility to the compiler tracking improvements described in previous sections, we have also added new features to [`mix xref`](https://mix.hexdocs.pm/Mix.Tasks.Xref.html). `mix xref` is a task that describes cross-references between files in your projects and can be helpful to diagnose large compilation cycles in projects. For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.11.0). -Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Have fun! diff --git a/_posts/2020-11-17-real-time-collaboration-with-elixir-at-slab.markdown b/_posts/2020-11-17-real-time-collaboration-with-elixir-at-slab.markdown index e699b459a..41fadf9a9 100644 --- a/_posts/2020-11-17-real-time-collaboration-with-elixir-at-slab.markdown +++ b/_posts/2020-11-17-real-time-collaboration-with-elixir-at-slab.markdown @@ -32,7 +32,7 @@ The trial went better than expected, and Jason's journey with Slab had officiall ## Growing with the platform -Shortly after, Slab was in a private beta with a handful of companies as users. For each major feature they had along the way, Elixir and Phoenix provided the building blocks for it. When they implemented real-time comments, they used Phoenix Channels and Phoenix PubSub. The pattern goes on: "for asynchronous processing, we simply use [Elixir tasks](https://hexdocs.pm/elixir/Task.html)". Later on, to track users editing a document and give each a different cursor color, they used [Phoenix Presence](https://hexdocs.pm/phoenix/Phoenix.Presence.html), a tool that no other web framework offers out-of-the-box. +Shortly after, Slab was in a private beta with a handful of companies as users. For each major feature they had along the way, Elixir and Phoenix provided the building blocks for it. When they implemented real-time comments, they used Phoenix Channels and Phoenix PubSub. The pattern goes on: "for asynchronous processing, we simply use [Elixir tasks](https://elixir.hexdocs.pm/Task.html)". Later on, to track users editing a document and give each a different cursor color, they used [Phoenix Presence](https://phoenix.hexdocs.pm/Phoenix.Presence.html), a tool that no other web framework offers out-of-the-box. Another leap in Jason's journey with Slab and Elixir was when he had to learn Erlang/OTP, a group of behaviors that ship as part of Erlang's standard library for building distributed and fault-tolerant applications. @@ -44,7 +44,7 @@ One could try to solve this problem by keeping the server stateless. Every time When working with Node.js, Jason tried a different approach. If Alice and Bob were writing to the same document, a load balancer would guarantee that both would be routed to the same node. After trying out both Apache and Nginx, he implemented the balancer in Node.js. The overall solution was time-consuming to get right and introduced operational complexities. -Luckily, these problems are the bread and butter of Erlang/OTP. Jason knew he needed a stateful abstraction to keep this state on the server. He had already heard about the options the platform provides, but he was unsure which one to pick. Jason recalls: "I remember asking the community if I should use an [Agent](https://hexdocs.pm/elixir/Agent.html) or a [GenServer](https://hexdocs.pm/elixir/GenServer.html) and everyone was really helpful in providing guidance." They quickly landed on GenServer as their tool of choice. +Luckily, these problems are the bread and butter of Erlang/OTP. Jason knew he needed a stateful abstraction to keep this state on the server. He had already heard about the options the platform provides, but he was unsure which one to pick. Jason recalls: "I remember asking the community if I should use an [Agent](https://elixir.hexdocs.pm/Agent.html) or a [GenServer](https://elixir.hexdocs.pm/GenServer.html) and everyone was really helpful in providing guidance." They quickly landed on GenServer as their tool of choice. By default, both GenServer and Agents are local to each node. However, they also support the `:global` option, which registers a given name across the cluster. To use this option, they need the Erlang distribution, which they were already using for Phoenix PubSub and Presence, so this was a straight-forward change. This guarantees both Alice and Bob talk to the same GenServer, regardless if they joined node X or node Y. diff --git a/_posts/2021-05-19-elixir-v1-12-0-released.markdown b/_posts/2021-05-19-elixir-v1-12-0-released.markdown index 676f3d2e2..b361d5f55 100644 --- a/_posts/2021-05-19-elixir-v1-12-0-released.markdown +++ b/_posts/2021-05-19-elixir-v1-12-0-released.markdown @@ -56,13 +56,13 @@ Elixir has had support for ranges from before its v1.0 release. Ranges support o Unfortunately, due to this inference, it is not possible to have empty ranges. For example, if you want to create a list of `n` elements, you cannot express it with a range from `1..n`, as `1..0` (for `n=0`) is a decreasing range with two elements. -Elixir v1.12 supports stepped ranges via [the `first..last//step` notation](https://hexdocs.pm/elixir/1.12/Kernel.html#..///3). For example: `1..10//2` will emit the numbers `1`, `3`, `5`, `7`, and `9`. You can consider the `//` operator as an equivalent to "range division", as it effectively divides the number of elements in the range by `step`, rounding up on inexact scenarios. Steps can be either positive (increasing ranges) or negative (decreasing ranges). Stepped ranges bring more expressive power to Elixir ranges and they elegantly solve the empty range problem, as they allow the direction of the steps to be explicitly declared instead of inferred. +Elixir v1.12 supports stepped ranges via [the `first..last//step` notation](https://elixir.hexdocs.pm/1.12/Kernel.html#..///3). For example: `1..10//2` will emit the numbers `1`, `3`, `5`, `7`, and `9`. You can consider the `//` operator as an equivalent to "range division", as it effectively divides the number of elements in the range by `step`, rounding up on inexact scenarios. Steps can be either positive (increasing ranges) or negative (decreasing ranges). Stepped ranges bring more expressive power to Elixir ranges and they elegantly solve the empty range problem, as they allow the direction of the steps to be explicitly declared instead of inferred. -As of Elixir v1.12, implicitly decreasing ranges are soft-deprecated and warnings will be emitted in future Elixir versions based on our [deprecation policy](https://hexdocs.pm/elixir/compatibility-and-deprecations.html#deprecations). +As of Elixir v1.12, implicitly decreasing ranges are soft-deprecated and warnings will be emitted in future Elixir versions based on our [deprecation policy](https://elixir.hexdocs.pm/compatibility-and-deprecations.html#deprecations). ## `then/2` and `tap/2` -Two new functions have been added to `Kernel` module, in order to ease working with pipelines. [`tap/2`](https://hexdocs.pm/elixir/1.12/Kernel.html#tap/2) passes the given argument to an anonymous function, returning the argument itself. [`then/2`](https://hexdocs.pm/elixir/1.12/Kernel.html#then/2) passes the given argument to an anonymous function, returning the result. The following: +Two new functions have been added to `Kernel` module, in order to ease working with pipelines. [`tap/2`](https://elixir.hexdocs.pm/1.12/Kernel.html#tap/2) passes the given argument to an anonymous function, returning the argument itself. [`then/2`](https://elixir.hexdocs.pm/1.12/Kernel.html#then/2) passes the given argument to an anonymous function, returning the result. The following: ```elixir "hello world" @@ -93,10 +93,10 @@ IEx got two important quality of life improvements in this release. Hitting tab Elixir v1.12 has also added many functions across the standard library. The `Enum` module received additions such as `Enum.count_until/2`, `Enum.product/1`, `Enum.zip_with/2`, and more. The `Integer` module now includes `Integer.pow/2` and `Integer.extended_gcd/2`. -The `Code` module got a [`cursor_context/2`](https://hexdocs.pm/elixir/1.12/Code.html#cursor_context/2) function, which is now used to power `IEx` autocompletion and it is [used by projects such as Livebook to provide intellisense](https://user-images.githubusercontent.com/17034772/115117125-533b2900-9f9d-11eb-94a9-a2cf2ccb7388.mp4). +The `Code` module got a [`cursor_context/2`](https://elixir.hexdocs.pm/1.12/Code.html#cursor_context/2) function, which is now used to power `IEx` autocompletion and it is [used by projects such as Livebook to provide intellisense](https://user-images.githubusercontent.com/17034772/115117125-533b2900-9f9d-11eb-94a9-a2cf2ccb7388.mp4). The EEx application has also been extended to provide metadata on text segments. This has enabled the Surface and Phoenix LiveView teams to implement [a new template language called HEEx](https://github.com/phoenixframework/phoenix_live_view/pull/1440), which validates both HTML and EEx. Finally, the `Registry` module supports the `:compressed` option, which is useful for GraphQL applications managing hundreds of thousands of subscriptions via [Absinthe](http://absinthe-graphql.org/). -For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.12.0). Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.12.0). Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Have fun! diff --git a/_posts/2021-07-29-bootstraping-a-multiplayer-server-with-elixir-at-x-plane.markdown b/_posts/2021-07-29-bootstraping-a-multiplayer-server-with-elixir-at-x-plane.markdown index e0563549c..23a777822 100644 --- a/_posts/2021-07-29-bootstraping-a-multiplayer-server-with-elixir-at-x-plane.markdown +++ b/_posts/2021-07-29-bootstraping-a-multiplayer-server-with-elixir-at-x-plane.markdown @@ -37,11 +37,11 @@ They eventually settled on three top contenders: Rust, Go, and Elixir. Elixir to ## Modeling multiplayer with Elixir -Ready to give Elixir a try, Tyler picked up a couple books but soon realized the language's [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) provided the background he needed. He explains: "while the introductory guide covers the language constructs, the advanced guide on the website has you build an actual project with TCP connections, with the basic architectural patterns we would use in production." +Ready to give Elixir a try, Tyler picked up a couple books but soon realized the language's [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) provided the background he needed. He explains: "while the introductory guide covers the language constructs, the advanced guide on the website has you build an actual project with TCP connections, with the basic architectural patterns we would use in production." However, instead of jumping headfirst into the multiplayer server, he decided to give Elixir a try on a smaller problem. He wrote a web proxy to the National Oceanic and Atmospheric Administration (NOAA) weather services and put it in production. This experience taught him the importance of leveraging all of the instrumentation and metrics provided by the Erlang VM. They chose [AppSignal](https://www.appsignal.com/) to help consume and digest this information. -Two weeks later, he started working on the server by implementing [the UDP-centric RakNet protocol in Elixir](https://en.wikipedia.org/wiki/RakNet). Unfortunately, there is little documentation, so they had to refer to the reference implementation in C++ most of the time. Luckily, thanks to its roots in telecommunication and network services, [Elixir and Erlang have built-in support for parsing binary packets](https://hexdocs.pm/elixir/Kernel.SpecialForms.html#%3C%3C%3E%3E/1), which made the task a joy. The team also mapped each UDP connection to distinct lightweight threads of execution in Elixir, which we call _processes_. Elixir processes are cheap, isolated, concurrent, and are fairly scheduled by the runtime. This design allowed the X-Plane team to fully leverage the properties of robustness and predictable latency that first attracted them to the platform. Their implementation is written on top of Erlang's [gen_udp](http://www.erlang.org/doc/man/gen_udp.html) and [is open source](https://github.com/X-Plane/elixir-raknet). +Two weeks later, he started working on the server by implementing [the UDP-centric RakNet protocol in Elixir](https://en.wikipedia.org/wiki/RakNet). Unfortunately, there is little documentation, so they had to refer to the reference implementation in C++ most of the time. Luckily, thanks to its roots in telecommunication and network services, [Elixir and Erlang have built-in support for parsing binary packets](https://elixir.hexdocs.pm/Kernel.SpecialForms.html#%3C%3C%3E%3E/1), which made the task a joy. The team also mapped each UDP connection to distinct lightweight threads of execution in Elixir, which we call _processes_. Elixir processes are cheap, isolated, concurrent, and are fairly scheduled by the runtime. This design allowed the X-Plane team to fully leverage the properties of robustness and predictable latency that first attracted them to the platform. Their implementation is written on top of Erlang's [gen_udp](http://www.erlang.org/doc/man/gen_udp.html) and [is open source](https://github.com/X-Plane/elixir-raknet). Five months after choosing Elixir, they began welcoming beta testers into the server. The community's reaction was overwhelmingly positive, and the new multiplayer experience led to a strong uptick in the number of subscriptions as it went live a month later. diff --git a/_posts/2021-12-03-elixir-v1-13-0-released.markdown b/_posts/2021-12-03-elixir-v1-13-0-released.markdown index 486d27699..6839fb973 100644 --- a/_posts/2021-12-03-elixir-v1-13-0-released.markdown +++ b/_posts/2021-12-03-elixir-v1-13-0-released.markdown @@ -44,13 +44,13 @@ To give a more practical example, take a regular [Phoenix project](https://phoen ## Code fragments -The [`Code`](https://hexdocs.pm/elixir/Code.html) module got a companion module called [`Code.Fragment`](https://hexdocs.pm/elixir/Code.Fragment.html). +The [`Code`](https://elixir.hexdocs.pm/Code.html) module got a companion module called [`Code.Fragment`](https://elixir.hexdocs.pm/Code.Fragment.html). The `Code` module works with complete code. For example, its functions will consider the snippet `123 +` as invalid, since the right-hand side of `+` is missing. However, our tooling, such as editors, REPLs, and code notebooks must still parse and understand such snippets, in order to provide code completion, argument suggestion, etc. That's the goal of the `Code.Fragment` module. It contains different heuristics to analyze and return context informational of code fragments, which are code snippets that may be incomplete. -To better show the benefits of said improvements, let's talk about IEx, Elixir's interactive shell. IEx has been rewritten to use `Code.Fragment` and, in the process, it gained new functionality as part of its autocompletion system (available by hitting TAB). For example, it can now autocomplete sigils, used to [create regexes](https://hexdocs.pm/elixir/Kernel.html#sigil_r/2) or [lists of words](https://hexdocs.pm/elixir/Kernel.html#sigil_w/2), and their terminators: +To better show the benefits of said improvements, let's talk about IEx, Elixir's interactive shell. IEx has been rewritten to use `Code.Fragment` and, in the process, it gained new functionality as part of its autocompletion system (available by hitting TAB). For example, it can now autocomplete sigils, used to [create regexes](https://elixir.hexdocs.pm/Kernel.html#sigil_r/2) or [lists of words](https://elixir.hexdocs.pm/Kernel.html#sigil_w/2), and their terminators: @@ -58,11 +58,11 @@ Similarly, you can now autocomplete struct names and their fields: -Overall, we hope the `Code.Fragment` module will become the shared foundation to power many of the tools in the ecosystem. We have also added new reflection APIs to [`Module`](https://hexdocs.pm/elixir/Module.html), which can then be used to power code intelligence features. +Overall, we hope the `Code.Fragment` module will become the shared foundation to power many of the tools in the ecosystem. We have also added new reflection APIs to [`Module`](https://elixir.hexdocs.pm/Module.html), which can then be used to power code intelligence features. ## mix xref -[`mix xref`](https://hexdocs.pm/mix/Mix.Tasks.Xref.html) is a tool that analyzes relationships between files. By analyzing the compile-time and runtime dependencies between them, it allows developers to understand what has to be recompiled whenever a file changes. +[`mix xref`](https://mix.hexdocs.pm/Mix.Tasks.Xref.html) is a tool that analyzes relationships between files. By analyzing the compile-time and runtime dependencies between them, it allows developers to understand what has to be recompiled whenever a file changes. Elixir v1.13 comes with many improvements to `mix xref`, such as: @@ -96,7 +96,7 @@ Or even [Zig](https://ziglang.org/), [via the Zigler project](https://github.com } """ -However, while you can format Elixir source code with [`mix format`](https://hexdocs.pm/mix/Mix.Tasks.Format.html), you could not format the code inside snippets. +However, while you can format Elixir source code with [`mix format`](https://mix.hexdocs.pm/Mix.Tasks.Format.html), you could not format the code inside snippets. Elixir v1.13 solves this by adding plugins to `mix format`. Plugins can teach the formatter how to format new files and how to format sigils, via the `Mix.Tasks.Format` behaviour. @@ -140,14 +140,14 @@ We are looking forward to see how this new functionality will be used by communi 1 | hello + * world | ^ -The `Code` module has also been augmented with two functions: [`Code.string_to_quoted_with_comments/2`](https://hexdocs.pm/elixir/Code.html#string_to_quoted_with_comments/2) and [`Code.quoted_to_algebra/2`](https://hexdocs.pm/elixir/Code.html#quoted_to_algebra/2). Those functions allow someone to retrieve the Elixir AST with their original source code comments, and then convert this AST to formatted code. In other words, those functions provide a wrapper around the Elixir Code Formatter, supporting developers who wish to create tools that directly manipulate and custom format Elixir source code. +The `Code` module has also been augmented with two functions: [`Code.string_to_quoted_with_comments/2`](https://elixir.hexdocs.pm/Code.html#string_to_quoted_with_comments/2) and [`Code.quoted_to_algebra/2`](https://elixir.hexdocs.pm/Code.html#quoted_to_algebra/2). Those functions allow someone to retrieve the Elixir AST with their original source code comments, and then convert this AST to formatted code. In other words, those functions provide a wrapper around the Elixir Code Formatter, supporting developers who wish to create tools that directly manipulate and custom format Elixir source code. -`elixir --short-version` has been added to quickly get the Elixir version, without booting the Erlang VM. The `Task` module includes performance optimizations and [new](https://hexdocs.pm/elixir/Task.html#ignore/1) [functions](https://hexdocs.pm/elixir/Task.html#completed/1). Finally, `mix test --profile-require=time` has been added to debug loading times of test suites and the recently added [`Mix.install/2`](https://hexdocs.pm/mix/Mix.html#install#2) has been improved with new options and environment variables. +`elixir --short-version` has been added to quickly get the Elixir version, without booting the Erlang VM. The `Task` module includes performance optimizations and [new](https://elixir.hexdocs.pm/Task.html#ignore/1) [functions](https://elixir.hexdocs.pm/Task.html#completed/1). Finally, `mix test --profile-require=time` has been added to debug loading times of test suites and the recently added [`Mix.install/2`](https://mix.hexdocs.pm/Mix.html#install#2) has been improved with new options and environment variables. ## Learn more For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.13.0). You can also [watch my ElixirConf 2021 keynote about Elixir v1.13](https://youtu.be/ydjx2kKHzrM) to learn more. -Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Have fun! diff --git a/_posts/2022-09-01-elixir-v1-14-0-released.markdown b/_posts/2022-09-01-elixir-v1-14-0-released.markdown index 7ae52d259..c87a459c3 100644 --- a/_posts/2022-09-01-elixir-v1-14-0-released.markdown +++ b/_posts/2022-09-01-elixir-v1-14-0-released.markdown @@ -15,7 +15,7 @@ Note: this announcement contains [asciinema](https://asciinema.org) snippets. Yo ## `dbg` -[`Kernel.dbg/2`](https://hexdocs.pm/elixir/Kernel.html#dbg/2) is a new macro that's somewhat similar to [`IO.inspect/2`](https://hexdocs.pm/elixir/IO.html#inspect/2), but specifically tailored for **debugging**. +[`Kernel.dbg/2`](https://elixir.hexdocs.pm/Kernel.html#dbg/2) is a new macro that's somewhat similar to [`IO.inspect/2`](https://elixir.hexdocs.pm/IO.html#inspect/2), but specifically tailored for **debugging**. When called, it prints the value of whatever you pass to it, plus the debugged code itself as well as its location. @@ -55,7 +55,7 @@ As an another example of the power behind `dbg`, the Livebook team has implement ## PartitionSupervisor -[`PartitionSupervisor`](https://hexdocs.pm/elixir/PartitionSupervisor.html) implements a new supervisor type. It is designed to help when you have a single supervised process that becomes a bottleneck. If that process' state can be easily partitioned, then you can use `PartitionSupervisor` to supervise multiple isolated copies of that process running concurrently, each assigned its own partition. +[`PartitionSupervisor`](https://elixir.hexdocs.pm/PartitionSupervisor.html) implements a new supervisor type. It is designed to help when you have a single supervised process that becomes a bottleneck. If that process' state can be easily partitioned, then you can use `PartitionSupervisor` to supervise multiple isolated copies of that process running concurrently, each assigned its own partition. For example, imagine you have a `ErrorReporter` process that you use to report errors to a monitoring service. @@ -143,7 +143,7 @@ Enum.to_list(1..10//3) #=> [1, 4, 7, 10] ``` -Stepped ranges are particularly useful for numerical operations involving vectors and matrices (see [Nx](https://github.com/elixir-nx/nx), for example). However, the Elixir standard library was not making use of stepped ranges in its APIs. Elixir v1.14 starts to take advantage of steps with support for stepped ranges in a couple of functions. One of them is [`Enum.slice/2`](https://hexdocs.pm/elixir/Enum.html#slice/2): +Stepped ranges are particularly useful for numerical operations involving vectors and matrices (see [Nx](https://github.com/elixir-nx/nx), for example). However, the Elixir standard library was not making use of stepped ranges in its APIs. Elixir v1.14 starts to take advantage of steps with support for stepped ranges in a couple of functions. One of them is [`Enum.slice/2`](https://elixir.hexdocs.pm/Enum.html#slice/2): ```elixir letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] @@ -151,7 +151,7 @@ Enum.slice(letters, 0..5//2) #=> ["a", "c", "e"] ``` -[`binary_slice/2`](https://hexdocs.pm/elixir/Kernel.html#binary_slice/2) (and [`binary_slice/3`](https://hexdocs.pm/elixir/Kernel.html#binary_slice/3) for completeness) has been added to the `Kernel` module, that works with bytes and also support stepped ranges: +[`binary_slice/2`](https://elixir.hexdocs.pm/Kernel.html#binary_slice/2) (and [`binary_slice/3`](https://elixir.hexdocs.pm/Kernel.html#binary_slice/3) for completeness) has been added to the `Kernel` module, that works with bytes and also support stepped ranges: ```elixir binary_slice("Elixir", 1..5//2) @@ -181,12 +181,12 @@ MapSet.put(fruits, :pear) The `MapSet.new/1` expression evaluates to exactly the struct that we're inspecting. This allows us to hide the internals of `MapSet`, while keeping it as valid Elixir code. This expression-based inspection has been implemented for `Version.Requirement`, `MapSet`, and `Date.Range`. -Finally, we have improved the `Inspect` protocol for structs so that fields are inspected in the order they are declared in `defstruct`. The option `:optional` has also been added when deriving the `Inspect` protocol, giving developers more control over the struct representation. See [the updated documentation for `Inspect`](https://hexdocs.pm/elixir/Inspect.html) for a general rundown on the approaches and options available. +Finally, we have improved the `Inspect` protocol for structs so that fields are inspected in the order they are declared in `defstruct`. The option `:optional` has also been added when deriving the `Inspect` protocol, giving developers more control over the struct representation. See [the updated documentation for `Inspect`](https://elixir.hexdocs.pm/Inspect.html) for a general rundown on the approaches and options available. ## Learn more For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.14.0). -Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more. +Check [the Install section](/install.html) to get Elixir installed and read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Happy debugging! diff --git a/_posts/2022-10-05-my-future-with-elixir-set-theoretic-types.markdown b/_posts/2022-10-05-my-future-with-elixir-set-theoretic-types.markdown index 11f8d06c6..9aac64df0 100644 --- a/_posts/2022-10-05-my-future-with-elixir-set-theoretic-types.markdown +++ b/_posts/2022-10-05-my-future-with-elixir-set-theoretic-types.markdown @@ -29,7 +29,7 @@ Different programming languages and platforms extract different values from type For example, different languages can extract performance benefits from types. However, Elixir still runs on the Erlang VM, which is dynamically typed, so we should not expect any meaningful performance gain from typing Elixir code. -Another benefit of types is to _aid_ documentation (emphasis on the word _aid_ as I don't believe types replace textual documentation). Elixir already reaps similar benefits from [typespecs](https://hexdocs.pm/elixir/typespecs.html) and I would expect an integrated type system to be even more valuable in this area. +Another benefit of types is to _aid_ documentation (emphasis on the word _aid_ as I don't believe types replace textual documentation). Elixir already reaps similar benefits from [typespecs](https://elixir.hexdocs.pm/typespecs.html) and I would expect an integrated type system to be even more valuable in this area. However, the upsides and downsides of static typing become fuzzier and prone to exaggerations once we discuss them in the context of code maintenance, in particular when comparing types with other software verification techniques, such as tests. In those situations, it is common to hear unrealistic claims such as "a static type system would catch 80% of my Elixir bugs" or that "you need to write fewer tests once you have static types". @@ -111,9 +111,9 @@ Personally, I find set-theoretical types an elegant and accessible approach to r Despite the initial fit between Elixir semantics and set-theoretic types, there are open questions and existing challenges in putting the two together. Here are some examples: - * Elixir has [an expressive collection of idioms used in pattern matching and guards](https://hexdocs.pm/elixir/patterns-and-guards.html), can we map them all to set-theoretic types? + * Elixir has [an expressive collection of idioms used in pattern matching and guards](https://elixir.hexdocs.pm/patterns-and-guards.html), can we map them all to set-theoretic types? - * Elixir associative data structures, [called maps](https://hexdocs.pm/elixir/Map.html), can be used both as records and as dictionaries. Would it be possible to also type them with a unified foundation? + * Elixir associative data structures, [called maps](https://elixir.hexdocs.pm/Map.html), can be used both as records and as dictionaries. Would it be possible to also type them with a unified foundation? * Gradual type systems must introduce runtime type checks in order to remain sound. However, those type checks will happen in addition to the checks already done by the Erlang VM, which can degrade performance. Therefore, is it possible to leverage the existing runtime checks done by the Erlang VM so the resulting type system is still sound? diff --git a/_posts/2022-12-22-cheatsheets-and-8-other-features-in-exdoc-that-improve-the-developer-experience.markdown b/_posts/2022-12-22-cheatsheets-and-8-other-features-in-exdoc-that-improve-the-developer-experience.markdown index 505bf15bf..46b70a4ea 100644 --- a/_posts/2022-12-22-cheatsheets-and-8-other-features-in-exdoc-that-improve-the-developer-experience.markdown +++ b/_posts/2022-12-22-cheatsheets-and-8-other-features-in-exdoc-that-improve-the-developer-experience.markdown @@ -7,13 +7,13 @@ category: Announcements excerpt: This post explains the motivation behind the new ExDoc Cheatsheet feature. It also highlights other ExDoc features that show how ExDoc has been evolving to make the documentation experience in Elixir better and better. --- -ExDoc has a cool new feature, [cheatsheets](https://hexdocs.pm/ex_doc/cheatsheet.html)! +ExDoc has a cool new feature, [cheatsheets](https://ex-doc.hexdocs.pm/cheatsheet.html)! In this blog post, we'll explain what that new feature is and the motivation behind it. We'll also take the opportunity to highlight other ExDoc features that show how it has been evolving to make the documentation experience in Elixir better and better. ## What are ExDoc cheatsheets and how they improve the documentation experience -ExDoc's cheatsheets are Markdown files with the `.cheatmd` extension. You can see [an example](https://hexdocs.pm/ecto/crud.html) of how the Ecto project is using them. +ExDoc's cheatsheets are Markdown files with the `.cheatmd` extension. You can see [an example](https://ecto.hexdocs.pm/crud.html) of how the Ecto project is using them. Writing and reading cheatsheets is not exactly new to developers. What ExDoc brings to the table is the possibility of integrating cheatsheets alongside the rest of the documentation of an Elixir project, instead of hosting them in a different place. @@ -58,7 +58,7 @@ documentation for a function](https://i.imgur.com/PXvoeDk.gif) One of the most common formats of library documentation is an API reference. But depending on your needs, that's not the most approachable format. For example, it's not optimal when you're just getting started with a library or when you want to learn how to solve a specific problem using it. That's why ExDoc allows writing other types of docs besides API references, like *"Getting started" guides* or *How-tos*. -Look at how [Ecto's documentation](https://hexdocs.pm/ecto/getting-started.html) uses that, for example: +Look at how [Ecto's documentation](https://ecto.hexdocs.pm/getting-started.html) uses that, for example: ![Screencast of a user exploring the guides in the Ecto documentation](https://i.imgur.com/KInZb4x.gif) @@ -80,13 +80,13 @@ Instead of listing the ~40 functions of `Ecto.Repo` as a single extensive list, - Runtime API - User callbacks -The same functionality is available for modules and pages (guides, how-tos, and so on). Phoenix is a [good example](https://hexdocs.pm/phoenix/overview.html) of how that's used. +The same functionality is available for modules and pages (guides, how-tos, and so on). Phoenix is a [good example](https://phoenix.hexdocs.pm/overview.html) of how that's used. ### Full-text search Sometimes you don't know or don't remember the name of the function that you're looking for. For example, let's say you're looking for a function for dealing with file system directories. -Although there's no function or module called "directory" in Elixir, when you type "directory" in [Elixir's documentation](https://hexdocs.pm/elixir/search.html?q=directory), it will return all the entries that have the word "directory" inside the documentation. It will even return entries with variations of the word "directory", like "directories", doing a fuzzy search. +Although there's no function or module called "directory" in Elixir, when you type "directory" in [Elixir's documentation](https://elixir.hexdocs.pm/search.html?q=directory), it will return all the entries that have the word "directory" inside the documentation. It will even return entries with variations of the word "directory", like "directories", doing a fuzzy search. ![Screenshot of the result of searching for "directory" in the Elixir documentation](https://i.imgur.com/IHHuej8.png) @@ -135,7 +135,7 @@ One of the ways Elixir developers have been using Livebook is for documentation. With that in mind, ExDoc offers the possibility of integrating Livebook notebooks. That means one can host Livebook-based documentation together with the API reference. -Here's an [example of using Livebook inside ExDoc for writing a Usage Guide](https://hexdocs.pm/req_sandbox/usage.html): +Here's an [example of using Livebook inside ExDoc for writing a Usage Guide](https://req-sandbox.hexdocs.pm/usage.html): ![Screencast of a user navigating through the "req_sandbox" documentation, finding a Livebook, clicking "Run in Livebook", and using the Livebook that @@ -145,12 +145,12 @@ opens up on their local machine.](https://i.imgur.com/FxOLs0Y.gif) [EEP 48](https://www.erlang.org/eeps/eep-0048) proposed a standardized way for how BEAM languages could store API documentation. This allows any BEAM language to read documentation generated by each other. -By leveraging that work, ExDoc can generate documentation for an Erlang project. For example, Telemetry is a library written in Erlang that has [its documentation](https://hexdocs.pm/telemetry/readme.html) generated with ExDoc. +By leveraging that work, ExDoc can generate documentation for an Erlang project. For example, Telemetry is a library written in Erlang that has [its documentation](https://telemetry.hexdocs.pm/readme.html) generated with ExDoc. ![Screenshot of "telemetry" documentation generated with ExDoc](https://i.imgur.com/C4Idbuh.png) -By using ExDoc to also generate documentation for Erlang-based projects, we can have more consistency in the user experience along the BEAM ecosystem. See the great [`rebar3_ex_doc`](https://hexdocs.pm/rebar3_ex_doc/) plugin to get started. +By using ExDoc to also generate documentation for Erlang-based projects, we can have more consistency in the user experience along the BEAM ecosystem. See the great [`rebar3_ex_doc`](https://rebar3-ex-doc.hexdocs.pm/) plugin to get started. ### Bonus: Doctests diff --git a/_posts/2023-03-09-embedded-and-cloud-elixir-at-sparkmeter.markdown b/_posts/2023-03-09-embedded-and-cloud-elixir-at-sparkmeter.markdown index 2a5fa73ce..c173d0f1c 100644 --- a/_posts/2023-03-09-embedded-and-cloud-elixir-at-sparkmeter.markdown +++ b/_posts/2023-03-09-embedded-and-cloud-elixir-at-sparkmeter.markdown @@ -70,7 +70,7 @@ SparkMeter used Elixir for the ground (embedded) and cloud aspects of the new sy For the firmware of the grid edge management unit, they used Nerves. For the hardware, they built on top of a BeagleBone Black device. -The communication between the grid edge management unit and the meters was via radio, using Rust to manage the radio hardware module inside the grid edge management unit. They used [Elixir Ports](https://hexdocs.pm/elixir/1.13.4/Port.html) to communicate with Rust and process the data from the meters. +The communication between the grid edge management unit and the meters was via radio, using Rust to manage the radio hardware module inside the grid edge management unit. They used [Elixir Ports](https://elixir.hexdocs.pm/1.13.4/Port.html) to communicate with Rust and process the data from the meters. Elixir was also used for communication with the cloud servers via 3G or Edge. This communication required bandwidth usage optimization due to the cost of sending large volumes of data through the cellular network. They evaluated various solutions like REST, CoAP, MQTT, Kafka, and Websockets. Still, none fit their specific needs, so they created a custom protocol tailored to their use case, which involved designing a binary protocol and implementing a TCP server. Mike Waud discussed this in more detail in his talks at [ElixirConf 2021](https://www.youtube.com/watch?v=DJRL86mO4ks) and [2022](https://www.youtube.com/watch?v=BxTIUvyZHKw). @@ -86,13 +86,13 @@ During and after the development of the new generation of their system, SparkMet One of them was the reduction of the complexity of the grid edge management unit. The old version had more moving parts, using Ubuntu and Docker for the system level, Python/Celery and RabbitMQ for asynchronous processing, and Systemd for managing starting job processes. -In the new version, they replaced all of that mainly with Elixir and Nerves. And for the parts where they needed tools that were not part of the BEAM stack, they could manage them like any other BEAM process by using [Elixir Ports](https://hexdocs.pm/elixir/1.13.4/Port.html). Here's what they said about that experience: +In the new version, they replaced all of that mainly with Elixir and Nerves. And for the parts where they needed tools that were not part of the BEAM stack, they could manage them like any other BEAM process by using [Elixir Ports](https://elixir.hexdocs.pm/1.13.4/Port.html). Here's what they said about that experience: > The new grid edge management unit has a very unified architecture. We can treat everything as an (Elixir) process. We have full control over the start and stop within a single ecosystem. It's just a very coherent storyline. > > \- *Jon Thacker, Senior VP Of Engineering* -Another aspect they liked about Nerves was that it included security best practices. For example, they used SSL certificates on the client and the server side for communication between the ground and the cloud. Nerves made this easy through the [NervesKey component](https://github.com/nerves-hub/nerves_key), which enables the use of a hardware security module to protect the private key. Nerves also made it easy to keep up with system security patches, as the firmware generated by Nerves is a single bundle containing a minimal Linux platform and their application packaged as a [release](https://hexdocs.pm/mix/Mix.Tasks.Release.html). Here's what they said about security in Nerves: +Another aspect they liked about Nerves was that it included security best practices. For example, they used SSL certificates on the client and the server side for communication between the ground and the cloud. Nerves made this easy through the [NervesKey component](https://github.com/nerves-hub/nerves_key), which enables the use of a hardware security module to protect the private key. Nerves also made it easy to keep up with system security patches, as the firmware generated by Nerves is a single bundle containing a minimal Linux platform and their application packaged as a [release](https://mix.hexdocs.pm/Mix.Tasks.Release.html). Here's what they said about security in Nerves: > It's easy enough to keep tracking upstream changes, so we're not getting behind the latest security patches. Nerves made that easy. Nerves just pushed us towards a good security model. > diff --git a/_posts/2023-06-19-elixir-v1-15-0-released.markdown b/_posts/2023-06-19-elixir-v1-15-0-released.markdown index ffc23b810..9be4f5ee7 100644 --- a/_posts/2023-06-19-elixir-v1-15-0-released.markdown +++ b/_posts/2023-06-19-elixir-v1-15-0-released.markdown @@ -114,7 +114,7 @@ at the top of your `mix.exs` to bring the old behaviour back. ## Integration with Erlang/OTP logger This release provides additional features such as global logger -metadata and [file logging](https://hexdocs.pm/logger/Logger.html#module-erlang-otp-handlers) (with rotation and compression) out of the box! +metadata and [file logging](https://logger.hexdocs.pm/Logger.html#module-erlang-otp-handlers) (with rotation and compression) out of the box! This release also soft-deprecates Elixir's Logger Backends in favor of Erlang's Logger handlers. Elixir will automatically @@ -155,7 +155,7 @@ config :logger, :default_handler, Finally, the previous Logger Backends API is now soft-deprecated. If you implement your own backends, you want to consider migrating to [`:logger_backends`](https://github.com/elixir-lang/logger_backends) -in the long term. See the new [`Logger`](https://hexdocs.pm/logger) +in the long term. See the new [`Logger`](https://logger.hexdocs.pm) documentation for more information on the new features and compatibility. ## Learn more @@ -164,7 +164,7 @@ For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.15.0). Check [the Install section](/install.html) to get Elixir installed and -read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) +read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Happy compiling! diff --git a/_posts/2023-12-22-elixir-v1-16-0-released.markdown b/_posts/2023-12-22-elixir-v1-16-0-released.markdown index 6e4a61dca..a918e0b57 100644 --- a/_posts/2023-12-22-elixir-v1-16-0-released.markdown +++ b/_posts/2023-12-22-elixir-v1-16-0-released.markdown @@ -100,7 +100,7 @@ references, tutorials, cheatsheets, and more](/blog/2022/12/22/cheatsheets-and-8 However, because many of the language tutorials and reference documentation were written before ExDoc, they were maintained separately as part of the official website, separate from the language source code. With Elixir v1.16, -[we have moved our learning material to the language repository](https://hexdocs.pm/elixir/introduction.html). +[we have moved our learning material to the language repository](https://elixir.hexdocs.pm/introduction.html). This provides several benefits: 1. Tutorials are versioned alongside their relevant Elixir version @@ -110,15 +110,15 @@ This provides several benefits: 3. ExDoc will autolink module and function names in tutorials to their relevant API documentation Another feature we have incorporated in this release is the addition -of cheatsheets, starting with [a cheatsheet for the Enum module](https://hexdocs.pm/elixir/main/enum-cheat.html). +of cheatsheets, starting with [a cheatsheet for the Enum module](https://elixir.hexdocs.pm/main/enum-cheat.html). If you would like to contribute future cheatsheets to Elixir itself, feel free to start a discussion and collect feedback on the [Elixir Forum](https://elixirforum.com/). Finally, we have started enriching our documentation with [Mermaid.js](https://mermaid.js.org/) diagrams. You can find examples -in the [GenServer](https://hexdocs.pm/elixir/GenServer.html) -and [Supervisor](https://hexdocs.pm/elixir/Supervisor.html) docs. +in the [GenServer](https://elixir.hexdocs.pm/GenServer.html) +and [Supervisor](https://elixir.hexdocs.pm/Supervisor.html) docs. Elixir has always been praised by its excellent documentation and we are glad to continue to raise the bar for the whole ecosystem. @@ -128,7 +128,7 @@ we are glad to continue to raise the bar for the whole ecosystem. Elixir v1.16 incorporates and extends the work on [Understanding Code Smells in Elixir Functional Language](https://github.com/lucasvegi/Elixir-Code-Smells/blob/main/etc/2023-emse-code-smells-elixir.pdf), by Lucas Vegi and Marco Tulio Valente, from [ASERG/DCC/UFMG](http://aserg.labsoft.dcc.ufmg.br/), -into [the official documention in the form of anti-patterns](https://hexdocs.pm/elixir/what-anti-patterns.html). +into [the official documention in the form of anti-patterns](https://elixir.hexdocs.pm/what-anti-patterns.html). Our goal is to provide examples of potential pitfalls for library and application developers, with additional context and guidance on how to improve their codebases. @@ -141,10 +141,10 @@ their prevalence in actual codebases). To incorporate the anti-patterns into the language, we trimmed the list down to keep only anti-patterns which are unambiguous and actionable, and divided -them into four categories: [code-related](https://hexdocs.pm/elixir/code-anti-patterns.html), -[design-related](https://hexdocs.pm/elixir/design-anti-patterns.html), -[process-related](https://hexdocs.pm/elixir/process-anti-patterns.html), -and [meta-programming](https://hexdocs.pm/elixir/macro-anti-patterns.html). +them into four categories: [code-related](https://elixir.hexdocs.pm/code-anti-patterns.html), +[design-related](https://elixir.hexdocs.pm/design-anti-patterns.html), +[process-related](https://elixir.hexdocs.pm/process-anti-patterns.html), +and [meta-programming](https://elixir.hexdocs.pm/macro-anti-patterns.html). Then we collected more community feedback during the release candidate period, further refining and removing unclear guidance. @@ -173,9 +173,9 @@ and [Dashbit](https://dashbit.co). Other notable changes in this release are: -* the addition of [`String.replace_invalid/2`](https://hexdocs.pm/elixir/String.html#replace_invalid/2), to help deal with invalid UTF-8 encoding +* the addition of [`String.replace_invalid/2`](https://elixir.hexdocs.pm/String.html#replace_invalid/2), to help deal with invalid UTF-8 encoding -* the addition of the `:limit` option in [`Task.yield_many/2`](https://hexdocs.pm/elixir/Task.html#yield_many/2) that limits the maximum number of tasks to yield +* the addition of the `:limit` option in [`Task.yield_many/2`](https://elixir.hexdocs.pm/Task.html#yield_many/2) that limits the maximum number of tasks to yield * improved binary pattern matching by allowing prefix binary matches, such as `<<^prefix::binary, rest::binary>>` @@ -183,7 +183,7 @@ For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.16.0). Check [the Install section](/install.html) to get Elixir installed and -read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) +read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Happy learning! diff --git a/_posts/2024-03-05-veeps-elixir-case.markdown b/_posts/2024-03-05-veeps-elixir-case.markdown index f0e60b7d1..c97922883 100644 --- a/_posts/2024-03-05-veeps-elixir-case.markdown +++ b/_posts/2024-03-05-veeps-elixir-case.markdown @@ -71,7 +71,7 @@ Different parts of the Veeps system have different scalability requirements. For Say you have 250,000 people watching a concert: the Beaconing service needs to handle thousands of requests per second for a few hours at a time. As a result, it needs to scale differently from other parts of the system, such as the merchandise e-commerce or backstage management. -To tackle this issue, they built a distributed system. They packaged each subsystem as an [Elixir release](https://hexdocs.pm/elixir/config-and-releases.html#releases), totaling five releases. For the communication layer, they used distributed Erlang, which is built into Erlang/OTP, allowing seamless inter-process communication across networked nodes. +To tackle this issue, they built a distributed system. They packaged each subsystem as an [Elixir release](https://elixir.hexdocs.pm/config-and-releases.html#releases), totaling five releases. For the communication layer, they used distributed Erlang, which is built into Erlang/OTP, allowing seamless inter-process communication across networked nodes. In a nutshell, each node contains several processes with specific responsibilities. Each of these processes belongs to their respective [distributed process group](https://www.erlang.org/doc/man/pg.html). If node A needs billing information, it will reach out to any process within the "billing process group", which may be anywhere in the cluster. @@ -80,9 +80,9 @@ When deploying a new version of the system, they deploy a new cluster altogether ### Service-oriented architecture within a monorepo -Although they run a distributed system, they organize the code in only one repository, following the monorepo approach. To do that, they use the [Umbrella Project feature](https://hexdocs.pm/elixir/dependencies-and-umbrella-projects.html#content) from Mix, the build tool that ships with Elixir. +Although they run a distributed system, they organize the code in only one repository, following the monorepo approach. To do that, they use the [Umbrella Project feature](https://elixir.hexdocs.pm/dependencies-and-umbrella-projects.html#content) from Mix, the build tool that ships with Elixir. -Their umbrella project consists of 16 applications (at the time of writing), which they [sliced into five OTP releases](https://hexdocs.pm/mix/Mix.Tasks.Release.html#module-umbrellas). The remaining applications contain code that needs to be shared between multiple applications. For example, one of the shared applications defines all the structs sent as messages across the subsystems, guaranteeing that all subsystems use the same schemas for that exchanged data. +Their umbrella project consists of 16 applications (at the time of writing), which they [sliced into five OTP releases](https://mix.hexdocs.pm/Mix.Tasks.Release.html#module-umbrellas). The remaining applications contain code that needs to be shared between multiple applications. For example, one of the shared applications defines all the structs sent as messages across the subsystems, guaranteeing that all subsystems use the same schemas for that exchanged data. > With umbrella projects, you can have the developer experience benefits of a single code repository, while being able to build a service-oriented architecture. > @@ -91,7 +91,7 @@ Their umbrella project consists of 16 applications (at the time of writing), whi ### Reducing complexity with the Erlang/Elixir toolbox -Veeps has an e-commerce platform that allows concert viewers to purchase artist merchandise. In e-commerce, a common concept is a shopping cart. Veeps associates each shopping cart as a [GenServer](https://hexdocs.pm/elixir/GenServer.html), which is a lightweight process managed by the Erlang VM. +Veeps has an e-commerce platform that allows concert viewers to purchase artist merchandise. In e-commerce, a common concept is a shopping cart. Veeps associates each shopping cart as a [GenServer](https://elixir.hexdocs.pm/GenServer.html), which is a lightweight process managed by the Erlang VM. This decision made it easier for them to implement other business requirements, such as locking the cart during payments and shopping cart expiration. Since each cart is a process, the expiration is as simple as sending a message to a cart process based on a timer, which is easy to do using GenServers. diff --git a/_posts/2024-06-12-elixir-v1-17-0-released.markdown b/_posts/2024-06-12-elixir-v1-17-0-released.markdown index c857c906e..c946bf365 100644 --- a/_posts/2024-06-12-elixir-v1-17-0-released.markdown +++ b/_posts/2024-06-12-elixir-v1-17-0-released.markdown @@ -89,7 +89,7 @@ better error messages. Keep in mind, however, that the Elixir typechecker only infers types from patterns within the same function at the moment. Analysis from guards and across function boundaries will be added in future releases. For more details, see our new [reference document on gradual set-theoretic -types](https://hexdocs.pm/elixir/gradual-set-theoretic-types.html). +types](https://elixir.hexdocs.pm/gradual-set-theoretic-types.html). The type system was made possible thanks to a partnership between [CNRS](https://www.cnrs.fr/) and [Remote](https://remote.com/). The development @@ -172,7 +172,7 @@ For a complete list of all changes, see the [full release notes](https://github.com/elixir-lang/elixir/releases/tag/v1.17.0). Check [the Install section](/install.html) to get Elixir installed and -read our [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) +read our [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more. Happy learning! diff --git a/_posts/2024-08-15-welcome-elixir-language-server-team.markdown b/_posts/2024-08-15-welcome-elixir-language-server-team.markdown index b9e29ca0f..e4d13a79b 100644 --- a/_posts/2024-08-15-welcome-elixir-language-server-team.markdown +++ b/_posts/2024-08-15-welcome-elixir-language-server-team.markdown @@ -62,7 +62,7 @@ Some ecosystems have undertaken [multi-year efforts to redesign their compilers For example, every Language Server implementation compiles their own version of a project, making it so every application and its dependencies have to be compiled twice in development: once for Mix and once for the Language Server. Wouldn't it be nice if Elixir and the Language Servers could all rely on the same compilation artifacts? -This is not news to the Elixir team either: almost every Elixir release within the last 3 years has shipped new code analysis APIs, such as [Code.Fragment](https://hexdocs.pm/elixir/Code.Fragment.html), with the goal of removing duplication across Language Servers, [IEx](https://hexdocs.pm/iex), and [Livebook](https://livebook.dev/), as well as reduce their reliance on internal Elixir modules. Most recently, Elixir v1.17 shipped with [new APIs to help developers emulate the compiler behaviour](https://hexdocs.pm/elixir/Macro.Env.html). Our goal is to make these building blocks available for all Elixir developers, so their benefits are reaped beyond the language server tooling. +This is not news to the Elixir team either: almost every Elixir release within the last 3 years has shipped new code analysis APIs, such as [Code.Fragment](https://elixir.hexdocs.pm/Code.Fragment.html), with the goal of removing duplication across Language Servers, [IEx](https://iex.hexdocs.pm), and [Livebook](https://livebook.dev/), as well as reduce their reliance on internal Elixir modules. Most recently, Elixir v1.17 shipped with [new APIs to help developers emulate the compiler behaviour](https://elixir.hexdocs.pm/Macro.Env.html). Our goal is to make these building blocks available for all Elixir developers, so their benefits are reaped beyond the language server tooling. Furthermore, as [set-theoretic types make their way into Elixir](https://elixir-lang.org/blog/2024/06/12/elixir-v1-17-0-released/), we also want to provide official APIs to integrate them into our tools. diff --git a/_posts/2024-08-28-typing-lists-and-tuples.markdown b/_posts/2024-08-28-typing-lists-and-tuples.markdown index 545996655..d562f6d2c 100644 --- a/_posts/2024-08-28-typing-lists-and-tuples.markdown +++ b/_posts/2024-08-28-typing-lists-and-tuples.markdown @@ -100,7 +100,7 @@ While different developers will prefer certain idioms over others, I am not conv Thanks to set-theoretic types, we will most likely distinguish between empty lists and non-empty lists in Elixir's type system, since pattern matching on them is a common language idiom. Furthermore, several functions in Elixir, such as `String.split/2` are guaranteed to return non-empty lists, which can then be nicely encoded into a function's return type. -Elixir also has the functions `hd` (for head) and `tl` (for tail) inherited from Erlang, which are [valid guards](https://hexdocs.pm/elixir/patterns-and-guards.html). They only accept non-empty lists as arguments, which will now be enforced by the type system too. +Elixir also has the functions `hd` (for head) and `tl` (for tail) inherited from Erlang, which are [valid guards](https://elixir.hexdocs.pm/patterns-and-guards.html). They only accept non-empty lists as arguments, which will now be enforced by the type system too. This covers almost all use cases but one: what happens if you want to access the first element of a list, which has not been proven to be empty? You could use pattern matching and conditionals for those cases, but as seen above, this can lead to common boilerplate such as: @@ -120,7 +120,7 @@ Now that we have discussed lists, we can talk about tuples. In a way, tuples are 2. We natively access tuples by index, instead of its head and tail, such `elem(tuple, 0)` -In the upcoming v1.18 release, Elixir's new type system will support tuple types, and they are written between curly brackets. For example, the [`File.read/1` function](https://hexdocs.pm/elixir/File.html#read/1) would have the return type `{:ok, binary()} or {:error, posix()}`, quite similar to today's typespecs. +In the upcoming v1.18 release, Elixir's new type system will support tuple types, and they are written between curly brackets. For example, the [`File.read/1` function](https://elixir.hexdocs.pm/File.html#read/1) would have the return type `{:ok, binary()} or {:error, posix()}`, quite similar to today's typespecs. The tuple type can also specify a minimum size, as you can also write: `{atom(), integer(), ...} `. This means the tuple has at least two elements, the first being an `atom()` and the second being an `integer()`. This definition is required for type inference in patterns and guards. After all, a guard `is_integer(elem(tuple, 1))` tells you the tuple has at least two elements, with the second one being an integer, but nothing about the other elements and the tuple overall size. diff --git a/_posts/2024-12-19-elixir-v1-18-0-released.markdown b/_posts/2024-12-19-elixir-v1-18-0-released.markdown index 22edc0364..6a6ecc24d 100644 --- a/_posts/2024-12-19-elixir-v1-18-0-released.markdown +++ b/_posts/2024-12-19-elixir-v1-18-0-released.markdown @@ -114,7 +114,7 @@ Keep in mind the current implementation does not perform type inference of guard The next Elixir release should improve the typing of maps, tuples, and closures, allowing us to type even more constructs. We also plan to fully type the `with` construct, `for`-comprehensions, as well as protocols. -But more importantly, we want to focus on complete type inference of guards, which in turn will allow us to explore ideas such as redundant pattern matching clauses and exhaustiveness checks. Our goal with inference is to strike the right balance between developer experience, compilation times, and the ability of finding provable errors in existing codebases. You can learn more [about the trade-offs we made for inference in our documentation](https://hexdocs.pm/elixir/1.18/gradual-set-theoretic-types.html#type-inference). +But more importantly, we want to focus on complete type inference of guards, which in turn will allow us to explore ideas such as redundant pattern matching clauses and exhaustiveness checks. Our goal with inference is to strike the right balance between developer experience, compilation times, and the ability of finding provable errors in existing codebases. You can learn more [about the trade-offs we made for inference in our documentation](https://elixir.hexdocs.pm/1.18/gradual-set-theoretic-types.html#type-inference). Future Elixir versions will introduce user-supplied type signatures, which should bring the benefits of a static type system without relying on inference. [Check our previous article on the overall milestones for more information](https://elixir-lang.org/blog/2023/06/22/type-system-updates-research-dev/). @@ -139,9 +139,9 @@ These enhancements do not only improve editor tooling, but they also directly be ## Built-in JSON -[Erlang/OTP 27 added built-in support for JSON](https://www.erlang.org/doc/apps/stdlib/json.html) and we are now bringing it to Elixir. A new module, called [`JSON`](https://hexdocs.pm/elixir/1.18/JSON.html), has been added with functions to encode and decode JSON. Its most basic APIs reflect the ones [from the Jason project](https://hexdocs.pm/jason/Jason.html) (the de-facto JSON library in the Elixir community up to this point). +[Erlang/OTP 27 added built-in support for JSON](https://www.erlang.org/doc/apps/stdlib/json.html) and we are now bringing it to Elixir. A new module, called [`JSON`](https://elixir.hexdocs.pm/1.18/JSON.html), has been added with functions to encode and decode JSON. Its most basic APIs reflect the ones [from the Jason project](https://jason.hexdocs.pm/Jason.html) (the de-facto JSON library in the Elixir community up to this point). -A new protocol, called [`JSON.Encoder`](https://hexdocs.pm/elixir/1.18/JSON.Encoder.html), is also provided for those who want to customize how their own data types are encoded to JSON. You can also derive protocols for structs, with a single-line of code: +A new protocol, called [`JSON.Encoder`](https://elixir.hexdocs.pm/1.18/JSON.Encoder.html), is also provided for those who want to customize how their own data types are encoded to JSON. You can also derive protocols for structs, with a single-line of code: ```elixir @derive {JSON.Encoder, only: [:id, :name]} @@ -152,9 +152,9 @@ The deriving API mirrors the one from `Jason`, helping those who want to migrate ## Parameterized tests and ExUnit groups -[ExUnit now supports parameterized tests](https://hexdocs.pm/ex_unit/1.18/ExUnit.Case.html#module-parameterized-tests). This allows your test modules to run multiple times under different parameters. +[ExUnit now supports parameterized tests](https://ex-unit.hexdocs.pm/1.18/ExUnit.Case.html#module-parameterized-tests). This allows your test modules to run multiple times under different parameters. -For example, Elixir ships [a local, decentralized and scalable key-value process storage called `Registry`](https://hexdocs.pm/elixir/Registry.html). The registry can be partitioned and its implementation differs depending if partitioning is enabled or not. Therefore, during tests, we want to ensure both modes are exercised. With Elixir v1.18, we can achieve this by writing: +For example, Elixir ships [a local, decentralized and scalable key-value process storage called `Registry`](https://elixir.hexdocs.pm/Registry.html). The registry can be partitioned and its implementation differs depending if partitioning is enabled or not. Therefore, during tests, we want to ensure both modes are exercised. With Elixir v1.18, we can achieve this by writing: ```elixir defmodule Registry.Test do @@ -213,6 +213,6 @@ More migrations will be added in future releases to help us push towards more co ## Summary -Other notable changes include [`PartitionSupervisor.resize!/2`](https://hexdocs.pm/elixir/1.18/PartitionSupervisor.html#resize!/2), for resizing the number of partitions (aka processes) of a supervisor at runtime, [Registry.lock/3](https://hexdocs.pm/elixir/1.18/Registry.html#lock/3) for simple in-process key locks, PowerShell versions of `elixir` and `elixirc` scripts for better DX on Windows, and more. [See the CHANGELOG](https://hexdocs.pm/elixir/1.18/changelog.html) for the complete release notes. +Other notable changes include [`PartitionSupervisor.resize!/2`](https://elixir.hexdocs.pm/1.18/PartitionSupervisor.html#resize!/2), for resizing the number of partitions (aka processes) of a supervisor at runtime, [Registry.lock/3](https://elixir.hexdocs.pm/1.18/Registry.html#lock/3) for simple in-process key locks, PowerShell versions of `elixir` and `elixirc` scripts for better DX on Windows, and more. [See the CHANGELOG](https://elixir.hexdocs.pm/1.18/changelog.html) for the complete release notes. Happy coding! diff --git a/_posts/2025-08-18-interop-and-portability.markdown b/_posts/2025-08-18-interop-and-portability.markdown index dc4895db8..d8c9ea885 100644 --- a/_posts/2025-08-18-interop-and-portability.markdown +++ b/_posts/2025-08-18-interop-and-portability.markdown @@ -173,7 +173,7 @@ rustler::init!("Elixir.Example"); ### Zig -[Zigler](https://hexdocs.pm/zigler) lets us write NIFs in Zig, a low-level programming language designed for maintaining robust, optimal, and reusable software. Zig removes hidden control flow, implicit memory allocation, and similar abstractions in favour of code that's explicit and predictable. +[Zigler](https://zigler.hexdocs.pm) lets us write NIFs in Zig, a low-level programming language designed for maintaining robust, optimal, and reusable software. Zig removes hidden control flow, implicit memory allocation, and similar abstractions in favour of code that's explicit and predictable. Zigler compiles Zig code at build time and exposes it directly to Elixir, without external build scripts or glue. It tightly integrates with Elixir tooling: Zig code is formatted via `mix format` and documentation written in Zig appears in IEx via the `h` helper. diff --git a/_posts/2025-10-16-elixir-v1-19-0-released.markdown b/_posts/2025-10-16-elixir-v1-19-0-released.markdown index 32c2ee283..7338d8e01 100644 --- a/_posts/2025-10-16-elixir-v1-19-0-released.markdown +++ b/_posts/2025-10-16-elixir-v1-19-0-released.markdown @@ -145,7 +145,7 @@ defmodule MyLib.SomeModule do end ``` -Because the spawned process is not visible to the compiler, it won't be able to load `MyLib.SomeOtherModule`. You have two options, either use [`Kernel.ParallelCompiler.pmap/2`](https://hexdocs.pm/elixir/Kernel.ParallelCompiler.html#pmap/2) or explicitly call [`Code.ensure_compiled!(MyLib.SomeOtherModule)`](https://hexdocs.pm/elixir/Code.html#ensure_compiled!/1) before spawning the process that uses said module. +Because the spawned process is not visible to the compiler, it won't be able to load `MyLib.SomeOtherModule`. You have two options, either use [`Kernel.ParallelCompiler.pmap/2`](https://elixir.hexdocs.pm/Kernel.ParallelCompiler.html#pmap/2) or explicitly call [`Code.ensure_compiled!(MyLib.SomeOtherModule)`](https://elixir.hexdocs.pm/Code.html#ensure_compiled!/1) before spawning the process that uses said module. The second one is related to `@on_load` callbacks (typically used for [NIFs](https://www.erlang.org/doc/system/nif.html)) that invoke other modules defined within the same project. For example: @@ -214,6 +214,6 @@ This work was performed by [Jonatan Männchen](https://maennchen.dev) and sponso ## Summary -There are many other goodies in this release, such as improved option parsing, better debuggability and performance in ExUnit, the addition of `mix help Mod`, `mix help Mod.fun`, `mix help Mod.fun/arity`, and `mix help app:package` to make documentation accessible via shell for humans and agents, and much more. [See the CHANGELOG](https://hexdocs.pm/elixir/1.19/changelog.html) for the complete release notes. +There are many other goodies in this release, such as improved option parsing, better debuggability and performance in ExUnit, the addition of `mix help Mod`, `mix help Mod.fun`, `mix help Mod.fun/arity`, and `mix help app:package` to make documentation accessible via shell for humans and agents, and much more. [See the CHANGELOG](https://elixir.hexdocs.pm/1.19/changelog.html) for the complete release notes. Happy coding! diff --git a/_posts/2025-12-02-lazier-bdds-for-set-theoretic-types.markdown b/_posts/2025-12-02-lazier-bdds-for-set-theoretic-types.markdown index 89438e7c7..c3b7662c0 100644 --- a/_posts/2025-12-02-lazier-bdds-for-set-theoretic-types.markdown +++ b/_posts/2025-12-02-lazier-bdds-for-set-theoretic-types.markdown @@ -91,7 +91,7 @@ The difference between two DNFs is implemented similarly to intersections, excep Luckily, those exact issues are well documented in literature and are addressed by Binary Decision Diagrams (BDDs), introduced by [Alain Frisch (2004)](https://www.cduce.org/papers/frisch_phd.pdf) and later recalled and expanded by [Giuseppe Castagna (2016)](https://www.irif.fr/~gc/papers/covcon-again.pdf). -BDDs represent set-theoretic operations as an ordered tree. This requires us to provide an order, any order, across all types. Given [all Elixir values have a total order](https://hexdocs.pm/elixir/Kernel.html#module-term-ordering), that's quite straightforward. Furthermore, by ordering it, we can detect duplicates as we introduce nodes in the tree. The tree can have three distinct node types: +BDDs represent set-theoretic operations as an ordered tree. This requires us to provide an order, any order, across all types. Given [all Elixir values have a total order](https://elixir.hexdocs.pm/Kernel.html#module-term-ordering), that's quite straightforward. Furthermore, by ordering it, we can detect duplicates as we introduce nodes in the tree. The tree can have three distinct node types: ```elixir type bdd() = :top or :bottom or {type(), constrained :: bdd(), dual :: bdd()} diff --git a/_posts/2026-01-09-type-inference-of-all-and-next-15.markdown b/_posts/2026-01-09-type-inference-of-all-and-next-15.markdown index 894cb051f..889562f46 100644 --- a/_posts/2026-01-09-type-inference-of-all-and-next-15.markdown +++ b/_posts/2026-01-09-type-inference-of-all-and-next-15.markdown @@ -212,7 +212,7 @@ The first release candidate for Elixir v1.20 is out and includes type inference Every release will have a thread in the [Elixir Forum](http://elixirforum.com) for discussion. -Check our documentation to learn more about our [overall work on set-theoretic types](http://hexdocs.pm/elixir/1.20.0-rc.0/gradual-set-theoretic-types.html). This release also includes [our official types cheatsheet](https://hexdocs.pm/elixir/1.20.0-rc.0/types-cheat.html). +Check our documentation to learn more about our [overall work on set-theoretic types](https://elixir.hexdocs.pm/1.20.0-rc.0/gradual-set-theoretic-types.html). This release also includes [our official types cheatsheet](https://elixir.hexdocs.pm/1.20.0-rc.0/types-cheat.html). The [complete CHANGELOG for this release](https://github.com/elixir-lang/elixir/blob/v1.20.0-rc.0/CHANGELOG.md) is on GitHub. diff --git a/development.markdown b/development.markdown index b84d2552e..282cbc6fd 100644 --- a/development.markdown +++ b/development.markdown @@ -17,7 +17,7 @@ Elixir runs on top of the Erlang Virtual Machine, which provides a scalable and Elixir's source code is under the [Apache 2 License](https://github.com/elixir-lang/elixir/blob/main/LICENSE) and is maintained by the [Elixir Team](#team). The source code and contribution guidelines can be found on [the language repository](https://github.com/elixir-lang/elixir). -Elixir v1.0 was released in September 2014 and a new minor version is released every 6 months, around May and November of every year. New releases are announced in the read-only [announcements mailing list](https://groups.google.com/group/elixir-lang-ann) with a link to the complete CHANGELOG. All security releases [will be tagged with "[security]"](https://groups.google.com/forum/#!searchin/elixir-lang-ann/%5Bsecurity%5D%7Csort:date). Security vulnerabilities should be disclosed to [elixir-security@googlegroups.com](mailto:elixir-security@googlegroups.com). Our [compatibility and deprecation policies](https://hexdocs.pm/elixir/compatibility-and-deprecations.html#content) are also documented. +Elixir v1.0 was released in September 2014 and a new minor version is released every 6 months, around May and November of every year. New releases are announced in the read-only [announcements mailing list](https://groups.google.com/group/elixir-lang-ann) with a link to the complete CHANGELOG. All security releases [will be tagged with "[security]"](https://groups.google.com/forum/#!searchin/elixir-lang-ann/%5Bsecurity%5D%7Csort:date). Security vulnerabilities should be disclosed to [elixir-security@googlegroups.com](mailto:elixir-security@googlegroups.com). Our [compatibility and deprecation policies](https://elixir.hexdocs.pm/compatibility-and-deprecations.html#content) are also documented. Since v1.0, the language development has become focused to provide a compact and consistent core. The Elixir team focuses on language features that: diff --git a/docs.markdown b/docs.markdown index 55c20390a..2e8e1262f 100644 --- a/docs.markdown +++ b/docs.markdown @@ -9,7 +9,7 @@ image: /images/social/elixir-og-card.jpg The Elixir programming language is broken into 6 applications. The links below reference the documentation for the modules and functions in each of those -applications. See also [our Getting Started guide](https://hexdocs.pm/elixir/introduction.html) +applications. See also [our Getting Started guide](https://elixir.hexdocs.pm/introduction.html) and [the Learning page](/learning.html) for books, courses, videos, and more. {% assign stable = site.data.elixir-versions[site.data.elixir-versions.stable] %} @@ -29,21 +29,21 @@ and [the Learning page](/learning.html) for books, courses, videos, and more. Supported Erlang/OTP versions: {% for otp in version[1].otp_versions reversed %}{{ otp }}{% if forloop.last %}{% else %}, {% endif %}{% endfor %}. {% endif %} -* [Elixir](https://hexdocs.pm/elixir/{{ version[1].version }}/) - standard library -* [EEx](https://hexdocs.pm/eex/{{ version[1].version }}/) - templating library -* [ExUnit](https://hexdocs.pm/ex_unit/{{ version[1].version }}/) - unit test library -* [IEx](https://hexdocs.pm/iex/{{ version[1].version }}/) - interactive shell -* [Logger](https://hexdocs.pm/logger/{{ version[1].version }}/) - built-in Logger -* [Mix](https://hexdocs.pm/mix/{{ version[1].version }}/) - build tool +* [Elixir](https://elixir.hexdocs.pm/{{ version[1].version }}/) - standard library +* [EEx](https://eex.hexdocs.pm/{{ version[1].version }}/) - templating library +* [ExUnit](https://ex-unit.hexdocs.pm/{{ version[1].version }}/) - unit test library +* [IEx](https://iex.hexdocs.pm/{{ version[1].version }}/) - interactive shell +* [Logger](https://logger.hexdocs.pm/{{ version[1].version }}/) - built-in Logger +* [Mix](https://mix.hexdocs.pm/{{ version[1].version }}/) - build tool
{% endfor %} #### Development -* [Elixir](https://hexdocs.pm/elixir/main/) - standard library -* [EEx](https://hexdocs.pm/eex/main/) - templating library -* [ExUnit](https://hexdocs.pm/ex_unit/main/) - unit test library -* [IEx](https://hexdocs.pm/iex/main/) - interactive shell -* [Logger](https://hexdocs.pm/logger/main/) - built-in Logger -* [Mix](https://hexdocs.pm/mix/main/) - build tool +* [Elixir](https://elixir.hexdocs.pm/main/) - standard library +* [EEx](https://eex.hexdocs.pm/main/) - templating library +* [ExUnit](https://ex-unit.hexdocs.pm/main/) - unit test library +* [IEx](https://iex.hexdocs.pm/main/) - interactive shell +* [Logger](https://logger.hexdocs.pm/main/) - built-in Logger +* [Mix](https://mix.hexdocs.pm/main/) - build tool diff --git a/index.html b/index.html index 66925b0e5..ae0b354c4 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@
Elixir is a dynamic, functional language for building scalable and maintaina %{"E" => 1, "i" => 2, "l" => 1, "r" => 1, "x" => 1} {% endhighlight %} -

Check our Getting Started guide and our Learning page to begin your journey with Elixir. Or keep scrolling for an overview of the platform, language, and tools. +

Check our Getting Started guide and our Learning page to begin your journey with Elixir. Or keep scrolling for an overview of the platform, language, and tools. @@ -125,7 +125,7 @@

Extensibility and DSLs

Elixir has been designed to be extensible, allowing developers to naturally extend the language to particular domains, in order to increase their productivity.

-

As an example, let's write a simple test case using Elixir's test framework called ExUnit:

+

As an example, let's write a simple test case using Elixir's test framework called ExUnit:

{% highlight elixir %} defmodule MathTest do @@ -151,7 +151,7 @@

Tooling features

A growing ecosystem

-

Elixir ships with a great set of tools to ease development. Mix is a build tool that allows you to easily create projects, manage tasks, run tests and more:

+

Elixir ships with a great set of tools to ease development. Mix is a build tool that allows you to easily create projects, manage tasks, run tests and more:

$ mix new my_app
 $ cd my_app
@@ -170,7 +170,7 @@ 

A growing ecosystem

Interactive development

-

Tools like IEx (Elixir's interactive shell) leverage the language and platform to provide auto-complete, debugging tools, code reloading, as well as nicely formatted documentation:

+

Tools like IEx (Elixir's interactive shell) leverage the language and platform to provide auto-complete, debugging tools, code reloading, as well as nicely formatted documentation:

{% highlight text %} $ iex @@ -196,7 +196,7 @@

Erlang compatible

<<192, 223, 75, 115, ...>> {% endhighlight %} -

To learn more about Elixir, check our Getting Started guide.

+

To learn more about Elixir, check our Getting Started guide.

diff --git a/learning.markdown b/learning.markdown index c78d1ba5a..0a1a0a019 100644 --- a/learning.markdown +++ b/learning.markdown @@ -9,7 +9,7 @@ image: /images/social/elixir-og-card.jpg {% include toc.html %} -Elixir's official documentation includes a [Getting Started guide](https://hexdocs.pm/elixir/introduction.html) to learn more about Elixir's foundations. Later on, it explores how to build projects with [Mix and OTP](https://hexdocs.pm/elixir/introduction-to-mix.html). Elixir also includes [extensive API documentation](/docs.html). +Elixir's official documentation includes a [Getting Started guide](https://elixir.hexdocs.pm/introduction.html) to learn more about Elixir's foundations. Later on, it explores how to build projects with [Mix and OTP](https://elixir.hexdocs.pm/introduction-to-mix.html). Elixir also includes [extensive API documentation](/docs.html). The Elixir Community has also produced plenty of resources to learn the language from different backgrounds and other perspectives. We list some of them below. We are sure you will find a resource that suits your pace and goals.