Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Metaprogramming Elixir

    Metaprogramming Elixir

    Chris McCord · 2015

    Lisp & FunctionalProgramming
    Open LibraryAmazon
    Stats for nerds
    3recommend
    4mentions
    4people
    2015–2021years
    75% recommend25% neutral

    Mentions per year

    2015201620172018201920202021

    What Hacker News says

    1. nesarkvechnepOct 2021
      It’s too early for you to try metaprogramming. It has very simple rules but proficiency with the language is advised when diving into macros. You might want to read Chris McCord’s “Metaprogramming Elixir”. The author is also one of Phoenix’s authors.
      thread
    2. innocentoldguyDec 2016
      I don't know of any new constructs to support recursive anonymous functions in Elixir, but I don't know everything about Elixir either, so that isn't saying much. You could always create an anonymous function to accept a function, and then pass it into itself as an argument though.

      Having said that, I've never ran into a case where I wanted to use an anonymous function recursively in Elixir. Come to think of it, I don't really use anonymous functions much at all, outside of Enum calls, which handle the recursion part for you anyway. What would be the use case?

      On a side note, I think this article provided an outstanding tutorial for writing macros in Elixir. Since macros are how Elixir implements metaprogramming, knowing how to write them is a good thing. I typically use macros to write more expressive guard clauses, but you can do whatever you want with them. Chris McCord wrote an excellent book on macros, called Metaprogramming Elixir, if you want to know more about them.

      thread
    3. kaweraJun 2016
      Phoenix's author Chris McCord wrote an excellent book on metaprogramming in Elixir: https://pragprog.com/book/cmelixir/metaprogramming-elixir
      thread
    4. lectrickApr 2015
      > Thanks, that's a really helpful answer.

      I really like this language, I've met Jose Valim and he's a super nice, super smart guy, as is Chris McCord. So I feel naturally motivated to promote it. Also, it's just lots of fun to work with!

      > it means the ecosystem is maturing if we now can be fashion driven, rather than having to care about "does it work?"

      Well in my case, as I said, I got tired of certain classes of Ruby bugs, and certain, shall we say, "uglinesses" which presented themselves, but only after (sigh) YEARS of working with Ruby. In a way that's an argument FOR Ruby! It will only start to look ugly years after you work with it. ;) More than can be said for MANY other languages!

      So far I haven't seen too much "ugly" in Elixir (which is good, as it should be in the "beautiful bouncing baby" phase!). In fact, in some ways it's even more Rubylike than Ruby is, such as with being able to define your own sigils: http://elixir-lang.org/getting-started/sigils.html And of course the macro facility is pretty much the ultimate definition of Ruby's oft-touted "metaprogramming." Chris McCord already has a book out on it, actually: http://smile.amazon.com/Metaprogramming-Elixir-Write-Less-Co...

      thread

    Related

    Cover of Designing Elixir Systems With OTP
    2019–2026

    Designing Elixir Systems With OTP

    II James Edward Gray
    7 recommend · 15
    Cover of Functional Web Development with Elixir, OTP, and Phoenix
    2017–2025

    Functional Web Development with Elixir, OTP, and Phoenix

    Lance Halvorsen
    4 recommend · 8
    Cover of Elixir in action
    2015–2026

    Elixir in action

    Sas̄a Jurić
    48 recommend · 72
    Cover of The Little Elixir & OTP Guidebook
    2015–2020

    The Little Elixir & OTP Guidebook

    Benjamin Tan Wei Hao
    9 recommend · 11
    Cover of Programming Elixir
    2013–2023

    Programming Elixir

    Dave Thomas
    40 recommend · 80
    Cover of How to Design Programs
    2007–2026

    How to Design Programs

    Matthias Felleisen
    277 recommend · 776
    Cover of Introducing Elixir
    2013–2017

    Introducing Elixir

    Simon St Laurent
    4 recommend · 6
    Cover of Programming Clojure
    2009–2026

    Programming Clojure

    Stuart Halloway
    37 recommend · 103