2011-11-17

<hcarty> Most of the popular extensions I've seen were ported to the new camlp4.
<hcarty> camlp4 documentation comes down to wikis and reading code, primarily
<thelema> hcarty: not by volume, but the maintained ones are in camlp4
<reynir> Is camlp4 much different?
<hcarty> And most extensions are written in camlp4 at this point
<hcarty> reynir: Keep in mind that camlp5 and camlp4 are not likely to play well together
<hcarty> reynir: IIRC, camlp5/only-camlp4 was not able to properly preserve comments. camlp4-new has somewhat better support, but there are a number of bugs.
<thelema> reynir: preserving comments isn't something that camlp4 does well
<NaCl> it may be some argument to camlp4 that may already be enabled, actually
<reynir> Do you suggest I use camlp4 (the new one)? In that case, do you have links for good tutorials? :-)
<adrien> the camlp4 in newer ocaml versions is actually a different one
<adrien> reynir: because camlp5 is mostly ocaml < (<= ?) 3.10's camlp4 that got taken and developped outside of the official ocaml distributions
<adrien> Kakadu: also, do you think you could have a camlp4 extension instead of moc?

2011-11-06

<hcarty> And it is apparently camlp4-safe

2011-10-20

<hcarty> eikke: There are a few camlp4 extensions which provide something similar - deriving, one for s-expressions, one or more for JSON

2011-10-18

<thelema> I see articles on "Macros in " {Perl6, Haskell} on HN - is there a good camlp4 tutorial to suggest?

2011-10-16

<everyonemines> is there a camlp4 extension for RPN function application ?

2011-10-12

