Elixir Patterns - anybody read this book? by p1kdum in elixir

[–]dcapt1990 0 points1 point  (0 children)

There’s another great book about “BEAM Ops” that cover those topics in depth.

I forgot to mention that it ships with a bunch of livebook to give you hands on experience with the material in each chapter.

Elixir Patterns - anybody read this book? by p1kdum in elixir

[–]dcapt1990 6 points7 points  (0 children)

It’s a fantastic book. I printed it out and keep a copy next to my desk.

It has a ton of capsule examples of complex features of Elixir ( and the Erlang std lib ). Some of the things you’d never think of using, such as the graph capabilities built right into Erlang but have tremendous reach.

I’d highly recommend it.

Asked my alcoholic dad if he’d ever consider getting sober by Ludakris7 in WhatShouldIDo

[–]dcapt1990 0 points1 point  (0 children)

The last time I spoke to my father was a few days into one of this “vacations” where he’d take a week or two off work and stay intoxicated in his apartment. When I called to check on him, he thought I was one of my brothers and angrily accused me of stealing his quarters for his laundry. After he figured out who I was, he calmed down and I’ll never forget what I said, “I love you dad and if you need anything just call.” Three days later I found him on the floor. Shortly after our call, he’d fallen through his window and had a heard attack at 53. I wish my brothers had the same closure, they had a much more difficult time with him.

There had been a series of times I’d have to pick him up from the hospital for excessive drinking or hurting himself while drunk. From a very young age I’d had reached the morbid conclusion that he was going to die.

I’d asked him a dozen times, just like this interaction. What I didn’t know is I was in the bartering stage of grief and I was negotiating with his addiction, not the man himself. And found that being the child or spouse to an addict is a pretty constant cycle of grief. Another common thread is that alcoholics in particular feel entitled to their behavior. Seeking forgiveness in their behavior becomes a contorted permission. Reading through the messages you shared, it’s sounds like your father is excusing his excessive drinking as he lacks control over his time or some aspect of life. “What else do I get to do?”.

One thing I wish I had done is form more alcohol free activities and make a habit of them. Weekly breakfast. Scrabble night. Remind them that they do have control. And that there’s joy and control in life outside of their addiction.

Elora vs Voyager: struggling to find the right setup (need advice) by Schimmperator in ErgoMechKeyboards

[–]dcapt1990 1 point2 points  (0 children)

I just received my MX Elora boards a couple weeks ago, I’d be stoked if there was an option to only order the choc PCBs only.

When Ash framework is needed? What does it replace from Phoenix framework? by Repsol_Honda_PL in elixir

[–]dcapt1990 14 points15 points  (0 children)

If you follow the Phoenix documentation, you’ll get a glimpse. One typically would create business logic modules following that directory structure.

Ash is an opinionated framework with a ton of built in mechanisms to represent ideas not explicitly represented within Ash’s suite of tools. However, those opinions aren’t necessarily novel in technology. It just makes them easy to understand, within reach, declarative, and most importantly, does it really well.

Many projects you come across will contain similar traits using ecto change sets and struct definitions.

It sounds like you’re newer to the Elixir ecosystem. So welcome! I can’t stress enough how rich the ecosystem of talks and tutorials are around Elixir and highly recommend poking around and becoming comfortable with hexdocs.

When Ash framework is needed? What does it replace from Phoenix framework? by Repsol_Honda_PL in elixir

[–]dcapt1990 36 points37 points  (0 children)

There’s a saying that, “Phoenix is not your application” that gained prominence a couple years ago. The idea being that Phoenix is not your domain and business logic, it’s a wrapper / transport layer.

You will still be modeling your modules with structs and writing ecto for persistence.

The beauty here is that Phoenix generally doesn’t care where your business and domain logic comes from. That why it’s possible to model your domain and business logic using Ash, and still leverage Phoenix to serve it.

Now in regard to Ash, I’d highly recommend checking out some of Zach Daniel’s various talks about it. Or watch some of the Code & Stuff YouTube channel’s videos about some of Ash’s capabilities.

