andrewray / iocaml

An OCaml kernel for the IPython notebook
MIT License
193 stars 20 forks source link

PPX in iocaml #38

Open hcarty opened 8 years ago

hcarty commented 8 years ago

Extension points and attributes do not seem to work properly from a non-JS iocaml environment. For example:

#use "topfind"
#require "ppx_deriving_yojson"
type t = {
  x : int;
  y : int;
} [@@deriving yojson]

Those cells don't end up defining the expected to_yojson/of_yojson functions.

This is with the latest from opam as of April 14, 2016.

andrewray commented 8 years ago

The kernel needs to run Pparse.apply_rewriters. I've tried to add it, but it causes strange crashes elsewhere after a ppx is enabled. Will need to have a closer look into why this is happening.