Live data from Hacker News

Phoenix 1.7 is View-less

germanvelasco.com

201–210 of 224 posts

Re: Phoenix 1.7 is View-less

#201

Earlier quoted context omitted.

Thanks. I’m on the pattern matching section of that course now, and and am loving the style so far. I like that the explanation isn’t solely dependent on the videos, too.

Also, if I may, recommend two videos to watch which is what got me into Elixir in the first place. 1. "The Soul of Elixir and Erlang" - https://youtu.be/JvBT4XBdoUE ; this fast-paced talk by Sasa Juric will highlight exactly what is special about Elixir/Erlang in terms of fault-tolerance and scalability 2. "Using the Beam to Fight COVID-19" - https://youtu.be/cVQUPvmmaxQ ; this highlights a real-world use of Elixir a…

Thanks. Added all of these to my list :)

Re: Phoenix 1.7 is View-less

#202
post #59

Earlier quoted context omitted.

Actually, I think the next big unlock in user adoption is static typing. Lack of it is frequently cited as the number one reason that makes people hesitate in switching to Elixir. I know it is an active research project right now, and I hope it bears fruit.

I really don’t get this, personally. I’ve worked in Java, Ruby, Typescript, Elixir, JS, and a bit of Elm and I literally never feel like I’m missing anything by not having static types in Elixir. This is doubly true with web based projects. What are people looking for that they might get from static types?

Size of projects and lifetime of project. Team members swapping in and out, moving project/repo ownership to another team, ability to make simple changes to a code base without having full understanding, etc.

Re: Phoenix 1.7 is View-less

#203
post #195

Earlier quoted context omitted.

My answer to this is the following: do your software have by any chance, SQL writes and HTTP request to any third party APIs within the same endpoint? Or maybe it uses some background job processing that's not SQL based and you have at least one endpoint where a job is enqueued AND something is written with SQL? If the answer is yes, you already have a distributed systems with all the downsides and none of the mitiga…

It's not the distributed system bits. It's the heavy abstractions over the distributed system bits that make me question if operating it requires specialized knowledge. I have a performance issue or an edge case with actors from the OTP. How do I debug and resolve it? Say network partitions aren't behaving like I expect and there seems to be data inconsistency or lost. I think you're doing a disservice when you prete…

The central abstraction isn't IMHO that heavy. It's just this:

A process has an isolated execution state, a message queue, and an id.

Messages can be added to the queue using the process id (from local or remote processes), and messages can be pulled from the queue by the process (with pattern matching, first matching message is removed from the queue)

If you have a performance issue, introspect with erlang:process_info to see what your processes are doing, and language indepedent tools to see what the VM is doing. process_info gives tons of information, IMHO, much more operable than other systems I'm familiar with. Ex: if your process has a large message queue, either it's not processing it's messages fast enough, it's selectively processing messages and leaving junk in the queue, or some combination; you can get inspect the queue with process_info and maybe figure that out. Lots of possibilities for why too slow, maybe it's waiting, maybe it's slow numerically, etc; process_info can tell you what function is running, which is usually helpful, etc.

Network partitions and their effects are highly application dependant, but if you have multiple nodes in your existing system, you have to think about it already, or choose to ignore it, which you can also do here, although if you use mnesia, you shouldn't ignore it: the default is for partitioned and then rejoined nodes to stay apart, waiting for an intervention, which may be the only reasonable default (because there's no right answer), but it's not what people usually want.

Re: Phoenix 1.7 is View-less

#204
post #195

Earlier quoted context omitted.

My answer to this is the following: do your software have by any chance, SQL writes and HTTP request to any third party APIs within the same endpoint? Or maybe it uses some background job processing that's not SQL based and you have at least one endpoint where a job is enqueued AND something is written with SQL? If the answer is yes, you already have a distributed systems with all the downsides and none of the mitiga…

It's not the distributed system bits. It's the heavy abstractions over the distributed system bits that make me question if operating it requires specialized knowledge. I have a performance issue or an edge case with actors from the OTP. How do I debug and resolve it? Say network partitions aren't behaving like I expect and there seems to be data inconsistency or lost. I think you're doing a disservice when you prete…

I see your point, I still disagree, I encountered some bugs that were incredibly surprising with postgres + sidekiq combo (made perfect sense though)

Elixir doesn't distribute anything unless you tell it to, keep that in mind. You can run it like a normal rails app. The OTP by default runs on one machine and as such, it's not subject to distributed systems law.

And you can still scale horizontally in the traditional way (deploy the app to multiple machines), no need to learn or use the multi-nodes.

The debugging experience is the same. Of course you have to learn the OTP library at some point, but it's equivalent to study the ruby standard library: it's natural, must be done, like for any programming language.