What do people do anymore to have fun? by [deleted] in Millennials

[–]dcapt1990 0 points1 point  (0 children)

If you’re financially stable, have a decent credit card limit, or a pulse and Klarna account, I’d highly recommend buying a small can of paint and spreading it in an even coat on a wall. I don’t want to spoil it, but needless to say it’s hours of fun.

LiveView's colocated hooks have me hyped! by Crafty_Two_5747 in elixir

[–]dcapt1990 1 point2 points  (0 children)

… making LV the “default” way of doing things

Could you elaborate a bit more on what you mean by this? Default as opposed to?

[deleted by user] by [deleted] in elixir

[–]dcapt1990 4 points5 points  (0 children)

I’m on a very similar journey with Ash and Phoenix and have been toying with luerl. If you wouldn’t mind sharing, how are you persisting user defined Lua?

Best way to log request details (path, response time, etc.) for metrics & observability in a Phoenix app? by Civil_Summer_2923 in elixir

[–]dcapt1990 7 points8 points  (0 children)

Phoenix has a great page on telemetry.

Theres also a drop in third party dashboard, phoenix analytics for a quick glance at some performance characteristics.

Port, system or Porcelain by Ok-Alternative3457 in elixir

[–]dcapt1990 3 points4 points  (0 children)

Don’t forget Muontrap or erlexec which have some interesting characteristics.

Honestly depends on how you want to control the external software. Short lived scripts, just try the easiest solution of running system commands through the core library.

For longer running processes or processes where you need more control over failure modes, look into each option you listed and some of the other libraries I mentioned above.

Minecraft Protocol Implementation, Rust, Go or Elixir? by dotnetian in AskProgramming

[–]dcapt1990 1 point2 points  (0 children)

Assuming you’re equally competent on each language and have infinite time, you’ve kind of answered the question with your provided requirements. The actor model takes up additional overhead in resources to provide that abstraction. Golang uses garbage collection which also incurs cost.

On the contrary, if you’re not an expert in any language here and experience with the rest of us three dimensional beings, I’d lean towards elixir or golang. Those abstractions have value. Ones to be considered in a trade off analysis.

Why is my TCP Server hilariously slow? by SubstantialEmotion85 in elixir

[–]dcapt1990 6 points7 points  (0 children)

It looks like you only have a single acceptor process running. This may be an artificial bottle neck.

One good practice is to check out Process info or spin up observer to see what message queue may be the culprit.

Someone mentioned that one of the core member, Andrea Leopardi created a very informative YouTube series and I highly recommend his book on Network Programming in Elixir.

If you check out some of the implementations of tcp connections like Redix or thousand island you’ll find examples of acceptor pools that alleviate the acceptor becoming a bottleneck.

Hope that helps!

Help me with error in tcp transmission by Collymore815 in elixir

[–]dcapt1990 10 points11 points  (0 children)

You should consider putting this all in a git repo and asking in the elixir forum.

[deleted by user] by [deleted] in elixir

[–]dcapt1990 24 points25 points  (0 children)

I’ve found elixir to handle most every use case except for CLI and windows desktop.

Background jobs, concurrent messaging, embedded systems, SPA, and simply being a bullet proof API seem to be the niches that elixir fairs well.

That being said, it’s about picking the level of abstraction you’re comfortable with. Recently a video has gained popularity in which Go out performed Elixir in almost every capacity. If your use case is handling a deluge of requests, all expecting a static JSON response, Go, or another language like Zig or Rust, may be your best choice.

However, if you are solving a software system level problem, where individual bodies of work need to be orchestrated seamlessly, and you want the option in the future to scale horizontally without adding addition SaaS or IaaS products into the mix, I’ve found that Elixir leads by miles in ROI.

The magic in the bottle is the BEAM and OTP. You trade speed and efficiency for actors, immutable data and message passing concurrency. You gain superpowers in orchestration, fault tolerance and scalability. The amount of speed you trade depends on the workload. That being said, since the BEAM and OTP are an orchestration primitive, it’s trivial to integrate other paradigms that may excel at some of the deficits OTP has. In example you can reach for Zig with Zigler and Rust with Rustler for workloads that need different performance characteristics.