<mfp> ugh camlp4 parses {< a = x; b = y >} as {< a = (x; b = y) >} :-(

2011-10-06

<thelema> I was thinking something more like sed, not camlp4
<everyonemines> camlp4 huh

2011-10-02

<thelema> flux: yes, that I know nothing of. But then I knew nothing of the old camlp4, so...
<flux> and current camlp4 which remains basically undocumented?-(

2011-09-29

<thelema> hcarty: good to know. I wonder who will complain if the next batteries has no camlp4

2011-09-22

<everyonemines> adrien: Building a DSL with functions in a module seems adequate to me, you mean even camlp4 isn't good enough?

2011-09-21

<metasyntax|work> If there's a compile problem with Subversion in /version/3.12 is that worthy of a bug report? The error is "Unbound module Camlp4_import." I didn't know if it was kosher to pester them about it.

2011-09-15

<avsm> if you're using camlp4, it's a reserved identifier for antiquotations, so rename your function to something else not involving dollars
<Kakadu> Any ideas about this camlp4 error? http://groups.google.com/group/fa.caml/msg/b172a2df2ed5bd1f?hl=en

2011-09-14

<avsm> Diml: hrm, so you compile all the camlp4 plugins as .cmxs files?
<avsm> failing spectacularly to get camlp4orf.opt working. Has anyone successfully done native code camlp4 with natdynlink extensions?

2011-09-13

<thelema> DimitryKakadu: sorry, I'm no good with camlp4 errors
<DimitryKakadu> PR#5172: camlp4 support for 'module type of' construct

2011-09-09

<adrien> and if I can use atd and yojson and they don't use camlp4, I'll use that in yypkg
<adrien> actually, I think that even for yypkg (so ocaml 3.11), I had issues for camlp4 (sexplib)
<adrien> actually, right now, I only have ints to store, and only a few, so I could even do it by hand myself and that's what I'd do rather than trying with camlp4 this time
<flux> so, camlp4&windows is a no-go?
<adrien> it's using camlp4 somewhere in the source
<adrien> couldn't find anything that suited my needs; "dump" modules don't support reading back and most of the (de)serializers use camlp4

2011-09-08

<hcarty> I'd love to figure out camlp4's internals well enough to make a perltidy-like tool for OCaml
<hcarty> There have been a large number of smaller camlp4 and ocamlbuild bug fixes over the past few months.
<hcarty> adrien: There were a number of camlp4 changes wrt the new 3.12 syntax over the course of 3.12.1's development. It could be a bug which was fixed between your snapshot and 3.12.1final
<adrien> without camlp4, it's windows :P
<flux> adrien, with/without camlp4? mine was with (..I think..)

2011-09-06

<thelema> acually, lisp changes the language with macros, more like using camlp4, except that camlp4 is bolted on in a particularly orthogonal way, which makes it more trouble.
<thelema> yup, there's little that needs camlp4.
<thelema> camlp5 is the old version of camlp4, renamed and still maintained outside inria
<thelema> camlp4 was heavily revised in ocaml version 3.10
<thelema> if the language you're trying to parse is basically ocaml, use camlp4, otherwise lex+yacc
<everyonemines> Should I use camlp4 or ocamllex + ocamlyacc ?

2011-08-31

<thelema> hmm, bad META file for camlp4 somehow... I think I'm on my way home.
<thelema> hmm, problems with findlib.conf under windows: "unbound module Camlp4"
<thelema> Boscop: I'd say ocaml makes language implementation much easier than many other languages. There's good support for unicode parsing outside camlp4: look up ulex
<Boscop> thelema: does camlp4 handle unicode?
<thelema> Boscop: hmm, I don't think camlp4 gets whitespace tokens from its lexer by default. It's possible to replace the lexer, but then you have to build a new ocaml lexer
<Boscop> thelema: and can camlp4 (or ocamllex) be used to respect indentation (e.g. for a python-like syntax) or whitespace between tokens (e.g. 'a - b' means 'a minus b', but 'print-line' is one identifier)?
<thelema> Boscop: by default oper precedence is by first char of operator, it's possible to use camlp4 to change this.
<Boscop> is it possible to use camlp4 to for operator precedence parsing where the precedence depends on the chars that the operator consists of (or just the first char)?

2011-08-27

<thelema> ousado: if you're using the preprocessor camlp4, it has to do a full parse of your code

2011-08-25

<mbac> camlp4 macros
<avsm> like camlp4, the tool is pretty awesome in its power, just a bit obscure

2011-08-06

<gasche> I think you should rather consider using a preprocessor-like extension, such as Martin Jambon's cppo or camlp4's pa_macro
<gasche> but a camlp4 extension cannot know where the fragments are defined
<gasche> (may I ask for more context on the present discussion? Is adrien proposing a camlp4 extension?)

2011-08-05

<hcarty> ( >> ) can cause conflicts with camlp4

2011-07-29

<thelema> grr, camlp4 having different parser than ocaml proper...
<mfp> uh, was testing on the toplevel, had forgotten camlp4 didn't support module type of in 3.12.0
<thomasga> and I'll like to have export a library which uses camlp4 and do not have to link with dynlink every time :-)
<goncalo> Camlp4: Uncaught exception: DynLoader.Error ("pa_rpc.cma", "file not found in path")

2011-07-23

<elehack> What does 'lid:foo' mean in an antiquotation in a camlp4 extension?

2011-07-09

<mouse> Camlp4 doesn't find Batteries though :-(
<mouse> Camlp4: Uncaught exception: DynLoader.Error ("./pa_ast.cma", "error while linking ./pa_ast.cma.\nReference to undefined global `Batteries'")

2011-07-08

<mouse> wow -- whole camlp4 is only ~10k lines of code (counting lines in .ml files with ocamlwc)
<mouse> oh my. camlp4 is almost as gory as ocamlbuild
<mouse> My brain explodes as I try to read camlp4 source
* thelema gives up on camlp4 again and goes back to his work
<mouse> According to the old camlp4 tutorial, quotations can help me to solve this problem cleanly
<mouse> So far I have found the source of camlp4 to be the best documentation :-)
<mouse> Oh. Gildor is the great guy who helped me last time with camlp4!
<thelema> I wish I could help, but my camlp4-fu is non-existent. @gildor?
<mouse> So, the first problem is: how to plug existing parser into camlp4?
<mouse> I want to make a camlp4 quotation that would use this parser to print back AST using ocaml-data-notation.
<mouse> Hello. Can someone help me to do a supposedly simple thing with camlp4?

2011-07-07

<thelema> camlp4 is completely optional for batteries. There's some syntax extensions for list comprehensions and lazy list matching and magic printing
<adrien> what about camlp4?

2011-06-30

<sheets> How do I make ocamlbuild only include syntax extension modules in camlp4 calls?
<sheets> i dunno why the camlp4 would call the stubs… maybe
<thelema_> is it possible the camlp4 you're using is calling the stubs?

2011-06-29

<KDr2> hello all, is there some document about the new camlp4 ? are these http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial004.html still correct?

2011-06-28

* NaCl wonders why camlp4 errors are even harder to read than standard ocaml errors
<thelema_> flag ["ocaml"; "compile"; "ocamlviz_auto"] (S[A"-ppopt"; A"camlp4 pa_o.cmo s
<NaCl> how would I get specific flags to go into camlp4 when using ocamlbuild with ocamlfind?

2011-06-27

<sheets> ugh… so the new camlp4 uses a different syntax extension object naming convention?? Camlp4OCamlFoo.cmo?? but you can still pass the old names (pa_o.cmo) to the camlp4 command?
<sheets> avsm: ah, yes, i see what you mean… could just patch camlp4
<sheets> i'm using ocamlbuild with ocamlfind… i think i will globally install the bugfix instead of figuring out how to coerce ocamlbuild to use a custom camlp4 include dir
<avsm> patching camlp4 is safe in that regard, unless the patch changes the output code
<avsm> it might be easier just to backport the fix to your local camlp4 in 3.12.0; fairly localised
<thelema_> - PR#4673, PR#5144: camlp4 fails on object copy syntax

2011-06-21

<thelema_> hmm, I wish I knew more camlp4 to help
<hcarty> It doesn't get double-interpolated - camlp4 chokes on it

2011-06-18

<mouse> yeah, I was about to go and read the source of camlp4
<mouse> both ocamlbuild and camlp4 are severly undocumented beasts
<gildor> mouse: you are not slow, but camlp4 is not really an easy feature for beginners
<mouse> + ocamlfind ocamlc -c -annot -package batteries -package batteries.syntax -package camlp4 -package camlp4.mapgenerator -package sexplib.syntax -package threads -syntax camlp4o -thread -I obsolete -o ast.cmo ast.ml
<gildor> pkg_camlp4.mapgenerator add it for you, but camlp4 handle "synonyms", but I don't remember the mapping
<mouse> should I add pkg_camlp4?
<mouse> gildor, the problem is: how to combine sexplib and camlp4 filters
<mouse> as if sexplib wasn't properly loaded into camlp4
<mouse> recently, I have decided to add some ast transformation routines based on camlp4 filters (map, fold)
<gildor> (I am using daily sexplib, camlp4, ocamlfind and ocamlbuild)
<mouse> I have a problem with trying to use sexplib and camlp4 filters at the same time
<mouse> Hello. Does anyone here have experience of using camlp4 with ocamlfind+ocamlbuild?

2011-06-14

<f[x]> $ will cause problems with camlp4 only inside quotations iiuc

2011-06-12

<thelema> not even with camlp4 which works before type inference

2011-06-05

<thelema> there's some camlp4 that will auto-generate that kind of code for you

2011-06-02

<hcarty> adrien: I don't have position reporting working with this though... another part of camlp4 to figure out!
<hcarty> Does camlp4 have a string -> expr function? (if such a thing makes sense...)

2011-05-31

<thelema> batteries is a package, predicates are things like "mt" and "camlp4"
<rixed> ocamlmktop gives me this: "Reference to undefined global `Camlp4'"

2011-05-30

<thelema> for me too, which is why I keep my use of camlp4 to a minimum.
<thelema> well, it looks like batteries requires camlp4, but bitstring requres camlp4of
<rixed_> gives: ocamlfind: No unique value for the META variable 'preprocessor': package camlp4 defines `camlp4', package bitstring.syntax defines `camlp4of'
<thelema> findlib needs to know which camlp4 you're using before it'll enable any syntax extensions
<rixed_> ocamlfind: No unique value for the META variable 'preprocessor': package camlp4 defines `camlp4', package bitstring.syntax defines `camlp4of'
<rixed_> Any pro of findlib + camlp4 ? I'm trying to use both batteries.syntax and bitstring.syntax and I got this:

2011-05-26

<thelema> well, camlp4 will allow you to use $
<thelema> camlp4 error compiling odn under 3.12 - does it require 3.11?

2011-05-18

<joelr> does anybody know what this refers to? happens when a camlp4 syntax tag is added to _tags

2011-05-03

<bitbckt> is ocaml-data-notation compatible with 3.12.0? I'm getting camlp4 type errors on build.
<hcarty> thelema: http://codepad.org/NIhnOkyi -- A brief ocamlscript + Batteries + camlp4 example
<hcarty> But I'm not familiar enough with the details of either camlp4 or what they are proposing to properly judge their merits.
<hcarty> I like the idea of <:foo< >>-style delimited extensions without camlp4
<hcarty> thelema: It works well. I believe it enables camlp4 by default
<thelema> hcarty: its support of findlib does produce a 90% solution. I wonder how/if it works with camlp4

2011-04-27

<rproust> all this could be automated via camlp4 I guess.

2011-04-17

<thelema_> orbitz: there is some sort of list comprehension camlp4 in the standard distribution somewhere, as I recall there being a bug in it on mantis

2011-04-11

<thelema> I take that back, it does. Well, install camlp5 and use otags -camlp4 camlp5
<thelema> in any case, otags shouldn't need camlp4 - I'm looking up how to turn that off
<thelema> camlp4 git switched out around 3.10 or so
<thelema> camlp5 is what used to be camlp4
<iris1> That's right. But now that I looked carefully, I noticed there is one for camlp5. I am going to try to hack that to make it camlp4... Thank you very much!
<thelema> iris1: I'm surprised the homebrew ocaml didn't include camlp4 - I assume there's no homebrew for camlp4?
<iris1> Dear experts, I would like to use tags with ocaml and emacs, but I ran into a couple of problems. I found otags and downloaded a version (unfortunately it's for 3.09, and my ocaml is 3.11, but I don't think this is causing my problem). When I try to make it, it tries to use Pcaml and dies. I think the problem is that Pcaml is part of camlp4 which I don't have. What's the simplest way to install camlp4 if I don't want to replace my existing

2011-04-08

* rien is finding camlp4 fascinating

2011-04-07

<scooty-puff> my plan was to use camlp4 and the bytecode representation, which would require that the user compile to bytecode, then the bytecode to machine code

2011-04-06

<thelema_> my guess is that not enough people learn camlp4, and those that do are so busy building the future to have much time for helping others learn camlp4
<scooty-puff> is there a good source for documentation on the newest camlp4?

2011-03-30

<thelema> it's kinda disappointing that findlib can't auto-enable camlp4 on requiring a syntax package.
<thelema> or #require "camlp4"
<philed> Sorry again for the questions, but I'm struggling to find help for this on the web. I've never really been able to get camlp4 extensions to work. I'd like to use lwt.syntax, but it's not working for me.
<thelema> mrvn: or use camlp4, like deriving (as rproust is suggesting)
<rproust> orbitz: camlp4 extension pa_macro may help you

2011-03-28

<joelr> requires = "camlp4"
<rproust> and btw, pretty-printers are not suppose to output pretty source code, but merely source code. The other printer for camlp4 is an AST dump!
<rproust> anyone starting to tweak camlp4 syntax extensions/pretty printers should read all the posts of http://ambassadortothecomputers.blogspot.com/search/label/camlp4
<hcarty> The printers can be tweaked, but I don't understand enough of the camlp4 code to say how.
<joelr> how do you use camlp4 as a pretty printer?

2011-03-26

<kerneis> then, if you have a monad, there is a camlp4 extension to add syntactic sugar

2011-03-16

<arkadir> failing that, is there any monad camlp4 syntax "standard" enough to be included on debian?

2011-03-06

<kaustuv> 3.11 to 3.12 is mostly painless. AFAIK there is only one (annoying) regression involving quoting type applications in camlp4

2011-03-04

<thelema_> I'm not a camlp4 expert, so I'm only repeating what I remember hearing... Many things stayed the same but some important syntax for how to plug into the parser changed.
<thelema_> almost certainly manual 3.07 is for version 3.07 of camlp4

2011-03-02

<orbitz> thelema: i'm thinking a minimal level of beign able to specify a type might be a good start. camlp4 sounds easiet fo this right (i don't know any camlp4)

2011-02-26

<gildor_> npouillard, orbitz; I was at CUFP and at the tutorial, and find it quite interesting, but I already know a bit of camlp4
<ygrek> npouillard, is there a way to print camlp4ast item from within camlp4 (i.e. I get assert false for unmatched pattern in Camlp4Ast2OcamlAst and I want to inspect what was the item)

2011-02-25

<thelema> except I don't know any camlp4
<thelema> static typing would require camlp4 to magick the strings

2011-02-24

<thelema> not that I know of, but I'm no camlp4 expert (or even beginner)
<eaburns> Can anyone explain how camlp4 grammars deal with recursion?

2011-02-23

<magthe> I'll have to go ask our camlp4 guru about that one I think
<magthe> but then, using camlp4orf I get another error: Camlp4: Uncaught exception: Not_found
<gildor> seems to deal with quotation and other camlp4 internal tricks
<gildor> magthe: C header file -> feature request for 0.3.0, camlp4 -> see _tags of oasis itself, for now it is about to add file.ml: syntax_camlp4o, pkg_odn.with.syntax

2011-02-22

<thelema> confound: add "-syntax camlp4o" to that line to enable any camlp4

2011-02-18

<adrien> ah, my bad, it's not emacs, it's camlp4: I keep on forgetting that lablgtk2's src/gtkSignal.ml is actually generated from src/gtkSignal.ml4 (and I always edit the wrong file too >< )

2011-02-16

<adrien> I want so split a .ml4 file from lablgtk2 (camlp4 parsing) into two files and, hmmm, it could be already done with ocamlbuild

2011-02-14

<thelema> and to inspect all possible codepaths in camlp4 and verify that the resulting string is correct? I don't think so...

2011-02-10

<eaburns> Hi. I am looking to write a parser for a lisp-ish language. I am looking into menhir and camlp4. Does anyone have any recommendations either way?
<thelema> I'd probably favor LazyList as we have camlp4 to pattern match it
<mfp> then we want camlp4 to see at compile time PGSQL(dbh) "execute" "... SQL code given in 'up' ..." followed by PGSQL(dbh) "execute" "... down ..." and then again PGSQL(dbh) "execute" "... up ..."

2011-02-08

<thelema> The ocamlviz_auto didn't work for me, but that should implement their camlp4 plugin that auto-instruments everything

2011-02-07

<thelema> jlenormand: no, I think it's someone's camlp4...

2011-02-03

<kaustuv> alexyk: that sounds like a camlp4 error. The syntax I wrote was native ocaml.
<thelema_> and I think it's time to get rid of the camlp4 bug by releasing batteries 1.3... in about 8 hours, after work

2011-02-02

* thelema strongly approves of the no camlp4 part
<kaustuv_> bittest benefit: no camlp4
<npouillard> f[x]: I merely no longer spend time on camlp4 :)
<hcarty> f[x]: It looks like xclerc is/was on a camlp4 fixing spree today. Perhaps a few of these will be caught in that.
<f[x]> and btw how do you debug camlp4 without PR#5120? ;)
<f[x]> npouillard, camlp4 in 3.12 broke some previously working code - see PR#5080
<npouillard> Was "module type of" the only 3.12 feature that was not supported by camlp4?

2011-01-31

<hcarty> spicey: Part of the reason for using ( |> ) over ( $ ) is that $ has a special meaning for camlp4

2011-01-30

<kaustuv_> Note, camlp5 is still maintained and usually gets support for new OCaml syntax before camlp4!
<mfp> jm: camlp5 is a fork of camlp4, derived (and compatible with) camlp4 pre-3.10. It is usually used to compile syntax extensions that haven't been ported to camlp4 post-3.10
<jm> mfp: That sounds too good to be true! How does camlp5 relate to camlp4?
<mfp> jm: there are several camlp4 syntax extensions that can generate pretty-printers automatically given the type definition

2011-01-28

<gildor> we have the usual suspect : camlp4 packages using black magic

2011-01-24

<dark> i used a parser from the ocaml manual (it was an example there :P) because i struggled to make my own (it uses camlp4)

2011-01-22

<hcarty> dark: camlp5 is a continuation of the old (pre-OCaml 3.10.0) camlp4. A new, incompatible version of camlp4 was introduced in OCaml 3.10.0.
<dark> http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html there is actually a good doc on camlp4
<dark> accel, oh about camlp4 extensions itself being written in ocaml, i don't know that
<accel> is camlp4 basically one of thse things
<dark> i can barely find a good tutorial on how to compile a camlp4 program u.u
<dark> accel, they aren't strictly ocaml, but well, usually you can combine many camlp4 extensions in one program
<accel> are camlp4 programms writen in ocaml? So basically, a camlp4 program is a peice of ocaml code that transforms a DSL into ocaml code ?

2011-01-21

<thelema> hmm, I'm surprised batteries isn't setting that for you, the normal META file for batteries has a bunch of camlp4 extensions
<thelema> if you have ocamlfind installed, it should already have meta files for camlp4
<EliasAmaral> ocamlfind requires a preprocessor at some META file in order to use camlp4. can I do it without actually creating this file? (I could using OMakefile..),
<hcarty> orbitz: You're welcome. A few warnings: 1) This is OCaml 3.12.0 or later only; 2) camlp4 doesn't play well with "module type of"
<flux> I mean, using camlp4 for something like that might be considered overkill :)
<flux> based on camlp4 of course
<accel> time to learn camlp4
<flux> with camlp4. but otherwise, perhaps +| would do for you.
<accel> camlp4's lexer is _that_ limited?
<cyy> i'll have to see if I can get camlp4's lexer to see whitespace as significant, there must be a way
<flux> the white space thingy-developer opted to use non-camlp4/5-solution
<cyy> how feasible would it be to implement Python's grammar using camlp4 (or camlp5) -- since its whitespace sensitive?

