Giter Site home page Giter Site logo

eterm's Introduction

ETerm

Understand Erlang Terms.

Compile C code

Change ERL_INCLUDE_PATH in Makefile. After get the dependency elixir_make, every time run mix compile, it will also invoke make to compile C code if necessary.

Use as library

In mix.exs

  defp deps do
    [
      {:eterm, git: "https://github.com/sunboshan/eterm.git"},
    ]
  end

Then mix do deps.get, deps.compile.

Usage

$ iex -S mix
iex> ETerm.show(1)
0x000000000000001f      immediate       1
00000000_00000000_00000000_00000000_00000000_00000000_00000000_00011111        small int

iex> ETerm.show([])
0xfffffffffffffffb      immediate       []
11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111011        nil

iex> ETerm.show({1, 2, 3})
0x000000001921500a      boxed   {1, 2, 3}
00000000_00000000_00000000_00000000_00011001_00100001_01010000_00001010        boxed
0x0000000019215008      header  tuple_size: 3
00000000_00000000_00000000_00000000_00000000_00000000_00000000_11000000        arity val
0x0000000019215010      body    1
00000000_00000000_00000000_00000000_00000000_00000000_00000000_00011111        small int
0x0000000019215018      body    2
00000000_00000000_00000000_00000000_00000000_00000000_00000000_00101111        small int
0x0000000019215020      body    3
00000000_00000000_00000000_00000000_00000000_00000000_00000000_00111111        small int

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.