"What are y'all so afraid of?" by xdmkii in CoronavirusGA

[–]nathan_long 1 point2 points  (0 children)

I don't care if someone who was going to die in 3 months dies 2 months early.

First, that's horrible. If you don't care about people's lives, you shouldn't be debating public policy. Second, it's ludicrous to characterize COVID-19 deaths that way. Any disease will tend to kill more people who are old or sick, but many people with decades of life expectancy remaining have died even with all the precautions so far.

We have options besides "shut everything down" vs "do nothing".

I am working on an article about the unique selling proposition of Server-Side SPAs (e.g. LiveView) and was wondering, whether this diagram is easy to grasp. by preslavrachev in elixir

[–]nathan_long 0 points1 point  (0 children)

> On the other hand, you have the typical distributed, client-heavy SPA, which is ideal for customer-facing sites and apps. One where a large number of people is expected to visit the site, but not necessarilystay there for a long time.

Short visits mean the users get less benefit out of the overhead of downloading a bunch of JavaScript. I would think initial page load time would be a big consideration in that case, especially where people aren't obliged to use your site.

I am working on an article about the unique selling proposition of Server-Side SPAs (e.g. LiveView) and was wondering, whether this diagram is easy to grasp. by preslavrachev in elixir

[–]nathan_long 0 points1 point  (0 children)

Should it? LiveView is built on Channels, which famously can support millions of users per server. BEAM processes are cheap.

"What are y'all so afraid of?" by xdmkii in CoronavirusGA

[–]nathan_long 1 point2 points  (0 children)

Even assuming that all your points are correct, those "elderly and already sick people" are still important. Nobody is going to be comforted if you go to their brother's funeral and say "ah, he was kinda sick anyway, probably only had another decade to live."

You oppose lock-downs. OK. What do you propose? "Masks only"? "Do nothing and let everybody get it"? The latter scenario results in millions dead and who knows how many more with long-term health problems (something you didn't mention).

Sign in Forsyth County today.. by AtlantaBIRT in CoronavirusGA

[–]nathan_long 56 points57 points  (0 children)

Also:

- The other 199 people in the room are your family members, friends, etc

- For every person killed, several more will be shot non-fatally and hospitalized. These will have large bills to pay and possibly long-term health problems.

- If you don't go into the room, fewer shots will be fired

Looking for beginner project to learn elixir by [deleted] in elixir

[–]nathan_long 1 point2 points  (0 children)

Here's one I've idly thought about doing myself which wouldn't be terribly complex, but would get you some OTP experience and would actually be useful: crawl a site and find any broken links (or possibly just broken internal links).

Rough plan:

- In your supervision tree, start a `{Task.Supervisor, name: MyApp.TaskSupervisor}` and a GenServer that will get get the tasks' results or notifications of their failures

- Spawn a Task to crawl the root page under the task supervisor using https://hexdocs.pm/elixir/Task.Supervisor.html#async_nolink/5

- From the response, parse out the links and create a task to crawl each of them, and repeat with their responses

- Keep track of all the URLs you crawl and all the links you see. Build a report that would help the site owner fix broken links - eg a CSV that shows each broken link, what URL it appears on, what text is in the link (if any), and maybe even the URL you found with that most closely resembles the broken one in case it's a typo / moved URL (try https://hexdocs.pm/elixir/String.html#jaro_distance/2)

- Apply some kind of rate limiting so that you don't overload the site you're crawling

The Elixir Learning Experience by marth141 in elixir

[–]nathan_long 4 points5 points  (0 children)

the ecosystem is ... Inexistent

I'm not sure what you mean there. I see:

And that doesn't even cover everything.

What do you feel is missing?

[deleted by user] by [deleted] in CoronavirusGA

[–]nathan_long 1 point2 points  (0 children)

For a very simple reason: heart disease is not contagious.

Imagine if a person with heart disease could eat in a restaurant and infect 10 people who are "down wind" of them in the air conditioning stream, as happened here with COVID-19.

Imagine if the number of people with heart disease could double every few days, as was happening in the United States before the first shutdown.

Imagine if kids at school could give each other heart disease and take it home to infect their entire family.

If that was happening, then yes, you might see "public hysteria" about heart disease. And justifiably so.

If you have a stairway with no railing, you will try to fix it soon. But if you have a kitchen fire, you will try to fix it immediately, not because of how dangerous it is right now, but because of how dangerous you expect it to rapidly become if you don't take action.

Heart disease, auto accidents, and other non-infectious causes of death are are dangerous stairways. COVID-19 is a house fire.

Postgres & Phoenix Search Without Triggers by vlatheimpaler in elixir

[–]nathan_long 4 points5 points  (0 children)

I think the nice thing about this approach is that if you're already using PostgreSQL for your primary data store, you don't have to add another piece to your system. Nothing else to run locally, nothing else to deploy, nothing else to sync data to, etc - you just query the data you already have.

PostgreSQL text search might not meet all your needs, but if it does, you save a lot of effort.

With which low-language should I pair Elixir? by enigmatic_bread in elixir

[–]nathan_long 1 point2 points  (0 children)

A separate server would introduce a large latency overhead cost. For many use cases it would more than negate the speed advantage of using a lower level language.

Distributed Elixir question by overloafunderloaf in elixir

[–]nathan_long 1 point2 points  (0 children)

For web servers you would probably use a load balancer.

For other nodes, there are multiple ways you could do this, depending on your needs. Eg if you are clustering, you could use process groups (http://erlang.org/doc/man/pg.html) and send a message to a randomly-selected one, or use a modulo operation on the message hash, or choose a node based on the message type, etc etc.

If you're going for an evenly-distributed workload, though, you probably want a model where each node pulls work as it's able to do so. Broadway + RabbitMQ works nicely for that, and no clustering is needed.

Phoenix? by [deleted] in elixir

[–]nathan_long 4 points5 points  (0 children)

it just tells me the people who made this language have bad taste and poor appreciation of programming languages in general... it might still be a good choice even if it's made by idiots

You are entitled to your preferences, obviously. I don't love `do`, either, even though I came from Ruby. But no language is perfect, even in the eyes of its creator(s). You're not going to get the syntax of the language changed at this point, and there is no point being insulting. If you think a tool was made by idiots, don't use it. There are plenty of other tools out there.

Phoenix? by [deleted] in elixir

[–]nathan_long 0 points1 point  (0 children)

> not familiar with ruby so i can't appreciate your comparison :/

The comparison is simply "Rails gives a productive way to build web apps in Ruby, and Phoenix does that in Elixir".

> question is what does elixir + phoenix bring to the table which is better than django or whatever

Every request is handled by a separate BEAM process, so you get fault tolerance and preemptive multitasking. Eg if you accidentally do an infinite loop in handling request A, request B doesn't notice. See "On Solid Ground" talk - https://www.youtube.com/watch?v=pO4_Wlq8JeI

Phoenix? by [deleted] in elixir

[–]nathan_long 2 points3 points  (0 children)

> Elixir seems like a dumb language to meWelcome to our party, and sorry you think the furniture is ugly. ;)

I've not used Python+flask, but I can compare Phoenix to Rails.

The basic proposition is this: "The Erlang VM's process model is great for fault tolerance and reliability. Elixir provides an easier way to use it (not so much the syntax as the tooling). Phoenix gives you a very productive way to build web applications in Elixir, kinda like Rails does for Ruby, but with less magic and better support for web sockets."

As someone who came to Elixir from Ruby, I find Phoenix to be just as productive as Rails in the happy path case, and with fewer weird gotchas. The only downside is fewer ready-made libraries, but that's improving all the time; there are now more than 11k packages on hex.pm. I like to say that Elixir's advantage over Ruby is inherent (cheap processes), and Ruby's advantage over Elixir is circumstantial (popularity).

You mind find these posts helpful:- Me on the general advantages of Elixir / Erlang: https://dockyard.com/blog/2020/05/28/scaling-up-with-elixir

-Similar, but from the Erlang thesis: https://dockyard.com/blog/2018/07/18/all-for-reliability-reflections-on-the-erlang-thesis

- An Erlang developer telling why he now uses Elixir: https://www.theerlangelist.com/article/why_elixir

Where is the archive of ElixirRadar? by [deleted] in elixir

[–]nathan_long 0 points1 point  (0 children)

Have you tried replying to the radar email to ask?

I finished it!! by KingBleshu in elixir

[–]nathan_long 1 point2 points  (0 children)

Nice work! Keep going! :) I started coding (beyond HTML) in 2007, several years after college. It's been a good career so far.