2011-01-19

<thelema_> you could do such as camlp4

2011-01-18

<mfp> basically, yes; some people might prefer camlp5 (old camlp4 style) for new developments, though
<accel> so basically, camlp5 = for older code; camlp4 = current + latest + greatest ?
<accel> Camlp4 is part of the official OCaml distribution which is developed at the INRIA. Its original author is Daniel de Rauglaudre. OCaml version 3.10.0, released in May 2007, introduced a significantly modified and backwards-incompatible version of Camlp4. De Rauglaudre maintains a separate backwards-compatible version, which has been renamed Camlp5. All of the examples below are for Camlp5 or the previous version of Camlp4 (versions 3.09 and prior).
<mfp> accel: typically, camlp5 is used to build older code (that used to compile with camlp4 before OCaml 3.10)
<mfp> accel: camlp5 is a branch derived from camlp4 pre-3.10
<alpounet> camlp5 is more recent than camlp4
<accel> is the following correct? Camlp5 = old preprocessor, Camlp4 = current preprocessor? the numbering confusessss me
<edwin> but you can try looking at some examples that use camlp4, same should apply to camlp5
<elehack> anyone know of a camlp4 extension to generate construction functions from a type's constructors?

2011-01-17

<adrien> hmm, right, I think I had already had this problem, but simply removing the whole middle chunk of code is quite annoying, I probably only found the issue because I had camlp4 parsing enabled and the post-processed source in /tmp

