adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.08 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.08/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
AtumT has quit [Quit: AtumT]
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 265 seconds]
jao has quit [Remote host closed the connection]
kakadu has joined #ocaml
kakadu__ has quit [Ping timeout: 268 seconds]
jao has joined #ocaml
jao is now known as Guest24661
Guest24661 has quit [Remote host closed the connection]
jao- has joined #ocaml
jao- is now known as jao
mfp has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 240 seconds]
analogue has joined #ocaml
copy` has quit [Write error: Connection reset by peer]
flux[m] has quit [Read error: Connection reset by peer]
aecepoglu[m] has quit [Read error: Connection reset by peer]
trakjohnson[m] has quit [Read error: Connection reset by peer]
ptival[m] has quit [Remote host closed the connection]
keep-learning[m] has quit [Write error: Connection reset by peer]
otini has quit [Remote host closed the connection]
Haudegen[m] has quit [Remote host closed the connection]
sepp2k has quit [Read error: Connection reset by peer]
stan[m] has quit [Read error: Connection reset by peer]
rgr[m] has quit [Read error: Connection reset by peer]
dl3br[m] has quit [Read error: Connection reset by peer]
regnat[m] has quit [Read error: Connection reset by peer]
hdurer[m] has quit [Read error: Connection reset by peer]
isaachodes[m] has quit [Read error: Connection reset by peer]
smondet[m] has quit [Read error: Connection reset by peer]
aspiwack[m] has quit [Read error: Connection reset by peer]
peddie has quit [Write error: Connection reset by peer]
Virgile[m] has quit [Read error: Connection reset by peer]
jimt[m] has quit [Write error: Connection reset by peer]
aspiwack[m] has joined #ocaml
smondet[m] has joined #ocaml
aecepoglu[m] has joined #ocaml
copy` has joined #ocaml
dl3br[m] has joined #ocaml
Haudegen[m] has joined #ocaml
flux[m] has joined #ocaml
hdurer[m] has joined #ocaml
jimt[m] has joined #ocaml
otini has joined #ocaml
peddie has joined #ocaml
ptival[m] has joined #ocaml
keep-learning[m] has joined #ocaml
isaachodes[m] has joined #ocaml
regnat[m] has joined #ocaml
rgr[m] has joined #ocaml
Virgile[m] has joined #ocaml
trakjohnson[m] has joined #ocaml
sepp2k has joined #ocaml
stan[m] has joined #ocaml
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 265 seconds]
igitoor has quit [*.net *.split]
thizanne has quit [*.net *.split]
Kitambi has quit [*.net *.split]
jerme_ has quit [*.net *.split]
analogue has quit [Quit: Leaving]
igitoor has joined #ocaml
thizanne has joined #ocaml
Kitambi has joined #ocaml
jerme_ has joined #ocaml
falcon_t has joined #ocaml
gravicappa has joined #ocaml
bitwinery has joined #ocaml
vicfred has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
vicfred has quit [Quit: Leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
liberiga has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
narimiran has joined #ocaml
vicfred has joined #ocaml
Haudegen has joined #ocaml
<def`> r
mbuf has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
reynir has quit [Ping timeout: 245 seconds]
reynir has joined #ocaml
barockobamo has joined #ocaml
barockobamo2 has joined #ocaml
barockobamo has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
lelf has joined #ocaml
<vsiles> def`: x
<pino|work> p
FreeBirdLjj has joined #ocaml
_5HT has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
bitwinery has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<Leonidas> o
sagax has quit [Remote host closed the connection]
<Armael> I mean, maintaining a pgp key server sounds pretty boring
slice has quit [Ping timeout: 246 seconds]
slice has joined #ocaml
_5HT has quit [Remote host closed the connection]
mfp has joined #ocaml
nullifidian_ is now known as nullifidian
sagax has joined #ocaml
_5HT has joined #ocaml
FreeBirdLjj has joined #ocaml
liberiga has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
lelf has left #ocaml ["ERC (IRC client for Emacs 26.1.90)"]
_5HT has quit [Remote host closed the connection]
_5HT has joined #ocaml
jao has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 258 seconds]
_5HT has quit [Remote host closed the connection]
_5HT has joined #ocaml
_5HT has quit [Remote host closed the connection]
pino|work has quit [Quit: brb]
pino|work has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
ggole has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
hcit has quit [Quit: leaving]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 268 seconds]
<mbuf> How do I use evensl in a real example? https://pastebin.com/t6bsFCHR
<mbuf> If I try, evensl evens [[1; 2]; [3; 4]], I get "Error: This expression has type int but an expression was expected of type int list"
<mbuf> [[1; 2]; [3; 4]] tells me it is of type int list list.
barockobamo2 has quit [Remote host closed the connection]
gravicappa has joined #ocaml
<def`> evensl evens [[[1; 2]; [3; 4]]]
<def`> There are three level of map: one in evens, two in evensl
<def`> so you need a three level-deep list.
<mbuf> def`, ahh! okay
barockobamo has joined #ocaml
gravicappa has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
ygrek has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
vicfred has quit [Read error: Connection reset by peer]
vicfred has joined #ocaml
FreeBirdLjj has joined #ocaml
zolk3ri has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
malina has joined #ocaml
barockobamo has quit [Remote host closed the connection]
malina has quit [Remote host closed the connection]
barockobamo has joined #ocaml
jao has joined #ocaml
barockobamo2 has joined #ocaml
barockobamo has quit [Ping timeout: 276 seconds]
laudecay has joined #ocaml
KeyJoo has joined #ocaml
malina has joined #ocaml
laudecay has quit [Ping timeout: 276 seconds]
laudecay has joined #ocaml
sgnb has quit [Remote host closed the connection]
<laudecay> yo so i'm running out of memory trying to run a dune test and i've isolated the error to two lines where I do Cstruct.of_bytes b |> Cstruct.hexdump;
<laudecay> the two bytes are of length 8 and 32 respectively and i'm really not allocating that much anywhere period
<laudecay> are there good heap profiler tools?
<laudecay> companion_cube: love yr nick btw
<companion_cube> thx ;)
<companion_cube> for heap profiling, you can try the spacetime switches, or the statistical memprof switches, I think
<laudecay> also when i schedule a full major heap collection right before these lines it segfaults!
<laudecay> wonderful
<def`> laudecay: this looks more like a memory corruption than an allocation problem
<laudecay> oh great
<laudecay> i have C bindings but they shouldn't be allocating
<def`> They don't need to allocate to corrupt memory :)
<def`> are they open source ?do you have a link to the C bindings ?
<laudecay> one second let me show you
<laudecay> yeah
<laudecay> they're in private github until the end of this week, does termbin work for you?
<def`> probably, I haven't used it yet
<laudecay> these are just wrappers on the libsodium and blake2 libraries
FreeBirdLjj has joined #ocaml
<companion_cube> a lot of calls to `Gc.compact()` can make allocation problems more obvious, btw
<laudecay> i have been using these bindings (and the precise calls i've been making to them) without a problem
<def`> caml_crypto_gen_key is incorrect
<def`> there is no CAMLreturn.
<laudecay> oh but i'm not calling that
<laudecay> but ill add it
<def`> Just remove the CAMLparam2, it is not necessary if randombytes_buf doesn't allocate.
<laudecay> oh really
<laudecay> i'm actually not sure it may do some allocation
<laudecay> hopefully not but like ya never know right
<def`> Can you share the corresponding ml file ?
<laudecay> yeah one second
<laudecay> wait no that one returns void def
<laudecay> yeah thats ok it returns void
<laudecay> so ok one second
<laudecay> the crypto library is kinda hellabig so i'll just open up the repo, i gotta check w my boss first
<laudecay> ok crypto/ is the bindings
<laudecay> the stuff thats breaking is in cookies/test
<laudecay> specifically the code that's being called is in crypto/constants.ml
flux has quit [Ping timeout: 252 seconds]
<def`> caml_crypto_siphash uses Int64_val while an int is passed
<laudecay> not using siphash
<laudecay> just gonna take that out for now
<laudecay> thanks tho
<laudecay> this is legit super helpful
gareppa has joined #ocaml
KeyJoo has quit [Ping timeout: 246 seconds]
barockobamo2 has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
<def`> mutating the int64 in caml_crypto_aead_chacha20poly1305_encrypt probably won't corrupt memory but is semantically unsound
<laudecay> should i make it a ref?
<def`> (the int64 is pure, so the compiler will consider it constant, it can do folding, eliminate redundant load, etc)
<laudecay> what would be the right way to do this?
<def`> data_with_len should probably be { bytes: bytes; mutable len: int64 }
<laudecay> is that the only change i'd need to make
<laudecay> ?
<def`> and you use a local unsigned long long clen_p;
<def`> you pass &clen_p to the C function
<laudecay> wait hold up what sorry
<laudecay> local to the c bindings?
<def`> yes
<laudecay> oh ok
<laudecay> cool :)
<def`> then you allocate an ocaml int64 after returning from the function and then mutate the data_with_len record.
<laudecay> wait
<laudecay> sorry is there an example im kinda new with the ffi
<laudecay> so i changed my type
<def`> something like https://pastebin.com/JnEPhF4W
<laudecay> is the way i'm populating these bytes things ok
<laudecay> like is ocaml gonna be alright that i'm just treating these as void*'s and chucking random stuff in there
<def`> also, avoid nesting calls to ffi function. Interaction with GC needs a C-sequence point, otherwise you get an undefined behavior.
<def`> Yes.
<laudecay> wdym nesting
<laudecay> oh ok
<laudecay> nm i get it
gareppa has quit [Quit: Leaving]
<laudecay> ok ill change that around and push
<def`> sorry, I have to go. I can take a look later if you still have FFI issues :)
<laudecay> yeah for sure thanks a ton!
gareppa has joined #ocaml
<laudecay> i fixed and it's still segfault :/
AtumT has joined #ocaml
laudecay has quit [Quit: WeeChat 2.5]
spew has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
pino|work has quit [Quit: brb]
pino|work has joined #ocaml
laudecay has joined #ocaml
ziyourenxiang has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
gareppa has quit [Quit: Leaving]
vicfred has quit [Quit: Leaving]
mbuf has quit [Quit: Leaving]
gravicappa has joined #ocaml
analogue has joined #ocaml
ggole has quit [Quit: Leaving]
Haudegen has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
analogue has quit [Ping timeout: 276 seconds]
analogue has joined #ocaml
analogue has quit [Remote host closed the connection]
analogue has joined #ocaml
_5HT has joined #ocaml
<dmbaturin> Anyone knows why ppxx doesn't work with 4.08 and what it will take to get it to work?
laudecay has quit [Quit: WeeChat 2.5]
barockobamo has joined #ocaml
laudecay has joined #ocaml
malina has quit [Remote host closed the connection]
malina has joined #ocaml
barockobamo has quit [Remote host closed the connection]
ravenous_ has joined #ocaml
gravicappa has quit [Ping timeout: 258 seconds]
nullifidian has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
ravenou__ has joined #ocaml
ravenous_ has quit [Ping timeout: 276 seconds]
jnavila has joined #ocaml
<companion_cube> laudecay: interesting commit messages 🙃
<laudecay> :)
<laudecay> any thoughts?
<laudecay> im still having a bad time
<companion_cube> C bindings are tough, sorry, I'm not competent with cstruct either
<laudecay> yeah np
_5HT has quit [Remote host closed the connection]
<dmbaturin> Damn, ppxx uses hg on bitbucket.
<cemerick> if variants without parameters are unboxed at runtime (per RWO, just an enumeration of ints), is there a reason why the same couldn't be done for single-constructor types with an int param (e.g. `type t = Foo of int`)?
<companion_cube> it's possible, look for the `unboxed` attribute
<companion_cube> (single case constructor, or single field record)
<cemerick> I shall in a bit
<cemerick> I'm inferring that that's not the case, given a change in total runtime after replacing an int type with one like the above
<companion_cube> you need to ask for it
<companion_cube> (and use a recent compiler, possibly with flambda)
JimmyRcom has joined #ocaml
JimmyRcom has quit [Max SendQ exceeded]
JimmyRcom has joined #ocaml
JimmyRcom has quit [Remote host closed the connection]
klntsky has quit [Remote host closed the connection]
klntsky has joined #ocaml
analogue has quit [Quit: later alligator]
malina has quit [Remote host closed the connection]
troydm has quit [Ping timeout: 245 seconds]
kakadu_ has joined #ocaml
TC01 has quit [Ping timeout: 265 seconds]
TC01_ has joined #ocaml
ravenou__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bitwinery has joined #ocaml
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ocaml
ygrek has joined #ocaml
laudecay has quit [Ping timeout: 258 seconds]
<cemerick> mmm, ok
<cemerick> oh, you mean ocaml.unboxed, got it
<companion_cube> yes
zolk3ri has quit [Quit: leaving]
narimiran has quit [Ping timeout: 265 seconds]
Hrundi_V_Bakshi has joined #ocaml
olle has joined #ocaml
oriba has joined #ocaml
oriba has quit [Quit: WeeChat 2.6]
spew has quit [Quit: going home]
olle has quit [Quit: leaving]
jnavila has quit [Remote host closed the connection]
stux|RC-only has quit [Quit: Aloha!]
stux|RC-only has joined #ocaml
troydm has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
zolk3ri has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
kakadu_ has quit [Remote host closed the connection]
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 240 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 276 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
nullifidian__ has joined #ocaml
_5HT has joined #ocaml
nullifidian_ has quit [Ping timeout: 265 seconds]
_5HT has quit [Remote host closed the connection]
_5HT has joined #ocaml
guest334 has joined #ocaml
guest334 has quit [Remote host closed the connection]
b0bby__ has joined #ocaml
<b0bby__> hello
<b0bby__> I'm trying to learn ocaml and was trying to define the type:
<b0bby__> type lookup_table = Lookup_table of ((Pair of int * string) list) * lookup_table | EmptyTable
<b0bby__> Can someone please tell me what is wrong with it?
<dmbaturin> b0bby__: You can't define one sum type inside another.
<dmbaturin> type lookup_table = Lookup_table of ((int * string) list) * lookup_table | EmptyTable (* is likely what you want *)
<b0bby__> that looks about right, thank you
_5HT has quit [Remote host closed the connection]
analogue has joined #ocaml
_5HT has joined #ocaml
<dmbaturin> There's rather little point in named product types, so you likely don't want to name the pair type anyway.
_5HT has quit [Remote host closed the connection]
_5HT has joined #ocaml
_5HT has quit [Remote host closed the connection]
_5HT has joined #ocaml
_5HT has quit [Remote host closed the connection]
_5HT has joined #ocaml
ziyourenxiang has joined #ocaml