Giter VIP home page Giter VIP logo

deriving's Introduction

ocsigen.org

deriving's People

Contributors

balat avatar benozol avatar dhil avatar drup avatar duckpilot avatar ghuysmans avatar hhugo avatar hnrgrgr avatar kit-ty-kate avatar leovalais avatar raphael-proust avatar vasilisp avatar vbmithr avatar whitequark avatar yallop 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

Watchers

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

deriving's Issues

hangs in toplevel

Under MacOS deriving hangs in toplevel:

# #require "deriving.syntax";;
# type sum = S0 | S1 of int | S2 of int * float | S3 of int * float * bool | Sunit of unit | Stup of (int * float) |     Stup1 of (int)
  deriving (Dump, Eq, Show, Typeable, Pickle)  ;;

  ^C Interrupted.

Original issue: ocaml/opam-repository#4103

Can this be used to pre-process source code?

For example, if I have:

type t = Left of int | Right deriving (Show)

let () =
    print_endline (Show.show<t> (Left 5))

can I run a preprocessor on that to output OCaml code that doesn't need to build with this library?

By the way, it's not at all obvious from the docs that in order to build this snippet, I have to do:

ocamlfind ocamlc -linkall -syntax camlp4o -package deriving -o test ./lib/deriving_Show.ml test.ml

does not compile with ocaml.4.08.0

Here's the relevant part of the compilation log :

+ /home/jan/.opam/4.08.0/bin/ocamlfind ocamldep -syntax camlp4o -syntax camlp4o -ppopt syntax/common/pa_deriving_common.cma -syntax camlp4o -package camlp4.quotations.o -package camlp4.extend -package camlp4 -package bytes -modules syntax/std/pa_deriving_std.ml > syntax/std/pa_deriving_std.ml.depends
Camlp4: Uncaught exception: DynLoader.Error ("./syntax/common/pa_deriving_common.cma", "no implementation available for Pa_deriving_common.Id")

File "syntax/std/pa_deriving_std.ml", line 1:
Error: Error while running external preprocessor
Command line: camlp4 '-I' '/home/jan/.opam/4.08.0/lib/ocaml/camlp4' '-I' '/home/jan/.opam/4.08.0/lib/ocaml/camlp4' '-I' '/home/jan/.opam/4.08.0/lib/ocaml/camlp4' '-parser' 'o' '-parser' 'op' '-printer' 'p' '-parser' 'Camlp4QuotationCommon' '-parser' 'Camlp4OCamlOriginalQuotationExpander' '-parser' 'Camlp4GrammarParser' 'syntax/common/pa_deriving_common.cma' 'syntax/std/pa_deriving_std.ml' > /tmp/ocamlppe0e1ea

Command exited with code 2.
Compilation unsuccessful after building 39 targets (37 cached) in 00:00:00.
E: Failure("Command ''/home/jan/.opam/4.08.0/bin/ocamlbuild' syntax/common/pa_deriving_common.cma syntax/common/pa_deriving_common.cmxa syntax/common/pa_deriving_common.a syntax/common/pa_deriving_common.cmxs syntax/std/pa_deriving_std.cma syntax/std/pa_deriving_std.cmxa syntax/std/pa_deriving_std.a syntax/std/pa_deriving_std.cmxs syntax/classes/pa_deriving_classes.cma syntax/classes/pa_deriving_classes.cmxa syntax/classes/pa_deriving_classes.a syntax/classes/pa_deriving_classes.cmxs lib/deriving.cma lib/deriving.cmxa lib/deriving.a lib/deriving.cmxs lib/deriving_num.cma lib/deriving_num.cmxa lib/deriving_num.a lib/deriving_num.cmxs -use-ocamlfind -tag debug' terminated with error code 10")
make: *** [Makefile:7: build] Error 1

Really use OASIS

For now the META file is written by hands because of some issues.
@hnrgrgr can you explain here what are the issues you encountered ?

Maybe someone has an idea of how to fix it.

missing file or META error

the META reference the 2 following files. It seems they're not installed

pa_deriving_common.cmo pa_deriving.cmo

Issue a release

Please make a release with 4.02 fixes. In the last two days at least three people asked at IRC "why Eliom doesn't work on 4.02".