2011-01-12

<thelema_> mrvn: z isn't necessarily from Foo. And sadly, I don't think camlp4 can do that for you
<mrvn> Could camlp4 simplify that too?
<thelema_> maybe xavier also thinks that camlp4 can be used for that, so special compiler support isn't needed
<adrien> that might be with the latest sexplib: it looks like that when I use camlp4, I lose the location of errors

2011-01-11

<npouillard> however maybe a camlp4 limitation, if camlp4 does not provide a simple mean to load the basics stuff without commiting on the syntax
<hcarty> npouillard: This is how estring registers itself with the toplevel. I'm not sure if the bug is with estring or camlp4.
<hcarty> npouillard: Loading Camlp4Top.cmo after camlp4 has been loaded/activated in the toplevel causes all types to be reported in revised syntax
<hcarty> npouillard: If you're off to sleep, no rush. Just checking on a estring and/or camlp4 bug. I'm trying to figure out which program is causing the issue.
<hcarty> thelema: Either that or estring is not initializing itself with the toplevel properly. I don't know enough about camlp4 to know which.
<hcarty> thelema: http://vpaste.net/OkeQ3? -- These steps reproduce the bug for me, so it seems to be a camlp4 bug
<hcarty> thelema: Loading Camlp4Top.cmo after camlp4 has been loaded/activated in the toplevel seems to cause the problem

