Live data from Hacker News

Lovely Week with Elixir

ramblingcode.dev

91–100 of 139 posts

Re: Lovely Week with Elixir

#91
post #46

Earlier quoted context omitted.

Wait, how does that answer prevent only one instance of the job across the whole system? That's what I'd use Redis or something for - for locking.

You can use tricks like the global spawn option to make processes globally unique. Doesn't scale infinitely, but for a 2->low double digits HA/load balanced system it should be fine.

Oh wow, so this will work across multiple instances of the BEAM?

Re: Lovely Week with Elixir

#92

Earlier quoted context omitted.

Check out the Elixir "protocol" feature, it's similar to interfaces: https://elixir-lang.org/getting-started/protocols.html

Protocols + the Typeclass library [0] makes for some of the most extensible Elixir code I've worked with. [0] https://github.com/witchcrafters/type_class

Hi Elixir friend! Have you done a blog post on this by chance? I'd be really interested in reading one.

Re: Lovely Week with Elixir

#93
I wrote two blog posts before on Elixir:

The first piece is longer, on my journey learning Elixir and building machine learning libraries.

https://fredwu.me/blog/2016-07-24-i-accidentally-some-machin...

The second piece is shorter, on Elixir’s functional aspect and how doctest changes the way I code.

https://fredwu.me/blog/2017-08-07-elixir-and-doctest-help-wr...

Re: Lovely Week with Elixir

#94
The only downside I've found with Elixir is that because of the language and runtime internals, it doesn't really lend itself to power serverless/lambda functions (like Python, Ruby, Go, etc).

Re: Lovely Week with Elixir

#95
post #92

Earlier quoted context omitted.

Protocols + the Typeclass library [0] makes for some of the most extensible Elixir code I've worked with. [0] https://github.com/witchcrafters/type_class

Hi Elixir friend! Have you done a blog post on this by chance? I'd be really interested in reading one.

I haven't, but the creator of the library (Brooklyn Zelenka / @expede) has given a few excellent talks that reference her libraries. This is a personal favourite: https://www.youtube.com/watch?v=JD0FJTmuV_Q

Re: Lovely Week with Elixir

#96

I love Elixir. Phoenix makes web development a pleasure and LiveView is even more exciting. I would love to find a job doing it.

My team at Synopsys is hiring. We were recently acquired by them, and we build dynamic security analysis tools in Elixir, and make heavy use of Phoenix and GraphQL through Absinthe. We're also open to remote work, and have offices in most large cities.

The job posting is a little bit generic, but it's specifically for my team: https://sjobs.brassring.com/TGnewUI/Search/Home/Home?partner...

Feel free to reach out to me (my website is in my profile) if you want more info!

Re: Lovely Week with Elixir

#97
post #33
post #8

If you're interested in using Elixir, jump right into Phoenix with LiveView. It is fantastic for prototyping new tools. Once you learn the basics of LiveView, it's ridiculously easy to create the web UI that interacts with your Elixir back-end. For a while I was using Phoenix Elm as my stack and I enjoy programming in Elm. But there's a lot of boilerplate you have to tediously connect for every input and output on bo…

I really hope there's a book covering more in depth on how to use LiveView. Im a little bit of a noob in programming and mostly learn using book for the first few steps. A lot of my coworker asking me to learn through docs as it seems to be more "full" but I found it's a bit steep learning with it compared to book that usually hold your hand through each concept. This is how I learnt Go web programming about 8 months…

[deleted]

Re: Lovely Week with Elixir

#98
Elixir and Phoenix are living proof that functional programming can be easy - most of the time you just play with struct and functions, that's basically it. No need to pay attention to monads and type classes.

On the other hand, it also reflects functional programming is also more straightforward than Object-oriented programming because it's more objective to just model the data, than modeling the data and procedures at the same time. If you have two people writing the same thing, there's a much larger chance they'll yield similar or identical results.

Re: Lovely Week with Elixir

#99
post #91

Earlier quoted context omitted.

You can use tricks like the global spawn option to make processes globally unique. Doesn't scale infinitely, but for a 2->low double digits HA/load balanced system it should be fine.

Oh wow, so this will work across multiple instances of the BEAM?

If they are clustered using erlang clustering, yes. https://erlang.org/doc/man/global.html

Note that this works by taking a transaction lock on the entire cluster, so it's not recommended if you're making requests frequently. It also doesn't respect netsplits, unless you instruct in code to fail with a deficient cluster membership.

Post reply on HN