I am a Developer Advocate for Security in Mobile Apps and APIs at approov.io.
Another passion is the Elixir programming language that was designed to be concurrent, distributed and fault tolerant.
Location
Scotland
Education
Self teached Developer
Work
Developer Advocate for Mobile and API Security at approov.io
Elixir will become handy on the future as Rust, both are in demand right now and hard to find developers for them. Just depends in what part of the globe you live or if you are a remote developer.
Elixir is the language of choice for distributed, concurrent, parallel and fault tolerant systems. Elixir is a functional programming language that makes very easy to write software that runs concurrently in a fault tolerant way across several machines(distributed), their philosophy is "Let it crash...". Elixir is not suitable for heavy number crunching, but here we can interface with Rust, C to get the ultimate performance while benefiting the fault tolerant features of running a system in Elixir.
Elixir runs on the BEAM, that has more than 20 years of development and continues to be used on telephony exchange systems and in Cisco routers. The BEAM as nine nines of availability while AWS achieves only five nines.
Rust shines for being as fast as C while memory safe, due to the borrow and ownership model that guarantees at compile time that the code is memory safe, thus not needing garbage collection at run-time. Rust have a hard learning curve, thus I do not recommend you to use it to learn while doing the advent of code challenge.
Rust is powering now the new versions of Firefox and have strong foundations to replace C in the future.
Clojure I cannot comment on, but I would recommend you to go with Elixir for the advent of code challenge and afterwards you can challenge yourself to solve them again with Rust or Clojure and then you will have a good view what suites best your code style and the problems you need to solve.
Please remember that the hard part of doing Elixir is to shift to functional programming mindset, because developers more often than not will write OOP code while coding in a functional programming language and this is often without themselves realizing that they are doing so.
Clojure I cannot comment on, but I would recommend you to go with Elixir for the advent of code challenge and afterwards you can challenge yourself to solve them again with Rust or Clojure and then you will have a good view what suites best your code style and the problems you need to solve.
That's a great point. I can redo it in the future with the other two languages I didn't choose :-)
Please remember that the hard part of doing Elixir is to shift to functional programming mindset, because developers more often than not will write OOP code while coding in a functional programming language and this is often without themselves realizing that they are doing so.
Yeah I can see that happening, I'm definitely spoiled by imperative languages :-)
I am a Developer Advocate for Security in Mobile Apps and APIs at approov.io.
Another passion is the Elixir programming language that was designed to be concurrent, distributed and fault tolerant.
Location
Scotland
Education
Self teached Developer
Work
Developer Advocate for Mobile and API Security at approov.io
I am a Developer Advocate for Security in Mobile Apps and APIs at approov.io.
Another passion is the Elixir programming language that was designed to be concurrent, distributed and fault tolerant.
Location
Scotland
Education
Self teached Developer
Work
Developer Advocate for Mobile and API Security at approov.io
They are very nice people and will help you in your journey.
I am not doing the advent of code... unfortunately I don't have spare time to dedicate to it.
TIP: while if else exists in Elixir is barely used by a functional programmer. Instead try to use pattern matching in the function heads. See here an example dev.to/flatironschool/pattern-matc...
They are very nice people and will help you in your journey.
Nice to know! I still haven't completely ruled out Clojure :D
I am not doing the advent of code... unfortunately I don't have spare time to dedicate to it.
It's perfectly fine, it's my first time ever!
TIP: while if else exists in Elixir is barely used by a functional programmer. Instead try to use pattern matching in the function heads.
Thanks for the tip. I'll surely read it. I tried to use pattern matching with MapSet.member? as a guard but it wasn't allowed, so I switched to a recursion first and then the if + reduce_while version.
I hope I'll have time to study the language a little better, not just try to butt my head on the wall until I get a decent solution :D
I am a Developer Advocate for Security in Mobile Apps and APIs at approov.io.
Another passion is the Elixir programming language that was designed to be concurrent, distributed and fault tolerant.
Location
Scotland
Education
Self teached Developer
Work
Developer Advocate for Mobile and API Security at approov.io
Not everything can go in guard clauses. Try to read about them.
I am seeing some doing the advent of code in 2 languages at same time. So why not Elixir and Clojure for solving each day challenge?
No matter what language you want to use for the advent of code would have been good that you had time to prepare for it before, like going through the basics of it.
What worked better for me to left the imperative thinking and adopt the functional programming way was this video course and this book. They are paid but totally worth every cent I paid for them. The author spent a lot of time ensuring that we understand the functional programming paradigm. By the end we have built something useful that we can use in our day to day as developers.
Elixir will become handy on the future as Rust, both are in demand right now and hard to find developers for them. Just depends in what part of the globe you live or if you are a remote developer.
Elixir is the language of choice for distributed, concurrent, parallel and fault tolerant systems. Elixir is a functional programming language that makes very easy to write software that runs concurrently in a fault tolerant way across several machines(distributed), their philosophy is "Let it crash...". Elixir is not suitable for heavy number crunching, but here we can interface with Rust, C to get the ultimate performance while benefiting the fault tolerant features of running a system in Elixir.
Elixir runs on the BEAM, that has more than 20 years of development and continues to be used on telephony exchange systems and in Cisco routers. The BEAM as nine nines of availability while AWS achieves only five nines.
Rust shines for being as fast as C while memory safe, due to the borrow and ownership model that guarantees at compile time that the code is memory safe, thus not needing garbage collection at run-time. Rust have a hard learning curve, thus I do not recommend you to use it to learn while doing the advent of code challenge.
Rust is powering now the new versions of Firefox and have strong foundations to replace C in the future.
Clojure I cannot comment on, but I would recommend you to go with Elixir for the advent of code challenge and afterwards you can challenge yourself to solve them again with Rust or Clojure and then you will have a good view what suites best your code style and the problems you need to solve.
Please remember that the hard part of doing Elixir is to shift to functional programming mindset, because developers more often than not will write OOP code while coding in a functional programming language and this is often without themselves realizing that they are doing so.
That's a great point. I can redo it in the future with the other two languages I didn't choose :-)
Yeah I can see that happening, I'm definitely spoiled by imperative languages :-)
Thanks for the advice!
Let me know if you need some good resources to start with functional programming in Elixir.
Have fun in your advent of code challenge.
Please let us know what was the language that you decided to use.
I've posted my broken solution in Elixir but it's not working: github.com/rhymes/aoc2018/blob/mas...
Keep in mind I haven't even read the tutorial yet :D
Basically it's supposed to iterate on infinite stream of numbers, add one to the previous and if the sum is already known (hence the set), quit
Try to follow the advent of code in Elixir forum elixirforum.com/t/advent-of-code-2..., they are sharing their solutions there. The solution from member Sneako seems a good one, check it elixirforum.com/t/advent-of-code-2....
They are very nice people and will help you in your journey.
I am not doing the advent of code... unfortunately I don't have spare time to dedicate to it.
TIP: while if else exists in Elixir is barely used by a functional programmer. Instead try to use pattern matching in the function heads. See here an example dev.to/flatironschool/pattern-matc...
yeah, I ended with a similar solution github.com/rhymes/aoc2018/blob/mas... - though you can see how more imperative is my code
Nice to know! I still haven't completely ruled out Clojure :D
It's perfectly fine, it's my first time ever!
Thanks for the tip. I'll surely read it. I tried to use pattern matching with
MapSet.member?
as a guard but it wasn't allowed, so I switched to a recursion first and then theif
+reduce_while
version.I hope I'll have time to study the language a little better, not just try to butt my head on the wall until I get a decent solution :D
Nice you have been able to figure it out.
Not everything can go in guard clauses. Try to read about them.
I am seeing some doing the advent of code in 2 languages at same time. So why not Elixir and Clojure for solving each day challenge?
No matter what language you want to use for the advent of code would have been good that you had time to prepare for it before, like going through the basics of it.
What worked better for me to left the imperative thinking and adopt the functional programming way was this video course and this book. They are paid but totally worth every cent I paid for them. The author spent a lot of time ensuring that we understand the functional programming paradigm. By the end we have built something useful that we can use in our day to day as developers.
Thank you :-) You're right, I should have gone through at least the tutorial before, but I totally forgot about it :D