Hi people,
I hope you are doing well. I am new to Elixir, and I was intrigued by it when I watched a conference on how Elixir operated, and is able to serve high amount of requests, practically all at the same time and isolating them.
I want to tinker with Elixir, and I have two projects to tackle. One is simple, the other one is… probably not.
One of them is to develop an API consumer and send emails if certain conditions are met. No UIs. Pure logic.
The other one is a server for a small game I will make.
All of them are hobby projects. My main goal is to use and explore Elixir, and deepen my knowledge in networking. I like to reinvent the wheel until I feel some level of competency to start using abstractions/frameworks and stuff. I need suggestion on whether I should use a particular framework or not, and if I should, which one. But before going into that, I will share a quick background info about me:
- I am a web developer working professionally for 1.5 years with C# ASP.NET WebForms, and .NET Core.
- I know how to write Java, and Java Spring Boot.
- Used Ruby, Rails, and Python before. (Though I have not used them for a while now.)
There are frameworks like Phoenix, and Ash. Since this is a hobby project, and my main goal is to deepen my skills and knowledge, maybe they are not a good fit. I have seen people suggesting to use Plugs, or Cowboy. Cowboy seemed interesting, but cannot tell if it is the right direction.
I desire to make things from scratch, but I feel like going too low-level would deter me. It is a matter of personal taste, I know, but I would like to get your suggestions.
Thank you for any insight you could share!
1 Like
Welcome. I like to re-inventing wheels too; however, I prefer to understand how the existing wheel works first. For example, I still use Phoenix, but I have replaced many functionalities of Phoenix with my code to scratch my itches.
2 Likes
There’s a great video series by Andrea Leopardi if you want to get into lower level networking (tcp/udp):
He also has a book on the topic.
4 Likes
I find it less enjoyable to figure out how to do something in a prebuilt system than to figure out things from scratch all by myself. And this decreased enjoyment makes me quit or not persist. On the contrary, if there is time constraint and it is too challenging, it becomes off putting to do everything from scratch. I am trying to find that sweet spot for me.
I will consider again though. Thanks for sharing your thoughts!
1 Like
Thanks, I have skimmed through one of his videos. They might be useful, will check them out again in a more spacious time.
Merhaba, hoş gel!
Personally despite many years working in web space, I have never kindled much of an interest in networking deeper than that of a user. However, at framework level, Phoenix is already built on Cowboy/Bandit so you could start a project with one of those (probably Bandit) and design your own request parsing/routing/response handlers. Not something I’ve done myself full disclosure but that’s where I would start.
1 Like
To be honest, I am not particularly interested in writing a framework from scratch. The whole thing is… I want to understand what is happening under the hood. Not just on the surface though. I appreciate understanding why a wheel has no corners, and why it has evolved into its current form by trying to push a car with rectangular tires
By recreating its initial form, I get to see how things emerged. And I like it. I do it to some extend, just enough to satisfy my desire to internalize.
Haven’t heard of Bandit before, will check it out! I guess I will start with either Cowboy or Bandit as you suggested, and see if it is the sweet spot. If I find it too challenging to my taste, will consider Phoenix with many rewrites.
Thanks for sharing.
P.S: Hoş bulduk. ^^ Appreciate the warm welcome.
Slightly different but if you don’t really care about the “end result” but just want to experiment with some building blocks:
It might be fun to just build a simple TCP server and play around with that and “actors” and (binary) pattern matching. That’s basically a web server, isn’t it? Can go as simple or as hard with your network protocol as you like.
Should give you a sense of how programming and building something like that works out in Elixir.
Something similar is actually one of the introduction chapters of Elixir and specifically Mix / OTP: Task and gen_tcp — Elixir v1.19.5
2 Likes
That’s something no one else can help. Since everyone has different backgrounds and interests, I’d suggest you to come up with 2~3 ideas, and people on this forum can tell you how much time/effort each would require, so you judge for yourself?
That would be interesting and suit my case probably the best, though my only concern is how safe it is. Even though I don’t care about selling the software I make with it, it should be safe (for me) to deploy to the internet. But that would also be the charm to it, right? (Making it safe.) Thanks for the link, I will check it out before all.
Yes, the reason I wanted to open this thread was to get as many ideas/input as possible, and see who has done what, or what kind of paths may I take.
Instead of people judging a case for me, I am more interested in what people has got to share. For example, thanks to you, I know I could start with Phoenix and just replace anything I would like to tinker with.
Should you told me “Just use Phoenix”, that would not make much of a difference to me, but you showed a different lense, and it widened my perspective on the topic. That is exactly what I was hoping to find, and you gave it to me, thanks!
Sorry, i misunderstood your post. I didn’t think you wanted to use whatever you’re building “in production”. In that case you should very likely go with safer options, yes.
I just thought you wanted to build something that makes you understand how established solutions in this space work - and then you don’t mind actually switching to and using them. (I also still think that wouldn’t be a stupid idea, but if it’s not what you imagined then no worries
)
1 Like
No matter how hard I try, I just cannot make myself sit through and develop something without a real product at the end, even if it is a really bad piece of software. Your answer was actually really helpful. I felt like “This is the thing I was looking for!” I still have doubts as it might be too low-level, but I will start with it. For some reason, I find it more approachable than Plug, but I just skimmed over the guide, so, I might be making statements too early.
It is a feeling, so hard to tell when it will come up, but the moment I feel content, I will step up. To either Cowboy or Bandit! Thanks a lot!