typo the META file

hello again :)

the meta file refers to deriving.base, while it should be (?) deriving-ocsigen.base (line 3 of the META file)

thanks !

best

william

Fatal error: exception rule "\"type\"; type_declaration" cannot be found in entry

I encountered a fatal error when doing this in utop:

#use "topfind";;
#camlp4o;;
#require "deriving-ocsigen";;
#load "pa_deriving.cma";;
#load "deriving.cma";;

Fatal error: exception rule "\"type\"; type_declaration" cannot be found in entry
str_item: [ "top" LEFTA
  [ "TYPE_CONV_PATH"; STRING _
  | "let"; "module"; a_UIDENT; module_binding0; "in"; expr
  | "let"; "open"; module_longident; "in"; expr
  | "let"; opt_rec; binding; "in"; expr
  | "let"; opt_rec; binding
  | "exception"; constructor_declaration; "with"; LIST1 generator SEP ","
  | "exception"; constructor_declaration; "="; type_longident
  | "exception"; constructor_declaration
  | "external"; a_LIDENT; ":"; ctyp; "="; string_list
  | "include"; module_expr
  | "module"; "rec"; module_binding
  | "module"; "type"; a_ident; "="; module_type
  | "module"; found_module_name; module_binding0
  | "open"; module_longident
  | "class"; "type"; class_type_declaration
  | "class"; class_declaration
  | ANTIQUOT (("" | "stri" | "anti" | "list"), _)
  | QUOTATION _
  | [ "type"; nonrec; type_declaration; "with"; LIST1 generator SEP ","
    | "type"; nonrec; type_declaration ]
  | expr ] ]
Raised at file "map.ml", line 117, characters 16-25

Seems like it has something to do with type_conv :-/

clarify what deriving packages there are

Minor suggestions to avoid users going on a wild goose chase:

  • Right now this project is marked as being a fork of jaked/deriving. As resolved in #5, this is now the master fork, so that is just confusing. I would disassociate this project from jaked/deriving. I believe you have to contact GitHub support to make this request, but they are very responsive so that should be easy.
  • The README links to http://code.google.com/p/deriving/, but again this seems completely out of date. Please delete the link.
  • This project used to be distributed as opam package deriving-ocsigen, but is now called deriving. So thus the opam package description for deriving-ocsigen should say "DEPRECATED: please use deriving".

'deriving' instead of 'deriving-ocsigen'

Does it still make sense to package under the name deriving-ocsigen as it seems to be the only updated deriving.

It has been confusing for some people (thinking it depends on ocsigen).

Looking at opam-repository, js_of_ocaml/eliom are the only packages depending on it.

missing dep in the Makefile

hello

it seems that in lib/Makefile, the rule

%.cmo: %.ml
${OCAMLC} ${OCAMLFLAGS} ${PP} -c $&lt;

should be replaced by

%.cmo: %.ml %.cmi
${OCAMLC} ${OCAMLFLAGS} ${PP} -c $&lt;

otherwise the project does not build (from scratch) : deriving_Bounded.cmo is built before deriving_Bounded.cmi, which eventually cause the build to stop because the cmi file does not exists.

cheers

william

broken syntax : module.(expression)

the following breaks when using deriving syntax

$ cat t.ml 
let _ = Int32.(add)
$ ocamlfind ocamlc -syntax camlp4o -package deriving.syntax.std  t.ml
File "t.ml", line 1, characters 6-7:
Parse error: [expr] expected after "=" (in [cvalue_binding])
File "t.ml", line 1:
Error: Error while running external preprocessor
Command line: camlp4 '-I' '/Users/hugo/.opam/4.02.0/lib/ocaml' '-I' '/Users/hugo/.opam/4.02.0/lib/ocaml/camlp4' '-I' '/Users/hugo/.opam/4.02.0/lib/deriving' '-I' '/Users/hugo/.opam/4.02.0/lib/deriving' 'unix.cma' '-parser' 'o' '-parser' 'op' '-printer' 'p' 'pa_deriving_common.cma' 'pa_deriving_std.cma'  't.ml' > /var/folders/t6/__fyp3752vl2fj94wrp8hh140000gn/T/ocamlpp9a6ed6

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.