GithubHelp home page GithubHelp logo

ocaml-memgraph's Introduction

Build

Memgraph

A small library to output memory graph for ocaml values. Memgraph can be used to generate graphs that represent the memory layout of any valid ocaml value. Memgraph can produce .dot files that can then be processed using the graphviz suite of tools to generate images of the memory graph of ocaml values.

You can look at the examples folder to see how to use memgraph.

example

Memgraph & Kitty

For users of the kitty terminal emulator, you can use the Memgraph_kitty package and library to show the memory graph directly in a toplevel session (using ocaml or utop for instance).

kitty

WARNING: using this module in a terminal other than kitty may lead to weird behaviour, such as filling your screen with weird characters.

ocaml-memgraph's People

Contributors

armael avatar gbury avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ocaml-memgraph's Issues

[feature wish] do not depend on unix in the core package

Using memgraph with js_of_ocaml currently raises a few warnings because of the dependency on unix (for Dot.to_file). It would be slightly cleaner to avoid depending on unix in the core library, and expose file-related helpers in a separate package.

closures and js_of_ocaml

Running ocaml-memgraph under js_of_ocaml means that the closure representation is different from native and bytecode.
For instance, trying to display the graph for (fun () () -> ()) will raise an assertion failure in mk_closinfo.

One idea would be to read Sys.backend_type to avoid reading into a closure block in the Other case.

Some of the colour arguments being passed to Graphviz are unquoted

Normally Graphviz accepts unquoted keywords (such as SVG or X11 colours) but hex values must be quoted. Calling memgraph after initialising the config with unquoted hex values triggers a syntax error. The following is how I properly configure the colours:

let config =
  Memgraph.Dot.config
    ~external_node_color:(Some "#bababa")
    ~block_node_color:(Some "#535955")
    ~root_node_color:(Some "#0a0a0a")
    ~outline_color:"\"#cccccc\""
    ~background_color:(Some "\"#252a2a\"")
    ~direction:`Horizontal
    ()

From a cursory look at the code, I suspect only the values parsed in styles_with_color get properly quoted and the others parsed in print_list don't.

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.