You and Elixir in 2021/22/23

hey there, i was into operations and due to covid 19 pandemic my closed down and i was looking to change my carrier that’s when i came to know about live_view by my partner a month ago then i started exploring the Elixir Land, i really surprised about the power and capabilities of elixir and phoenix. with little or no programming background and now i’m tinkering elixir/phoenix flutter but i want to learn more.
my observations:
there are not much of learning materials on internet.
it would be great and helpful for newbies if people upload more and more tutorial videos to youtube.
thinking to do some experiment projects on IoT using flutter, rasberryPi, nerves, phoenix, live_view

1 Like

pattern matching :slight_smile:

1 Like
  • What brought you to it? (Was there a specific article, talk or person that prompted you?)

To be honest, I can’t even remember because it’s been more than a year but I think it was because of the Medium article written by Discord - How Discord Scaled Elixir to 5,000,000 Concurrent Users. After that, I read some more articles on Elixir and which companies are using it. How those companies were able to reduce their servers with the help of Elixir. So, yes all this looked way too cool to me XD.

  • Which language did you come from?
    I mostly work with Javascript, ReactJs and Nodejs frameworks. But I also know Java and Python, rarely used Java in any project. Python, mostly for scripting and automating few things.

  • How are you finding it?
    Elixir is great. I used to find recursion so difficult but the way it’s used in Elixir, it has made it very easy. The principle of dividing everything into functions and then chaining them with the help of a pipe operator is also great. I realised that one can understand a lot about programming concepts with the help of Elixir.

  • How do you think you’ll use it?
    Maybe with the help of Phoenix to create APIs as of now? And later on, can check Liveview also. There’s a lot to learn XD.

  • Which bits are you finding easy, which, not so much?
    Some times the syntax is easy and some times it’s difficult (especially those erlang modules, difficult to understand its documentation also).

  • Is there anything missing that you’d like to see included?
    Maybe a library like Xstate to use state machines?

P.S - Bear with my writing part, not so good because of the fatigue this covid gave me :joy:

1 Like
  • What brought you to it? (Was there a specific article, talk or person that prompted you?)

I first found Elixir through a PeepCode video where José Valim was given a coding task from its founder, Geoffrey Grosenbach. The task was to parse the metadata of MP3 files. I was totally hooked after that and began learning it off and on over the years.

  • Is there anything you’d like to see more of or improved or included?

I would like to see the following improved within Elixir/Phoenix:

  • [Elixir] use, import, and alias simplified to simply use import similar to languages like Python

  • [Elixir] see Lumen project come to realization and allowing developers to generate statically compiled binary executables without having to use Dialyzer

  • [Elixir] improved compiler error reporting similar to Elm and Rust

  • [Elixir] simplified function specs similar to Elm and Haskell

  • [Phoenix] add missing HTML helpers within the language like multi-select checkboxes

  • [Phoenix] unify and simplify the CLI. For example, …

    mix phx.new someappname to phx new someappname
    mix ecto.create to phx db:create
    mix phx.gen.json Directory Business businesses ... to phx g json Directory Business businesses ... and phx [delete|d] json Directory Business businesses ...

  • simplify context modules

    Today. defmodule AppName.ContextModule - all functions within a single file

    Solution. defmodule AppName.ContextModule.Movie - all movie functions stored here
    defmodule AppName.ContextModule.Review - all review functions stored here

1 Like

Not really possible as each of these has different raison d’être. Additionally both import and alias are special forms (which need to be understood by the compiler during parsing) and use is simple macro, which mean that you can overwrite it. Making them the same would mean that either using macros would be way harder or it would cause pointless recompilations.

I do not get what you want there. Dialyzer do not generate statically compiled binaries, it is just type checker for Erlang. And statically compiled binaries would cause that a lot of nice properties of the Erlang would need to be abandoned, for example dynamic tracing or hot upgrades.

It is coming up with OTP 24. However due to dynamic nature of Elixir compilation, it will be harder (impossible) to do in 100% of cases.

What you mean there?

Please, no. Ecto is completely separate from Phoenix. Making it seem like part of Phoenix will IMHO cause only harm, just like it is with phoenix_pubsub where people treat it as a part of Phoenix and avoid it in non-Phoenix projects.

About rest - it would needlessly complicate the implementation, as implementing mix phx.gen.json is just creation of Mix.Tasks.Phx.Gen.Json module that implement Mix.Task behaviour. With mix phx gen json it would require Mix.Tasks.Phx task to understand the gen and json arguments and would force the Phoenix team to create new API for providing extensions to such task. Right now if I would like to implement new “format” to the Phoenix I can implement for example Mix.Tasks.Phx.Gen.ETF that will use External Term Format and it will “feel” natural.

You mean something like Phoenix.HTML.Form.multiple_select/3?

But your solution is possible today as well, you just need to create such modules on your own. I do not get what you want.

3 Likes

I was a Ruby dev before coming to Elixir. I used Elixir for a fun project and kinda fell in love with it because Phoenix felt as productive as Rails without the big performance drawback.

So I decided I wanted to help this community grow as much as I could, contributed to a lot of open-source projects, convinced my boss to use it for some projects, got hired by another company, and now I started these livestreams contributing to open source.

It’s being a really fun journey so far… :slight_smile:

5 Likes

Lumen is not for static typing, but to allow running on different environment, like WASM.

But there is a typed Erlang project from FB which can remove the need for Dialyzer.

