adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org and http://caml.inria.fr | http://ocaml.org/releases/4.02.0.html | Public channel logs at http://irclog.whitequark.org/ocaml
serge has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
nze` has quit [Ping timeout: 265 seconds]
darkfish has joined #ocaml
madroach has joined #ocaml
manud has quit [Quit: manud]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
pharpend has quit [Quit: WeeChat 0.4.3]
<artagnon> whitequark: Why doesn't setgc("shadow-stack") work?
pharpend has joined #ocaml
mort___ has quit [Quit: Leaving.]
<whitequark> I dunno
<whitequark> I only ever used gc "ocaml" in LLVM
* artagnon tries ocaml
<artagnon> Nope, doesn't work.
<artagnon> Unsupported GC.
<artagnon> What am I missing?
<whitequark> I don't know.
<whitequark> get out gdb, set a breakpoint on wherever the C++ code fails that assertion, debug from there.
<whitequark> you *will* have to get your hands dirty if you want to use LLVM.
* artagnon nods
pharpend has quit [Quit: WeeChat 0.4.3]
<artagnon> I don't mind doing that.
pharpend has joined #ocaml
taion809 has joined #ocaml
hausdorff has joined #ocaml
<artagnon> So it's in GCStrategy *GCModuleInfo::getOrCreateStrategy
hausdorff has quit [Remote host closed the connection]
<artagnon> whitequark: I can't go deeper than function information. Should I link to the trunk LLVM source tree?
hausdorff has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
<artagnon> The brew llvm isn't a debug build, it looks like.
<whitequark> yes.
sheijk has quit [Quit: .]
rwmjones has quit [Read error: Network is unreachable]
rwmjones has joined #ocaml
shinnya has quit [Ping timeout: 272 seconds]
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
hausdorf_ has joined #ocaml
hausdorff has quit [Read error: Connection reset by peer]
hausdorf_ has quit [Read error: Connection reset by peer]
hausdorf_ has joined #ocaml
hausdorf_ has quit [Remote host closed the connection]
hausdorf_ has joined #ocaml
ontologiae has quit [Ping timeout: 258 seconds]
boogie has joined #ocaml
SomeDamnBody has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Disconnected by services]
darkf_ is now known as darkf
serge has quit [Remote host closed the connection]
serge has joined #ocaml
serge has quit [Read error: Connection reset by peer]
serge has joined #ocaml
pharpend has quit [Ping timeout: 265 seconds]
serge has quit [Ping timeout: 260 seconds]
koderok has joined #ocaml
huza has joined #ocaml
pharpend has joined #ocaml
marvin-hh has quit [Ping timeout: 258 seconds]
marvin-hh has joined #ocaml
koderok has quit [Read error: Connection reset by peer]
BitPuffin has quit [Ping timeout: 265 seconds]
pyon has quit [Quit: stupid emacs]
koderok has joined #ocaml
marynate has joined #ocaml
samrat has joined #ocaml
ontologiae has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
serge has joined #ocaml
koderok has quit [Read error: Connection reset by peer]
larhat1 has quit [Quit: Leaving.]
koderok has joined #ocaml
alinab has joined #ocaml
darkfish has quit [Quit: None]
keen______ has joined #ocaml
hausdorf_ has quit [Remote host closed the connection]
keen_____ has quit [Ping timeout: 255 seconds]
hausdorff has joined #ocaml
SomeDamnBody has quit [Ping timeout: 272 seconds]
pyon has joined #ocaml
siddharthv_away is now known as siddharthv
alinab has quit [Quit: leaving]
taion809 has quit [Ping timeout: 260 seconds]
manud has joined #ocaml
<artagnon> whitequark: In LLVMGetPointerToGlobal, how do I know what function type I will get (and hence cast to using Obj.magic)?
manud has quit [Quit: manud]
meiji11 has joined #ocaml
mcclurmc has joined #ocaml
boogie has quit [Quit: Leaving...]
huza has quit [Quit: WeeChat 0.3.8]
<artagnon> To represent ExecutionEngineRef, do I have to go into each field and declare the corresponding structure in Ctypes?
<artagnon> That's a lot of boring work :\
araujo has quit [Quit: Leaving]
mcclurmc has quit [Remote host closed the connection]
robink has quit [Ping timeout: 255 seconds]
ontologiae has quit [Ping timeout: 244 seconds]
robink has joined #ocaml
axiles has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
ggole has joined #ocaml
ggole has quit [Ping timeout: 255 seconds]
serge has quit [Remote host closed the connection]
ggole has joined #ocaml
samrat has joined #ocaml
<def`> ls
<def`> oups
ygrek has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
sinelaw has joined #ocaml
MercurialAlchemi has joined #ocaml
oscar_toro has joined #ocaml
vogler has quit [Ping timeout: 255 seconds]
vogler has joined #ocaml
serge has joined #ocaml
<sinelaw> what's a good reference for type inference of mutable record fields?
manud has joined #ocaml
meiji11 has quit [Remote host closed the connection]
samrat has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
larhat has joined #ocaml
hhugo1 has joined #ocaml
vogler has quit [Read error: Connection reset by peer]
vogler has joined #ocaml
oscar_toro has quit [Ping timeout: 258 seconds]
koderok has quit [Ping timeout: 255 seconds]
sinelaw has quit [Ping timeout: 255 seconds]
q66[lap] has joined #ocaml
q66[lap] has quit [Client Quit]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
vogler has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
koderok has joined #ocaml
koderok has quit [Client Quit]
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
Pepe_ has quit [Remote host closed the connection]
hausdorff has quit [Remote host closed the connection]
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
hausdorff has joined #ocaml
Mercuria1Alchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
manud has quit [Quit: manud]
Pepe_ has joined #ocaml
jao has quit [Ping timeout: 255 seconds]
manud has joined #ocaml
oscar_toro has joined #ocaml
hhugo1 has quit [Quit: Leaving.]
oscar_toro has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
uggwar has left #ocaml [#ocaml]
<artagnon> whitequark: I'm confused about what kind of interface we want in OCaml.
<artagnon> We can pass a Llvm.llvalue and t from earlier calls to EE.create etc.
<artagnon> What do we want to do with the function pointer we get back? Run it, right?
mcclurmc has quit [Ping timeout: 272 seconds]
<artagnon> I realize that we shouldn't use llgenericvalue as the return type, because GenericValue is going away in favor of libffi.
<artagnon> ... but ctypes requires the types of the arguments and return type of the function to construct a valid type.
cago has joined #ocaml
manud has quit [Quit: manud]
oscar_toro has joined #ocaml
manud has joined #ocaml
manud has quit [Quit: manud]
zpe has joined #ocaml
kakadu has joined #ocaml
bezirg has joined #ocaml
keen_______ has joined #ocaml
keen______ has quit [Ping timeout: 272 seconds]
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
samrat has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
hausdorff has quit [Ping timeout: 240 seconds]
samrat has joined #ocaml
Simn has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
samrat has quit [Client Quit]
ocp has joined #ocaml
samrat has joined #ocaml
samrat has quit [Client Quit]
oscar_toro has quit [Ping timeout: 244 seconds]
zpe has quit [Remote host closed the connection]
ocp has quit [Quit: Leaving.]
ocp has joined #ocaml
sgnb has joined #ocaml
taion809 has joined #ocaml
sinelaw has joined #ocaml
raichoo has joined #ocaml
<raichoo> Hi, this might look like flame bait but I'm really interested what some of your reasons are why you use OCaml instead of Haskell. The module system seems utterly brilliant, any other reasons?
<johnelse> raichoo: for me personally, one reason is that it doesn't force you away from imperative programming e.g. you can just write a for loop if you want
<johnelse> but, the functional features are still there
<raichoo> fair enough :)
<johnelse> also, eagerness means less having to worry about hidden space leaks (although laziness does let you do some fun tricks)
<johnelse> and this is more subjective, but OCaml libraries tend to be more straightforward to use - with Haskell I often had to wade through a sea of types before I could understand what was going on
<raichoo> I don't have a problem with "subjective answers". I'm interested in them as well ^^
<emias> In my book, strict evaluation is the really strong point. Haskell can be lots of fun, but the hidden space leak issue can be considered a show stopper for using Haskell for certain types of applications.
hausdorff has joined #ocaml
<ggole> I like having mutation available without fuss when it fits a problem
<raichoo> Yeah, there is really a lot of discussion going on between strict vs. non-strict. I like both. :)
hausdorff has quit [Ping timeout: 272 seconds]
<emias> Me too.
<ggole> Yeah, OCaml has some support for laziness but it isn't really leaned on
<flux> I think it's not a small factor that the time it takes to ocamlc/ocamlopt is usually imperceptible, quite the opposite with ghc
<raichoo> I know, I could help but skimming some resources. Learning OCaml is still on my list, I just never really had enough motivation to really dive into it.
<flux> (well, unless it has sped up recently)
<flux> raichoo, well, nowadays things are even nicer than they used to be ;-): installing stuff is (usually) a breeze with opam, and if you're into emacs/vi, merlin gives great type information and locating value definitions.
<raichoo> I'm pretty excited that both languages seem to pick up a lot of momentum recently. I'm pretty much sold to Haskell at the moment but having OCaml in my toolbox as well is pretty tempting ^^
huza has joined #ocaml
oriba has joined #ocaml
siddharthv is now known as siddharthv_away
oriba has quit [Client Quit]
dzhulk has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
oscar_toro has joined #ocaml
<reynir> raichoo: ":" for types and "::" for lists ;)
<reynir> also, hi ^^
bytbox has joined #ocaml
darkf_ has joined #ocaml
<raichoo> hey reynir ^^
darkf has quit [Ping timeout: 265 seconds]
gdsfh has joined #ocaml
araujo has joined #ocaml
araujo has joined #ocaml
bytbox has quit [Remote host closed the connection]
darkf_ is now known as darkf
hausdorff has joined #ocaml
arj has joined #ocaml
<gdsfh> hello. If any of lwt developers are here, please tell me will you accept trivial patch to Lwt_condition that adds "waiters_exist : 'a t -> bool", or not?
<gdsfh> I need to know it to choose what should I do: fork + patch + PR, or implement workaround (like record with 'a Lwt_condition.t and "mutable nwaiters : int" and incr/decr on Lwt_condition.wait enter/exit).
hausdorff has quit [Ping timeout: 255 seconds]
<mfp> gdsfh: I'll forward that to #ocsigen because I believe several ppl there have commit rights
<gdsfh> mfp: thanks.
<mfp> gdsfh: anyway, if you're using OPAM (and you really should), nothing stops you from patching and publishing your custom repos somewhere. The PITA that is rebuilding all reverse deps is automated, so all you'd have to do if the PR were not accepted quickly is merge against origin/master every once in a while.
<gdsfh> mfp: yes, I can patch lwt and use custom version, but I prefer to not do it: 1. I'll need to update my fork manually, while opam updates lwt automatically, 2. I'll need to rebase my patch. Workaround with condvar + nwaiters is much easier in the long term.
<gdsfh> (I'm about case when my PR isn't accepted, of course.)
<mfp> indeed, managing a custom branch for such a trivial feature is not worth it in the long-term, but I'd be surprised if such a PR were not accepted
<flux> which (lwt) reminds me, any news from the multicore folk?-o
serge has quit [Remote host closed the connection]
serge has joined #ocaml
<mfp> flux: last I heard (from the talk video) was they had it working on bytecode and were making progress wrt. native code
<flux> I guess native code is required for people to take it seriously.
hugomg has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
<flux> it'll be interesting to see how much code breaks with it :), not to mention benchmark results
serge has quit [Ping timeout: 260 seconds]
<mfp> they had good gains on a IIRC 64-core box running bytecode fib :-P
<flux> ah yes, my fib-running-needs should then be perfectly addressed
samrat has joined #ocaml
<reynir> hehe
badkins has joined #ocaml
<artagnon> Can someone help me with a link failure? https://gist.github.com/artagnon/8a088fd26b1a8533a127
<artagnon> It's not finding global Llvm in the final link.
<artagnon> When I use ocamlfind -package llvm, it works fine.
<artagnon> ... but I want to link to trunk LLVM.
q66[lap] has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
<artagnon> I tried -custom -cclib -ccopt, but no change.
<whitequark> use OCAMLPATH
<whitequark> OCAMLPATH=~/llvm/Debug+Asserts/lib/ocaml:$OCAMLPATH
hausdorff has joined #ocaml
<hugomg> quick question: I want to build a list of things by appending elements to its tail. Do I use prepends on a regular list and reverse it at the end of the algorithm or is there a more direct data structure in the standard library / Core.Std that I can use? Its ok if its mutable, being purely functional is not a requirement in my case.
<acieroid> hugomg: prepending + reversing is the common idiom; I don't think there is something else in the stdlib (don't know about Core.Std though)
hausdorff has quit [Ping timeout: 255 seconds]
<companion_cube> the simplest way is prepending
<companion_cube> what do you want to use the list for, afterwards?
<hugomg> basically, I print it to stdout. I need to keep a list though because there are separate lists for the header and the file body and they need to be printed in the right order.
<ggole> DynArray, or whatever it is called
<flux> I think prepend+reverse is the most common solution
<flux> I guess a tree or a DynArray as ggole mentioned would be efficient alternatives
hsuh has quit [Ping timeout: 250 seconds]
<hugomg> thanks then. as long as there isn't something "obviously better" I'm convinced that the idiomatic prepend+reverse is the way to go :)
hsuh has joined #ocaml
* ggole mumbles something about tail recursion modulo cons
<gdsfh> hugomg: Queue
bezirg has quit [Remote host closed the connection]
bezirg has joined #ocaml
eizodo has joined #ocaml
bezirg has quit [Client Quit]
bezirg has joined #ocaml
dsheets has joined #ocaml
<hugomg> gdsfh: how didnt I think of that, hahaha
<gdsfh> gdsfh: or, if you want to just print, you can use two Buffer.t
<gdsfh> or even one: store "what to print second" in it, and just output "what to print first" to stdout.
darkf has quit [Quit: Leaving]
r0ok has quit [Quit: leaving]
BitPuffin has joined #ocaml
bezirg has quit [Ping timeout: 245 seconds]
Hannibal_Smith has joined #ocaml
jbalnit has left #ocaml [#ocaml]
jbalnit has joined #ocaml
<Drup> gdsfh: if the feature is not easily accessible otherwise, I'm pretty sure the patch would be accepted
<Drup> (but even if I have commit rights, I'm not an lwt maintainer :p)
hsuh has quit [Ping timeout: 272 seconds]
<nicoo> hugomg: Also, for many of your list-like-stream needs, Sequence is nice
shinnya has joined #ocaml
hsuh has joined #ocaml
SethTIsue has joined #ocaml
<hugomg> I thought Sequence was about abstracting over iterables though?
hsuh has quit [Ping timeout: 240 seconds]
<companion_cube> it's also ok for some operations, like flat_map
<flux> hmm, so if you had a recursive function of the form let foo = function 0 -> [] | _ -> 42::foo (n - 1), wouldn't it be possible to rewrite it into tail recursion by with let pseudo_foo result = function 0 -> result.fst <- nil | _ -> result.fst <- 42; foo' result.snd (n - 1) or something
Thooms has joined #ocaml
<Pepe_> Drup: ! I finally got Core to build :)
<Pepe_> (was a bit busy until now)
<companion_cube> let rec foo i k = if i>0 then (k 42; foo (i-1) k);; Sequence.iter (printf "value: %d\n") (f 100);;
<companion_cube> :>
<Pepe_> I did it from a fresh switch install, and pinned it to the git repo
<bernardo1pc> companion_cube: foo 100, right ;-)
<companion_cube> oops
bezirg has joined #ocaml
hsuh has joined #ocaml
hugomg has quit [Read error: Connection reset by peer]
samrat has quit [Quit: Computer has gone to sleep.]
hausdorff has joined #ocaml
bytbox has joined #ocaml
arj has quit [Quit: Leaving.]
hausdorff has quit [Ping timeout: 272 seconds]
samrat has joined #ocaml
rand000 has joined #ocaml
zpe has joined #ocaml
<artagnon> whitequark: Perfect; thanks :)
bezirg has quit [Ping timeout: 250 seconds]
<artagnon> I don't have to touch my Makefile if I use OCAMLPATH.
<artagnon> However, you haven't told me how to proceed with those two ctype wrappers.
<whitequark> oh, right
<whitequark> I'll get back to IRC in ten minutes or so and I will
bezirg has joined #ocaml
<artagnon> Sure.
mcclurmc has joined #ocaml
serge has joined #ocaml
fraggle-boate has quit [Quit: Quitte]
arj has joined #ocaml
bytbox has quit [Remote host closed the connection]
samrat has quit [Quit: Computer has gone to sleep.]
bytbox has joined #ocaml
<whitequark> back.
fraggle-boate has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
<Drup> whitequark: I took another look at the issue. Current situation is that both int and FP functions to get the value out of a Constant asserts if it don't fit *BUT* we have a way to know beforehand if it cannot fit for int
<Drup> and we don't have one for FP
<artagnon> whitequark: Quickly tell me what function type is necessary.
Simn has joined #ocaml
<artagnon> What should OCaml see?
<artagnon> Also, this code is producing syntax error: http://pastie.org/9678817
<whitequark> Drup: hm, how do you learn this for an int?
<Drup> so my proposition is to say fuck off and expose the looseInfo boolean in the C API and use it in the OCaml binding to return None
<Drup> whitequark: "LLVMGetIntTypeWidth(LLVMTypeOf(Const)) <= 64"
<whitequark> I think similar machinery should be available for floats
<whitequark> artagnon: ugh
<Drup> I didn't saw anything except the looseInfo boolean from the conversion function
<whitequark> don't put any ctypes code into llvm itself
<whitequark> although
<whitequark> hm
<artagnon> Oh.
<whitequark> well, actually, it might not be a bad idea after all.
<Drup> whitequark: since we are on the not-bad-idea-after-all
freling has quit [Read error: Connection reset by peer]
freling has joined #ocaml
freling has quit [Client Quit]
<Drup> do you think there is a non-insane way (also know as "go through strings") to plug Zarith for intergers and FP that are too big ?
freling has joined #ocaml
<artagnon> Okay, why is that segment syntax failing, and what do I from_voidp to?
<artagnon> (I don't think you need Obj.magic
<artagnon> from_voidp fits the bill, I think.
<Drup> artagnon: remove the "in"
<whitequark> I don't know why it's failing, you didn't include the error
<whitequark> I'm not telepathic.
<Drup> I am. :D
<whitequark> if something is broken, show me the fucking error
<artagnon> Drup: Oops, but that doesn't fix it.
<artagnon> Okay, one sec.
<Drup> arg !
samrat has joined #ocaml
<Drup> not telephatic after all, fu.
<artagnon> Oh, it does.
<artagnon> Different error now.
<Drup> \O/
badkins has quit [Remote host closed the connection]
<Drup> whitequark: I have an idea to make the binding typesafe, btw
<artagnon> I opam install'ed ctypes but I have to modify the Makefile to pick it up I guess.
bytbox has quit [Remote host closed the connection]
<artagnon> Why doesn't Makefile.ocaml use ocamlfind to simplify things?
<whitequark> it's very old.
dzhulk has quit [Quit: Leaving.]
Thooms has quit [Quit: WeeChat 1.0.1]
eizodo has quit [Quit: Page closed]
<whitequark> Drup: ok, let me explain how I see that API.
<whitequark> oh
<whitequark> "int64_of_const c returns the int64 value of the c constant integer. None is returned if this is not an integer constant, or bitwidth exceeds 64"
<whitequark> ok, so, float_of_const c should definitely not assert on huge floats
<whitequark> Drup: yes, I agree, expose the loseInfo flag.
<Drup> /me likes to agree with the maintainer on how to implement things.
dzhulk has joined #ocaml
dsheets has joined #ocaml
seanmcl has joined #ocaml
hugomg has joined #ocaml
freling has left #ocaml [#ocaml]
<artagnon> The Makefile is a colossal mess.
<artagnon> I can't understand where half the variables come from.
<whitequark> from LLVM's own makefiles. it's not separate.
<Drup> oh and btw, whitequark, it's not a question of huge float, it's a question of representable floats.
<whitequark> Drup: in principle, yes
<whitequark> in practice, LLVM doesn't allow you to enter arbitrary floats
sinelaw has quit [Ping timeout: 255 seconds]
<whitequark> (you can't represent them in the IR)
<Drup> what do you mean ?
<artagnon> Plane landing; I'll get some sleep and return in a while.
<whitequark> so you only have fp128, x86_fp80 and ppc_fp128 as the floats that can't be converted to double
<whitequark> which are incidentally all bigger than double.
<Drup> oh, you can't have custom floating point semantics ?
<Drup> the api seems to imply you can
slash^ has joined #ocaml
ivan\ has joined #ocaml
<gdsfh> Drup: my patch can be non acceptable, because in C there is no way to know whether there are waiters for given pthread_cond_t or not. It's a bit philosophical question, that's why I'm asking here. Anyway I'll follow both paths: workaround + "todo: check for PR ... and remove this code" + PR itself.
larhat has quit [Quit: Leaving.]
gdsfh1 has joined #ocaml
gdsfh has quit [Ping timeout: 265 seconds]
hausdorff has joined #ocaml
badkins has joined #ocaml
hausdorff has quit [Ping timeout: 258 seconds]
raichoo has quit [Ping timeout: 265 seconds]
olauzon has joined #ocaml
badkins has quit [Ping timeout: 250 seconds]
badkins has joined #ocaml
dsheets has quit [Ping timeout: 258 seconds]
dsheets has joined #ocaml
morphles has joined #ocaml
<whitequark> craaap
<whitequark> Drup: no, you can't
<whitequark> the lowest levels of API (APFloat & friends) allow that
<whitequark> but higher ones don't really give you the freedom you need for that
<Drup> ok
<whitequark> the "craaap" remark referred to the following
<whitequark> Llvm_executionengine is useless without ctypes.
<whitequark> but I can't put a dependency on ctypes into llvm.
<whitequark> it's not even in debian yet at all.
<Drup> that's sad.
bezirg has quit [Ping timeout: 244 seconds]
badkins has quit [Ping timeout: 244 seconds]
hugomg has quit [Ping timeout: 256 seconds]
jwatzman|work has joined #ocaml
badkins has joined #ocaml
hausdorff has joined #ocaml
zz_adgtl is now known as adgtl
<whitequark> siiiigh
<whitequark> oh, ctypes is actually in debian
<whitequark> ancient 0.2.3 in jessie
hugomg has joined #ocaml
cago has left #ocaml [#ocaml]
jbalnit has quit [Ping timeout: 265 seconds]
shinnya has quit [Ping timeout: 265 seconds]
jbalnit has joined #ocaml
bytbox has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
nico159_ has joined #ocaml
Hannibal_Smith has quit [Ping timeout: 265 seconds]
nico159_ has quit [Client Quit]
Hannibal_Smith has joined #ocaml
zpe has quit [Remote host closed the connection]
dotfelix has joined #ocaml
dotfelixb has joined #ocaml
serge has quit [Remote host closed the connection]
dotfelix has quit [Read error: Connection reset by peer]
serge has joined #ocaml
raichoo has joined #ocaml
serge has quit [Ping timeout: 258 seconds]
ygrek has joined #ocaml
dotfelixb has quit [Quit: Leaving]
arj has quit [Quit: Leaving.]
zpe has joined #ocaml
ygrek has quit [Remote host closed the connection]
pyon has quit [Ping timeout: 272 seconds]
ygrek has joined #ocaml
jzelinskie_ is now known as jzelinskie
bytbox has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
marynate has quit [Quit: Leaving]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
jwatzman|work has joined #ocaml
adgtl is now known as zz_adgtl
zz_adgtl is now known as adgtl
adgtl is now known as anildigital
anildigital is now known as zz_anildigital
ikaros has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
* reynir waits for 4.02.01 to hit the arch repos
<Drup> reynir: don't wait, use opam! :]
kakadu has quit [Quit: Page closed]
<reynir> it's easier to "migrate" the opam packages by waiting for the arch repos ^^
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
hausdorf_ has joined #ocaml
hausdorff has quit [Ping timeout: 258 seconds]
q66[lap] has quit [Changing host]
q66[lap] has joined #ocaml
jpdeplaix` is now known as jpdeplaix
Thooms has joined #ocaml
hausdorf_ has quit [Remote host closed the connection]
hausdorff has joined #ocaml
paddymahoney has joined #ocaml
hausdorff has quit [Ping timeout: 272 seconds]
dzhulk1 has joined #ocaml
samrat has quit [Ping timeout: 244 seconds]
ljs has joined #ocaml
dzhulk has quit [Ping timeout: 265 seconds]
ocp has quit [Ping timeout: 265 seconds]
_obad_ has quit [Ping timeout: 260 seconds]
samrat has joined #ocaml
srcerer has quit [Quit: ChatZilla 0.9.91 [Firefox 32.0.3/20140923175406]]
dsheets has quit [Ping timeout: 240 seconds]
serge has joined #ocaml
srcerer has joined #ocaml
serge has quit [Ping timeout: 250 seconds]
badon has quit [Ping timeout: 256 seconds]
slash^ has quit [Read error: Connection reset by peer]
claudiuc has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
_andre has quit [Quit: leaving]
claudiuc has quit [Read error: Connection reset by peer]
claudiuc has joined #ocaml
ygrek has quit [Remote host closed the connection]
samrat has quit [Quit: Computer has gone to sleep.]
thmslld has joined #ocaml
larhat has joined #ocaml
kakadu has joined #ocaml
WraithM has joined #ocaml
pyon has joined #ocaml
artagnon has quit [Ping timeout: 272 seconds]
strmpnk has quit [Ping timeout: 272 seconds]
nox has quit [Ping timeout: 272 seconds]
artagnon has joined #ocaml
ggherdov has quit [Ping timeout: 244 seconds]
dch has quit [Ping timeout: 272 seconds]
lopex has quit [Ping timeout: 272 seconds]
strmpnk has joined #ocaml
jcloud has quit [Ping timeout: 272 seconds]
dch has joined #ocaml
nox has joined #ocaml
jcloud has joined #ocaml
lopex has joined #ocaml
sinelaw has joined #ocaml
<sinelaw> can ocaml infer anonymous record types?
<sinelaw> I know this won't compile: let x = { v = [] } ;; but is there something like that code that will?
<companion_cube> record types must be declared
<sinelaw> ok
<ggole> object types can be anonymous
<ggole> let o = object method v = [] end
manud has joined #ocaml
ggherdov_ has joined #ocaml
SethTIsue_ has joined #ocaml
hausdorff has joined #ocaml
SethTIsue has quit [Ping timeout: 244 seconds]
SethTIsue_ is now known as SethTIsue
SethTIsue has quit [Client Quit]
Hannibal_Smith has quit [Quit: Sto andando via]
ggole has quit []
badkins has quit [Ping timeout: 272 seconds]
lordkryss has joined #ocaml
SethTIsue has joined #ocaml
ygrek has joined #ocaml
emmanueloga has quit [Ping timeout: 250 seconds]
WraithM has quit [Ping timeout: 265 seconds]
SethTIsue has quit [Ping timeout: 244 seconds]
SethTIsue has joined #ocaml
OnkV has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
emmanueloga has joined #ocaml
Haudegen is now known as Guest39355
Guest67269 has quit [Ping timeout: 260 seconds]
claudiuc has quit [Remote host closed the connection]
Guest67269 has joined #ocaml
claudiuc has joined #ocaml
SethTIsue has quit [Ping timeout: 244 seconds]
SethTIsue has joined #ocaml
<whitequark> they're not really equivalent though
paddymahoney has quit [Ping timeout: 250 seconds]
<whitequark> I would really hate to see some code using objects in place of records in order to avoid pre-declaring them
Simn has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
Sim_n has joined #ocaml
axiles has quit [Remote host closed the connection]
bezirg has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
morphles has quit [Ping timeout: 245 seconds]
mstr_ has joined #ocaml
paddymahoney has joined #ocaml
mstr_ is now known as mstrhh
serge has joined #ocaml
ljs has quit [Quit: Be back later ...]
<thmslld> Hi folks, I'm new to OCaml and was wondering if anyone knows of an easy way to get version 4.02.1 on Ubuntu 14.10?
serge has quit [Ping timeout: 258 seconds]
<whitequark> opam
<whitequark> apt-get install opam; opam switch 4.02.1
<whitequark> oh, actually, scratch that, there is a better way: a repository
simn__ has joined #ocaml
Sim_n has quit [Ping timeout: 260 seconds]
hhugo1 has joined #ocaml
bytbox has joined #ocaml
simn__ has quit [Quit: Leaving]
<thmslld> Thanks whitequark, I've now got the latest version. What I've been thinking of doing after I finished up OCaml from the very beginning I will try my hand at writing a text adventure to improve my skills.
<thmslld> The only major problem I foresee is saving the progress any advice there?
<whitequark> thmslld: you could serialize it into JSON and save into a file
<whitequark> say, https://github.com/whitequark/ppx_deriving_yojson could help you with the JSON serialization/deserialization boilerplate
<companion_cube> or to S-expressions
<companion_cube> ;)
hhugo1 has quit [Client Quit]
<whitequark> no ppx_deriving_sexplib for you
<companion_cube> awww
<thmslld> Thanks I think I may just follow your advice. Hope you don't mind beginner questions as there may be a lot more to come. :)
<whitequark> sure, that's what this channel is for
<companion_cube> this channel is also to ask whitequark to implement things
<companion_cube> :>
oscar_toro has quit [Read error: Connection reset by peer]
<whitequark> I have this feeling I'm going to spend this week refactoring LLVM because ugh
<whitequark> LLVM bindings
mstrhh has quit [Quit: mstrhh]
ygrek has quit [Ping timeout: 265 seconds]
dsheets has joined #ocaml
ljs has joined #ocaml
SethTIsue has quit [Quit: SethTIsue]
oscar_toro has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
avsm has joined #ocaml
hooplahoops has joined #ocaml
WraithM has joined #ocaml
<hooplahoops> Hi, I have a module 'equal.ml' with a 'module type Equal = sig ... end', and I have a module 'myfunctor.ml' containing something like 'module Foo = Functor (Equal : Equal) -> struct ... end'
<hooplahoops> I first compile Equal with ocamlc, and then I compile myfunctor, but I then always get the following: Error: Unbound module type Equal
<hooplahoops> What am I doing wrong?
<whitequark> Equal.Equal
<hooplahoops> ooh
<hooplahoops> whitequark: yeah that does it, thanks!
<hooplahoops> Why do I get such a stupid error message, it sounds like it had trouble finding the module as opposed to a type error
<whitequark> unbound module type Equal
<whitequark> oh, I see your point
Nahra has joined #ocaml
<hooplahoops> I now have another issue. If I have equal.ml and equal.mli, where equal.mli has 'module type Equal = sig ... end', and I have 'module Equal = struct ... end', I get: The field `Equal' is required but not provided
<hooplahoops> Why is 'Equal' not provided by the 'module Equal = struct ... end'?
<whitequark> module types are similar to regular types
<whitequark> so you'd have "type a" in the .mli and "type a = int" in the .ml
<whitequark> in other words you need to provide a module type in implementation for every module type in the interface
<whitequark> btw I reported the confusing message as http://caml.inria.fr/mantis/view.php?id=6633
Nahra has quit [Remote host closed the connection]
<hooplahoops> whitequark: cool, thanks for the bug report!
Nahra` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<hooplahoops> whitequark: yes, I actually have the following: module Equal = struct type t = int ;; let equal x y = (x == y) end
<hooplahoops> along with module type Equal = sig type t ;; equal : t -> t -> bool end
<hooplahoops> Then I type 'ocamlc equal.mli && ocamlc equal.ml'
jwatzman|work has quit [Quit: jwatzman|work]
<whitequark> can you name your modules and module types differently?
<whitequark> the convention for module types is all-uppercase, e.g. module type EQUAL
<whitequark> you will also immediately see the error.
<hooplahoops> ah, ok, thanks let me try
WraithM has quit [Ping timeout: 240 seconds]
WraithM has joined #ocaml
olauzon has quit [Quit: olauzon]
Nahra has joined #ocaml
manud has quit [Quit: manud]
<hooplahoops> I renamed the modules, do I still keep them in 'equal.ml' and 'equal.mli', or do I need 'EQUAL.ml' etc?
<hooplahoops> with 'equal.ml' I still get: The field `EQUAL' is required but not provided
oscar_toro has quit [Ping timeout: 265 seconds]
<whitequark> show your equal.ml,mli
<whitequark> on e.g. gist.github.com
<hooplahoops> ok, one moment, thanks
<whitequark> hooplahoops: see, "module type" is the module language equivalent of "type", and "module" is the equivalent of "val" or "let"
<whitequark> so essentially you wrote "type a" in .mli and "let a = whatever" in .ml
WraithM has quit [Ping timeout: 256 seconds]
<whitequark> you need to put the module type into .ml exactly as you have it in .mli
<hooplahoops> whitequark: oh, so I should say 'module EQUAL : EQUAL = struct ... end' ?
<whitequark> no.
jwatzman|work has joined #ocaml
<whitequark> you need to put the module type into .ml exactly as you have it in .mli.
<whitequark> module type EQUAL = ... in both .ml and .mli.
<hooplahoops> Oh, ok
<whitequark> like you would do for "type a".
<hooplahoops> Is there no say to avoid that?
<whitequark> no
<whitequark> well
<hooplahoops> doesn't that mean we repeat interfaces all the time?
<whitequark> yes, that's what generally happens with types in OCaml.
<whitequark> you duplicate it in the interface and implementation
<hooplahoops> Hmm, ok. Is that more useful than not repeating it in some sense?
<whitequark> the reason being that you might want to constrain the type you export, but have full access to its internals in the implementation.
<whitequark> yep!
<whitequark> like you could have "type a = int" in implementation but just "type a" (abstract) in the interface.
<hooplahoops> I thought the purpose of the .mli was to do the constraining automatically?
<hooplahoops> I was guessing I'd always have access to the full implementation (type t = int) in the 'struct', but any module using it would be constrained by the equal.mli
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hooplahoops> So if I repeat the signature, am I getting something beyond the above?
<whitequark> you explicitly say whether you want to expose the details of the type or not in the .mli
paddymahoney has quit [Ping timeout: 258 seconds]
WraithM has joined #ocaml
<whitequark> you might want to make the type abstract in the interface, or you might not
<whitequark> there is no way for the compiler to guess
<hooplahoops> Yes, I understand the abstract types in the .mli, so I understand repeating the 'type t = int' part
<hooplahoops> But you seem to be saying, "copy the entire 'module type Equal = sig ... end' into 'equal.ml', correct?
<whitequark> well, you can have an abstract module type just as well
<hooplahoops> That allows me to not repeat it, or it makes the entire implementation abstract?
<whitequark> makes it abstract
dzhulk1 has quit [Quit: Leaving.]
<hooplahoops> So no one can call any function?
<hooplahoops> Or does it pertain only to all the types?
<whitequark> it'd be entirely abstract
<whitequark> I'm not saying this is useful in your case, I'm explaining the rationale for duplication
<whitequark> duplication exists to give you a chance to make the interface more conservative
<hooplahoops> It indeed seems to compile with the duplication
<hooplahoops> But if I wanted to change the interface, I'd have to change the implementation, the .mli and the module type in the module?
<hooplahoops> In that case, could I just omit the .mli entirely?
<whitequark> in principle, yes, but that's bad practice.
<whitequark> on >=4.02, you can use https://github.com/whitequark/ppx_import to avoid duplication
<whitequark> so you'd have just "module type EQUAL = [%import: (module Equal.EQUAL)];" in the implementation
dsheets has quit [Ping timeout: 265 seconds]
<hooplahoops> I'm still a little hazy on the details. If I have a module Equal having two signatures, and a module A that uses Equal, which signature does it refer to?
<whitequark> when you refer to a signature, you have to specify the full path.
<whitequark> so in your case, that would be Equal.EQUAL.
<whitequark> so, there can be no ambiguity.
<hooplahoops> I guess what I mean is, if I use 'open Equal', do I get the stuff listed in the module type from equal.ml, or the stuff from equal.mli?
jwatzman|work has quit [Quit: jwatzman|work]
<whitequark> oh. externally, you can only see that what is defined in the .mli
<hooplahoops> Ah, I see, ok, thanks!
jwatzman|work has joined #ocaml
<hooplahoops> Can I add more contents to the module type in equal.ml than in equal.mli, or vice versa?
zpe has quit [Remote host closed the connection]
<whitequark> hm
<whitequark> let me verify
<hooplahoops> It seems to complain here ;)
zpe has joined #ocaml
<hooplahoops> For either case
<hooplahoops> Which suggests the signatures have to be identical?
<whitequark> yes, they have to be identical.
<whitequark> but you can make it abstract in the .mli.
<whitequark> that's ... not very useful, I suppose.
<hooplahoops> So you were saying that you can be more conservative with the module type in the .ml file, how can I do that if the signatures have ot be identical?
<whitequark> well, I was wrong, sorry
WraithM has quit [Ping timeout: 244 seconds]
raichoo has quit [Ping timeout: 265 seconds]
<hooplahoops> Ah ok, no worries
avsm has quit [Ping timeout: 260 seconds]
zpe has quit [Ping timeout: 255 seconds]
manud has joined #ocaml
ustunozgur has joined #ocaml
<whitequark> hm, what to do
<whitequark> I know, let's break utop
<companion_cube> whitequark: you should add something about "how to compile" in your ppx_dreiving readme
<whitequark> companion_cube: huh?
<whitequark> For every plugin, you need to require the corresponding package, e.g. ppx_deriving.show for the show deriver. The package ppx_deriving.std depends on every standard deriver.
<companion_cube> I mean to compile a binary (which option to give to oasis/ocamlbuild)
<whitequark> I don't understand
<companion_cube> I mean, how to tell ocamlbuild which ppx to use. -package surely isn't enough?
<whitequark> it is
<companion_cube> oh
<companion_cube> impressive
<whitequark> I spent two months screwing with ocamlfind and now you give me this :/
<companion_cube> well, it seemed too easy :p
<hooplahoops> I think the idea is that you typically don't write 'module Foo = struct ... end', instead you just write your definitions directly, and then write a '.mli'?
<hooplahoops> then you don't need to repeat the whole signature
<hooplahoops> so the module thing is useful in case you want multiple modules in one file, perhaps?
serge has joined #ocaml
<whitequark> huh?
<companion_cube> hooplahoops: it's useful for modules within modules, or to provide arguments to functors
<hooplahoops> companion_cube: right, that's what I thought
<hooplahoops> I must say the ocaml tooling feels a little retro :p
<companion_cube> sadly, yes :/
<hooplahoops> I just want to type 'ocaml foo.ml' and have it compile all dependencies. Almost any other language has automatic dependency resolution
<whitequark> OCaml has this, of course
<companion_cube> you can do something like ocamlbuild foo.native
<whitequark> use ocamlbuild.
<hooplahoops> yeah, that what you get told
<hooplahoops> It's not easy for newcomers to learn about all these tools
<whitequark> companion_cube: oooh. I just got an idea for an OCaml buildsystem
<hooplahoops> it also complains about hygiene etc
<whitequark> hooplahoops: well, it complains rightly
serge has quit [Ping timeout: 264 seconds]
<hooplahoops> whitequark: why? It can't look at timestamps?
<hooplahoops> Or use hashes?
<whitequark> it uses hashes
lordkryss has quit [Quit: Connection closed for inactivity]
<whitequark> you shouldn't have any build artifacts in your source tree anyway
larhat has quit [Ping timeout: 258 seconds]
<hooplahoops> so why doesn't it build my project, rebuilding anything that's out of date?
<whitequark> it does
<Drup> whitequark: what's the idea ? :D
<hooplahoops> ok I'll do the cleaning then and see :)
<whitequark> Drup: two things actually
<whitequark> 1) get rid of forking *entirely*
<whitequark> 2) specify the dependencies inside [%%nodes], not _tags
BitPuffin has quit [Ping timeout: 255 seconds]
<companion_cube> ppx_assemblage
<whitequark> so it'd go like
jwatzman|work has quit [Read error: Connection reset by peer]
<whitequark> parse, invoke Findlib, typecheck, etc, etc
<Drup> and what does it solves ?
<whitequark> 1) solves ocamlbuild being slow
<whitequark> 2) solves the need for external buildsystem configuration
<whitequark> the only thing you need to compile a .ml file is that .ml file
<companion_cube> that's indeed a nice property to have
<Drup> how do I do project wide configuration ?
<companion_cube> a yolo.ml file at the root of the project
<whitequark> you don't
<Drup> yeah, but I wnat.
<whitequark> hm
<Drup> want*
<whitequark> then what companion_cube says
<whitequark> something like
<whitequark> [%%config "yolo.ml"]
<whitequark> it's explicit
<Drup> huum, why not
<whitequark> wanna join?
<whitequark> any of you
<Drup> I'm not getting involve in the conception of any build system, as a point of honor
<Drup> but I can be beta tester if you want.
<whitequark> oh, another bonus point to not ever forking: I could reuse the Typedtree and Lambda between all the .cmo/.cmx/etc invocation
<companion_cube> awww
<companion_cube> at least I trust you for doing something that works
<Drup> (also, I'm waiting for assemblage, because I think it would be a good unfucking step forward)
<whitequark> similarly the ppx can not only be invoked only once, but also built into the frontend
<companion_cube> hence, ppx_assemble
<companion_cube> ppx_assemblage*
<whitequark> right now I want to add syntax highlighting to utop
<whitequark> ~because~
<companion_cube> ~o~
<whitequark> it is entirely possible that I will bail on it once I see the relevant parts of utop
<whitequark> oh. oh holy shit I just remembered how lambda-term requires you to color the code
<whitequark> holy fuck who ever thought that is a good idea
<whitequark> basically you need to specify the whole set of attributes for every single character.
hausdorff has quit [Remote host closed the connection]
<Drup> I did something for coloration a little more sane, did you saw it ?
<whitequark> no
<whitequark> well, yes, but I forgot
<Drup> :D
<whitequark> oooooooo
<whitequark> wow neat
jwatzman|work has joined #ocaml
<Drup> yes, very
hausdorff has joined #ocaml
<whitequark> can it be that I will come to hate my life slightly less?!
<Drup> I remember explaining how it works, just to make your eyes bleed
<whitequark> oh, yes, THAT I remember
<whitequark> I never seen this PR in fact, or even knew that it was merged
<whitequark> I don't think you told me
<whitequark> so.
<whitequark> how do I actually use the API?
<Drup> hum, I don't think I did, indeed
manud has quit [Ping timeout: 255 seconds]
<Drup> whitequark: the first step is to make a bidirectionnal directory Format.tag (= string) <-> LTerm_style.t
<Drup> that's the ugly part.
<whitequark> I'll just use ppx_deriving_yolojson
<Drup> then, you give the decoding (string -> LTerm_style.t) to make_formater
<Drup> and it will give you a formater and a flush function
<Drup> a content function*
<Drup> and then you give the encoding function to "pp_with_style"
<Drup> or styprintf, or kstyprintf
<Drup> and after that, it's regular Format stuff
<whitequark> ok, I follow
<whitequark> hahaha
<whitequark> the interface of UTop_lexer makes it easier to use the old lambda-term API, in fact
<whitequark> it gives you the locations, but not, say, the blank characters
<Drup> yeah, I'm not surprised, since they were designed together :p
kakadu has quit [Quit: Konversation terminated!]
<whitequark> wait, it actually has syntax highlighting?
<whitequark> holy shit
ustunozgur has quit [Remote host closed the connection]
<Drup> sure it does
<Drup> ahah, I didn't actually look at what you wanted to do
<Drup> yeah, it's not enabled by default, but you only need to add a few line in the config file, and that's all
<whitequark> my eyes bleed
<whitequark> that's utoprc-dark
<Drup> :D
<whitequark> could you possibly find a less appealing color combination on purpose?
hooplahoops has quit [Ping timeout: 244 seconds]
<whitequark> who the fuck makes comments red
<whitequark> RED
<whitequark> COMMENTS
<whitequark> my ass
<whitequark> *throws laptop out window*
<Drup> half of any default themes of any text editors are terrible
<Drup> and same for any windows manager
ljs has quit [Quit: Be back later ...]
manud has joined #ocaml
<whitequark> Drup: I'll call this buildsystem/frontend "ocamllang"
<whitequark> because of "clang"
<Drup> mui
sinelaw has quit [Quit: Leaving]
<whitequark> and it will include functionality of every single tool ocaml ships by default, including toplevel
avsm has joined #ocaml
<Drup> that sounds scary.
zpe has joined #ocaml
jao has quit [Ping timeout: 250 seconds]
<whitequark> I changed my mind
<whitequark> well, maybe once I get to inbox zero
segmond has joined #ocaml
struktured has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
sgnb has quit [Ping timeout: 244 seconds]
manud has quit [Quit: manud]
bezirg has quit [Ping timeout: 245 seconds]
struktured has quit [Ping timeout: 272 seconds]
rand000 has quit [Quit: leaving]
<Drup> orbitz: what's a CRDT ?
struktured has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
Thooms has quit [Quit: WeeChat 1.0.1]