2011-01-03

<thelema> batteries causes types to be reported using revised syntax - bug in camlp4
<hcarty> Axioplase_: Batteries is a library + a few optional camlp4 extensions. It sits on top of OCaml, it doesn't modify the language/compiler itself.
<kaustuv> It doesn't extend the language by default, through there are some Camlp4 extensions. I think it's almost 100% OCaml, but there might be one or two foreign functions

2011-01-02

<hcarty> npouillard: It seems that way - it works without camlp4, but fails with it. I'm not sure if it's a complete lack of support, or a smaller bug somewhere.
<hcarty> npouillard: Do you know of a work-around for http://caml.inria.fr/mantis/view.php?id=5172 ("module type of" does not work with camlp4)?
<joelr> from the old camlp4
<joelr> any camlp4 experts here?

2011-01-01

<hcarty> There may be a camlp4 extension somewhere which automatically creates constructor functions...

2010-12-29

<hcarty> The camlp4 wiki (brion.inria.fr) is too

2010-12-28

<mrvn> yezariaely: camlp4 can do write you of_string and to_string functions for your type. some people have written the modules for it somewhere.
<thelema> I wonde why this hasn't been done in ocaml (using camlp4) before: http://www.levelofindirection.com/journal/2010/12/28/unit-testing-in-c-and-objective-c-just-got-easier.html