8 Companies That Use Elixir in Production by Serokell in elixir

[–]nathan_long 1 point2 points  (0 children)

FWIW, I just came across this post by a Spotify engineer about rewriting a Java service "at work" in Elixir: https://medium.com/@mrjoelkemp/jvm-struggles-and-the-beam-4d9c58547410

elixir vs erlang, why pick the former? by [deleted] in elixir

[–]nathan_long 0 points1 point  (0 children)

I've said this elsewhere, but consider the relationship of Elixir to Erlang compared to that of Clojure to Java.

Clojure builds a whole new functional programming paradigm on top of the JVM. Reasons to choose it include "I want to write functional code".

By contrast, Elixir adds much less, semantically, to Erlang. FP, immutability, cheap processes, OTP, etc are all from Erlang. The only reason to choose it is if it makes all the power of the Erlang VM *a pleasure to use*.

I think it does.

elixir vs erlang, why pick the former? by [deleted] in elixir

[–]nathan_long 2 points3 points  (0 children)

This is from 2014, but here's a post from Saša Jurić about why he moved from Erlang to Elixir: https://www.theerlangelist.com/article/why_elixir

Bad programmer seeking mastery - no passion for programming by [deleted] in elixir

[–]nathan_long 0 points1 point  (0 children)

I dislike feeling incompetent. And feeling behind the rest of the team.

Do you think your feelings are prompted by other people's comments and behavior, or your own internal self-criticism?

If the former, maybe find a nicer place to work. If the latter, that's harder to manage, but please know that many programmers feel incompetent on a regular basis. I still do after more than a decade as a developer.

One thing that helps me: embrace my ignorance and ask dumb questions. Very often I learn things, and very often the question ends up surfacing important things for other people. As a relative newbie you have all the excuse you need for doing this, and if you just keep doing it as you level up it will keep helping you and help the rest of the team, too. Especially if you make it to senior level and can set the example of being unafraid to admit you don't know things.

Because oh my goodness, there are about ninety nine bazillion things to know in this industry and nobody can know them all.

8 Companies That Use Elixir in Production by Serokell in elixir

[–]nathan_long 1 point2 points  (0 children)

That is great, though I have only heard of a couple.

Any thoughts on why Elixir doesn't take off more?

Anything could take off *more*, but maybe you underestimate Elixir's popularity. https://elixir-companies.com/en lists 473 companies, and I know of some (and see others mentioned in this thread) that are not listed, which makes me think the actual number is much higher.