<gasche>
amiller_: there is no documentation of the typedtree and, frankly, even if there were it would not be pretty
<gasche>
on the contrary, Alain Frisch has been working on documenting the asttree, and did quite a good job out of it
<amiller_>
maybe there's some other tool for type inference over the asttree?
<gasche>
(under the forms of comments in parsing/parsetree.mli, but only in his extensions_points branch for now)
<gasche>
amiller_: other than what?
<gasche>
what kind of applications do you have in mind?
<amiller_>
i'm trying to implement a type-directed language extension
<gasche>
(I inferred that part :)
<amiller_>
well in short i'm making a generalized "merkle tree" language
<amiller_>
where i'd add a new blatant type flag like int MERKLEIZE
<amiller_>
and basically in the runtime the value of that type would be replaced by a tiny hash digest rather than the actual data
<gasche>
(int might not be a great example then :p )
<amiller_>
type tree = Tip | Bin of MERKLE tree * a * MERKLE tree;; is better maybe
<gasche>
the wikipedia article on MERKLE tree indicates that the idea is to keep a hash of each substructure, *along* with the substructure, for security / integrity purposes
<companion_cube>
val angela : MERKLE
<companion_cube>
</fun>
<gasche>
aren't you rather thinking of hash-consing, where you keep a global hash table to increase value sharing?
<amiller_>
indeed, this is basically used in two-party protocols
<amiller_>
so there would be two translations of a program, one for a Prover party, another for a Verifier party
<amiller_>
the Prover would maintain the hashes as well as the substructures, like you said, no benefit of compression, but the Verifier only stores the hashes
<gasche>
ok
<gasche>
do you really need the type information for that, or could you describe the program transformation by operating on the AST of type declarations, à la type_conv or deriving ?
<amiller_>
well i think i should do it with type information because this applies not just to explicit type definitions
<amiller_>
i additionally expect to have function keywords for coercion like merkleize/unmerkleize that would go in and out of that representation
<gasche>
a type_conv extension could generate additional function definitions, derived from the type declaration
<avsm>
amiller_: if you first prototype isn't too performance sensitive, then just use Dyntype
<gasche>
but I'm not sure whether that's enough; maybe indeed you need to transform all code operating on values of this t ype
<avsm>
that uses type_conv to give you a Type.t and a Value.t and conversions to the native types
<avsm>
it introduces extra boxing, but is convenient to play with types
<amiller_>
yeah doing runtime type inspection may well be the easiest way to show this
<avsm>
once you're happy with whatever transformation you want, you can engage in masochistic camlp4 hackery
himito has quit [Quit: WeeChat 0.3.7]
ousado has quit [Ping timeout: 248 seconds]
ousado has joined #ocaml
adrien_o1w has joined #ocaml
adrien_oww has quit [Ping timeout: 252 seconds]
eikke has joined #ocaml
adrien_o1w is now known as adrien_oww
<gasche>
avsm: Yaron is popularizing beginners material that advises them to "opam init; opam switch 4.01.0dev+trunk"
<gasche>
that's not reasonable
<dsheets>
gasche, causes problems with ocamlnet 3.6.x which has dupe stat method in netpop.ml... i searched the trunk source for substrings of "The method `stat' has multiple definitions in this object" and came up empty. Why?
maufred_ has quit [Read error: Operation timed out]
<gasche>
dsheets: no idea, old copy or you failed your grep
<gasche>
the bug report I linked to has the commit number
<adrien_oww>
there's one thing that has irked me a *LOT* around opam
<adrien_oww>
advising people to use trunk/head/unstable versions
<gasche>
well a stabilized tag on an experimental version with the new features RWO relies on would be understandable
<gasche>
but dev+trunk is not
<adrien_oww>
agreed, that means something like "beta" at least
<gasche>
dsheets: it's interesting to know that ocamlnet fails
<gasche>
do you think it's a bug in the ocamlnet code, or something justified or at least harmless?
<dsheets>
gasche, indeed... I find it now. ocamlnet <=3.6.5 will not be compat with 4.01
<adrien_oww>
but that's not because a system makes it very easy to use trunk code that is should be done
<dsheets>
it's a bug in ocamlnet, the method is lexically identical
<gasche>
dsheets: could you comment on the bugtracker with a link to the relevant ocamlnet source code
maufred has joined #ocaml
<gasche>
?
<gasche>
that would help Damien if he finds the issue before the release
<dsheets>
unless netpop uses some weird oo thing that makes identical duplicate methods do the same thing at different places in the object defn sequence
<gasche>
did you find that out with the hopefully-soon-more-public ocamlot infrastructure?
<dsheets>
gasche, it is not your bug, though, i need to report to gerd, yes? unless the compiler team also cares?
<gasche>
well
<gasche>
you do need to report it to gerd
<gasche>
(that looks like a silent merge bug)
eikke has joined #ocaml
<gasche>
it would also be helpful to comment pointing this piece of code on the bugtracker discussion opened by Alain about the change
<dsheets>
gasche, ok, thanks for the advisements
maufred_ has joined #ocaml
Yoric1 has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
maufred has quit [Ping timeout: 264 seconds]
Zeev has joined #ocaml
csakatok_ has quit [Remote host closed the connection]
chambart has joined #ocaml
smondet has joined #ocaml
Zeev has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
osa1 has joined #ocaml
lusory has quit [Ping timeout: 264 seconds]
ttamttam has quit [Quit: ttamttam]
csakatoku has joined #ocaml
gal_bolle has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
ttamttam has joined #ocaml
mattrepl has joined #ocaml
Zeev has joined #ocaml
Drup has joined #ocaml
smondet has quit [Remote host closed the connection]
breakds has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
ttamttam has quit [Quit: ttamttam]
<gal_bolle>
I just installed the git version of opam, and it seems not to check for new commits in git/darcs repositories when I do opam update. Is that supposed to happen?
Yoric1 has quit [Ping timeout: 252 seconds]
<gal_bolle>
in fact, it seems to only check for them if at least one package version number has changed (whether the same one or another)
<gasche>
gal_bolle: that seems contrary to the documented behaviour; but your "at least one package changed" comment makes it sound like an incorrect optimize, and therefore a bug
<dsheets>
gal_bolle, in Makefile, change opamMain.native to opamMain.d.byte on l37 and l38
<dsheets>
gal_bolle, and use with-ocamlbuild and install-with-ocamlbuild
<gal_bolle>
you mean make with-ocamlbuild?
<dsheets>
yes
ggole has joined #ocaml
travisbrady has joined #ocaml
ollehar1 has joined #ocaml
<gal_bolle>
now ocamlfind complains that cmdliner is not found
csakatoku has quit [Remote host closed the connection]
<gal_bolle>
this is because ocamlbuild picks up /usr/bin/ocamlfind instead of ~/.opam/…/ocamlfind, but I don't know how to correct it
<avsm>
that's a bug in 4.00.1, fixed in 4.01.0dev+trunk
<avsm>
hard to correct in 4.00.1 without a compiler patch, sadly, so you'll either need to 'opam switch 4.01.0dev+trunk' or uninstall the system ocamlbuild
<gal_bolle>
thanks
ttamttam has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
rwmjones_holiday has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
<dsheets>
avsm, what's the bug? i have some of these ocamlfind path problems, too
<dsheets>
under ocamlbuild that is
Watcher7|off is now known as Watcher7
shinnya has joined #ocaml
<avsm>
just uninstall any system findlib
<avsm>
its picked in preference to the PATH
<avsm>
if you have just a findlib installed under ~/.opam, everything works fine (since OPAM can select it via the PATH as usual)
ttamttam has quit [Quit: ttamttam]
<dsheets>
what is the bug? I have my PATH configured correctly but sometimes ocamlbuild seems to use an old PATH. Do you know where this is tracked?
<dsheets>
mantis changelog doesn't seem to have anything
<gasche>
I think ocamlbuild essentially ignored PATH and looked for /usr/bin specifically
<gasche>
(I don't remember very well)
<avsm>
something like that. it, like most tools that try to reimplement the shell, didn't quite get it right :)
<gasche>
there is some hardcoded-path support inside ocamlbuild which is used during its bootstrap phase (it builds from a "simple" version of itself that was built without plugin support, and is not yet installed)
<xavierm02>
without using a CARTHESIAN_SQUARE and a SAME_SET_RELATION types?
<asmanur>
your way of doing this is a bit strange
<asmanur>
why not use functors ?
<xavierm02>
I do use functors
<xavierm02>
those are module types
travisbrady has joined #ocaml
<xavierm02>
not modules
<asmanur>
right
darkf has quit [Quit: Leaving]
<asmanur>
why so ? you want several implementations of CARTESIAN_PRODUCT_SET ?
<xavierm02>
well
<xavierm02>
no
<asmanur>
then you don't need those module types :P
<xavierm02>
but I might at some point get a CARTESIAN_POWER things
<xavierm02>
like
<xavierm02>
sequences of elements
<xavierm02>
and then, I might want it to be seen as a CARTESIAN_PRODUCT too
<xavierm02>
anyway
csakatoku has quit [Ping timeout: 252 seconds]
<xavierm02>
how do I not need it?
<asmanur>
why not do simply
<asmanur>
module CartesianProduct (A : Set) (B : Set) : Set with type t = A.t * B.t = struct ... end ?
<xavierm02>
because when I define a binary relation
<xavierm02>
I have to do it on a carthesian product set
chambart has quit [Read error: Operation timed out]
<asmanur>
yes
<asmanur>
but your definition of binary relation is wrong anyway
<asmanur>
Rel(A, B) is P(A×B) not A×B
<xavierm02>
>_<
<xavierm02>
no
<xavierm02>
I just
<xavierm02>
haven't put the mem method yet
<xavierm02>
but if I get a mem method
<xavierm02>
it becomes a subset of AxB
<asmanur>
hm
gautamc has joined #ocaml
<asmanur>
oh
<asmanur>
so SET is really SUBSET
<xavierm02>
no
<xavierm02>
SET is SET
<xavierm02>
but a subset
<xavierm02>
is a SET too
<xavierm02>
and yeah
<xavierm02>
sets aren't defined by a type
<xavierm02>
it's a type and a mem function
<asmanur>
well
<asmanur>
then
<asmanur>
hm
<asmanur>
why not do module Subset (S : Set) : Set with type t = S.t -> bool = struct (* ... *) end ?
<xavierm02>
I know I could do it with a CARTHESIAN_SQUARE that would be a subtype of CARTHESIAN_PRODUCT and SAME_SET_RELATION that would be a subset or RELATION
eikke has joined #ocaml
<xavierm02>
erm
<xavierm02>
i didnt get ur last message
<xavierm02>
the type would be "functions from t to bool"?
<asmanur>
yes
<asmanur>
it's not perfect actually
<asmanur>
but i'm not really seeing what you are trying to achieve here
<xavierm02>
>_<
<xavierm02>
I'll just go with the CARTHESIAN_SQUARE etc.
<xavierm02>
and when I get everything working
<xavierm02>
I'll come back and ask for criticises
testcocoon has quit [Quit: Coyote finally caught me]
jcao219 has quit [Quit: Leaving]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
ggole has quit []
testcocoon has joined #ocaml
raichoo has joined #ocaml
mcclurmc has joined #ocaml
ttamttam has joined #ocaml
Kakadu has joined #ocaml
dinosaure has joined #ocaml
<xavierm02>
if I want a module type to have two different names for THE SAME module
<xavierm02>
how do I do that?
<xavierm02>
like
<xavierm02>
module A : MODULE_TYPE
<xavierm02>
module B = A
<xavierm02>
but ofc I get a syntax error
csakatoku has joined #ocaml
Snark has quit [Quit: leaving]
ttamttam has left #ocaml []
csakatoku has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
ollehar1 has joined #ocaml
tobiasBora_ has joined #ocaml
tane has joined #ocaml
Anarchos has joined #ocaml
osnr has quit [Quit: Leaving.]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
osnr has quit [Client Quit]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
osnr has quit [Client Quit]
<hnrgrgr>
xavierm02: I would do: module B : MODULE_TYPE with type t = A.t and ...
emmanuelux has joined #ocaml
_andre has quit [Quit: leaving]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
<xavierm02>
hnrgrgr: ty, I didn't even think of that >_<
osa1 has joined #ocaml
<osa1>
what is camlp4oof and where can I learn more about it?
Neros has quit [Remote host closed the connection]
<osa1>
I'm trying to make a choice between camlp4 parser thing and ocamllex & ocamlyacc
<dsheets>
osa1, for what grammar?
<osa1>
dsheets: um .. programming language ..
<dsheets>
osa1, sure, they have grammars... what does yours look like? is it embedded in ocaml?
<osa1>
dsheets: no, it's a toy language and will probably be compiled with LLVM tools ..
<dsheets>
osa1, i recommend ocamllex + menhir
<dsheets>
rather than ocamlyacc if your grammar fits that model
<dsheets>
camlp4 is rather overkill if yacc/menhir does what you need
<Drup>
more thant that, camlp4 is not intended to be a general purpose parser, it's for ocaml extension. You can do it, but that's really not the point (and it will be horrible to do)
<osa1>
ok, I don't want to use another 3rd party tool at this point, I think I'll go with ocamlyacc then ..
<osa1>
also, I have some experience with lex/yacc tools
<Anarchos>
osa1: ocamllex/ocamlyacc are really easy to use, so don't hesitate to give them a try
gbluma_ has quit [Ping timeout: 240 seconds]
<dsheets>
osa1, menhir is a lot like ocamlyacc but with better error messages and some obvious niceties in production rules
<dsheets>
it's available on opam
<osa1>
yes, actually I gave it a try, ~100 loc ocamlyacc file. it was really easy to use, especially when compared with alex/happy (haskell equivalents of lex/yacc)
<osa1>
for now I'm only using standard OCaml tools and GNU Make for building, because tools like ocamlbuild are too complex for me(ie. I couldn't find a way in one hour, to link my program with llvm with ocamlbuild, but it was easy with ocamlc)
<osa1>
should I learn ocamlfind? it produces ocamlc parameters for linking libraries, right?
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<Drup>
osa1: ocamlfind is really easy to use
<osa1>
Drup: how so? it has a huge man page
<Drup>
instead of using "ocamlc -I /complicated/page/to/lib", you can do "ocamlfind ocamlc -package my_package"
<Drup>
and everything else is pretty much the same.
<Drup>
s/page/path
<Drup>
And this way, it's portable. Other people with a different path to the lib can compile your code with the same command.
<osa1>
Drup: should I set any env variables for ocamlfind?
<Drup>
no
<osa1>
because it couldn't find llvm library installed at /usr/local/lib/ocaml
jbrown has quit [Read error: Connection reset by peer]
<amiller_>
ppx?
<amiller_>
oh a pretty printer?
<dsheets>
osa1, i recommend using opam so all of this library registration happens automatically... if you decline, ocamlfind install is the command you need to against the compiled lib files and the ocamlfind META file
<Drup>
ppx is not a pretty printer, it's the new think in ocaml 4.1 that allow to do syntactic extensions
<dsheets>
osa1, checking llvm distribution, one moment
<amiller_>
no not in this case, so far i am just untyping the typedtree to an asttree, then typing that again
<amiller_>
oh
<amiller_>
hadn't heard of that, /me goes to look
<osa1>
dsheets: ah, I found a META file
<osa1>
dsheets: in llvm distribution, I think it's for ocamlfind
<dsheets>
osa1, yes, excellent, do [ "cp" "%{lib}%/llvm/META.llvm" "%{lib}%/llvm/META" ]
<Drup>
osa1: you should really use opam anyway ;)
<osa1>
dsheets: um, me don't understand bash
<osa1>
Drup: well I'm compiling LLVM with some flags ..
<amiller_>
Drup, well afaict, this ppx only works with the AST, whereas i think i really need to observe the inferred types of expressions
<osa1>
for debugging
<amiller_>
so yeah ppx for typedtree would be nice :3
<Drup>
amiller_: yeah, that's what I meant by "ppx for the typedtree"
<amiller_>
so... is there one of those?
Tobu has quit [Ping timeout: 256 seconds]
<Drup>
not yet.
<Drup>
since you seems to be motivated, maybe in the future :)
<osa1>
Drup: ok I copied META.llvm as META, now how can I register it?
<amiller_>
so the only thing that could be happening is if Pprintast.structure is omitting some structure by which the original parsed ast differs from the untypeast
<dsheets>
osa1, adopting opam will solve this problem and many future ones like it, btw
<osa1>
dsheets: like I said I can't use opam for llvm because I'm compiling it with some custom parameters(for enabling assertions, debugging etc.)
<dsheets>
osa1, you can still build it custom and pin your build into opam
csakatoku has quit [Ping timeout: 264 seconds]
<dsheets>
osa1, but if using ocamlfind gets you working, that's great
breakds has quit [Quit: Konversation terminated!]
<xavierm02>
gah
<xavierm02>
still the same problem
<xavierm02>
I have a module type
<xavierm02>
and want to make sure two modules are equal
<amiller_>
ah weird so there is a difference when i print out the implementation with dumpparsetree basically
<amiller_>
my pattern match pattern of type Bin(a) gets originally interpreted as a patternmatch tuple with one element
<xavierm02>
I can make sure their types are equal with a "with t := t" but I can't make sure the functions are the same
* osa1
still trying to register llvm to ocamlfind ...
<amiller_>
and then the second time after untype output it is just printed as a variable not inside a pattern match tuple
<osa1>
maybe I should read man page
<gasche>
22:45 < Drup> more thant that, camlp4 is not intended to be a general purpose parser, it's for ocaml extension. You can do it, but that's really not the point (and it will be horrible to do)
<gasche>
Drup: that is not correct
<gasche>
Camlp4 provides a rather generic way to define parsers as a kind of DSL, that is actually appropriate to write whole parsers for serious programming languages
<gasche>
(Camlp4 uses it to define the grammar of the whole OCaml language, with error messages that are often better than what the ocamlyacc parser provides)
<gasche>
that said, I think the advice to prefer menhir is a sound one, because menhir is a simpler tool
<gasche>
but I've used EXTEND to write parsers and that was definitely not "horrible"
<gasche>
(the semantics are not very well documented, though; Jake Donham's blog series is very helpful for this)
jbrown has joined #ocaml
<osa1>
I installed menhir with opam but "ocamlfind query menhir" fails with "not found", why?
<gasche>
because it is a program and not a library
<osa1>
ahh, right
<gasche>
the library is named menhirLib I believe
<gasche>
try ocamlfind list | grep menhir
travisbrady has quit [Quit: travisbrady]
<osa1>
yeah, menhirLib
<gasche>
you should have a "menhir" program in your opam PATH
gbluma has joined #ocaml
<osa1>
yes, it's there
<gasche>
ocamlbuild provides support for compiling .mly files using menhir directly
<gasche>
but if you like the explicit way better, read the manual to find the correct invocation
skchrko has quit [Quit: Leaving]
osa1 has quit [Quit: Konversation terminated!]
raichoo has quit [Quit: leaving]
jbrown has quit [Read error: Connection reset by peer]
jbrown has joined #ocaml
pootler_ has quit [Ping timeout: 245 seconds]
pootler__ has quit [Read error: Operation timed out]
pootler_ has joined #ocaml
pootler__ has joined #ocaml
xavierm02 has quit [Remote host closed the connection]