2010-12-26

<thelema> I think the arguments for that are: -syntax camlp4 -package batteries.syntax

2010-12-21

<julm> ocamlc -c -pp "camlp4orf " -w Ae -I +camlp4 pa_type_conv.ml
<hcarty> adrien: What/where are the incompatible camlp4 changes in 3.13?
<hcarty> adrien: That could be. My view of the issue is colored by being bitten by bugs in each release since the 3.10.0 old-camlp4 to new-camlp4 switch.
<adrien> well, loooks like 3.13 has incompatible changes to camlp4 so I don't know if we can say one is developped more actively than the other, more like that we see camlp5's announce more maybe
<hcarty> I don't personally have any use for camlp5 (over camlp4). I'm just (very very mildly) bitter that I can't use some of the new 3.12 features with camlp4 (new version)
<flux> I do wonder if at certain point one should just 'let go' of camlp4, but I guess there are still old-camlp4-dependant syntax extensions that haven't been updated
<hcarty> camlp5 is now external to the main OCaml project, while the new camlp4 is internal
<hcarty> The short version is that "module type of ..." does not work under camlp4
<orbitz> camlp4 is having tourbel ifnding pa_lwt.cmo

2010-12-05

<flux> but that doesn't work with camlp4 :/

2010-12-02

<hcarty> With camlp4 in place (no extensions), the error is more explicit. You need a -> after a when
<palomer> camlp4 _really_ slows down compilation