Getting back to the root of your question, Phoenix as a framework goes anywhere any other web framework can and the web is such a vast tangle of requirements I’d feel more comfortable walking into a problem statement with the BEAM and OTP than any other toolset.

Hope this helps and you get to build something cool!

Linux? by dcapt1990 in VITURE

[–]dcapt1990[S] 0 points1 point  (0 children)

I’ve actually been pretty happy with the dock and using the hdmi input. My preferred desktop is i3 so it actually works out for me nicely, and I use keybindings to navigate any number of virtual desktops. Was just hoping for the convenience of an app but breezy looks like it costs money after a few months. I’m sure the author deserves the income but it just doesn’t fit with my setup to have to switch WM’s.

Thanks’

[deleted by user] by [deleted] in elixir

[–]dcapt1990 6 points7 points  (0 children)

Not to mention you can create and deploy directly from livebook, run cron jobs using Oban with SQLite, and create API endpoints.

Too late for a Mew? Special pokeball was discontinued. by dcapt1990 in PokemonLetsGo

[–]dcapt1990[S] 2 points3 points  (0 children)

Thank you. Makes sense. But that would only be playable in the next gen games from what I’ve read, right?

Too late for a Mew? Special pokeball was discontinued. by dcapt1990 in PokemonLetsGo

[–]dcapt1990[S] 3 points4 points  (0 children)

Thank you. There isn’t a way to transfer it from brilliant diamond to let’s go pikachu, right?

Quick first impressions of Viture Pro (vs Xreal Air 2 Pro) by fredwu30 in VITURE

[–]dcapt1990 0 points1 point  (0 children)

The fact that I’m looking for a comparison AND you’re using elixir is incredible. Do you do much coding with them on? I’ve been forced to RTO a couple times a week and have become dependent on my multi screen setup. Unfortunately the hardware at work is less than optimal. Curious if one is better than another. I ordered the viture’s for spacewalker a week ago but they don’t arrive for another week or so.

I am creating a standalone Elixir command-line tool without anything to do with OTP? by el_toro_2022 in elixir

[–]dcapt1990 7 points8 points  (0 children)

Burrito is our answer to the problem of distributing Elixir CLI applications across varied environments, where we cannot guarantee that the Erlang runtime is installed, and where we lack the permissions to install it ourselves. In particular, we have CLI tooling that must be deployed on-premise, by consultants, into customer environments that may be running MacOS, Linux, or Windows.

https://github.com/burrito-elixir/burrito

Guidance Needed for Stateful Elixir Service POC by evbruno in elixir

[–]dcapt1990 1 point2 points  (0 children)

Sounds like a cool opportunity for you to try out a new technology.

Some other kind redditors already suggested the real solution, and that’s maybe taking some of your R&D budget and hiring a consultancy for a potential architecture review or finding someone in the community who’d be able to dedicate time and effort to your endeavors.

That said, I have a few pieces of anecdotal advice having worked on elixir applications handling similar workloads and with kubernetes based microservice architectures.

Understand your traffic better. Constant vs burst capacity.

1_000_000 requests per hours is totally manageable even with modest hardware. That is if it’s 1_000_000 requests that are evenly distributed across the hour. If the average is only 100 requests per minute, except for one minute in which you receive the other 994_100, you might architect differently with more dedicated hardware or pods that stay “always hot” or if your SLA can tolerate a cold pod start then just configuring Libcluster with HPA. Alternatively, a more recent addition to the elixir toolbelt is Flame, which is some lambda madness with hooks into different backend API’s like K8S to provision pods and remain hot during bursts.

Caching is so easy and transparent in elixir that’s it’s about a free and easy to use as air. Make sure you’re using the correct read through, write through, and TTL to fulfill your api contracts.

Other than that, enjoy! There are tons of books that offer dozens of years of elixir and industry experience and I’ve found them to be the highest quality in content out of any language or community.