ocsigen / deriving Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jaked/deriving
Extension to OCaml for deriving functions from type declarations.
Home Page: http://code.google.com/p/deriving/
License: MIT License
This project forked from jaked/deriving
Extension to OCaml for deriving functions from type declarations.
Home Page: http://code.google.com/p/deriving/
License: MIT License
There is a typo in Jenkins configuration; It setups 4.00.1 env for 3.12.1 build
https://ci.inria.fr/ocsigen/job/Deriving-3.12.1/15/console
[Deriving-3.12.1] $ /bin/sh -xe /tmp/hudson420883496002817773.sh
+ . /builds/bin/setup-ocsigen-4.00.1-env
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
to take this fix into account 6e684be
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
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
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.
Camlp4 is deprecated for a long time, Camlp5 as well. It makes sense either migrate to mehrir, or extension points for preprocessing and parsing capabilities.
See discussion about Camlp4, Camlp5, Ulex and modern OCaml here: https://discuss.ocaml.org/t/camlp5-and-ocaml-4-08/3985
the META reference the 2 following files. It seems they're not installed
pa_deriving_common.cmo pa_deriving.cmo
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".
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
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 :-/
Minor suggestions to avoid users going on a wild goose chase:
deriving-ocsigen
, but is now called deriving
. So thus the opam package description for deriving-ocsigen
should say "DEPRECATED: please use deriving
".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.
hello
it seems that in lib/Makefile, the rule
%.cmo: %.ml
${OCAMLC} ${OCAMLFLAGS}
should be replaced by
%.cmo: %.ml %.cmi
${OCAMLC} ${OCAMLFLAGS}
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
For maintenance, readability and packaging purpose, can we consider moving to OASIS ?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.