2010-11-27

<palomer_> that's probably the first non typeconv good use of camlp4 I've seen

2010-11-20

<mfp> or using a camlp4-extension; at any rate, it requires recompilation of the code

2010-11-16

<thomasga> f[x]: so what should I do to make camlp4 happy with str.cma ?
<f[x]> camlp4 instead tries to load cma and searches for referenced shared lib
<flux> thomasga, try camlp4 dynlink.cma str.cma ?
<thomasga> using 3.11.2, 'camlp4 str.cma' doens't give me an error message ... should be a bug then :-)
<thomasga> any idea why : ocamlc str.cma --> OK but camlp4 str.cma --> Camlp4: Uncaught exception: DynLoader.Error ("/usr/lib/ocaml/str.cma", "error loading shared library: dllcamlstr.so: dynamic loading not supported on this platform") ?

2010-11-14

<thelema> yes, there's some camlp4 that helps with this

2010-11-09

<jsk> flux: I was using camlp4 as a simple check that a given patch causes no semantic changes to a file.
<jsk> flux: oops, misunderstood. I'm using camlp4 to detect non-whitespace changes to files.
<jsk> Hi all, does anyone know if there's a trivial way to remove all comments from an ml file? (If using camlp4, then ideally only with the built-in printers and filters.)

2010-11-07

