Elixir tutorial for TypeScript developers

preview_player
Показать описание
Join this channel to get access to perks:

Рекомендации по теме
Комментарии
Автор

And just complementing the video. In Elixir we have directives, like @type and @spec, that can be used to add more semantic, so you can do this:

@type word() :: String.t()

@spec long_word?(word()) :: boolean()
def long_word?(word) when is_binary(word) do
String.length(word) > 8
end

And when you use that with this library: dialyxir. It's going to be able to understand the code, and return a warning to you if this `long_word?` function is not returning boolean, it's not perfect, but it helps a lot.

And you can use the @type, to add more info on your struct, like this:

defmodule User do
defstruct [:name, :age]

@type t :: %__MODULE__{
name: String.t(),
age: integer()
}
end

it's not gonna check on compilation, but it helps as a documentation.

BrunoRibeiroDev
Автор

This channel is a treasure. It's so hard to find updated Elixir content on YouTube. I feel like Elixir is very underrated, but I really want to learn Elixir deeply because it's Elixir. Thank you so much.

zed-im
Автор

Daniel - your material is very good. It shows how things work with Elixir. To do justice - Elixir has a ton of great functionality - pattern matching, FP, great concurrency, nice libraries.

But that's not all - there is need to separate and evaluate separately two separate topics:
1. LSP performance, including: completion, diagnostics, highlighting, etc. - unfortunately, it is very poor here. Elixir's LSP compared to other languages (such as TS, Golang, Java, PHP, and even running on Erlang's VM - Gleam) - is nightmarish. In fact, I'm hard pressed to find any language used in 2024 that has such a poor LSP as Elixir. This is an overwhelming disadvantage that cannot be overlooked, for most developers it is a disqualifying disadvantage for the language.

2. Typing - and in the case of Elixir - no typing - which, with the quality of the LSP as I described above, only compounds the poor developer experience. Yes, static typing can be a disadvantage or an advantage, but at the same time static typing is inextricably linked to a more efficient LSP. By the way, let's remember that static typing does not have to be explicit - this is perfectly demonstrated by oCaml - you can write code there practically without explicit typing (which looks directly like code from a dynamically typed language) and the compiler and LSP know perfectly well what data type they are dealing with anyway and inform the developer about it.

Without a meaningful LSP - I wouldn't dare to use Elixir commercially - I just like too much not to get frustrated with the tools I use to make money.

coder_one
Автор

The way he says "error" keeps the video intersting

asratefrem
Автор

20:08 Don't be sorry for the long explanation, it's crystal clear and i appreciate it

tetreur
Автор

I used Elixir for 3–4 months and the language itself is just wonderful and very enjoyable to work with.

But what you showed in this video are not "types" as you say "like TypeScript" or any other types. They are not "types" at all.
A "type" is basically meant to be used at compile time, but what you're doing is testing at runtime, and that's precisely the issue.

Types do not exist for the computer, they are made for us humans to build complex software easier. Once the compilation happens, all types are removed, everything is pure binary. Types are syntactic sugar, so if they are not helping at "compile time" they are basically useless.

I know that types are coming to Elixir, and I'm so excited, but I think it will take a long time for the community to rewrite all the important libraries and all the main standard Elixir packages.
But I'm sure it will be beyond amazing to use, and probably my top 3 languages.


I also looked at Gleam, and it seems promising, but I'm not a big fan of compiling to JS, WASM, Erlang at the same time and not having a standard library...

aghileslounis
Автор

daniel please do create more long form tutorials on pheonix fundamentals too.

prashlovessamosa
Автор

Nice vid what theme and font for vscode are you using?

matthieu
Автор

Awesome content man! I want to bring new elixir content as well. Keep up the good work✌

BrunoRibeiroDev
Автор

Great video. For me, leaving OOP land for FP Elixir land took a lot of unlearning! I really wished I learned Elixir first. All of it is so well thought out.

solvm
Автор

I guess, Elixir is more strict comparing to TS for me :) Nice video, man!

kvatofermer
Автор

Please continue video on elixir, youtube need more of it 🙏

pseudo-aleatoire
Автор

Can you make videos about ecto? I know it is huge area, but the changemap does not make sense to me at all, and people are also talking about how it can be used outside of just DB interactions.

flipperiflop
Автор

Any advice on picking it as first language formally?

theuser
Автор

Caraca, tua pronúncia é muito boa, eu até pensei que fosse um gringo no início do vídeo, como vc pratica a sua pronúncia?

gatogordo
Автор

"when" gives you functions overloading

snatvb