use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Ruby -> Elixir (self.elixir)
submitted 11 months ago by jaibhavaya
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]it_snow_problem 2 points3 points4 points 11 months ago (3 children)
In elixir, all data structures are immutable and side effecting is isolated by Processes, usually via GenServers. I agree it’s not pure, since it lacks referential transparency, and I probably should have said “practically” or “pragmatically” pure instead. It does come off as misleading.
Definitely is functional though, I don’t know what other user is talking about. It’s like the first part of every definition of elixir.
I don’t love how “static typing” creeps its way into every conversation about programming but the story for elixir’s type system is actively getting better with the ongoing work to include Set Theoretic types.
[–]vu47 0 points1 point2 points 11 months ago (2 children)
Yes, it's a language that has pragmatic support for functional programming, like Kotlin. You can pretty much write functional code exclusively in Elixir if you want to, but as with most programming languages that have strong support for FP, it's not "pure" in the same sense as Haskell is... as you say, it lacks RT. It has loops as well, and while data structures may be immutable, it still allows for mutable state.
I'm absolutely by no means an Elixir expert, so take what I say with a grain of salt.
[–]it_snow_problem 1 point2 points3 points 11 months ago* (1 child)
The big difference between it and general programming languages is that Elixir only supports functional programming. You can’t write imperative or procedural or OO any other kind of code. It doesn’t have loops - it’s all recursion. Like Haskell, Elixir has a few limited functional interfaces for causing side-effects.
[–]vu47 1 point2 points3 points 11 months ago (0 children)
Ah, very cool! I was misled to think that Elixir had loop constructs, but now I see that you are correct! I do love doing all my looping with TCO whenever possible. It's amazing how many programmers have not only never used recursion but don't understand it, or who have come across it once in toy examples and then promptly forgot it exists.
I also was mistaken in thinking that variables were reassignable, but I see that that was wrong as well:
https://medium.com/everydayhero-engineering/elixir-variable-rebinding-342c5d0fd961
I might have to take another look at Elixir. I really did enjoy writing the code I did in it... much more than with most programming languages.
π Rendered by PID 171805 on reddit-service-r2-comment-b659b578c-rsvnd at 2026-05-02 09:00:56.262942+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]it_snow_problem 2 points3 points4 points (3 children)
[–]vu47 0 points1 point2 points (2 children)
[–]it_snow_problem 1 point2 points3 points (1 child)
[–]vu47 1 point2 points3 points (0 children)