5 Questions to 9 Elixir Developers for the 10th Anniversary of Elixir Language

On May 24, we all celebrated the 10th anniversary of Elixir!

It was on this occasion that we asked our Elixir developers about how they started their adventure with Elixir language, how long it took to learn Elixir to feel confident in this language, what advice that they would give to developers who want to learn the Language, and what sources they use for learning Elixir and everyday work.

If you’re curious about how #CuriousPeople do it, check out this blog post!

https://curiosum.com/blog/questions-to-elixir-developers-10th-anniversary-of-elixir-language

Elixir Meetup #6 ▶ hosted by Curiosum ▶ Gustavo Oliveira & Adolfo Neto

6th Elixir Meetup hosted by Curiosum ▶ http://curiosum.com

We discussed 2 presentations of our Elixir experts:

  • Gustavo Oliveira: TDD with Liveview simpler than you imagine! Description: We have been discussing TDD for over 10 years ago, and how good amazing is this tool for companies and developers. In this presentation, you will learn how to use TDD with Liveview and how easy, simple, fast and reliable you can build your apps using simple techniques.

  • Adolfo Neto: Learning Erlang and Elixir through Exercism and Advent of Code Description: There are numerous authorization libraries for Phoenix Framework - I will show you why none of those does it right and how we’re crafting the ecosystem’s first access control library that integrates seamlessly with both Plug and LiveView and perhaps more than that.

https://youtu.be/MPiWqmTfgK4

Lazy Sequences in Elixir and Erlang

In the article, we demonstrate and compare standard primitives for working with lazy sequences in Elixir and Erlang. While Elixir’s ones seem pretty well known, the ones from Erlang seem a bit underrated.

https://dev.to/savonarola/lazy-sequences-in-elixir-and-erlang-3mne

How LiveView got rid of dangling processes in tests – and how we can do the same

Before LiveView 0.13, testing LiveViews with database operations sometimes resulted in a big wall of red text. Then in LiveView 0.13 they were gone. I always wondered how that was fixed. I finally took a deep dive to find out.

https://germanvelasco.com/blog/how-live-view-got-rid-of-dangling-processes-in-tests

ThinkingElixir 103: Vaxine.io and CRDT DBs with James Arthur

In episode 103 of Thinking Elixir, James Arthur shares his project Vaxine.io, an Elixir layer built on top of a CRDT based distributed Erlang database called Antidote DB. We cover what CRDTs are and introduce how they work. We learn more about Antidote DB, the CURE protocol and especially the Vaxine.io project that adds Ecto types and makes it more approachable to Elixir applications. As applications become more global, the need for strongly consistent distributed writes is more important.

https://podcast.thinkingelixir.com/103

A Guide to Phoenix LiveView Assigns

Let’s demistify LiveView assigns and see how they work in practice. https://blog.appsignal.com/2022/06/14/a-guide-to-phoenix-liveview-assigns.html

OLEDVirtual 1.0.0 released

Today, OLEDVirtual 1.0.0 got released. It is a library to mock the oled library for local development.

Now you can code interactions with an OLED screen without building a Nerves firmware and deploying it into the device for each change.

It also comes with a MultiDisplay module to power both the real OLED screen and the virtual display at the same time, which is great if you want to keep a display preview in your web interface using e.g. Phoenix LiveView (guide included).

Dealing with idempotence in Elixir projects with the Ecto sandbox: benefits and points to consider

As a QA team, we quickly faced a challenge encountered by all teams when they build their test automation solution: successfully controlling our environment and restoring our initial dataset in order to respect the idempotence of executions. To manage this, we chose to activate the Ecto sandbox for our Cypress tests. In this article, we will focus on the benefits of this sandbox as well as the things to look out for from a QA perspective.

https://medium.com/wttj-tech/dealing-with-idempotence-in-elixir-projects-with-the-ecto-sandbox-benefits-and-points-to-consider-e16039bb2c21

wxErlang Hello World

In this post I explore wxErlang, a binding for wxWidgets. https://hidnasio.github.io/elixir/wxerlang/2022/06/08/wx-erlang-hello-world.html

TypeCheck v0.12.0 released

Version 0.12.0 of TypeCheck has been released! 🚀

Additions:

Per-dependency configuration

The default options used are now fetched from the application configuration. This means that you can configure a default for your app as well as for each of your dependencies(!) by adding config :app_name, :type_check […] to your configuration file(s).

(This configuration can then further be overridden per module, which was already possible in earlier versions.)

Building types and checks for external functions

