<orbitz>
struktured: I don't know. currently my protobuf implementation should work fine in riak though, so it shouldn't be a blocker
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
mekaj has quit [Ping timeout: 265 seconds]
_obad__ has quit [Ping timeout: 265 seconds]
_obad_ has joined #ocaml
hhugo has quit [Quit: Leaving.]
<Drup>
whitequark: would it be possible to make your log viewer NOT scroll to the bottom on each update when "live updates" is uncheck ?
<orbitz>
off to bed. thanks for the shoutout Drup. struktured keep an eye on ocaml-riakc for changes soon.
<struktured>
orbitz: will do. thanks
<Drup>
=)
hausdorff has joined #ocaml
<whitequark>
Drup: um, what? it shouldn't do that
Submarine has joined #ocaml
<Drup>
well, it does
Unhammer has joined #ocaml
hhugo has joined #ocaml
<Drup>
and it's driving me crazy
mekaj has joined #ocaml
<whitequark>
orbitz: I should actually extract the protobuf library outside ppx_deriving_protobuf, then
<struktured>
whitequark: yeah if you do that it would be much easier for to layer ppx ontop of it from a different library
<struktured>
*for me to
<whitequark>
struktured: hm?
<struktured>
struktured: there are several issues using ppx_deriving_protobuf with the existing ocaml-riakc. one is the competing Protobuf api modules.
<struktured>
whitequark: other issues involve camlp4 extensions, and some libs that aren't / weren't 4.01+ ready
<whitequark>
right
<whitequark>
I'll get on it
<struktured>
whitequark: cool, hopefully I can throw away 75% of my code now after this is all said and done :)
nicoo has quit [Remote host closed the connection]
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
hhugo1 has joined #ocaml
hhugo has quit [Read error: Connection reset by peer]
<Drup>
struktured: can you try the bug with each core_kernel dependency one by one ?
<struktured>
Drup: that's easy to do. sure. give me a few..
<whitequark>
dmbaturin: e.g. containers
<struktured>
Drup: side note- it crashes utop if you do #require core;; #require ppx_deriving_protobuf;; in that order. Inverse only throws an error as shown in that above issue
darkf has joined #ocaml
jabesed has quit [Ping timeout: 260 seconds]
<whitequark>
crshes?!
<whitequark>
that's a serious bug
<Drup>
:|
<whitequark>
what does the crash look like?
<struktured>
Drup: pa_test and core_kernel are the offenders from core's dep list
<Drup>
whitequark: looking at pa_ounit, it's indeed how it was supposed to work
<whitequark>
struktured: oh hahahahahaha
<whitequark>
I know why it broke
<whitequark>
tl;dr fuck camlp4
<Drup>
pa_ounit doesn't need camlp4, pa_ounit.syntax do
zpe has joined #ocaml
<whitequark>
struktured: what happened is that ppx_deriving_protobuf had the ppxopt option
<whitequark>
and to handle ppxopt in toplevel, findlib feeds a [%%ppx.option] extension node through the entire stack
<whitequark>
I could in principle add a workaround to utop, but I think it's not worth the hassle
* whitequark
takes out the flamethrower
<whitequark>
brb.
<struktured>
lol
<struktured>
ok, gonna see if I can wipe out this camlp4 injection, even if I have to opam pin 20 repositories
<struktured>
Drup: to be clear, the oasis XMETARequires section are the ones exported externally?
<Drup>
struktured: well, you juste have to change the XMETARequires line in pa_test's _oasis and regenerate it
<Drup>
yes
<struktured>
ok, yeah question is which how/many _oasis files are an issue, hopefully just core_kernel
<struktured>
and core
<whitequark>
orbitz: ping
<Drup>
hum, no, you don't need to change core_kernel and core's oasis
<whitequark>
just change the generated META file
<Drup>
you need to change pa_test's one
<whitequark>
#yolopackaging
<Drup>
whitequark: meh.
<whitequark>
Drup: it's actually applicable here in all seriousness
<whitequark>
you only live once, and wasting that on regenerating OASIS is somewhere lower than "getting addicted to crystal meth" on my scale
<Drup>
peuh
<Drup>
change a line, call oasis setup, done
<Drup>
don't overdo it :p
<whitequark>
anything worth doing is worth overdoing.
<struktured>
I'm taking the overdoing approach, metihnks
<struktured>
*methinks
<Drup>
that's the kind of vacuum filled mantra I find hilarious :D
<whitequark>
you do realize I wasn't applying it sincerely?
<Drup>
sure :D
<nicoo>
jpdeplaix: Please, fix OASIS' destdir :3
zpe has quit [Ping timeout: 272 seconds]
<whitequark>
nicoo: want me to lend the flamethrower?
* nicoo
lends whitequark his flamethrower, a keg of gasoline, a chainsaw and a team of ninjas
<whitequark>
no, to burn OASIS
<whitequark>
... burn an oasis
<nicoo>
Ah
<nicoo>
>_<'
<whitequark>
cover it with oil and set it on fire
* nicoo
orders the ninjas to murder whitequark's sense of humour
jao has quit [Ping timeout: 265 seconds]
<whitequark>
humour?
<nicoo>
whitequark: Yes, I got it when you said "burn OASIS"
<whitequark>
no, that wasn't a joke, rather a metaphor for deprecating software.
<Drup>
it's not yet deprecated, you need a good alternative to say something is deprecated :)
<nicoo>
Meh. What is less bad than OASIS and works for not-so-small projects ?\
<Drup>
no, bare ocamlbuild is not one, and neither is topkg
<whitequark>
well, personally I found that OASIS doesn't even work for small projects
<nicoo>
whitequark: Also, I need jpdeplaix to fix this, because it prevents me from (properly) packaging stuff which uses OASIS: the distro I use do all builds and installs in sandboxes
<struktured>
whitequark: I'm pretty disappointed by oasis
<whitequark>
Drup: I agree about topkg, it can't even install documentation
<whitequark>
it only mostly works for me
<whitequark>
orbitz: okay, so, the plan I offer is: I extract Protobuf into a separate package, add you as a collaborator, you add your monadic thing, we release that as protobuf 2.0
<artagnon>
This is core, core_kernel version 111.21.00
* artagnon
tries an opam update
natrium1970 has joined #ocaml
<natrium1970>
I am looking for a library for rational numbers for OCaml. The Num module at first looks useful, but it does not seem to provide a way to get the numerator and denominator of a (normalized) rational. Any suggestions?
<whitequark>
zarith
<natrium1970>
In fact, the Ratio module that Num uses for rationals deliberately hides this information!
<struktured>
argh: #require "core";; Error: Reference to undefined global `Pa_test_lib'
<Drup>
natrium1970: zarith is much better than the stdlib's interface in numerous ways ;)
<natrium1970>
I was hoping for something that doesn’t have outside dependencies because I plan on compiling the OCaml to JavaScript.
<whitequark>
oh.
<natrium1970>
And the dependency on GMP will make that a no-go.
<whitequark>
zarith is not for you, then.
<artagnon>
Now pipebang and herelib are not able to find caml4p.*
<Drup>
ah, right, indeed
<natrium1970>
I guess I’ll just hack on Ratio and expose the things it’s trying to hide.
<artagnon>
opam is so unreliable :(
ivg` has joined #ocaml
mcclurmc_ has quit [Ping timeout: 256 seconds]
ivg has quit [Ping timeout: 260 seconds]
<whitequark>
artagnon: let me guess, system compiler?
mcclurmc has joined #ocaml
<Drup>
natrium1970: in theory, it could be possible to implement the C primitives in javascript and be able to compile zarith to js
<Drup>
(that's how it's done for num, in fact, since there are C primitives in it too)
ivg` has quit [Client Quit]
ivg has joined #ocaml
<Drup>
(but I think the C primitives are less used)
<artagnon>
whitequark: What's the issue with ocamlopt from system?
hightower4 has quit [Ping timeout: 265 seconds]
<Drup>
artagnon: the ocamlopt, none. The camlp4 from the system, otoh ....
<artagnon>
camlp4 4.02.1+system
WraithM has joined #ocaml
<artagnon>
It's using ocamlfind to find it.
<whitequark>
yes
<artagnon>
Where is it installed on system and how do I nuke it?
<whitequark>
you use a compiler from opam.
<whitequark>
opam switch 4.02.1
<artagnon>
Ah, thanks.
mcclurmc has quit [Ping timeout: 272 seconds]
<artagnon>
... but I use the system compiler for my project, no?
<whitequark>
no
<whitequark>
and yes, this will require you to build an LLVM with the opam compiler
<whitequark>
see, this is why I hate camlp4.
<artagnon>
Oh man.
<artagnon>
Alright; should be back in a few hours.
artagnon has left #ocaml [#ocaml]
<Drup>
building an llvm with the opam compiler is not difficult, what's the issue ?
zpe has joined #ocaml
WraithM has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
mcclurmc has quit [Ping timeout: 250 seconds]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
<struktured>
sweet, I got core + ppx_deriving_protobuf working in utop... I think
malc_ has quit [Ping timeout: 264 seconds]
<struktured>
async too, apparently
<Drup>
congratulation :D
mcclurmc has joined #ocaml
<struktured>
I feel like something must have broke
<struktured>
but haven't ofund it yet
darkf_ has joined #ocaml
q66 has quit [Quit: Leaving]
darkf has quit [Ping timeout: 272 seconds]
natrium1970 has quit [Quit: natrium1970]
samrat has joined #ocaml
ggole has joined #ocaml
samrat has quit [Ping timeout: 260 seconds]
hhugo has joined #ocaml
samrat has joined #ocaml
shinnya has quit [Ping timeout: 250 seconds]
npnth has left #ocaml [#ocaml]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
zpe has joined #ocaml
hightower4 has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
darkf_ is now known as darkf
hausdorff has joined #ocaml
hhugo has quit [Quit: Leaving.]
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
hausdorff has quit [Remote host closed the connection]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
hausdorff has joined #ocaml
hausdorff has quit [Remote host closed the connection]
zpe has joined #ocaml
samrat has quit [Ping timeout: 255 seconds]
zpe has quit [Ping timeout: 272 seconds]
samrat has joined #ocaml
hhugo has joined #ocaml
hhugo has quit [Quit: Leaving.]
samrat has quit [Ping timeout: 244 seconds]
samrat has joined #ocaml
zpe has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
zpe has quit [Ping timeout: 245 seconds]
Submarine has quit [Ping timeout: 272 seconds]
hightower4 has quit [Ping timeout: 264 seconds]
hausdorff has joined #ocaml
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
waneck has quit [Read error: No route to host]
shinnya has joined #ocaml
Submarine has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
ygrek has joined #ocaml
hausdorff has quit [Ping timeout: 255 seconds]
boogie has joined #ocaml
geoffrey` has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
slash^ has joined #ocaml
Submarine has quit [Ping timeout: 255 seconds]
MercurialAlchemi has joined #ocaml
geoffrey` has quit [Ping timeout: 255 seconds]
<ggole>
Are existentials allowed as constructor arguments?
Submarine has joined #ocaml
Submarine has joined #ocaml
waneck has joined #ocaml
ebzzry has joined #ocaml
<Drup>
?
<ggole>
Say, type t = Nil | Cons of 'a . 'a k * 'a v * t
<Drup>
type t = Nil : t | Cons :'a k * 'a v * t -> t
<ggole>
Oh, yeah
rgrinberg1 has quit [Quit: Leaving.]
<ggole>
Drup: I've mostly figured out how to solve my table problem, but it involves an Obj.magic :/
<Drup>
ah yeah, about that
<Drup>
type table = { t : 'a . ('a key, 'a value) Hashtbl.t }
<ggole>
Yeah, that's my approach
<Drup>
but it's not really going to do what you want
ygrek has quit [Remote host closed the connection]
<Drup>
packing an existential is more sane than that
<ggole>
With module to express the higher-kindedness
<ggole>
The Obj.magic can probably be removed if I can figure out how to turn equality of a 'a key into knowledge that what it is associated with is a 'a value
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
boogie has quit [Remote host closed the connection]
pyx has joined #ocaml
pyx has quit [Client Quit]
samrat has quit [Quit: Computer has gone to sleep.]
serge has quit [Remote host closed the connection]
hausdorff has quit [Remote host closed the connection]
tane has joined #ocaml
darkf has quit [Ping timeout: 265 seconds]
samrat has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
boogie has joined #ocaml
larhat has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
boogie has quit [Ping timeout: 250 seconds]
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
zpe has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
kakadu has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
govg has quit [Quit: leaving]
samrat has joined #ocaml
<gdsfh>
ggole: about your gist: interface ParamKeyValue is strange: you don't guarantee (and don't have guarantees) that from 'a <> 'b follows forall (akey : 'a key) (bkey : 'b key), akey <> bkey. And when keys are equal, what will be the type of value got from hashtbl? Maybe you can describe what you want to have in the end?
bugabinga has quit [Remote host closed the connection]
bugabinga has joined #ocaml
gustav___ has quit [Ping timeout: 272 seconds]
gustav___ has joined #ocaml
serge has quit [Remote host closed the connection]
serge has joined #ocaml
boogie has joined #ocaml
boogie has quit [Ping timeout: 264 seconds]
darkf has joined #ocaml
slash^ has joined #ocaml
lordkryss has joined #ocaml
serge has quit [Remote host closed the connection]
serge has joined #ocaml
slash^1 has quit [Ping timeout: 272 seconds]
slash^1 has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
slash^ has quit [Ping timeout: 272 seconds]
<ggole>
gdsfh: right, doing it properly involves something like an equality witness
rand000 has joined #ocaml
<gdsfh>
ggole: i have solution without equality witness (at least explicitly), are you interested?
<mrvn>
does it use Obj.magic?
<gdsfh>
no
<mrvn>
then you must have some equality
davine has quit [Ping timeout: 265 seconds]
<ggole>
Sure
<ggole>
I'm thinking about an approach with a functor argument of module type T = sig type 'a key type 'a value val eq_assoc : 'a key -> 'b key -> 'b value -> 'a value option val hash : 'a key -> int end
<gdsfh>
mrvn: try-with catches only the exception i'm interested in, equality is here.
<ggole>
But I think that involves reimplementing the underlying table
<ggole>
eq_assoc is also a little strange
<ggole>
If you have another approach, I'd love to see it.
<ggole>
The use case is to be able to put GADT indexed types into a table in a type safe way, without using a wrapper like type any = Any : 'a t -> any
<mrvn>
ggole: you can't. you need to box the types in some way or they can't be in the same container.
<mrvn>
ggole: the alternative is to create one hashtable per GADT variant
<mrvn>
Which means hardcoding the variants or some preprocessor magic
<ggole>
I think it will be fine.
<ggole>
The "necessary" boxing (or quantification) can be done as part of the internal hashtable list type
captain_furious has joined #ocaml
<mrvn>
ggole: sure. you can hide it internally.
<ggole>
eg type list = Nil : list | Cons : 'a key * 'a value * list
<ggole>
And when you search, you have an equality witness that allows type safe recovery of the value.
<ggole>
So there's no code duplication, just a functor.
<mrvn>
ggole: I assumed you would be doing that. Write a new Hashtbl class with GADT support around the original.
govg has joined #ocaml
<ggole>
A new Tbl entirely, I think
<ggole>
Otherwise I need Obj.magic (unless I am missing a trick).
<mrvn>
ggole: you can have 'a key * 'a value * list or 'a witness * 'a value * list
<gdsfh>
ggole: base idea is simple, but implementation may do not what you want (here can be only one 'a key -> value binding in hashtbl, but you'll be able to modify code according to your concrete needs). https://gist.github.com/gdsfh/7ec01618f35a82e7e3c7
<ggole>
gdsfh: I'll take a look, thanks!
slash^ has joined #ocaml
<ggole>
This reminds me of Univ.
<ggole>
Interesting.
<gdsfh>
the whole idea is taken from Univ, really.
slash^1 has quit [Ping timeout: 272 seconds]
darkf_ has joined #ocaml
<orbitz>
whitequark: that sounds pretty nice to me
<gdsfh>
this approach helps me with dynamic typing, rtti, structure-based polymorphic functions (comparison, serializing), and it works in production for few years. (of course, only when i need flexibility and don't need speed. So, for most of code.)
<ggole>
gdsfh: I think I'll implement both and see how I like each one.
darkf has quit [Ping timeout: 265 seconds]
<gdsfh>
ggole: another one uses Obj?
dav has quit [Remote host closed the connection]
<ggole>
The one I'm writing now uses an equality witness (or rather, something similar)
<ggole>
Obj shoudln't be necessary.
dav has joined #ocaml
<gdsfh>
ggole: can you show it?
davine has joined #ocaml
<ggole>
Not yet, I've just started.
<ggole>
When I get enough in place to demonstrate the principle I'll let you know?
<gdsfh>
ggole: sure, i'm very interested!
boogie has joined #ocaml
boogie has quit [Ping timeout: 245 seconds]
<Drup>
gdsfh: you could do the same implementation with an open type now
<Drup>
it would avoid the burden of exceptions
<mrvn>
Drup: isn't that the same overhead?
<Drup>
I don't think so
<Drup>
well, you could even do with an existential I think, which is clearly more lightweight
<mrvn>
exceptions should just be an open type.
<Drup>
mrvn: not the raising part
<Drup>
raising and catching*
<mrvn>
true.
<mrvn>
although if you raise/catch in the same context the compiler should optimize that same as match
<mrvn>
(too bad ocaml doesn't optimize much)
<Drup>
in this context, no, it couldn't
<Drup>
because the function that can raise escape the scope of the definition of the exception, so it can't be optimised away as a jump
teiresias has quit [Ping timeout: 255 seconds]
<mrvn>
'try if foo then raise Bar else raise Baz with Bar -> ... | Bat -> ...' The raise could just be a goto
<Drup>
yes, did you look at the gist ?
<Drup>
because that's not the case here.
teiresias has joined #ocaml
<mrvn>
not yet
<Drup>
=)
<gdsfh>
Drup: which existentials? double packing, abstract module type or gadt-related ones?
<gdsfh>
Drup: and how exactly they are applicable here?
<mrvn>
Drup: if you inline enough the code becomes try raise A.E a with A.E a -> a
<Drup>
gdsfh: gadt obviously, all the others are obsolete
<mrvn>
A while back I wrote my own list and hashtbl for GADTs. But I should rewrite them for open types now that we have them.
<gdsfh>
mrvn: compiler doesn't know what "box" (with what contents) we are getting from hashtbl and passing it to kget.
<Drup>
mrvn: look at the code more closely
<Drup>
you can't inline
<mrvn>
gdsfh: I knows when it inlines the k1 / k2 argument.
<mrvn>
gdsfh: ocaml doesn't do that but you could.
darkf_ is now known as darkf
<mrvn>
gdsfh: note: It has to match the constructor of the box. But match does that too.
<gdsfh>
so compiler should know and maintain invariants like "for hashtbl.. when code adds value, next 'find' will get it"?
<gdsfh>
mrvn: ok, let's add function "let mess t = Hashtbl.replace t (Random.int 100) (fun () -> (* no raise here *) () )", compiler still would be able to look at field(box, 0)?
<ggole>
Keep in mind that O.eq_assoc returns an option
<mrvn>
hmm, or maybe not. | x -> x returns an option, which is what you want
<ggole>
Yeah, it's a bit surprising
<mrvn>
I was thinking find would raise Not_found
<ggole>
It could, but I prefer the option.
<mrvn>
Whenever I think I like one better I get into a situation where the other would be better.
<gdsfh>
ggole: now the most interesting part is an implementation of Ops. Do you have it?
<ggole>
The interface is a bit strange: the idea is that you write (or generate?) a GADT function that walks over an a key and a b key, using the equality thus discovered to determine that it can coerce the b value to an a value (and returning None if it can't)
shinnya has quit [Ping timeout: 250 seconds]
<ggole>
I'll do an example.
hightower4 has joined #ocaml
<gdsfh>
Drup: checked your gist. Open types are nice!
<Drup>
gdsfh: in fact, you can do pretty much the same with exception, since you can pattern match on them
<Drup>
(you would put an exn in the hashtbl
<Drup>
)
<Drup>
no need to raise and all that
<gdsfh>
Drup: i doubt. What should find's case "Some exn -> .." look like?
<struktured>
Drup: is it considered good practice to list transitive dependencies in XMetaRequires (at least for modules that your code explicitly references) ?
<Drup>
only if you need the dependency explicitly in your code
<Drup>
for example if you use lib A and B in your code, but A depends on B and C
<Drup>
you list A and B, not C
<Drup>
if you drop dependency to A, you will just have to remove it
<mrvn>
Those should be infered from the code.
<struktured>
Drup: ok, thats what I thought. I'm still not 100% sure if core really depends on pa_test at compile time, but when I wiped it out of XMeta* utop threw a missing reference error, so I put it back in for now. as long as camlp4 isn't aded to pa_test it doesn't matter anyhow
<Drup>
I will believe in package inference when I will see it implemented and with a degree of success superior to 90%
<Drup>
(for now, nobody has even attempted it ...)
<mrvn>
Drup: Should be simple by post processing ocamldep output
<Drup>
:]
<Drup>
Do it.
<mrvn>
It's the same problem except that ocamldep also has to list the internal dependencies
* struktured
seconds that motion
Guest71949 has quit [Ping timeout: 260 seconds]
dav_ has joined #ocaml
boogie has joined #ocaml
Hannibal_Smith has joined #ocaml
yomimono has joined #ocaml
boogie has quit [Ping timeout: 272 seconds]
mcclurmc has quit [Remote host closed the connection]
vfoley- has quit [Remote host closed the connection]
dav_ has quit [Ping timeout: 264 seconds]
yomimono has quit [Ping timeout: 244 seconds]
mcc has joined #ocaml
dav has joined #ocaml
<SomeDamnBody>
how can I get piqilib to compile to a cma and not a cmxa?
<SomeDamnBody>
when I do opam install piqilib?
<flux>
typically they should build both. if not, it's a bug.
<flux>
but the actual answer is probably 'manually'
<flux>
have it keep the build directory (I don't remember the option/environment variable off hand; I would guess OPAMKEEPBUILDDIR but maybe it's not it)
<flux>
and then go to the build directory and figure out how to build&install the bytecode version
gustav___ has quit [Ping timeout: 258 seconds]
ivg has quit [Remote host closed the connection]
gperetin has quit [Ping timeout: 260 seconds]
samrat has quit [Ping timeout: 244 seconds]
gustav___ has joined #ocaml
gperetin has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
samrat has joined #ocaml
tane has quit [Quit: Verlassend]
boogie has joined #ocaml
gustav___ has quit [Ping timeout: 265 seconds]
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
Anarchos has joined #ocaml
<SomeDamnBody>
flux, well I submitted a patch upstream to the github
dsheets has quit [Read error: Connection reset by peer]
<SomeDamnBody>
to build it with cma for this particular library...
dsheets has joined #ocaml
<SomeDamnBody>
really, I'd like to do an opam update && opam upgrade
<SomeDamnBody>
and just get the cma
gustav___ has joined #ocaml
boogie has quit [Ping timeout: 272 seconds]
esden has quit [Ping timeout: 260 seconds]
gustav___ has quit [Ping timeout: 245 seconds]
esden has joined #ocaml
BitPuffin has quit [Ping timeout: 250 seconds]
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
gustav___ has joined #ocaml
esden has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
gperetin has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
gperetin has joined #ocaml
dav has quit [Ping timeout: 244 seconds]
dav has joined #ocaml
govg has joined #ocaml
malc_ has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
malc_ has quit [Ping timeout: 264 seconds]
SomeDamnBody has quit [Ping timeout: 245 seconds]
gperetin has quit [Ping timeout: 260 seconds]
malc_ has joined #ocaml
gperetin has joined #ocaml
struktured has quit [Ping timeout: 272 seconds]
hausdorff has joined #ocaml
rfk has joined #ocaml
mcclurmc has joined #ocaml
struktured has joined #ocaml
hugomg has joined #ocaml
SomeDamnBody has joined #ocaml
boogie has joined #ocaml
<SomeDamnBody>
actually, I got everything to work
<SomeDamnBody>
I have one last question: a binary from a specific package fails with an assertion error
boogie has quit [Ping timeout: 258 seconds]
<struktured>
SomeDamnBody: curious- why do you require piqilib?
<SomeDamnBody>
struktured, maybe it's not piqilib, but piqic-ocaml that gets intalled with piqi
<SomeDamnBody>
fails on an assertion error
hugomg has quit [Ping timeout: 260 seconds]
<struktured>
SomeDamnBody: what I'm really asking is why do you need piqi at all?
<SomeDamnBody>
when an older version of the package that I pulled 3rd party that compiles with "picic ocaml"
<SomeDamnBody>
well basically, I have a package that uses ocaml, but at my workplace my workers want that package's capabilities but don't want to learn ocaml (I know, they should just learn)
<SomeDamnBody>
and the package I'm using defines it's data structure in terms of piqi
<struktured>
SomeDamnBody: got it, ok thanks
<SomeDamnBody>
anyway, where do I report an error in the opam packages?
<struktured>
if it's in the project's own metadata, then PR the project and they will release
<struktured>
if its a bug in opam itself than, opam's repo
<SomeDamnBody>
yeah I'm not sure...
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
BitPuffin has joined #ocaml
artagnon has joined #ocaml
artagnon has left #ocaml [#ocaml]
gustav___ has quit [Ping timeout: 244 seconds]
gustav___ has joined #ocaml
gustav___ has quit [Ping timeout: 255 seconds]
gustav___ has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcc has joined #ocaml
gustav___ has quit [Ping timeout: 255 seconds]
gustav___ has joined #ocaml
gustav___ has quit [Ping timeout: 255 seconds]
gustav___ has joined #ocaml
boogie has joined #ocaml
mcclurmc has joined #ocaml
sheijk has joined #ocaml
ggole has quit []
boogie has quit [Ping timeout: 258 seconds]
yan_ has quit [Remote host closed the connection]
yan_ has joined #ocaml
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
malc_ has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
malc_ has joined #ocaml
yan_ has quit [Remote host closed the connection]
artagnon has joined #ocaml
<artagnon>
How do I express a bool in ctypes?
<mrvn>
artagnon: simply as bool?
<artagnon>
mrv: nope, ctypes doesn't have a val bool.
<mrvn>
then use int
<artagnon>
I'm afraid that won't work.
<mrvn>
and write a bugreport asking for bool
* artagnon
nods
<artagnon>
I'll try to fix it myself.
manud has joined #ocaml
<mrvn>
artagnon: On the ocaml side match bool with false -> 0 | true -> 1 and for returning match res with 0 -> false | _ -> true
<artagnon>
Yeah, I do that fine.
<artagnon>
LLVM has an i1 type which I match against.
<struktured>
whitequark: does ppx_deriving always write a value to the buffer if the type is 'a option ?
<struktured>
whitequark: (in particular, bool / int32 optional for me)
<struktured>
whitequark: and sorry, I mean ppx_deriving_protobuf
<artagnon>
mrvn: Thanks for digging that up :)
gustav___ has quit [Ping timeout: 240 seconds]
<mrvn>
artagnon: first hit on google "ocaml ctypes bool"
gustav___ has joined #ocaml
<artagnon>
I missed the "ocaml" keyword while searching.
<mrvn>
yeah, but then you get hits for the python ctypes
<artagnon>
Exactly.
nicoo has quit [Remote host closed the connection]
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg1 has joined #ocaml
artagnon has left #ocaml [#ocaml]
samrat has quit [Quit: Computer has gone to sleep.]
<companion_cube>
Drup: something like what, in containers?
boogie has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
sheijk_ has joined #ocaml
sheijk has quit [Ping timeout: 264 seconds]
boogie has joined #ocaml
<struktured>
whitequark: think I answered my own question, thanks anyhow
sheijk has joined #ocaml
<whitequark>
struktured: oh. cool
<struktured>
whitequark: what I expect is if I do type foo = { flag: bool option [@key 1] [@default false]} [@@deriving protobuf], it will be exactly equal to an optional boolean's (de)seriralization behavior if I were to use protoc
sheijk_ has quit [Ping timeout: 264 seconds]
<whitequark>
I think that was the idea, yes
pyon has quit [Quit: nickserv]
<struktured>
whitequark: so when it serializes None or false, it adds no field to the buffer, i n that case.
<struktured>
None or Some false, to be pedantic
zpe has quit [Remote host closed the connection]
pyon has joined #ocaml
zpe has joined #ocaml
kdef has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
<MercurialAlchemi>
sometimes you really have to sacrifice a lot of () to the god of pattern matching
<MercurialAlchemi>
otherwise it may think your code is full of tuples when it really isn't
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
<whitequark>
oh my god
<whitequark>
it's full of tuples
mcclurmc has quit [Remote host closed the connection]
* mcc
opens utop for the first time
<mcc>
…
<mcc>
AAAAAAAAAAA
<SomeDamnBody>
I want to use utop to find out what is defined by a module
<SomeDamnBody>
basically, i
<SomeDamnBody>
I'm using piqi to specify an interface. I've generated the ml, but now I'm having trouble using it
<SomeDamnBody>
one of the problems stopping from using utop is when I try to load the piqi generated file, I get this error:
artagnon has joined #ocaml
<SomeDamnBody>
Error: Reference to undefined global `Piqirun'
<artagnon>
Can someone point me in the right direction?
<SomeDamnBody>
#load works
<mcc>
what is "counter" in utop and is there a piece of documentation for utop so i would not need to ask such a question
<whitequark>
mcc: what about it
<mcc>
whitequark: there is a lot of ascii art. i was surprised.
<whitequark>
oh, it just counts the number of commands you entered
<whitequark>
... i always found the ascii art in utop pointless.
<whitequark>
you can use #utop_prompt_simple;; to make it like ipython's, or #utop_prompt_dummy;; to remove all the cruft
<mcc>
ok... it... seems to always be 0 for me
<whitequark>
hm
<mcc>
the autocomplete at the bottom is interesting but maybe a bit confusing
<companion_cube>
indeed, it's weird
<companion_cube>
utop, like many other ocaml projects, lacks a good documentation (or it's impossible to find?)
<MercurialAlchemi>
what threw me off initially was "why the hell doesn't tab do anything?"
hightower4 has quit [Ping timeout: 265 seconds]
<MercurialAlchemi>
but once you get used to it, it's convenient, especially for all these "read-the-mlis"-documented packages
<mcc>
it lets you browse MLIs?
<whitequark>
not that I know of ...
<MercurialAlchemi>
with the autocomplete, you can get a good idea of the interface that is exposed
* companion_cube
prefers merlin for this kind of things
<whitequark>
that's not what I would call "documented" :/
<mcc>
Am I reading this right that Array cannot be resized?
<whitequark>
mcc: yes.
<mcc>
MercurialAlchemist: The thing that stands out to me about reading an MLI is the comment docs
<whitequark>
companion_cube: don't you have dynarray in containers?
<companion_cube>
I really can't wait for a proper centralized, exhaustive documentation for ocaml packages
<whitequark>
mcc: there's DynArray in extlib.
<companion_cube>
whitequark: CCVector
<whitequark>
oh
bezirg has joined #ocaml
<whitequark>
forget about extlib, use CCVector instead
<companion_cube>
it has a small twist though: a phantom type for mutability
<mcc>
Would either of those work well as a dequeue?
<MercurialAlchemi>
companion_cube: sounds like the second coming
Hannibal_Smith has quit [Quit: Sto andando via]
<companion_cube>
no, a dynamic array is unsuitable for deque
<companion_cube>
because you can't easily remove at fron,t
<companion_cube>
-,
SomeDamnBody has quit [Ping timeout: 240 seconds]
<whitequark>
companion_cube: yes, how come CCVector doesn't have shift/unshift?
<companion_cube>
MercurialAlchemi: well it's what opam-doc should be, I think
<companion_cube>
whitequark: I'm not sure what shift/unshift are. Insertion of an element in the middle ?
tane has joined #ocaml
<whitequark>
at the front
<whitequark>
it's identical to pop/push, except at the front
<MercurialAlchemi>
it may provide facilities for that, but it's not going to magically turn poorly documented packages into Java- or Python-level documented packages overnight
* mcc
only really knows perl and tries to write it in every language. my secret shame
<whitequark>
companion_cube: well yeah, you need to copy
<MercurialAlchemi>
(preferably with examples... examples are delicious...)
<companion_cube>
MercurialAlchemi: well if a package has documented (commented, I mean) .mli files, it shouldn't be too hard to generate some basic doc
<companion_cube>
I hope
<whitequark>
mcc: there's also CCDeque
<whitequark>
containers are great :p
<mcc>
yay
<whitequark>
(opam install containers)
<companion_cube>
CCDeque is a bit small atm though
<mcc>
so here's the situation i've actually got. i am trying to make a structure representing a line of code. i have three things i'll need to do: when i'm constructing it, i will need to progressively add items to the end. when construction is complete, i will do an evaluation which involves progressively removing items off the front and then maybe pushing another one back on. i also need to be able to iterate over the full list (for ex
<mcc>
ample if i'm pretty printing)
<whitequark>
much more efficient
<whitequark>
why are you mutating code? O_o
<mcc>
notice, (1) i don't think i actually need mutability-- it's possible it will even harm me, eventually (2) i don't need random access
<MercurialAlchemi>
yeah, but then you run into random Out_of_sleep_error
<whitequark>
I'd just represent it using a list
<whitequark>
construct it, List.rev it, iterate it
<mcc>
well, i'm not really mutating code, but like-- when i execute. what i'll really want to do is take the first two items A B, apply B as an argument to A, get C, and then feed the rest of the list into C.
<mcc>
Hm, ok.
<mcc>
Because with ocaml lists the efficient way of constructing is to add at the front?
<whitequark>
yes
<whitequark>
yes, lists sound perfect for your use case
<mcc>
yes, i think i agree
nicoo has joined #ocaml
<mcc>
thanks again for the helps. brb
MercurialAlchemi has quit [Ping timeout: 240 seconds]
artagnon has left #ocaml [#ocaml]
mort___ has joined #ocaml
Thooms has joined #ocaml
emery has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
boogie has quit [Remote host closed the connection]
emery has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
hightower4 has joined #ocaml
hausdorff has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
tane has quit [Quit: Verlassend]
kakadu has quit [Quit: Konversation terminated!]
thomasga has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
hausdorff has joined #ocaml
mcclurmc has joined #ocaml
hausdorff has quit [Ping timeout: 258 seconds]
mcclurmc has quit [Ping timeout: 260 seconds]
emery has quit [Ping timeout: 250 seconds]
nicoo has quit [Ping timeout: 250 seconds]
rgrinberg1 has quit [Quit: Leaving.]
manud has quit [Quit: Be back later ...]
manud has joined #ocaml
thomasga has quit [Quit: Leaving.]
manud has quit [Ping timeout: 258 seconds]
Submarine has quit [Read error: Connection reset by peer]