Update from the Elixir team - 2018

Update from the Elixir team - 2018

Faafc04d9e69b73b9f49995fd4c94d4d?s=128

Andrea Leopardi

May 31, 2018
Tweet

Transcript

  1. Update from the Elixir team elixir-lang.org

  2. @whatyouhide

  3. None
  4. None
  5. weedmaps.com/careers

  6. Elixir v1.0 Sep 2014 > 180 contributors

  7. Elixir v1.6 Jan 2018 > 730 contributors

  8. • Follow two- to three-part commands: "Put your book away,

    brush your teeth, and then get in bed." • Recognize familiar word signs such as "STOP" • Better understand the concept of time • Count ten or more objects • Correctly name at least four colors and three shapes Elixir 1.0 is almost 4yo
  9. Release every 6 months v1.5 → mid 2017 v1.6 →

    beg 2018 v1.7 →
  10. IMPROVEMENTS IN v1.6

  11. None
  12. Code formatter

  13. def foo ( a, b ) do a+ b end

    def foo(a, b) do a + b end
  14. Feature complete formats code is configurable (for some things) supports

    formatting entire Mix projects (.formatter.exs)
  15. None
  16. Dynamic supervisor

  17. simple_one_for_one confusing/mixed API documentation

  18. opts = [strategy: :one_for_one] {:ok, sup} = DynamicSupervisor.start_link(opts) DynamicSupervisor.start_child( sup,

    {Agent, fn -> %{} end} )
  19. "Just like simple_one_for_one but actually simple"

  20. Documentation

  21. @deprecated/@since @doc "Breaks a collection into chunks" @since "1.0.0" @deprecated

    "Use chunk_every/2 instead" def chunk(collection, chunk_size) do chunk_every(collection, chunk_size) end
  22. @deprecated/@since @doc "Breaks a collection into chunks" @since "1.0.0" @deprecated

    "Use chunk_every/2 instead" def chunk(collection, chunk_size) do chunk_every(collection, chunk_size) end
  23. @deprecated/@since @doc "Breaks a collection into chunks" @since "1.0.0" @deprecated

    "Use chunk_every/2 instead" def chunk(collection, chunk_size) do chunk_every(collection, chunk_size) end
  24. Library guidelines

  25. Compatibility table with Erlang/OTP

  26. Table of deprecations

  27. UX

  28. --slowest N $ mix test --slowest 2 Finished in 1.4

    seconds Top 3 slowest (0.9s), 61.0% of total time: * test client suicide (602.8ms) (RedixTest) * test unable to connect (201.2ms) (RedixTest) * test timeouts (101.8ms) (RedixTest)
  29. 10-20% compilation speedup with OTP21 definitely thanks to us

  30. defguard

  31. defguard is_drinking_age(age) when age >= 21 def serve_drink(%User{age: age}) when

    is_drinking_age(age) do # Serve the drink end
  32. FUTURE

  33. None
  34. StreamData data generation property-based testing +

  35. Enum.take(StreamData.integer(), 2) #=> [1, -2]

  36. use ExUnitProperties
 property "bin1 <> bin2 always starts with bin1"

    do check all bin1 <- binary(), bin2 <- binary() do assert String.starts_with?(bin1 <> bin2, bin1) end end
  37. only stateless testing... ...but discussion started for stateful testing

  38. __STACKTRACE__

  39. try do apply(mod, fun, args) catch :error, val -> {:error,

    {val, __STACKTRACE__}} end
  40. Configuration and releases

  41. Solve problems with Mix.Config Streamline releases and integrate with Mix

  42. Docs chunk

  43. EEP 48 documentation storage and format

  44. Standard API for all BEAM languages Access to docs in

    the shell + (Elixir already has this)
  45. RESEARCH PROJECTS

  46. Google Summer of Code

  47. StreamData + typespecs

  48. Enum.take(from_type(timeout/0), 3) #=> [0, :infinity, 927] @type timeout() :: non_neg_integer()

    | :infinity
  49. check all arg1 <- from_type(timeout/0) do result = my_fun(arg1) assert

    is_integer(result) end @spec my_fun(timeout()) :: integer()
  50. ElixirBench

  51. mix dialyzer

  52. TensorflEx: Tensorflow bindings for Elixir

  53. github.com/elixir-lang/elixir

  54. elixir-lang.org