adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
mengu has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
nomicflux has joined #ocaml
infinity0 has quit [Remote host closed the connection]
mengu has quit [Ping timeout: 260 seconds]
infinity0 has joined #ocaml
nomicflux has quit [Client Quit]
infinity0 has quit [Remote host closed the connection]
nomicflux has joined #ocaml
eh_eff has quit [Ping timeout: 240 seconds]
richi235 has quit [Ping timeout: 260 seconds]
mfp has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ptival has joined #ocaml
Atrumx has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
jabroney1 has quit [Quit: Leaving.]
ryanartecona has quit [Quit: ryanartecona]
ryanartecona has joined #ocaml
Fistine has quit [Ping timeout: 255 seconds]
_y has quit [Ping timeout: 240 seconds]
tobiasBora has quit [Ping timeout: 255 seconds]
_y has joined #ocaml
Fistine has joined #ocaml
tobiasBora has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
copy` has quit [Quit: Connection closed for inactivity]
jao has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
jao has joined #ocaml
nomicflux has quit [Quit: nomicflux]
jao has quit [Ping timeout: 240 seconds]
<keep_learning> Hi everyone
<keep_learning> I am getting Fatal error: exception Stack overflow
<keep_learning> When I am running my program with OCAMLRUNPARAM=b ./main.native < votes_1000000.txt
<keep_learning> All I am getting is 1000 lines of Called from file "list.ml", line 55, characters 32-39
<keep_learning> I am wondering if there is way to know which function is causing this stack overflow.
<keep_learning> or any memory profiling tool for OCaml programs
<keep_learning> I see ocp-memprof, but I think it is not freely available ?
nomicflux has joined #ocaml
eh_eff has joined #ocaml
eh_eff has quit [Ping timeout: 276 seconds]
hashpuppy has quit [Quit: Connection closed for inactivity]
nomicflux has quit [Quit: nomicflux]
nullcatxxx_ has joined #ocaml
lucybun has quit [Ping timeout: 245 seconds]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
lucybun has joined #ocaml
ryanartecona has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
infinity0 has joined #ocaml
eh_eff has joined #ocaml
ryanartecona has joined #ocaml
eh_eff has quit [Ping timeout: 276 seconds]
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 276 seconds]
spew has quit [Quit: foobar]
MercurialAlchemi has joined #ocaml
AlexDenisov has joined #ocaml
octachron has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
<octachron> keep_learning, note that function in the standard library List module are not all tail-recursive: using a not-tailrecursive function on a list of size 10^6 will trigger a stack overflow
eh_eff has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
eh_eff has quit [Ping timeout: 264 seconds]
jack5638 has joined #ocaml
agravier has joined #ocaml
<reynir> orbifx[m]: are you using the compiler-libs package?
<reynir> (oh, just noticed the timestamp)
alfredo has joined #ocaml
<orbifx[m]> reynir: don't think so, but maybe?
<reynir> orbifx[m]: I guess you could put your Path module inside another module as a work-around
<reynir> (I also think there's a issue somewhere about putting the compiler-libs modules into a namespace module or something)
jack5638 has quit [Ping timeout: 255 seconds]
agravier has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jack5638 has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has joined #ocaml
agravier has joined #ocaml
agravier has quit [Client Quit]
mengu has joined #ocaml
toolslive has joined #ocaml
<orbifx[m]> Thanks reynir, I'll check it out
mengu has quit [Ping timeout: 260 seconds]
nullcatxxx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Simn has joined #ocaml
p_nathan has quit [Ping timeout: 276 seconds]
ryanartecona has quit [Quit: ryanartecona]
zpe has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
AlexDenisov has joined #ocaml
alfredo has quit [Ping timeout: 240 seconds]
alfredo has joined #ocaml
eh_eff has joined #ocaml
eh_eff has quit [Ping timeout: 255 seconds]
mpenet has joined #ocaml
richi235 has joined #ocaml
agravier has joined #ocaml
mfp has joined #ocaml
agravier has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mpenet has left #ocaml ["ERC (IRC client for Emacs 26.0.50.2)"]
agravier has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
mengu has joined #ocaml
octachron has quit [Quit: Leaving]
ryanartecona has quit [Quit: ryanartecona]
john51 has quit [Read error: Connection reset by peer]
john51_ has joined #ocaml
agravier has quit [Quit: agravier]
|jbrown| is now known as jbrown
agravier has joined #ocaml
zpe has joined #ocaml
agravier is now known as agravier[away]
kakadu has joined #ocaml
richi235 has quit [Ping timeout: 260 seconds]
jabesed has joined #ocaml
agravier[away] has quit [Quit: agravier[away]]
tobast has quit [Quit: WeeChat 1.5]
inr has quit [Remote host closed the connection]
inr has joined #ocaml
eh_eff has joined #ocaml
tobast has joined #ocaml
eh_eff has quit [Ping timeout: 276 seconds]
alfredo_ has joined #ocaml
alfredo has quit [Ping timeout: 240 seconds]
jabesed has quit [Remote host closed the connection]
freusque has joined #ocaml
nomicflux has joined #ocaml
toolslive has quit [Ping timeout: 255 seconds]
toolslive has joined #ocaml
<orbifx[m]> Can Objmagic retrun the name of a value in a string?
<orbifx[m]> let str = string_of_value_obj some_value_obj ?
<companion_cube> how do you mean, the "name"?
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
jack5638 has quit [Ping timeout: 264 seconds]
AltGr has joined #ocaml
jack5638 has joined #ocaml
_andre has joined #ocaml
sepp2k has joined #ocaml
_y has quit [Ping timeout: 240 seconds]
Fistine has quit [Ping timeout: 240 seconds]
_y has joined #ocaml
agravier has joined #ocaml
bernardofpc has quit [Ping timeout: 240 seconds]
bernardofpc has joined #ocaml
eh_eff has joined #ocaml
eh_eff has quit [Ping timeout: 240 seconds]
nomicflux has quit [Quit: nomicflux]
toolslive has quit [Ping timeout: 276 seconds]
Fistine has joined #ocaml
toolslive has joined #ocaml
ChristopheT has joined #ocaml
ChristopheT has left #ocaml [#ocaml]
jmiven has quit [Quit: WeeChat 1.7.1]
jmiven has joined #ocaml
agravier has quit [Quit: agravier]
<freusque> is there a standard way to wrap some function's arguments
<freusque> aka, does let map_wrap f g = fun x y -> f (g x) (g y) exist in batteries or pervasives?
jabesed has joined #ocaml
<companion_cube> in containers: CCFun.compose_binop : ('a -> 'b) -> ('b -> 'b -> 'c) -> 'a -> 'a -> 'c
<freusque> thank you companion_cube :>
toolslive has quit [Ping timeout: 260 seconds]
ciniglio has quit [Ping timeout: 260 seconds]
lucybun has quit [Quit: lucybun]
lucybun has joined #ocaml
ziyourenxiang has joined #ocaml
toolslive has joined #ocaml
ciniglio has joined #ocaml
psacrifice has joined #ocaml
sh0t has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
jabesed has quit [Quit: Konversation terminated!]
jabesed has joined #ocaml
alqatari has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alqatari has joined #ocaml
balod has joined #ocaml
tane has joined #ocaml
ryanartecona has joined #ocaml
al-damiri has joined #ocaml
yomimono has joined #ocaml
copy` has joined #ocaml
p_nathan has joined #ocaml
hashpuppy has joined #ocaml
yomimono has quit [Ping timeout: 268 seconds]
jabesed has quit [Quit: Konversation terminated!]
jabroney has joined #ocaml
MercurialAlchemi has joined #ocaml
p_nathan has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
freusque has quit [Quit: WeeChat 1.7]
cross has joined #ocaml
jao has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has quit [Remote host closed the connection]
alqatari has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryanartecona has joined #ocaml
alqatari has joined #ocaml
FreeBirdLjj has joined #ocaml
AltGr has left #ocaml [#ocaml]
alqatari has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FreeBirdLjj has quit [Ping timeout: 258 seconds]
eh_eff has joined #ocaml
alqatari has joined #ocaml
alqatari has quit [Quit: Textual IRC Client: www.textualapp.com]
ryanartecona has quit [Quit: ryanartecona]
nullcatxxx_ has joined #ocaml
ryanartecona has joined #ocaml
ojmb has quit [Ping timeout: 260 seconds]
SpiceGuid has joined #ocaml
oh-camel has joined #ocaml
oh-camel has left #ocaml [#ocaml]
lambdacamel has joined #ocaml
agravier has joined #ocaml
spew has joined #ocaml
mengu has joined #ocaml
<lambdacamel> hi all, i have a question if anyone cares to enlighten me - i'm practicing writing a function that identifies all the free variables in a user-defined "expression" type (has vars, function application, what you would expect). however, when i try to test it, the compiler rejects any expression with free vars that i try to pass to the function, because it has unbound variables. so i am only able to test expressions with no free variables, making the test
<fds> Your message cut off.
<fds> Plus you should probably show some code if you want help. :-)
mengu has quit [Ping timeout: 260 seconds]
<lambdacamel> oops. basically i'm trying to test a function that identifies free variables. but i can't, because ocaml doesn't let you input anything with free variables. some code:
<lambdacamel> something like this is totally fine: assert (free_vars (Num(3)) = SS.empty) ;;
<lambdacamel> but something like this does not work: assert (not (SS.equal (free_vars (Fun(x, y))) (free_vars (Fun(x, x))))) ;;
<lambdacamel> because the x is unbound. which is the whole point.
<lambdacamel> ...actually, it is telling me the x is unbound, but it should be the y that is unbound, so maybe it's not parsing the entire thing correctly at all. hmmm
<fds> Hm, can you put your complete code on some pastebin site? I think that you're no representing your free variables correctly.
SpiceGuid has quit [Quit: ChatZilla 0.9.93 [SeaMonkey 2.46/20161213183751]]
<fds> You probably want something like Fun(Var 'x', Var 'y')
psacrifice has quit [Remote host closed the connection]
<fds> Well, even something like Fun('f', [Var 'x'; Var 'y']), but I'm just guessing. :-)
ziyourenxiang has quit [Quit: Leaving]
<lambdacamel> it very well could be a syntax error. i just tried Var 'x' and Var "x" though, and it did not help. the full code is here: https://pastebin.com/L2RQb0Ss
<lambdacamel> conceptually it seems like ocaml *should* reject any input with free variables, which would make this impossible. but i would also be really surprised if it was impossible to test something like this
<thizanne> lambdacamel: assert does not try to do automatic theorem proving
<thizanne> you just feed it a boolean condition, it checks if it's true, and if it's not it raises an error
igitoor has quit [Ping timeout: 245 seconds]
<lambdacamel> i've also tried just running my function in the top level and having it print out the result, compiler didn't like that either
<lambdacamel> that is, it will give the correct result only on inputs with no free vars
<lambdacamel> otherwise there is an error
<thizanne> yeah of course
<thizanne> how would you like it to print the value of a variable that is not defined ?
rand__ has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
<thizanne> so if you want to test your function, you can build arbitrary actual values for x and y
<lambdacamel> as just a string representation, ideally. i mean i do see the problem but just unsure how to bypass it
<thizanne> and then do the test
<lambdacamel> oh, interesting...
igitoor has joined #ocaml
<thizanne> otherwise you could use a library for automatic testing that will try the test with (a lot of) random values and hope it will be enough
<thizanne> or you can do (automatic) theorem proving, in which case you probably don't want ocaml anyway
<fds> Here's an example: assert (not (SS.equal (free_vars (Fun("f", Var "y"))) (free_vars (Fun("f", Var "x")))))
<fds> lambdacamel: I think you're getting confused between free variables in OCaml (the metalanguage) and free variables in expressions of type expr (the object language)
jao has quit [Ping timeout: 260 seconds]
<lambdacamel> fds - yes! i am absolutely getting confused by that. btw i just tried your version with the " " marks and this works. is this because the marks will specify it is in the object language?
<fds> OCaml rejects free variables in the metalanguage (i.e. unbound values), but doesn't reject free variables in the object language, which are just expressions of the form Var "foo".
<lambdacamel> thizanne - your first idea sounds like what i should be doing also
<fds> lambdacamel: "" is just to denote strings. In your code, varid is an alias for string.
<fds> So `Var of varid` means 'the word `Var` followed by a string'
* fds bbiab
igitoor has quit [Ping timeout: 255 seconds]
<lambdacamel> so, making my variables into strings lets ocaml know that they are varids and are of the object and not the metalanguage, simply speaking. is that about right?
<lambdacamel> i knew this was the problem but could not figure out how to distinguish
igitoor has joined #ocaml
<fds> Variables in the object language are defined as part of the definition `type expr = ...` (that's the definition of expressions in the object language)
richi235 has joined #ocaml
<lambdacamel> right
<fds> Specifically, variables are defined by the line `Var of varid`, which means you represent a variable in the object language by 'the word `Var` followed by an OCaml string'
igitoor has quit [Changing host]
igitoor has joined #ocaml
<lambdacamel> i see the error now. the type system of the object language is very straightforward but i missed that they need to be strings
agravier is now known as agravier[away]
<lambdacamel> and worried that ocaml cannot distinguish between the object and metalanguage... glad that is not the case : )
<lambdacamel> thanks
agravier[away] has quit [Quit: agravier[away]]
larhat has joined #ocaml
eh_eff has quit [Ping timeout: 240 seconds]
eh_eff has joined #ocaml
<fds> My pleasure.
alfredo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mengu has joined #ocaml
alfredo has joined #ocaml
mengu has quit [Ping timeout: 268 seconds]
TheLemonMan has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
nullcatxxx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
slash^ has joined #ocaml
maattdd has joined #ocaml
AlexDenisov has joined #ocaml
AlexDenisov has quit [Remote host closed the connection]
alfredo has quit [Quit: Textual IRC Client: www.textualapp.com]
slash^ has quit [Read error: Connection reset by peer]
agravier has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
eh_eff has quit [Ping timeout: 240 seconds]
richi235 has quit [Ping timeout: 240 seconds]
richi235 has joined #ocaml
rpg has joined #ocaml
lambdacamel has left #ocaml [#ocaml]
agravier is now known as agravier[away]
ryanartecona has quit [Quit: ryanartecona]
bi has joined #ocaml
bi has quit [Client Quit]
ryanartecona has joined #ocaml
kakadu has joined #ocaml
larhat has quit [Quit: Leaving.]
jao has joined #ocaml
eh_eff has joined #ocaml
rand__ has quit [Quit: leaving]
nullcatxxx_ has joined #ocaml
agarwal1975 has joined #ocaml
mengu has joined #ocaml
AlexRussia has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
AlexRussia has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
richi235 has quit [Ping timeout: 240 seconds]
sepp2k has quit [Ping timeout: 255 seconds]
ojmb_ has joined #ocaml
richi235 has joined #ocaml
nullcatxxx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
tane has quit [Quit: Leaving]
richi235 has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Client Quit]
richi235 has joined #ocaml
_andre has quit [Quit: leaving]
toolslive has quit [Remote host closed the connection]
ryanartecona has joined #ocaml
richi235 has quit [Ping timeout: 240 seconds]
richi235 has joined #ocaml
agarwal1975_ has joined #ocaml
RomanZ5 has joined #ocaml
al-damiri_ has joined #ocaml
apache2 has quit [Ping timeout: 258 seconds]
ahf has quit [Ping timeout: 240 seconds]
`micro has quit [Ping timeout: 276 seconds]
DanielRi1hman has joined #ocaml
DanielRi1hman has quit [Changing host]
DanielRi1hman has joined #ocaml
razwelle1 has joined #ocaml
srenatus[m]1 has joined #ocaml
igitoor_ has joined #ocaml
jrslepak_ has joined #ocaml
bbc_ has joined #ocaml
jun_ has joined #ocaml
zozozo_ has joined #ocaml
ipfix has joined #ocaml
zozozo_ has quit [Client Quit]
cartwright has joined #ocaml
zozozo_ has joined #ocaml
zozozo_ has quit [Client Quit]
zozozo_ has joined #ocaml
troydm1 has joined #ocaml
awal has quit [Ping timeout: 240 seconds]
bigs has quit [Ping timeout: 240 seconds]
al-damiri has quit [Read error: Connection reset by peer]
DanielRichman has quit [Ping timeout: 240 seconds]
agarwal1975 has quit [Ping timeout: 240 seconds]
cantstanya has quit [Ping timeout: 240 seconds]
jlouis has quit [Ping timeout: 240 seconds]
srenatus[m] has quit [Ping timeout: 240 seconds]
maufred has quit [Ping timeout: 240 seconds]
bbc has quit [Ping timeout: 240 seconds]
zozozo has quit [Ping timeout: 240 seconds]
jun has quit [Ping timeout: 240 seconds]
igitoor has quit [Ping timeout: 240 seconds]
mfp has quit [Ping timeout: 240 seconds]
troydm has quit [Ping timeout: 240 seconds]
jrslepak has quit [Ping timeout: 240 seconds]
rome has quit [Ping timeout: 240 seconds]
razwelles has quit [Remote host closed the connection]
agarwal1975_ is now known as agarwal1975
mfp has joined #ocaml
zozozo_ is now known as zozozo
al-damiri_ is now known as al-damiri
igitoor_ has quit [Changing host]
igitoor_ has joined #ocaml
awal has joined #ocaml
awal is now known as Guest53094
ahf has joined #ocaml
jlouis has joined #ocaml
`micro has joined #ocaml
apache2 has joined #ocaml
`micro is now known as Guest68242
agarwal1975 has quit [Ping timeout: 260 seconds]
ryanartecona has quit [Quit: ryanartecona]
Emmanuel_ has joined #ocaml
sh0t has quit [Remote host closed the connection]
phaer has joined #ocaml
phaer has quit [Client Quit]
phaer has joined #ocaml
phaer has quit [Quit: WeeChat 1.6]
nullcatxxx_ has joined #ocaml
maattdd has quit [Read error: Connection reset by peer]
maattdd has joined #ocaml
ryanartecona has joined #ocaml
nullcatxxx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrslepak_ is now known as jrslepak
kakadu has quit [Remote host closed the connection]
hashpuppy has quit [Quit: Connection closed for inactivity]
nullcatxxx_ has joined #ocaml
Simn has quit [Quit: Leaving]
ryanartecona has quit [Quit: ryanartecona]
agarwal1975 has joined #ocaml
richi235 has quit [Ping timeout: 260 seconds]
infinity0 has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]