That being said, the tools provided are really nice, given erlang is very old, the tools do exist. And you can connect to a production machine with an "irb session", except that the one in elixir is in the same memory space as the main process, so you can actually inspect in memory stuff, very powerful and dangerous.

Re: Phoenix 1.7 is View-less

#205
post #203
post #195

Earlier quoted context omitted.

It's not the distributed system bits. It's the heavy abstractions over the distributed system bits that make me question if operating it requires specialized knowledge. I have a performance issue or an edge case with actors from the OTP. How do I debug and resolve it? Say network partitions aren't behaving like I expect and there seems to be data inconsistency or lost. I think you're doing a disservice when you prete…

The central abstraction isn't IMHO that heavy. It's just this: A process has an isolated execution state, a message queue, and an id. Messages can be added to the queue using the process id (from local or remote processes), and messages can be pulled from the queue by the process (with pattern matching, first matching message is removed from the queue) If you have a performance issue, introspect with erlang:process_i…

One note, the message queue has a limit in size,going over the limit will drop messages.

Re: Phoenix 1.7 is View-less

#206
post #203

Earlier quoted context omitted.

The central abstraction isn't IMHO that heavy. It's just this: A process has an isolated execution state, a message queue, and an id. Messages can be added to the queue using the process id (from local or remote processes), and messages can be pulled from the queue by the process (with pattern matching, first matching message is removed from the queue) If you have a performance issue, introspect with erlang:process_i…

One note, the message queue has a limit in size,going over the limit will drop messages.

If there's a limit, it's new and I can't find it in a quick search; I did find a 2014 PR that was rejected because dropping messages violates core semantics, IMHO killing the recipient would be OK though. Traditionally it's unbounded, but when you exhaust the memory of the host (or the ulimit, if set), you'll likely loose the whole VM.

Re: Phoenix 1.7 is View-less

#207
post #206

Earlier quoted context omitted.

One note, the message queue has a limit in size,going over the limit will drop messages.

If there's a limit, it's new and I can't find it in a quick search; I did find a 2014 PR that was rejected because dropping messages violates core semantics, IMHO killing the recipient would be OK though. Traditionally it's unbounded, but when you exhaust the memory of the host (or the ulimit, if set), you'll likely loose the whole VM.

Turns out it was specific to the application I worked on, sorry for the misinformation.

It is configurable: https://www.erlang.org/eeps/eep-0042

Re: Phoenix 1.7 is View-less

#208

Earlier quoted context omitted.

Remember, he who types statically types twice the amount and thus half as fast. There's honestly no need for static typing in Elixir.

> he who types statically types twice the amount and thus half as fast. If you mean by this, "static typing is not worth the effort", the zeitgeist is definitely not with you on this one. > There's honestly no need for static typing in Elixir. I'd love for that to to be the case! Is the only way for me to find out for me to give it a try, or are there somethings you can say to help me believe?

Yes, that's definitely what I mean. I've never much cared for the zeitgeist. I care about a reasonable rate of return.

If you care about static type checking, Erlang/Elixir actually has an opt-in thing called Dyalizer that lets you annotate functions and then traces the types through. I've never even tried it though, because I never felt the need for static typing.

Re: Phoenix 1.7 is View-less

#209
post #206

Earlier quoted context omitted.

If there's a limit, it's new and I can't find it in a quick search; I did find a 2014 PR that was rejected because dropping messages violates core semantics, IMHO killing the recipient would be OK though. Traditionally it's unbounded, but when you exhaust the memory of the host (or the ulimit, if set), you'll likely loose the whole VM.

Turns out it was specific to the application I worked on, sorry for the misinformation. It is configurable: https://www.erlang.org/eeps/eep-0042

EEP 42 is not implemented in mainline OTP. If it were, the proposal would likely link to the implementation, and the EEP index in EEP 0 would show what version it was first included in: https://www.erlang.org/eeps/eep-0000

If your application is using something like this, you're running a modified beam (which is fine; my professional experience is on a modified beam where we added a process_info option to drop all messages in the queue of a given process, and to allow for messages to be added to the front of the queue, neither of which would be acceptable upstream, but both of which were super handy for us)

Re: Phoenix 1.7 is View-less

#210
post #107

Earlier quoted context omitted.

What are you using for the component library? I was thinking of trying out Elixir and if there’s something that works well with it I’d rather start there than by trial and error.

I would recommend Petal: https://petal.build/ It's what I used for quite a while and I think it's the most comprehensive currently. We're building two different UI's that share a common design language so we ended up creating a common UI application in the umbrella project.

Do you happen to know if this was built with accessibility in mind? There's no mention of it on the website as far as I'm able to tell.

Looking from the outside in, it is also unclear what relation the Petal framework has with the PETAL stack, I am confused by the name collision.

Post reply on HN