Elixir is already a mix of multiple languages, Erlang, Clojure and Ruby (for the syntax). But the root is Erlang :slight_smile:

1 Like

FWIW, that project seems to be very stalled - see for instance this mailing list message referenced in a forum post back in February and the archived project repo.

2 Likes

I really want to try out Elixir in a project, but building something by myself is not really motivating me, so I am looking for a project at work to apply Elixir and Phoenix in - just to try out something else than Laravel for a change.

I really curious about how the functionality and features are going to be implemented differently compared to an OOP based framework - and I really want to dive deeper into the whole debugging with iex, it seems really useful.

What I’m mostly worried about is deploying something with it - often articles and tutorials talk about what you need to do and so forth, but what I would love to read is the “don’t do this, because this will expose this port” or something like that - just to know how I might mess things up. I remember reading about bunch of S3 buckets being mis-configured and a lot of sensitive data got exposed, so from that point on, I’ve tried to think in “what might be done wrong” kind of way.

2 Likes

My background is control systems, i.e programming PLCs and SCADA systems and I wanted to build some software tools for that arena. I started with a web app, which I initially wrote in python, then C#, then F# and now elixir.

I needed something that could be installed on client’s machines and through the rewrites I found that I strongly dislike the async/await pattern, I don’t like exceptions for error handling or dependency injection and all the ceremony but I really love functional programming. F# was ok and you can use Akka for the actor model but the community, libraries and development experience are lacking compared to Elixir. I found it a lot quicker to write stuff when you are in the early stages of a project where things change so quickly compared to F# where I felt encouraged to start with domain types.

Elixir is great to work in and I’ll use it for most things but will learn something like Go or Rust or Zig for some things that need to be really fast and easy to run (until lumen is finished, purely for a single binary application).

I found it really easy to pick up as I was trying to learn F# when I started. Docs and forum are great and Sasa’s book is great. I did the free pragprog liveview course which helped understand the model. I find web dev a bit tricky as it’s all new to me and just getting things to look how I want is a stupid amount of work.

There is a bit of work ahead of us to get some better client libraries around things like SQL Server and the LiveView docs could do with a bit more flesh and examples around the JS interop.

When installing on windows, I’d like to be able to choose which OTP version the elixir is compiled in. And pretty much every lib writes their doc’s as if you’re using Unix. My market is people on windows so I use windows.

I’d like to see a more consolidated knowledge base. Information is spread out over a million blog posts, forum posts, Twitter accounts, conference talks and YouTube channels.

1 Like

Lumen isn’t meant to speed up BEAM execution, it is just implementation compiling to WebASM. JIT in the default Erlang VM is what is making Erlang faster right now.

3 Likes

Sorry, I meant just for a compiled binary.

1 Like

Been there with regards to leaving .net behind. Keep moving forward as the pay offs are tremendous.

1 Like

Still not there. Lumen will change nothing in that matter. And all released are “compiled binaries” in the same sense as JARs are compiled binaries. All you need is proper runtime to work with.

And if you want to have something that reassembles static binary when you squint your eyes and tilt head a little, then there is Bakeware

2 Likes

Maybe you can be a sound board when I write my series of deployment articles.

1 Like

Working for rails for some years.
I researched on Elixir and Phoenix to see how fast a framework can be.
Also, I enjoy playing with LiveView. I hope LiveView can have mobile support like Hotwire.

1 Like

I have migrated my entire project from nodejs to elixir + graphql. + performance + easy to maintenance + reduce servers usage :ok_hand:.
Elixir can call nodejs modules inside, so I can use some packages that elixir don’t have.

3 Likes

What are now the limitations of LiveView regarding mobile?

1 Like

I don’t think Lumen will change things much for server apps. But allows client side apps to be built with BEAM language. In the long run I think Lumen might also allow mobile apps to be built with BEAM languages. Of course single fast starting binary executables (because Lumen does AOT) are nice for command line tools etc.

1 Like

I first found Elixir in the 0.8 time frame. I wrote a version of memcached as a learning project. (A toy version.) My day job did’t involve Elixir so other than playing with my learning project I didn’t really use Elixir.

Around the 1.2 time frame I did a lunch and learn presentation since I was still interested and wanted to share. No one was particularly interested. (It’s surprising that people in our business are so resistant to learning new languages and platforms.) Except the chief architect. He saw the value of the OTP right away. So he wrote a little project to handle an auth task. It worked flawlessly. In fact in the two years we ran it we only updated it once. And it ran without issue for months at a time.

After that we started writing new projects in Elixir. They all ran well so we started replacing apps witten in other languages in Elixir. Eventually we rewrote our ad server in Elixir. The original ad server was written in Python but was replaced with one written in nodejs. The nodejs one took a team of engineers two years and was so fragile that it had a team full time babysitting it. The Elixir ad server took 2 engineers 6 months to write and was simple enough to understand that ever junior engineers were comfortable making changes. We replaced 27 nodejs server with 3 Elixir servers. Latency dropped significantly and responce time went from 29ms to 13ms. Building the adserver in Elixir was a massive win.

I haven’t worked in Elixir in a couple years other than a nerves project and a small Phoenix project. (Personal stuff.) I miss it desperately.

Everywhere I go I suggest using Elxir. People look at me like I am insane. But I think people are comfortable with what they know and don’t want to change or make the effort to learn something new. But having worked in this industry for 25 years I know that languages and platforms come and go and you will have to learn something new at some point so you better get used to the idea and embrace change. And why not learn something better than what you are using now?

10 Likes