If you want to use types from modules outside of your control, until now you had to manually recreate them. Now, the TypeCheck.External module allows fetching the ‘normal’ types and specs from a compiled module. Specifically:

  • TypeCheck.External module, with functions to work with typespecs in modules outside of your control.

    • fetch_spec to build a TypeCheck type from any function that has a @spec.
    • fetch_type to build a TypeCheck type from any @type.
    • enforce_spec! to wrap a call to any function that has a @spec with a runtime type-check on the input parameters and return value.
    • apply and apply! to wrap a call to any function with the function spec type that you give it.
iex> TypeCheck.External.enforce_spec!(Kernel.abs(-13))
13
iex> TypeCheck.External.enforce_spec!(Kernel.abs("hi"))
** (TypeCheck.TypeError) At lib/type_check/external.ex:175:
    `"hi"` is not a number.

This functionality is still very new, so we consider it to be a little experimental. In the near future, it might be integrated further with the rest of the library. For instance, we might add syntactic sugar to make ‘type overrides’ easier.

I want to take this opportunity to thank @orsinium greatly. Both the idea and the implementation of this functionality is his work! :star_struck:

Defstruct!

TypeCheck.Defstruct.defstruct!, a way to combine defstruct, @enforce_keys and the creation of the struct’s type, reducing boilerplate and the possibility of mistakes. (c.f. #118 )

Example:

defmodule User do
  use TypeCheck
  use TypeCheck.Defstruct

  defstruct!(
    name: "Guest" :: String.t(),
    age: _ :: non_neg_integer()
  )
end

is syntactic sugar for:

defmodule User do
  use TypeCheck
  use TypeCheck.Defstruct

  @type! t() :: %User{
    name: String.t(),
    age: non_neg_integer()
  }
  @enforce_keys [:age]
  defstruct [:age, name: "Guest"]
end

Fixes:

  • Long-standing issue where Dialyzer would sometimes complain in apps using TypeCheck is resolved. (c.f. #95)
  • Creation of the new maybe_nonempty_list type will no longer get stuck in an infinite loop on creation. (c.f. #120)

This new release is just in time for ElixirConf.EU where I will be speaking about TypeCheck. I look forward to see a lot of you there (live or virtually)!

There will also be stickers! 😊

As always, you can find TypeCheck on Hex.PM, on GitHub and on the Elixir forum.

ThinkingElixir 102: Machine Learning in Elixir with Sean Moriarity

In episode 102 of Thinking Elixir, Sean Moriarity, the author of Genetic Algorithms in Elixir, lays out Machine Learning in the Elixir space. We talk about where it is today and where it’s going in the future. Sean talks more about his book, how that led to working with José Valim which then led to the creation of Nx. He fills us in on recent ML events with Google and Facebook and shows us how Elixir fits into the bigger picture. It’s a fast developing area and Sean helps us follow the important points even if we aren’t doing ML ourselves… because our teams may still need it.

https://podcast.thinkingelixir.com/102

Elixir Code Smells with Lucas Vegi and Marco Tulio

In this episode we talk with Lucas Vegi, professor at UFV and PhD student at UFMG, and Marco Tulio Valente, professor at UFMG, about the paper entitled Code Smells in Elixir: Early Results from a Grey Literature Review

English subtitles available

https://www.elixiremfoco.com/episode?id=lucas-vegi-e-marco-tulio

Is the test LiveView immutable or not?

Someone from my Testing LiveView course recently asked me about the immutability of the view we get from live/2 in LiveView tests. It’s not the first time someone’s asked me that question, so I wanted to try to clarify things a bit. I hope this helps others too! https://www.germanvelasco.com/blog/is-the-test-liveview-immutable-or-not

Elixir metrics and StatsD

I wrote a new article in the “Elixir Telemetry” series.

Read it here:

https://blog.miguelcoba.com/elixir-metrics-and-statsd

Petal Components - ElixirCasts

In this episode, we’ll learn how to use Petal Components in a Phoenix application.

https://elixircasts.io/petal-components

The Comprehensive Guide to Elixir's List Comprehension

List comprehensions are one of my favorite features of Elixir and I am excited to finally be writing about them! In the article I go over every single feature and option of the comprehension, how to use them, and how they compare to Enum and recursive functions.

https://www.mitchellhanberg.com/the-comprehensive-guide-to-elixirs-for-comprehension/

IntelliJ Elixir v13.1.0

Changelog

v13.1.0

Enhancements

  • New Project > Language > Elixir includes all mix options

    • –app
    • –module
    • –sup
    • –umbrella
  • Add mix format external formatter. Requires project or module SDK be set in order to run. If the SDK is not available, only the internal formatter will be used. The internal formatter is still used for file subsection formatting and new line indenting as mix format works at the file-level.

    • Allow mix format external formatter to be disabled.
      1. Preferences
      2. Editor > Code Style > Elixir
      3. Click the mix format tab
      4. Expand the General group
      5. Uncheck “Format files with mix format“.
  • Support Elixir 1.13.0 in debugger.

Bug Fixes

  • Look above CallDefinitionImpl for Type scope processing It should go up to the ModuleImpl to find the TypeDefinitionImpl.
  • Have Credo Global Inspection use standard Mix.commandLine used for Run Configurations.
    • Allow environment variables to be set similar to Run Configurations for projects that require environment variables to be set for Mix tasks due to checks in their config.
    • No longer support Include Explanations as it takes too long to run.
    • Remove annotator until it can be re-implemented in performant manner using corrected environment and SDK from Global Inspection.
  • Fix Find Usages that resolve to compiled types.
    • Add element description for TypeDefinitionImpl
      • Node Text is @<module_attribte> <name>(<parameters>) :: …
      • Long Name and Short Name are just the name
      • Type is type
    • Mirror TypeDefinitionImpls to types in decompiled source. Allow TypeDefinitionImpl.getNavigation to go to decompiled types.
  • Allow types with atom keyword names to be highlight even though they are invalid names.
  • Restore Project configuration for Small IDEs. I dropped an ! when converting from equals to == when fixing the deprecation warnings, which made the Project SDK selection only be HIDDEN where it needed to be SHOWN.
  • Catch StackOverflowError in find_usages.Provider.getType().
  • Element descriptions for CallDefinitionImpl
  • Highlight CallDefinitionImpl references as predefined if resolved CallDefinitionImpl is in Kernel or Kernel.SpecialForms. Fixes highlighting def and other defined when using SDKs without source like Homebrew after the delayed-decompilation fixes from 12.2.1. Now source-less (Homebrew) and SDKs with sources (ASDF) will both be able to highlight predefineds.
  • No longer record the SDK name as an attribute of the Facet configuration, as it didn’t write back changes.
    • Instead detect the Elixir SDK by finding any of the libraries that have an Elixir SDK name in the module. (The Elixir SDK was already being added as a library to allow indexing the SDK.)
  • Clear out any existing Elixir SDKs listed as module libraries before setting a new SDK. This eliminates the duplicates that happened before. (It turns out the JetBrains API doesn’t prevent duplicates. Oopsie.) It also ensures that no SDK is recorded if the SDK is deselected in the UI, which wouldn’t happen before.
  • In IntelliJ 2022, the New Project dialog changed and it no longer automatically listed ModuleType.getBuilder ModuleBuilders as potential project builders, so it looked like Elixir New Project support disappeared. Fix this by implementing the newProjectWizard.language extension that was added to control the Language switching in the new New Project dialog.
  • Remove references to ElementClassHint in BeamFileImpl that only work in IntelliJ. ElementClassHint is part of the processDeclaration system used in Java and so was in the code because BeamFileImpl was original based on ClassFileImpl, but since the Elixir resolvers don’t use the hint system at all, it can just be removed.
  • Fix environment not being passed to debug runs of ESpec and ExUnit Run Configurations. The env from the Configuration was dropped because a local env was created to set MIX_ENV true.

Installation Instructions

🎉 Announcing the Paraxial.io Beta Launch!

Paraxial.io protects your Elixir/Phoenix application from bots attempting automated logins, scraping, and disruption of service. Today we are happy to announce the beta program is open to new users!

To sign up, email support@paraxial.io with a brief description of your website. The beta is open to anyone with an Elixir/Phoenix application, from a personal project to larger corporate site.

https://paraxial.io/blog/beta-announcement

ThinkingElixir 101: Replicating SQLite using Litestream with Ben Johnson

In episode 101 of Thinking Elixir, Ben Johnson explains his project Litestream.io, an OpenSource tool that replicates SQLite databases to remote servers and to backup locations like S3 for durability. We talk about how moving data out to the user creates true edge applications. We discuss what types of problems this helps solve, the architectures that become possible, and how a globally distributed Phoenix application could use this. He shares how Fly.io acquired the project and brought him on full-time to continue his work on it. Fascinating discussion that challenges many of the assumptions about how we’ve been building “web” systems for years.

https://podcast.thinkingelixir.com/101

Algebraic Data Types in Elixir

Discover the ins and outs of ADTs and their benefits for your Elixir app. https://blog.appsignal.com/2022/05/31/algebraic-data-types-in-elixir.html

Previous page Next page