Giter Club home page Giter Club logo

advent-of-code's Introduction

This repo contains solutions for the advent of code (http://adventofcode.com) written in Erlang.

Solutions

Code files contain solutions for the problems in various days. If you would like to know more about a particular solution, the more complicated ones have short explanation in the module comments.

Running the examples

To run the examples simply use rebar to build it. Do not forget to fetch dependencies. One of the examples (day12) utilised the jsx library to manipulate JSONs.

rebar get-deps
rebar compile

Some examples use excessive amounts of processes, just because it is more fun that way. Erlang VM has a limit on the max process count, that defaults to around 200000. You may want to start your Erlang VM with the +P flag:

erl +P 2000000

About 2 million process limit should do it, although it never really goes much about one million. :)

Lessons learned (2015)

  • Day 6 - The VM has a limit on how many processes can be spawned. This is configurable, but must be remembered.
  • Day 6 - Large ETS tables can be quite slow when performing selects. This may imply gproc may struggle when there's a LOT of processes running, although normally you probably wouldn't store ALL PIDs in one place.
  • Day 20 - Every math problem can be brute-forced with enough processes!
  • Day 20 - The catch expression seems to work in a strange way and not very well when there's a LOT of processes. Perhaps more investigation is required.
  • Many days - Erlang and string operations to not add up nicely. But we all knew that. Same applies to large arrays.

advent-of-code's People

Contributors

dependabot[bot] avatar haljin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.