<adrien> ah, I remember, there was your fork and Jake Donham's but only his provided ocaml 3.12's camlp4 compat
<thelema> orbitz: you'd have to camlp4 that.

2010-11-04

<orbitz> you don't need to know anything abotu camlp4 to do this
<xl0> Thanks, I'll look into this after I read about camlp4. ;)
<orbitz> xl0: a list, no, the list type is eager in ocaml, but the stream module lets you make lazily evaluate dobjects, and it has camlp4 syntax that look sliek lists [< .. >]

2010-11-01

<mfp> keep in mind I'm using camlp4 + estring to generate the code, so I cannot add top-level [let]s easily

2010-10-31

<DimitryKakadu> ocamlfind ocamlc -g -a -thread -dllib dllcore_stubs.so -custom -I +camlp4 -I . -cclib -lcore_stubs -cclib -lrt -o core.cma core.cmo

2010-10-30

<orbitz> could probably make a camlp4 to do it

2010-10-18

<rwmjones> not really ... I usually generate a config.ml file at compile time. Alternative is to use one of the macro camlp4 packages, but that's going to be much less straightforward than generating a .ml

2010-10-17

<dark> ok, ocamlfind ocamlc -package camlp4 -syntax camlp4o test.ml
<dark> stdDoubt, on toplevel? try #use "topfind";; then Topfind.load_deeply ["dynlink"; camlp4"];; or hmm

2010-10-15

<heller> adrien: ok, I've only seen oyacc and this recursive descent parser camlp4, so i guess this camlp4 will be the parsec equivalent?

2010-10-14

<adrien> hcarty: haven't had troubles with 3.12 except the camlp4 incompatibilities but now it's solved (I was using mikmatch) so I mostly switched to it
<adrien> yeah, camlp4 will often work for meta-programming and friends, but it's not really at runtime
<orbitz> adrien: camlp4 stuff comes to midn for itnrospection (like sexplib)

2010-10-09

<thelema> almost - it won't load the batteries camlp4 extensions
<thelema> dark: or something very similar - step 1: load ocamlfind, step 2: tell it you want camlp4, step3, load your packages

2010-10-06

<gildor> flux: camlp4 -> camlp5

2010-09-22

<gildor> like internal CICS section (better than camlp4)
<gildor> +camlp4 off course

2010-09-21

<thelema> robthebob: my experience is that it's not worth the Jane Street dependency chain and camlp4 dependency

2010-09-20

<hcarty> yezariaely: << and >> have special meanings with camlp4 IIRC. I didn't think they would cause problems in comments.

2010-09-06

<sgnb> thelema: BTW, you are aware of the parenthesis trick for camlp4 regression?
<thelema> you'll need the latest git of batteries - there was a regression in 3.12's camlp4

2010-09-03

<ygrek> nope, because of camlp4+ocamlbuild+custom requirements
<ygrek> gildor, look at myocamlbuild.ml, this is primarily because of camlp4

2010-09-02

<thelema> the toplevel init by default loads it, the package for camlp4 is separate
<kaustuv_> Batteries still depends on camlp4?