Questions tagged [elixir]

Elixir is an open-source, dynamic, compiled, general purpose functional programming language. It was designed to be fully compatible with the Erlang platform and is well suited to writing fault-tolerant, distributed applications with soft real-time guarantees and the ability for hot-code-swapping.

enter image description here

Elixir is an open-source, dynamic, compiled, general purpose functional programming language. It was designed to be fully compatible with the Erlang platform and is well suited to writing fault-tolerant, distributed applications with soft real-time guarantees and the ability for hot-code-swapping.

Elixir was designed with programmer productivity as a core concept and features:

  • Concise friendly syntax
  • Simple meta-programming with Macros
  • Scale facility and process orientation
  • Awesome documentation and testing built-in
  • Polymorphism with Protocols

Learning

Packages

Popular Elixir Projects

Books

Screencasts

Community

9482 questions
4
votes
1 answer

ElixirLS compiles without OTP EEP48 docs

Recently I had problem that I can't solve. It's about Elixir LS, when I run language server, it displays this message: {"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS…
4
votes
2 answers

Escape 5 or 6 hex digit Unicode codepoint

In the Elixir documentation it says that you can use the following escapes: \xNN - A byte represented by the hexadecimal NN \uNNNN - A Unicode code point represented by NNNN So what if I want to escape a codepoint that's longer than 4 hex digits,…
Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
4
votes
2 answers

How to debug Elixir with erlangs GUI debugger on Ubuntu-based linux?

I installed Erlang and Elixir as recommended in the Elixir documentation for Ubuntu & Debian. The results of running elixir -v: Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [jit] Elixir 1.13.0 (compiled…
4
votes
0 answers

How do you make a SSL server with a Pre-Shared Key in Erlang?

I'm trying to create a simple SSL server that uses a Pre-Shared Key to authenticate a client (no ssl certs). It seems this functionality exists in the Erlang ssl module, but it's unclear to me how to use it effectively. It's worth mentioning I'm…
clone1018
  • 1,207
  • 2
  • 10
  • 13
4
votes
0 answers

How do I validate an input in elixir?

I am trying to write tests using hound and elixir and I cant seem to figure out a way to validate what was input into an input field... There is obviously a way to do this, but I have not figured out how to do so.... Example:
Kody Berry
  • 111
  • 1
  • 7
4
votes
2 answers

Extract date from string using Regex.named_capture

I would like to take a string like "My String 2022-01-07" extract the date part into a named capture. I've tried the following regex, but it only works when there's an exact match: # Does not work iex>…
Peter Brown
  • 50,956
  • 18
  • 113
  • 146
4
votes
2 answers

Merge list items having more list and items

I am working on a list that happens to have such items [ %{localtions: [], doctors: [%{name: "Junaid", hospital: "west"}, %{name: "Farooq", hospital: "test"}]}, %{localtions: [%{name: "Dom", address: "test"}, %{name: "Domi", address: "west"}],…
Junaid Farooq
  • 2,484
  • 5
  • 26
  • 63
4
votes
1 answer

In Elixir, why is "alias" preferred over "import" for importing the modules?

Note that imports are generally discouraged in the language. When working on your own code, prefer alias to import. I found this statement in the documentation but further explanation is not available there.
4
votes
1 answer

Obtaining SSL cert using Elixir and Erlang ssl module

I'm trying to validate my websites SSL certificate with help from the tls_certificate_check library, Elixir and some calls to the Erlang :ssl module. The end goal is get the expiration date of the certificate, and maybe some other metadata. Here is…
wgwz
  • 2,642
  • 2
  • 23
  • 35
4
votes
1 answer

Phoenix LiveView Nested Associations Form

I'm experimenting with Phoenix 1.6 and LiveView, and trying to get my nested form/models to work as expected. I have a schema with something like: Parent, Child, where Parent has_many Children // Child belongs_to parent. I have a LiveView component…
mc92
  • 475
  • 5
  • 10
4
votes
0 answers

Stacktrace in erlang tracer

Is it possible to return a stacktrace in a trace? I'm using :dbg.tp/3 and :dbg.tracer/2 to get a trace along with the calling module. I tried caller function (see in docs: https://erlang.org/doc/apps/erts/match_spec.html) but it gives me the very…
Kanes115
  • 119
  • 6
4
votes
2 answers

Building docker amd64 images on mac M1 chip

I'm trying to build a dockerfile on my mac M1 (arm64) in two ways (important part of dockerfile below): FROM erlang:24 # elixir expects utf8. ENV ELIXIR_VERSION="v1.12.2" \ LANG=C.UTF-8 RUN set -xe \ &&…
akad
  • 31
  • 1
  • 3
4
votes
2 answers

What does "@" do in Elixir?

I have been looking through some coding solutions and they show the "@" symbol; however, I can't really seem to figure out what that symbol does by looking through documentation. What does the @ symbol do in Elixir, and why is it important? Here is…
Andrew Bregman
  • 190
  • 1
  • 17
4
votes
1 answer

VS Code Elixir F2 "rename symbol" not working

I'm using ElixirLS: Elixir support and debugger JakeBecker.elixir-ls and editor.formatOnType is working just fine. Pressing F2 to rename a variable doesn't work. There is no Output from ElixirLS. What I've tried: Using the Command Palette…
Tom Hale
  • 40,825
  • 36
  • 187
  • 242
4
votes
1 answer

Cowboy/Ranch kills handler process when client closes connection

I have Phoenix application with complex business logic behind HTTP endpoint. This logic includes interaction with database and few external services and once request processing has been started it must not be interrupted till all operations will be…
1 2 3
99
100