Code Monkey home page Code Monkey logo

elixir_experiments's Introduction

elixir_experiments

Setup and Installation

Erlang is a required dependency for Elixir. Unfortunately, it can't be installed easily on MacOS.

Therefore, the recommended way is to spin up a Docker instance (with Docker Desktop installed):

$ docker pull elixir
$ docker run elixir

Specifically, grab the Elixir Docker Image from Docker Hub.

The directory elixir-docker contains a variety of examples demonstrating how to work with Elixir programs with a Docker container.

Furthermore, the best approach to editing is probably Visual Studio Code. Make sure to grab the vscode-elixir plugin.

Resources:

  1. https://www.poeticoding.com/running-elixir-in-docker-containers/
  2. https://medium.com/@pentacent/getting-started-with-elixir-docker-982e2a16213c
  3. https://pspdfkit.com/blog/2018/how-to-run-your-phoenix-application-with-docker/

Note: the supplied bash scripts are not intended to be "simply executed" - they are to be walked through line by line. Some, for instance, contain Bash to start a Docker container and Bash to execute within it!

Programming Notes

The other directory elixir_lang contains simple programming (syntax and the like) examples.

Elixir-specific programming notes are described below:

  1. Elixir runs on BEAM (akin to Node or JVM).
  2. To execute compiled Elixir code and copy it into a Docker volume review elixir-docker.
  3. To quickly execute Elixir use an online IDE like jdoodle or repl.it.

Resources:

  1. https://elixir-lang.org/
  2. https://www.tutorialspoint.com/elixir/elixir_loops.htm
  3. https://elixirschool.com/en/lessons/basics/functions/

Mix

Elixir uses a build tool called Mix to compile, package, and manage Elixir programs.

  1. It's similar to webpack and NPM rolled into one.
  2. Or, Gradle and Maven.

An example Mix layout created via:

$ mix new mix_example_1 --module MixExample1
$ docker container run --rm -v $PWD:/data -w /data elixir mix new mix_example_1

is available in elixir-mix.

Resources:

  1. https://hex.pm
  2. https://hexdocs.pm/mix/Mix.html

elixir_experiments's People

Contributors

thoughtscript avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.