sashaafm

sashaafm

Elixir features inspired or modelled after other languages

I’m going to present an Elixir talk next week and I’m trying to gather a list of Elixir features that were inspired or modeled after other language features. Right now I’ve got the following list:

  • Syntax (Ruby)
  • Docstrings (Python)
  • Polymorphism and Protocols (Clojure)
  • Mix build tool (Clojure’s Leiningen and Ruby’s Rake)
  • Lazy evaluation (Haskell) → I’m not 100% certain on this one?
  • Pipeline operator (Clojure, but F# also has a similar one I believe)

I was thinking if ExUnit (aka built-in Unit Testing) also was inspired by any language? Probably by Ruby too, I guess.

Does anyone know of any other features that were inspired by other languages? :slight_smile:

Most Liked

josevalim

josevalim

Creator of Elixir

Also worth adding that I kept most of Erlang’s syntax for data structures purposedly, so Erlang plays a big role on the syntax side of things too.

Yup, docstrings and doctests come from Python.

And the @derive feature in protocols is inspired by a similar feature in Haskell’s type classes.

I wouldn’t say Rake had a big influence on Mix. My experience with Bundler played a bigger role on Mix for sure.

If by lazy evaulation you mean streams, then citing Haskell is correct although I wouldn’t call it lazy evaluation. :slight_smile: There was a lot of Haskell research involved for implementing streams in a purely functional fashion. The original idea came from Jessica Kerr’s talk on scalaz though. More info here: Introducing reducees « Plataformatec Blog

Not Clojure. It was from one of the ML variants (SML I think?) and F#.

josevalim

josevalim

Creator of Elixir

I remember looking at multiple Lisps. At least Common Lisp and Scheme to take an informed decision regarding hygiene and gensym. I cannot recall any special aspect from Clojure on this regard. Elixir ended-up having contextual hygiene (where variables belong to the modules that define them) which I don’t think I have seen elsewhere.

gregvaughn

gregvaughn

I personally wouldn’t list lazy evaluation as an elixir feature. Yes, with the Stream module you can achieve it, but it is done by the module, not core to the language.

If I recall, the pipeline operator comes most directly from F# which gets it from OCaml.

I think ExUnit comes most directly from Ruby, but really all the *Unit testing libraries go back to Smalltalk.

Macros were inspired by lisp in general, but you could name clojure specifically.

You could point out that hex is inspired by several dependency tools. I know ruby gems are one, but there are probably more.

If it were me giving the talk, I would want to mention erlang for the core concurrency model, though I understand your other comment that there’s so much elixir gets from erlang. You could point out that the pattern matching in both erlang and elixir comes from prolog.

Where Next?

Popular in Discussions Top

scouten
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19675 166
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New
New
thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
mikl
I wanted to capitalize a string, and tried using String.capitalize(). That generally works well, until you try to capitalize a word like...
New
pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New

Other popular topics Top

grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52774 488
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement