ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
oriba_ has quit [Quit: oriba_]
rgrinberg has joined #ocaml
njcomsec has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Simn has quit [Quit: Leaving]
<whitequark> ooo, my ppx_import enabling patches just went into trunk recently
philtor_ has joined #ocaml
<Drup> which ones ?
<whitequark> all of them
<Drup> https://github.com/ocaml/ocaml/pull/85#event-150210729 this was merge some time ago already, wasn't it ?
<whitequark> I just noticed
<Drup> but, you are the one who closed the issue ! :D
<whitequark> oh
<whitequark> hm
<whitequark> I dunno
<whitequark> maybe I was asleep
<Drup> whitequark: remind me the "correct" configure for llvm so that I don't kill my computer while recompiling ?
<whitequark> ./configure --enable-targets=x86 --enable-bindings=ocaml --enable-debug-runtime --enable-shared
cody__ has joined #ocaml
<whitequark> well, hm, maybe not
troutwine is now known as troutwine_away
<Drup> yeah, ocamloscope is not that useful because it unifies too easily
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<whitequark> hm, let me add module type import to ppx_import and publish it
<Drup> I modified llvm-c/Core.h, llvm_ocaml.c and llvm.ml, did I need to touch somewhere else ?
philtor_ has quit [Ping timeout: 240 seconds]
<whitequark> um. Core.cpp for the C implementation part?
<Drup> where is it ?
<whitequark> how about using an editor which can find files in tree for you ;P
<whitequark> should be in lib/IR or something
<whitequark> Drup: like https://github.com/d11wtq/fiplr
<whitequark> this is ~world-changing~
<Drup> wtf
englishm has quit [Remote host closed the connection]
<whitequark> hm?
jwatzman|work has quit [Quit: jwatzman|work]
<Drup> I really though 10 Go would be enough to let me compile llvm quietly, so I happily "make -j"d
<Drup> it was not enough :(
<whitequark> 10 Go?
<Drup> ram
<whitequark> oh, GB
<whitequark> it is enough for me
<whitequark> what -j factor do you use?
<Drup> no factor, just -j
<Drup> (on 4 core)
lordkryss has quit [Quit: Connection closed for inactivity]
<whitequark> what concurrency level does that translate to?
<Drup> probably 4
<whitequark> it certainly should be OK
<whitequark> 10 GB RAM is like five times more than you need
<Drup> well, kswapd didn't agree with you
<Drup> and no, you need more than 2GB to compile llvm, believe
<Drup> +me
<whitequark> Drup: I had a buildbot for LLVM, I know ;p
<whitequark> Drup: WTF
<whitequark> "If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously."
<whitequark> OF COURSE it used all your RAM
<Drup> O_o
<whitequark> you've launched like two hundred cc1's at once
<Drup> I always though he tried to fit the number of core you had and stuff
<whitequark> lol no, make's too dumb for that
<Drup> like, you know, being clever
<Drup> yeah
<Drup> I should have known
maattdd has quit [Ping timeout: 245 seconds]
racycle has quit [Quit: ZZZzzz…]
joncfoo has quit [Ping timeout: 255 seconds]
cody__ has quit [Quit: Leaving]
philtor_ has joined #ocaml
<Drup> hum, is pinning the opam package enough to get the C changes ?
<whitequark> hm?
<Drup> the llvm opam package
<whitequark> uh, just uninstall it entirely
<whitequark> and then use OCAMLPATH
<whitequark> and LD_LIBRARY_PATH
<Drup> whitequark !
<Drup> you upgraded ocamlfind
<whitequark> yes ?
<Drup> I have ONE HUNDRED EIGHT packages to recompiler
<Drup> I hate you
<whitequark> :3
dcampbell_ has quit [Quit: Leaving]
philtor_ has quit [Ping timeout: 255 seconds]
<rgrinberg> why did this never make it into ocaml: http://www.ocamlpro.com/blog/2011/08/10/ocaml-pack-functors.html
ygrek has joined #ocaml
<Drup> rgrinberg: the module alias stuff in 4.02 solve the whole pack situation better, I presume
<Drup> I don't feel like adding more pack stuff is a good solution, at least.
<rgrinberg> how so? i thought the module alias is just a performance tweak
<Drup> not exactly, it will also avoid recoyping type interface with "module type of BLA"
<Drup> various subtle type checking behavior at the type equality level, too
<Drup> module equality*
<rgrinberg> hmm.. when I look at packed functors I see them as a more convenient mechanism for parameterizing a whole library. Not sure how module alias could help out with that.
<rgrinberg> but this is the first time I've seen this proposal
<Drup> right
<Drup> I don't know the official opinion on the questoin
fraggle_laptop has quit [Ping timeout: 255 seconds]
<Drup> question*
shinnya has quit [Ping timeout: 250 seconds]
<Drup> but I don't like the idea of external flags that change the signature of a library and that you can't see in .mli :/
fraggle_laptop has joined #ocaml
<rgrinberg> haven't thought of that
<rgrinberg> it certainly doesn't seem elegant
q66 has quit [Quit: Leaving]
jprakash has quit [Quit: leaving]
araujo has quit [Read error: Connection reset by peer]
<Drup> whitequark: ok, back and ready, let's try to fiddle with these env variables
rgrinberg has quit [Quit: Leaving.]
araujo has joined #ocaml
<whitequark> Drup: do you ever, you know
<whitequark> sleep
<Drup> of course
<Drup> during the first half of the day
<Drup> while everyone is getting up, I go to bed
<Drup> :D
<whitequark> how is that compatible with being an employee / student ?
<Drup> :research:
<whitequark> uh, yeah, and?
<whitequark> you don't have to show up?
<Drup> occasionally ?
<whitequark> oh, cool
<whitequark> so it's basically remote work, but in academia
<Drup> it depends of your statue I guess, and the way you are working
<whitequark> ... statue?
<Drup> huu, wrong word.
<Drup> status* :D
<Drup> (it's not even the right one in french, I have no excuses)
<whitequark> it is known: Drup has a statue
<Drup> but at least, as an intern, my advisors were all ok with me having weird hours and showing up only for meetings.
<Drup> whitequark: I don't find documentation on this env variable, how do I set them ?
<whitequark> export OCAMLPATH=$LLVM/lib/ocaml/:${OCAMLPATH}
<whitequark> export CAML_LD_LIBRARY_PATH=$LLVM/lib/ocaml:${CAML_LD_LIBRARY_PATH}
<whitequark> OCAMLPATH is parsed by findlib
<Drup> you mean bindings/ocaml, I presume ?
<whitequark> LLVM=$HOME/llvm/build/Debug+Asserts
<Drup> ok
Zemeio has joined #ocaml
<Zemeio> Guys, can anyone help me? I am trying to build my project (frenetic project) and i keep geting an error saying that it does not find "async_netkat". I know where the .cmx is, but it is not linking properly. I am still new at the language.
jao has quit [Ping timeout: 245 seconds]
<whitequark> Zemeio: try adding -package netkat to your "ocamlfind ocamlc" invocation
<whitequark> or at least say what build system are you using
<Zemeio> sorry, i am using corebuild with -pkg netkat,async,openflow
<Zemeio> the OS is ubuntu 14.04 (in case it is relevant)
<Drup> ahah, I'm an idiot
<Drup> 10 minutes of walking around oasis configure
<Drup> I forgot to put my new function in the .mli
<whitequark> I concur
ygrek has quit [Ping timeout: 240 seconds]
<Drup> ok, an llvm assert :(
<whitequark> to the gdb
<Drup> no need
<Drup> whitequark: off by one error in the ocaml code which was not triggered by Llvm.operand by is by operand_use, for whatever reason
<Drup> s/by/but/
<Drup> nice, it works
rgrinberg has joined #ocaml
ygrek has joined #ocaml
philtor has quit [Ping timeout: 244 seconds]
<whitequark> Drup: please split LLVM commit in two
<whitequark> and I'll be able to commit that easily for you
<whitequark> (C/OCaml changes)
<Drup> ok
<Drup> http://i.imgur.com/eu5rt9c.png and the pretty picture.
<whitequark> my eyes
<Drup> what, you don't like xdot ? :)
<Drup> the edge layout is a bit questionable, though
<whitequark> the colors, the center alignment and non-monospace font.
<Drup> :D
<Drup> I will try to give better graphviz attributes, to satisfy your fancy tastes :p
<Drup> grmbl, what is the git clever command to rework the previous command ?
studybot_ has joined #ocaml
<whitequark> the previous commit?
<whitequark> git reset --soft HEAD
<whitequark> git reset --soft HEAD^
<Drup> right, this one
<Drup> I can't wrap my head around git cli, I think it's even worse than tar, which is quite an achievement
<Zemeio> "worse than tar", that is tough
<Drup> at least, for tar, the completion of my shell is enough most of the time.
joncfoo has joined #ocaml
<whitequark> compiling
<whitequark> Drup: oh, in the future, please add tests too
<whitequark> they're in test/Bindings/Ocaml
<Drup> ok
<Drup> for the C API too ?
<Drup> hum, I don't see tests for the C api
<whitequark> no, no tests for that
<Drup> ok
<whitequark> there was some talk about the ML
<whitequark> on the ML about the C API tests
<whitequark> tl;dr don't bother writing them if you have OCaml tests anyway
<Drup> you could argue that you are testing the C api when you test the ML one
<Drup> the ocaml one*
<whitequark> at -j10, I never had over 3GB memory usage
racycle has joined #ocaml
<whitequark> and that's counting chromium, too
<Drup> yeah, it was ok once I limited the number of job
<Drup> it was not ok at all when I had 4GB of RAM, though
<whitequark> r215419, r215420
<whitequark> now llvm buildbots are going to email me with spurious failures for several more weeks. yay.
<Drup> hehe :D
<Drup> do you know how long before the next version of llvm ?
Denommus has quit [Ping timeout: 240 seconds]
<whitequark> 3.5 is branched out already and the fix is not in
<whitequark> oh, no, it's not
<whitequark> so, mid-2015
* whitequark grins
<Drup> T____T
<whitequark> accept it, whatever are you doing with LLVM, you'll have to drag your own patchset with it
<whitequark> always.
Denommus has joined #ocaml
<Drup> hum, so the branching for 3.5 is going to be soon ?
<Drup> I should add these functions for float values and stuff quickly then
<whitequark> mmm, if the release is in mid-2015, probably not too soon
<whitequark> wait, let me figure out the release dates properly
<whitequark> oh. I dont know where mid-2015 came from.
<whitequark> 3.5 was branched in May and will be released in like a week
<whitequark> the next release will be half a year from now, and yes, you do need to get that stuff in quickly
<whitequark> since the branch would be in two months or so, I guess
<Drup> ok
manizzle has quit [Quit: Leaving]
<whitequark> Drup: oooh floats
<whitequark> did you by any chance do something that requires setting/getting fp flags?
<whitequark> like no-nan or something
<whitequark> there was a guy who sent me a patch for the C/OCaml API
<Drup> fp flags ? no
<Drup> no, I don't care about that
<Drup> It's only the "float_of_const" function that is missing
<whitequark> oh ok
<Drup> I completely forgot about it, since I never analyzed program with floats :>
<whitequark> do you have the patch somewhere already?
<Drup> no, I will do it during the week, now that I remember it :D
<whitequark> ok
<Drup> there is also the bug report I raised, which I should do
badon has quit [Quit: Leaving]
<whitequark> oh?
<Drup> lack of terminator-related functions
<whitequark> right
madroach has quit [Ping timeout: 250 seconds]
<Drup> whitequark: I can't manage to make a text left aligned in graphviz >_>
<whitequark> oh, I can tell you how to do that
<whitequark> it is... truly horrible
jao has joined #ocaml
<Drup> I found the \l thingy
madroach has joined #ocaml
<whitequark> like, you-can't-even-fucking-imagine-how-horrible horrible
<Drup> but it doesn't work
jao has quit [Changing host]
jao has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
<whitequark> ugh
<whitequark> can't find
<whitequark> basically, you wrap every line in <span align="left">
<whitequark> or something like that.
madroach has joined #ocaml
<whitequark> it is even worse
<Drup> that's interesting.
<Drup> ok, I understood.
<Drup> you replace all the newline \n by \l
<Drup> and it works
<Drup> slightly more lightweight than your method, but I feel dirty about using Str for that.
<whitequark> Str?
<Drup> "Str.global_replace (Str.regexp "\n") "\\l""
<whitequark> oh, \\l
<Drup> yeah
<Drup> http://i.imgur.com/VahGMoP.png is it better ? :3
<whitequark> yes, much better
<whitequark> do you know opt -view-cfg exists?
<Drup> sure
<Drup> I like the node division for the conditional jumps
<whitequark> division?
<Drup> when there is a conditional jump, the bottom of the node is divided in T/F and the edges are attached to the good part.
<whitequark> oh, yes
<Drup> It's nice
<whitequark> btw, why do you name them ; <label>:3 ?
<whitequark> isn't it just %3?
<Drup> I don't name them, that's llvm's string_of_llvalue
<whitequark> oh
<Drup> I didn't try to be very cleaver with the ouput, it's just a little test, to apply the k-color algorithm and see the result
<Drup> clever*
samrat has joined #ocaml
<Drup> Maybe I should try with a bigger program, so that I need more colors
<whitequark> try the main interpreter loop of QEMU
<whitequark> well, not QEMU, it doesn't have one. Bochs
<Drup> not sure I want to do that :(
siddharthv_away is now known as siddharthv
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
madroach has quit [Client Quit]
joncfoo has quit [Ping timeout: 255 seconds]
keen_____ has quit [Read error: Connection reset by peer]
keen_____ has joined #ocaml
ggole has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
Zemeio has quit []
jao has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
racycle has quit [Quit: ZZZzzz…]
relrod has quit [Ping timeout: 255 seconds]
rgrinberg has quit [Quit: Leaving.]
relrod has joined #ocaml
relrod has quit [Ping timeout: 245 seconds]
arj has joined #ocaml
relrod has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
typedlambda has quit [Ping timeout: 250 seconds]
typedlambda has joined #ocaml
_0xAX has joined #ocaml
thomasga has joined #ocaml
Arsenik has joined #ocaml
ygrek has joined #ocaml
cago has joined #ocaml
Simn has joined #ocaml
dsheets has joined #ocaml
<ebzzry> Why am I not getting the expected behavior, at http://pastebin.com/kgVL32su?
<jerith> ebzzry: What is the expected behaviour?
<ebzzry> jerith: I meant, *my* expected behavior. I was expecting that the numbers would be properly assigned.
<ebzzry> jerith: What am I doing wrong?
<ebzzry> jerith: I dumped a print to show what I was expecting.
Arsenik has quit [Remote host closed the connection]
<jerith> ebzzry: It looks like you're using the same inner array everywhere.
<jerith> [|a; a|] instead of [|a; b|].
samrat has quit [Quit: Computer has gone to sleep.]
Arsenik has joined #ocaml
<ebzzry> jerith: what do you mean, sir?
<jerith> tab.(x) and tab.(y) are the same mutable thing.
<ebzzry> jerith: how should it be written instead?
<jerith> In this particular case, Array.make_matrix might be useful.
<ebzzry> jerith: Ok, let's presume that Array.make_matrix is not available, and only Array.make is known only, at the moment.
maufred has quit [Ping timeout: 245 seconds]
<jerith> In the more general case, you want to create a new array for each element.
<jerith> http://caml.inria.fr/pub/docs/manual-ocaml/libref/Array.html probably has a better description of the problem than I gave.
Arsenik has quit [Remote host closed the connection]
maufred has joined #ocaml
<jerith> I think you want Array.init instead of Array.make.
<ebzzry> jerith: ok.
Arsenik has joined #ocaml
<jerith> Array.init n (fun _ -> Array.make n 0)
<jerith> ebzzry: Do you see what the problem is, though?
<ebzzry> jerith: still no. i'm stuck. i can only use Array.make.
<jerith> (Understanding that is more important than just having a solution.)
<jerith> Array.make returns an array with each element set to the value provided.
<jerith> In your case, you have a single inner array and every element of the outer array references it.
<jerith> You want a different inner array for each element of the outer.
samrat has joined #ocaml
<ebzzry> Do I not have a top-level array, with five elements?
<jerith> You have a top-level array with five elements, but each element is the same inner array.
<jerith> This matters because arrays are mutable.
Hannibal_Smith has joined #ocaml
<jerith> Your code is doing the equivalent of: table.(0) <- foo; table.(1) <- foo; ...
<ebzzry> hmm. let me read again.
<jerith> Instead, you need something like: table.(0) <- (Array.make n 0); table.(1) <- (Array.make n 0); ...
<ebzzry> So, this issue has got to do with mutability?
<jerith> Yes.
<jerith> It doesn't matter for immutable values because they can't change.
<ebzzry> I checked for the answer, and I indeed need to: tab.(x) <- Array.make n 0
<ebzzry> :-(
<ebzzry> Ouch. That one tripped me. :-/
<jerith> The same thing is happening for the inner array, but it doesn't matter because ints are immutable.
<ebzzry> jerith: hmm
<jerith> (This trips people up in languages like Python as well.)
elfring has joined #ocaml
<ebzzry> I didn't know that, that exists in Python, too.
<ebzzry> jerith: I thought, when I do a t.(x) <- ..., it's done.
<ebzzry> jerith: That the values than been modified, properly.
<jerith> The equivalent Python code (using list "multiplication") would be: [[0] * n] * n
lordkryss has joined #ocaml
<ebzzry> What is the explanation for the wrong expectations?
<jerith> Humans aren't very good at differentiating between copying and referencing.
<jerith> We tend to see what we expect rather than what's actually there.
<ebzzry> Why was the behavior, as such?
<ebzzry> Is there a such thing, in this context, an intuitive, and counter-intuitive operation expectations?
<jerith> ebzzry: The behaviour is quite clear once you understand what's happening.
<jerith> I take it this is a tutorial exercise or something?
<ebzzry> It's an exercise.
<ebzzry> I'm trying to pick up OCaml.
<jerith> It seems designed to point out exactly this thing. :-)
<ebzzry> jerith: May you do me (and us), a favor, by explaining to us again, what happened earlier. ;-)
<jerith> Sure.
<jerith> This would be easier with a whiteboard, but I don't have one handy.
<jerith> Are you familiar with Python or Ruby?
<jerith> I'm somewhat new to OCaml myself and have never actually used an array or for loop.
<ebzzry> Will an online whiteboard, do?
<jerith> I can give that a try, thanks.
<ebzzry> jerith: unfortunately, I'm not familiar with Python or Ruby. My main language is Lisp and Racket.
hhugo has joined #ocaml
Kakadu has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 260 seconds]
zarul has quit [Ping timeout: 260 seconds]
bezirg has joined #ocaml
madroach has joined #ocaml
darkf_ is now known as darkf
samrat has quit [Quit: Computer has gone to sleep.]
avsm has joined #ocaml
maattdd has joined #ocaml
samrat has joined #ocaml
thomasga has quit [Quit: Leaving.]
hhugo has quit [Quit: Leaving.]
hhugo has joined #ocaml
pyon has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
eikke__ has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
zarul has joined #ocaml
ggherdov has quit [Ping timeout: 240 seconds]
pjdelport has quit [Ping timeout: 260 seconds]
strmpnk has quit [Ping timeout: 250 seconds]
jennmoneydollars has quit [Ping timeout: 255 seconds]
steshaw has quit [Ping timeout: 272 seconds]
jzelinskie has quit [Ping timeout: 260 seconds]
puzza007 has quit [Ping timeout: 240 seconds]
leifw has quit [Ping timeout: 240 seconds]
Arsenik has quit [Remote host closed the connection]
nifty has quit [Ping timeout: 272 seconds]
avsm has quit [Quit: Leaving.]
jennmoneydollars has joined #ocaml
puzza007 has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
andreypopp has quit [Ping timeout: 260 seconds]
emmanueloga has quit [Ping timeout: 272 seconds]
IbnFirnas has quit [Ping timeout: 264 seconds]
_tca has quit [Ping timeout: 272 seconds]
lordkryss has quit [Ping timeout: 260 seconds]
jzelinskie has joined #ocaml
leifw has joined #ocaml
nox has quit [Ping timeout: 260 seconds]
msch has quit [Ping timeout: 250 seconds]
strmpnk has joined #ocaml
sgnb has joined #ocaml
nifty has joined #ocaml
__marius____ has quit [Ping timeout: 240 seconds]
SethTisue_______ has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
lopex has quit [Ping timeout: 250 seconds]
_tca has joined #ocaml
IbnFirnas has joined #ocaml
puzza007 has quit [Ping timeout: 272 seconds]
msch has joined #ocaml
emmanueloga has joined #ocaml
nox has joined #ocaml
lordkryss has joined #ocaml
jennmoneydollars has quit [Ping timeout: 240 seconds]
steshaw_ has joined #ocaml
lopex has joined #ocaml
__marius_____ has joined #ocaml
jennmoneydollars has joined #ocaml
puzza007 has joined #ocaml
pjdelport has joined #ocaml
ggherdov has joined #ocaml
SethTisue_______ has joined #ocaml
andreypopp has joined #ocaml
rand000 has joined #ocaml
hhugo has quit [Quit: Leaving.]
\u has quit [Ping timeout: 250 seconds]
\q has joined #ocaml
keen______ has joined #ocaml
keen_____ has quit [Ping timeout: 250 seconds]
AltGr has joined #ocaml
Superpelican_ has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
Submarine has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
huza has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
avsm has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
claudiuc has quit [Ping timeout: 240 seconds]
thomasga has quit [Quit: Leaving.]
_andre has joined #ocaml
maattdd has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
dorei has joined #ocaml
<dorei> is there a way to modify something before installing it with opam? conf-libev is giving me hard time :(
samrat has joined #ocaml
claudiuc has joined #ocaml
IbnFirnas has quit [Ping timeout: 264 seconds]
\q has quit [Ping timeout: 264 seconds]
\q has joined #ocaml
claudiuc_ has joined #ocaml
ggole has quit [Ping timeout: 264 seconds]
anddam has quit [Ping timeout: 264 seconds]
siddharthv is now known as siddharthv_away
anddam has joined #ocaml
avsm has quit [Quit: Leaving.]
IbnFirnas has joined #ocaml
claudiuc has quit [Ping timeout: 272 seconds]
ggole has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
hhugo has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
maattdd has joined #ocaml
Hannibal_Smith has joined #ocaml
avsm has joined #ocaml
BitPuffin has joined #ocaml
pgomes has joined #ocaml
bezirg has quit [Ping timeout: 260 seconds]
eikke__ has quit [Ping timeout: 246 seconds]
darkf has quit [Quit: Leaving]
bezirg has joined #ocaml
avsm has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
lordkryss has joined #ocaml
maattdd has quit [Ping timeout: 272 seconds]
englishm has joined #ocaml
eikke__ has joined #ocaml
sad0ur has quit [Ping timeout: 246 seconds]
bjorkintosh has quit [Ping timeout: 272 seconds]
sad0ur has joined #ocaml
bjorkintosh has joined #ocaml
joncfoo has joined #ocaml
Haudegen has quit [Remote host closed the connection]
Haudegen has joined #ocaml
Haudegen is now known as Guest37558
huza has quit [Quit: WeeChat 0.3.8]
<Drup> ebzzry: you will be happy to hear that this is *the* error that almost every beginner do with Array.make :]
Guest37558 has quit [Remote host closed the connection]
21WAAX0K6 has joined #ocaml
21WAAX0K6 has quit [Read error: Connection reset by peer]
OnkV has joined #ocaml
yomimono has joined #ocaml
<Drup> ebzzry: http://www.twiddla.com/1724439 you can admire my drawing skills
OnkV has quit [Remote host closed the connection]
OnkV_ has joined #ocaml
joncfoo has quit [Ping timeout: 255 seconds]
avsm has joined #ocaml
emias has quit [Ping timeout: 250 seconds]
rom1504 has quit [Ping timeout: 250 seconds]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
OnkV_ is now known as Haudegen
<Superpelican_> Drup: Ok, so I’ve found out that Tsdl doesn’t release SDL resources automatically, so I’m leaking memory, but what if creating something fails? Then I need to release the resources too
<Drup> Hum, I don't know Tsdl :D
<Drup> never used, never even looked at the API
<Drup> so, hum, look for a function to release ressources, I guess ?
<mrvn> Superpelican_: set up a Gc.finalize to free them
<Superpelican_> Drup: Do I have to pass all those resources including the renderer and window?
<Superpelican_> for example I have a function that loads a bitmap into memory
<Drup> what mrvn said is probably a good solution
<Superpelican_> yes, but does the OCaml GC even have control over SDL/C resources?
<Drup> no it does not
<Drup> but that doesn't matter
avsm has quit [Quit: Leaving.]
<Superpelican_> please explain :)
<mrvn> For ZeroMQ what I did was write thin bindings with ctypes that would leak and then use that in a module that implement more sane bindings and handles freeing resources and creating exceptions on error and so on.
<Superpelican_> yes
<Superpelican_> I guess that is pretty similiar to my situation with tsdl
<Superpelican_> which is also a thin binding
<Drup> Superpelican_: you will make a small function "create_ressource"
<Superpelican_> almost all the functions map directly to C functions
<Drup> wich will fecth the ressource
<mrvn> Superpelican_: http://paste.debian.net/115132/
<Drup> and attach the freeing function to it with Gc.finalize
<Drup> when the GC see that there are no more use for this ressource on the ocaml side, it will call the finalizing function you attached
<Superpelican_> Drup: ok, but what do you exactly mean with “fetching the resource"?
<mrvn> Superpelican_: calls Tsdl.init ()
<mrvn> Superpelican_: oder Tsdl.open_audio ()
<mrvn> or whatever creates the resource you want to track
<Drup> Superpelican_: a "ressource" in this context is "everything that need to be freed after it's use
_0xAX has quit [Remote host closed the connection]
<ggole> Relying on finalizers is a bit flaky
<adrien> its*
<Superpelican_> hmm maybe I should post my code
<Drup> ggole: I agree, but in this case, I don't see better solutions
<mrvn> One thing is bad in ocaml though. On exit the Gc does not finalize. So you can't have a global resource that gets freed on exit.
maattdd has joined #ocaml
<Superpelican_> This is what I currently have
<Superpelican_> but beware it’s “under construction”
<Superpelican_> so the code doesn’t completely make sense ;)
<mrvn> Superpelican_: after line 16 you would call Gc.finalize shutdown win
<Superpelican_> for example I should change the update_window_surface to render_present etc.
<mrvn> Superpelican_: in line 19 you do the same for renderer
<Superpelican_> yes, but how does the OCaml GC know about what Sdl.destroy_* does?
<mrvn> Superpelican_: it doesn't care
<mrvn> Superpelican_: it just calls shutdown when win becomes unreachable
<ggole> At some point after it becomes unreachable, really
samrat has joined #ocaml
<mrvn> Superpelican_: or whatever function you attach
<Superpelican_> well I try to explain what my code does
<Superpelican_> I -> I'll
<mrvn> Superpelican_: no need
<Superpelican_> mrvn: hmm, but win never becomes unreachable
<Superpelican_> Or does it?
<mrvn> Superpelican_: change line 40 to "let main () = ..." and add "let () = main (); Gc.full_major (); Gc.full_major ()
<Superpelican_> mrvn: The problem is, if for example loading the bitmap fails, I’ll need to release/free the window (win) and the renderer (renderer)
<Superpelican_> normally I wouldn’t need to pass win and renderer to my loadTex(ture) function
<mrvn> or better "let () = let res = try main (); None with _ as exn -> Some exn in Gc.full_major (); Gc.full_major; match res with None -> () | Some exn -> raise exn
<Superpelican_> But I can’t free them if loading the bitmap fails if I don’t pass them to loadTex
<Superpelican_> But I don’t want to clutter up all my functions with those arguments
<mrvn> Superpelican_: the Gc will free them
<Superpelican_> mrvn: But how does the GC know when to free them?
<Superpelican_> Because win won’t become unreachable
<Superpelican_> because it’s never freed
<mrvn> because they become unreachable
samrat has quit [Ping timeout: 250 seconds]
<Superpelican_> mrvn: You mean after exit?
<mrvn> Superpelican_: no. unfortunetly not. That's why you need the bit of code from above
<Superpelican_> Yes, but won’t win only become unreachable *after* exit?
<mrvn> The Gc runs every now and then in a longer running program but at exit you have to trigger it manually to get it to run one final time before exiting.
claudiuc_ has quit [Remote host closed the connection]
<Superpelican_> mrvn: I understand
<mrvn> Superpelican_: win becomes unreachable when line 40 returns
<mrvn> which means you need to remove line 46 by the way.
<Superpelican_> mrvn: So you mean let () will return when loadTex returns when an error occurs while trying to load the bitmap?
<ggole> What's wrong with good old try let res = create_thing () in foo (); dispose res with exn -> dispose res; raise exn?
<Superpelican_> mrvn: BTW why change let () to let () = main () and let main () = ?
thomasga has quit [Quit: Leaving.]
<ggole> It should work if the lifetime of the thing is clear
<mrvn> Superpelican_: so main gets called and after that you invoke the Gc
<Superpelican_> mrvn: So: “let () = main (); invokeGC ()”?
<mrvn> ggole: that would be the "with_foo ..." style of handling this
ygrek has joined #ocaml
<mrvn> Superpelican_: yes. Adding a try ... with around it to handle exceptions if you use those
<Superpelican_> mrvn: Well Tsdl doesn’t seem to use exceptions, but just polymorphic variants to return either `Error or `Ok, so l’m forced to use match bodies
<mrvn> ggole: problem with that approach is that you can't garantee that the resource does not escape the scope
<mrvn> Superpelican_: nothing stops you from matching those and then raising exceptions
<ggole> Then stick on finalize as well (preferably with a bit of code that shouts that you are doing it wrong)
<Superpelican_> mrvn: And exceptions don’t have scope?
<mrvn> Superpelican_: or any other thing can raise exceptions, like List.find
<Superpelican_> If exceptions are global, that maybe the key to the solution
<Superpelican_> Because then I could handle the exceptions in let ()
<Superpelican_> hmm
<mrvn> Superpelican_: exceptions have a namespace. Not sure what you mean by scope
racycle has joined #ocaml
<Superpelican_> mrvn: I mean if loadTex raises an exception upon matching `Error that exception could then be handled in let ()
<Superpelican_> And win and renderer are in the scope of let ()
<mrvn> exception Error of string let create_texture_from_surface imgSurface = match match Sdl.create_texture_from_surface imgSurface with | `Error err -> raise (Error err) | `Ok imgTexture -> imgTexture
samrat has joined #ocaml
avsm has joined #ocaml
<mrvn> you can raise and catch exceptions anywhere you like
<Superpelican_> ok, so they are “global"
<mrvn> no
<Superpelican_> but then we still have the problem that try is of course imperative
<Superpelican_> and not event driven
<Superpelican_> So loadTex would still need to notify let () that something went wrong while trying to load the bitmap
<mrvn> Superpelican_: you should read up and play with exceptions. You seem to never have used them
<Superpelican_> mrvn: I did use them in Python briefly, but you’re right that I haven’t used them yet in OCaml
eikke__ has quit [Ping timeout: 240 seconds]
<Superpelican_> mrvn: I’ll read up on exceptions in OCaml first and then come back :)
<Superpelican_> maybe it will provide a whole new perspective on how to solve the releasing of the SDL resources
<Superpelican_> (for me ;) )
<ggole> I have to admit that I don't see the difficulty
WraithM has quit [Remote host closed the connection]
<mrvn> exceptions won't release resources. they just manage the control flow
<mrvn> ggole: me neither. This is so fundamental that I can't even explain it
<Superpelican_> mrvn: Are you fond of Real World OCaml, or do you recommend something else (especially when considering RWO’s chapter “Error Handling” which I guess covers exceptions)?
<mrvn> never read Real World OCaml. Didn't exist when I started
<Superpelican_> ;)
pyon has quit [Quit: Fiat justitia ruat caelum.]
samrat_ has joined #ocaml
samrat has quit [Ping timeout: 272 seconds]
samrat_ is now known as samrat
studybot_ has quit [Ping timeout: 264 seconds]
<Superpelican_> mrvn: I know exceptions don’t release resources
<Superpelican_> mrvn: But you can use them to do that, right?
<ggole> Not really
<mrvn> you can use them to set off a nuclear explosion if you got the bomb
<ggole> You use ordinary code to release resources
<Drup> raise Radioactive_cloud
<Superpelican_> mrvn: “except FatalError releaseResources (); exit 1;”
<ggole> The trick is that exceptions can bypass that code, which is why you need to fiddle about with try
<Superpelican_> Drup: LOL “raise”
<mrvn> try ... with Release foo -> foo ()
thomasga has joined #ocaml
<Superpelican_> ok I really think I indeed should read up about exceptions in OCaml
<Superpelican_> because they seem to be different than those in Python
<mrvn> not really, or at all
<mrvn> exceptions are pretty much the same everywhere
samrat has quit [Ping timeout: 255 seconds]
<Superpelican_> LOL :OCaml doesn't have quite such a rich set of debugging commands - better than Java, about the same as C, not nearly as good as Perl.” - OCalm documentation
<Superpelican_> Are they reallly claiming that C has a richer set of debugging commands than Java?
<Superpelican_> Or is this just a mistake?
<mrvn> Superpelican_: ever used gdb?
<Superpelican_> well I did use it a few times
<Superpelican_> but that was pretty basic
<Superpelican_> I never used it’s advanced features
<Superpelican_> only print the value of the variable and execute until line X etc. ;)
<Superpelican_> Although it did help me catch some bugs
WraithM has joined #ocaml
<Superpelican_> mrvn: But gdb isn’t really a language feature
<Superpelican_> so I wouldn’t call it a “debugging command"
<Superpelican_> rather a “debugging tool”
rgrinberg has joined #ocaml
samrat has joined #ocaml
thomasga has quit [Quit: Leaving.]
yomimono has quit [Ping timeout: 245 seconds]
arj has quit [Quit: Leaving.]
shinnya has joined #ocaml
cago has quit [Quit: cago]
thomasga has joined #ocaml
claudiuc has joined #ocaml
yomimono has joined #ocaml
eikke__ has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
<Superpelican_> mrvn: What’s a “thunk”?
<Superpelican_> It’s mentioned in RWO
yacks has quit [Ping timeout: 240 seconds]
koderok has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
bezirg has quit [Ping timeout: 255 seconds]
eikke__ has quit [Ping timeout: 250 seconds]
yomimono has quit [Ping timeout: 260 seconds]
<whitequark> mrvn: Java has a lot of really awesome debugging tools though
<whitequark> like jvisualvm, which includes a cpu and a heap profiler, which don't suck. I'm not sure I know of *a* generic C heap profiler
<adrien> kcachegrind ? :P
pgomes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<whitequark> it profiles heap?
<adrien> you run valgrind, it creates a file which you throw at it and it'll display it
<adrien> the naming is quite bad
<adrien> and you valgrind run with --tool=cachegrind
hhugo has quit [Quit: Leaving.]
<whitequark> I see
travisbrady has joined #ocaml
rom1504 has joined #ocaml
<Superpelican_> Looks like exceptions aren’t even necessary most of the time
<Superpelican_> I really like OCaml’s rich type system :)
<Superpelican_> so much better than C’s or those of many other languages
<Superpelican_> using ints for everything is really ugly and error prone
<Superpelican_> Even a beginner like me can see that :)
<ggole> valgrind is pretty sweet
<ggole> Shame it's so slow.
<Superpelican_> I really like OCaml’s variant types and options
axiles has quit [Ping timeout: 240 seconds]
stevej has joined #ocaml
samrat has joined #ocaml
* Superpelican_ just came across https://blogs.janestreet.com/category/ocaml/
<Superpelican_> looks like strings are going to be immutable in 4.0.2
<Drup> indeed
<whitequark> 4.02*, and that's optional
<Drup> not by default, though
<whitequark> you have to opt-in
<Superpelican_> I already thought it was weird that strings were mutable by default in OCaml
<Superpelican_> As even Python has them immutable IIRC
rand000 has quit [Ping timeout: 272 seconds]
<whitequark> well, OCaml didn't really have strings, it had byte buffers
<Superpelican_> whitequark: So basically like C?
<Superpelican_> with its array of bytes?
<whitequark> C's strings are null-terminated (and unsafe)
<whitequark> but there are some conceptual similarities, yes
<whitequark> in OCaml, you can store zeroes and you can't get a segfault from an out-of-bounds access.
<Superpelican_> whitequark: yes, I didn’t expect them to be an exact copy of C string of course ;)
axiles has joined #ocaml
<Superpelican_> *strings
<Superpelican_> that would be a little weird considering the rest of OCaml’s type system
<whitequark> indeed
yomimono has joined #ocaml
NoNNaN has joined #ocaml
philtor has joined #ocaml
axiles has quit [Ping timeout: 272 seconds]
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
<Superpelican_> mrvn: So you still think I should use the GC method?
<Superpelican_> mrvn: Or do you have another solution (perhaps using exceptions etc.)?
<philtor> mrvn: have you had a chance to look at ocamlpi anymore?
<mrvn> Superpelican_: one has nothing to do with the other
<mrvn> philtor: unfortunately no.
<mrvn> philtor: but something is wrong in the threading. causes random crashes
ollehar has joined #ocaml
<Superpelican_> mrvn: No, I actually meant a solution which involves using exceptions ;)
axiles has joined #ocaml
avsm has quit [Quit: Leaving.]
troutwine_away is now known as troutwine
_0xAX has joined #ocaml
yacks has joined #ocaml
Superpelican_ has quit [Quit: Superpelican_]
pyon has joined #ocaml
q66 has joined #ocaml
jprakash has joined #ocaml
avsm has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
Hannibal_Smith has quit [Quit: Sto andando via]
axiles has quit [Ping timeout: 272 seconds]
travisbrady has quit [Quit: travisbrady]
slash^ has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
travisbrady has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
avsm has quit [Quit: Leaving.]
Kakadu has quit [Quit: Page closed]
tobiasBora has joined #ocaml
stevej has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
NoNNaN has joined #ocaml
rand000 has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
emias has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
NoNNaN has joined #ocaml
_0xAX has quit [Remote host closed the connection]
<whitequark> Drup: what about that
thomasga has quit [Quit: Leaving.]
mcclurmc has quit [Remote host closed the connection]
samrat has joined #ocaml
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
axiles has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
troydm has joined #ocaml
pyon has quit [Quit: Fiat justitia ruat caelum.]
Denommus has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
slash^ has quit [Read error: Connection reset by peer]
samrat has joined #ocaml
pyon has joined #ocaml
philtor_ has joined #ocaml
AltGr has left #ocaml [#ocaml]
yomimono has quit [Ping timeout: 244 seconds]
<Drup> whitequark: I though you would like haskell utf8 gloriousness in this matter :]
<whitequark> hmm
<whitequark> oh, got it
samrat has quit [Quit: Computer has gone to sleep.]
<whitequark> haha, if I try to type ಠ_ಠ into utop, it crashes
<Drup> yes, it's a valid function x)
<def`> Drup: unicode identifiers is a bbbbbaaaadddd idea
<Drup> def`: of course it's a terrible idea
<def`> whitequark: same as https://github.com/diml/utop/issues/79
<whitequark> def`: a very british-imperialistic point of view
<Drup> except when you do math, in this case, it can be actually useful
<whitequark> "everyone must learn english or die"
<def`> whitequark: what are you going to do about that? change keywords?
<whitequark> def`: for instance
* adrien grabs Drup, kicks him on the head, ties him, cuts his tongue, put him in a box and ships it to antarctica
<def`> keywords are already in "english" (wow, actually that's ocaml, not english)
<Drup> adrien : you would like my current code
<whitequark> def`: still, you are basically discounting every culture outside english-speaking world
<Drup> It's almost literate linear algebra programming
<whitequark> the latter is, in fact, a minority.
<def`> whitequark: if the whole language is designed to allow non ascii names, then why not. but in the current situation, it would introduce a lot of confusion
<adrien> as long as you don't publish it :P
<Drup> with lot's of utf8 symbols in the comments, to explain what the fuck it is doing
<dmbaturin> Non-english keywords? Tell the difference between "let" and "lеt".
<dmbaturin> (Spoiler: the latter has cyrillic 'е' instead of lating 'e' in it)
<whitequark> def`: huh? you would need to allow utf-8 longidents and add collation support for the module capitalization trick
<dmbaturin> * latin
<def`> dmbaturin: that's precisely what I am worried about
<Drup> you can catch that by normalization, though
<whitequark> def`: Java and JavaScript do this for ages. it is not exactly complex.
<whitequark> Drup: not really
<whitequark> there's no normalization mode that converts е to e
<Drup> really ?
<whitequark> as far as I'm aware
<Drup> weird
<whitequark> that's because they are completely different characters that happen to share a grapheme
<dmbaturin> Actually, there were several cyrillic-based languages in the USSR, including Ada with translated keywords. The Ada standard required that compliers treat identical looking cyrillic and latin characters as equal.
<whitequark> dmbaturin: neat
<whitequark> and horrible
<Drup> x)
<whitequark> anyway, you could trivially add an editor extension that would highlight mixed-language identifiers
<dmbaturin> I think compiler authors had to invent new swear words to describe that idea. :)
<Drup> whitequark: there is an issue with allowing utf8 arbitrarily, which I personally call "Haskell operator madness"
<whitequark> Drup: wait, they ALSO use UTF-8?
<whitequark> that upgrades it from "insane" to "completely deranged"
<Drup> of course they do
<whitequark> Drup: in my view, if you have more than ten operators apart from the arithmetic stuff everyone knows, you're doing it wrong and please stahp
<whitequark> five is already stretching it
<Drup> whitequark: true only if you have typeclasses
<dmbaturin> bitbckt: Did you try it? Do binaries still exist?
<whitequark> having + and +. and +/ IS wrong
<whitequark> and please stahp indeed
<mrvn> 4 for ints, 4 for floats, 4 for 2D vectors, 4 for 3D vectors, 6 for matrixes
<Drup> ahah
<whitequark> mrvn: ffuuu
<whitequark> also there is `mod`
<whitequark> so five
troutwine is now known as troutwine_away
<def`> whitequark: did you suffer having to learn the 26 characters of ascii alphabet? :|
<mrvn> 6 for bit operations
<Drup> whitequark: if your language is function, you will want |>, @@ and .
<mrvn> 2 for function combination
<Drup> functional*
<whitequark> def`: imagine reading a codebase where every single identifier is translitedated in slightly different ways by a dozen of programmers
<Drup> no, 3 for function combination
<whitequark> none of whom knows english
<whitequark> fuck that
<Drup> we lack one in ocaml
<whitequark> Drup: |> @@ @ ^ and >>=
<whitequark> and be done with it
<Drup> @ ?
<whitequark> List.concat
<mrvn> Drup: ok. Ocaml already has 16 operators defined that I've used
<Drup> whitequark: no, that's +
<def`> whitequark: use conceal to turn _hexencoding to a proper character :P
<Drup> don't need it.
<mrvn> Drup: @ ist a constructor
<whitequark> Drup: no, that's not +
<whitequark> at least if your + is the part of a Num typeclass
<whitequark> how would you define - or * for lists?
<Drup> right, depends on how you do it, ok
<whitequark> def`: what's your opinion here, btw?
<mrvn> whitequark: removal of elements and pairwise tuples
<whitequark> mrvn: but - has the signature 'a -> 'a -> 'a
<def`> whitequark: on operators?
<whitequark> for the whole Num typeclass
<whitequark> def`: yes
<dmbaturin> "-" could find if the lists have common beginning and return the difference.
<mrvn> [1; 2] - [2; 3] = [1]
<Drup> mrvn: please die
<Drup> =')
<def`> :D
<whitequark> dmbaturin: mrvn: but that wouldn't follow the usual arithmetic rules for + and +
<whitequark> er, + and -
<mrvn> whitequark: true.
<whitequark> x - y + y ≠ x
<dmbaturin> whitequark: Of course it wouldn't, I never said otherwise.
<mrvn> it is a bad idea
<whitequark> then it should die in a fire
<whitequark> def`: I think there should be a distinct "Concat" typeclass
<whitequark> for strings, ropes, arrays, byte arrays, lists, ...
<jpdeplaix> whitequark: llvm.moe <3
<whitequark> you could have @ as its sole member
<whitequark> jpdeplaix: ;D
<def`> whitequark: I thought of "monoid"
<whitequark> def`: "monoid"?
<mrvn> whitequark: so no more ^?
<whitequark> mrvn: yes
<Drup> whitequark: @
<Drup> it's call monoid
<def`> whitequark: "a category with only one object"
<whitequark> def`: can you please explain in English
<Drup> no, don't say it like that T_T
<Drup> whitequark: a set with a zero and an addition
<Drup> so, Z, lists, trees
<whitequark> Drup: okay
<whitequark> please don't call it "monoid"
<Drup> It's the right term
<whitequark> I know
<Drup> and it's not even category theory
<def`> whenever you can concat, with concatenating a zero being a no-op, you have a monoid
<Drup> it's just group theory, which is slightly less insane
<whitequark> I just don't want #ocaml to turn into #haskell
<def`> the name Monoid comes with a set of laws
<whitequark> because every time you say anything vaguely related to category theory, even if correct, any rational thought stops and shit starts being dispersed by fans
<def`> without having to lookup the documentation
<whitequark> def`: I know
<dmbaturin> whitequark: Let's turn #haskell into #ocaml instead.
<Drup> whitequark: I told you, it's not category theory T__T
<whitequark> personally, I have no objections to monads or monoids or whatever
<def`> whitequark: you're right
<whitequark> Drup: "vaguely related"
<Drup> well
<Drup> some math thingy is vaguely related to some other math thingy
<Drup> yeah, sure.
<whitequark> Drup: that is exactly how the holy war would go
<whitequark> so I intentionally said it like that.
<def`> whitequark: the problem with software engineer is that all concepts have a vague definition, if any
<def`> engineering*
<whitequark> def`: to be honest I see no big problem with typeclass "Concat" defined as "you can concat, with concatenating a zero being a no-op"
<ggole> Software is vague and precise at the same time, it's the nature of the beast.
<def`> whitequark: and concatenation is associative :P
<whitequark> it is a precise definition and it is understandable by literally anyone who has touched any language at all
<whitequark> yeah, associative
<Drup> whitequark: well, concat is still weird, semantically
<whitequark> Drup: why?
<Drup> because Z is a monoid
<Drup> do you say you concatenate integers ?
<def`> ggole: you can trust the implementation but not the implementor… that's not really helpful :P
<Drup> do you concatenate trees ?
<whitequark> I don't think we need Concat implementation for integers ;P
<whitequark> + is enough
<def`> Drup: as in type nat = unit list :D ?
<Drup> def`: psss, don't say anything !
<whitequark> Drup: hm, and how would you define Monoid for trees?
<dmbaturin> 10 `concat` 4 = 104 ;)
<Drup> whitequark: binary trees, you "concat" by creating a node with two subtrees
<whitequark> ok
<whitequark> then I definitely say it is just concatenation
<def`> dmbaturin: wrong channel :)
<def`> Drup: your definition of trees concatenantion doesn't look associative !
<Drup> hum, that's right
<def`> /kickbankick
<Drup> (there is even en haskell blog post about that)
<dmbaturin> There's a special name for non-associative algebraic structure. Magma or something.
<Drup> (which was actually interesting)
<Drup> yes, magma
<whitequark> "magma" ?
<Drup> whitequark: the same as monoid, but you don't require associativity
<dmbaturin> Disclaimer: I'm exactly an abstract algebra fan, not category theory fan. :)
<def`> and no unit
<Drup> dmbaturin: same here
<Drup> group theory is fun
<whitequark> huh, the term was invented by Bourbaki!
<whitequark> I wonder what were they thinking
<dmbaturin> Fields and field extensions are fun too.
<Drup> they were french, you can't tell.
<def`> Monoid are helpful and pervasives in software, it makes sense to keep the notion. Magma is too specific (or general, depending on your point of view)
<Drup> I agree with def`
<Drup> and anyway, you don't usually enforce the commutativity in the monoid typeclass (because you can't without proof insertions)
WraithM has quit [Ping timeout: 260 seconds]
<def`> Monoid doesn't require commutativity
<Drup> associativity*
<asmanur> Drup: a magma does not have an identity (it is just a set and a binary operation)
<Drup> sorry
<def`> asmanur: 21:29 < def`> and no unit
<def`> :p
<asmanur> ah damn
<Drup> asmanur: slow poke :p
<asmanur> but i'm looking at bourbaki "algebra 1 & 3" right now so it still counts
<def`> :)
<Drup> whitequark: about your remark on + being part of Num and not lists
<Drup> If you were listening to me, you would have Monoid (with +), Group (with -), Ring (with *) and Field = Num, (with /)
<Drup> and everyone would hate it, obviously
<Drup> but I would be happy x)
<whitequark> open DrupPervasives.EveryoneHatesHim
<Drup> (and + would work on lists)
<whitequark> Drup: I understand the sentiment
<def`> coding is neither about writing mathematics nor litterature. having a small alphabet with unambiguous interpretation is much more important
Kakadu has joined #ocaml
<Drup> Sure
<def`> (as the main audience of code is dumb and unforgiving)
<Drup> I still find that the reason "software engineers hate math" is saddening :(
<Drup> It's a good reason, but not a nice one
<whitequark> Drup: everyone hates math
<whitequark> because instead of teaching math, our schools just instill fear with an incredibly warped version of it
<whitequark> which has literally zero intersection with real math
<def`> [that must explain most backtraces I saw today]
<bjorkintosh> Drup, it's because the ONLY persistent slogan in software engineering is "Worse is better".
<bjorkintosh> math is not worse.
<bjorkintosh> so it's bad.
<Drup> bjorkintosh: <3
<bjorkintosh> whitequark, why ruin things for the mathematicians? they like what they do and don't want to share.
<Drup> whitequark: at least, that is something that is true regardless of the nation
<def`> whitequark: our schools do a similar job here
<Drup> math teaching is bad.
<whitequark> Drup: not quite.
<whitequark> I am saying that it was bad in RU based on my experience
<whitequark> but after asking how are things in USA, I see that in RU it is actually fucking awesome
<dmbaturin> whitequark: Read Arnold's papers about french math education.
<whitequark> in comparison
<def`> dmbaturin: do you have a link?
<dmbaturin> He was afraid .ru is going to be the same soon (he was wrong, it's even worse now).
<dmbaturin> asmanur: Yeah, looks like it. I read it in russian though.
<Drup> " Mathematics is the part of physics where experiments are cheap. " https://xkcd.com/435/
<Drup> the link was needed.
<asmanur> haha he clashes the ENS
<def`> "weak need gangs in order to survive" :D
troutwine_away is now known as troutwine
<Drup> Note that this outdated
<Drup> it's still bad, but in a completely different way.
nlucaroni has joined #ocaml
<Drup> and anyway, this treat of quite advanced math teaching already (ENS ...). This is not really where the problem is.
<dmbaturin> Drup: How bad is it now?
mcclurmc has joined #ocaml
<Drup> well, the problem is in highschool and beginning of university
<bjorkintosh> it is?
<bjorkintosh> it begins earlier.
<bjorkintosh> too much rote is taught.
<whitequark> indeed
<bjorkintosh> so that by highschool, there's no foundation for the other stuff.
<bjorkintosh> except, more rote.
<Drup> bjorkintosh: I agree, but I'm not competent for smaller kid teaching :)
<bjorkintosh> and then it moves on to a calculus sequence...
<whitequark> math should be taught as the art of reasoning, not the craft of manipulating numbers
<bjorkintosh> which supports MOAR rote!
<mrvn> bjorkintosh: that's what you get for multiple choice standardized exams
<whitequark> fuck standardized exams
<bjorkintosh> mrvn, well. it's cheaper that way :)
<dmbaturin> Arnold wrote on school math too, but I'm not sure if a translation exists.
<whitequark> just burn the whole system entirely and forget it ever existed
<Drup> whitequark: there is a thing called "prepa" in france, and the first thing the math teacher do, in these classes, is to start back from the very basic stuff. They have to do that because they can't rely on highschool math teaching :/
<whitequark> define "very basic" ?
<asmanur> basic set theory / logic
<whitequark> "basic" like addition? or "basic" like "trivial calculus"?
<Drup> what asmanur said
<asmanur> whitequark: they basically do a bourbaki
<asmanur> they start over from scratch, and prove everything from the bottom up
<dmbaturin> asmanur: Do they give kids Bourbaki's definition of 1? :)
<Drup> boolean logic, set theory, building the various number set (N, Z, Q, R) one on top of the other
<asmanur> dmbaturin: I don't know but we do see Peano's arithmetic
<whitequark> asmanur: that's pretty awesome
<Drup> dmbaturin: it's less crazy abstract than bourbaki's
<asmanur> less modular
<Drup> I heard university teacher were complaining too, because they changed highschool math program and it's even more poor than before
<asmanur> the real problem with bourbaki writing style is that it's too modular
<dmbaturin> Bourbaki's book on the history of math is pretty cool, by the way.
<nlucaroni> This article was really interesting on the history of how math is taught in the US and Japan. http://www.nytimes.com/2014/07/27/magazine/why-do-americans-stink-at-math.html
<dmbaturin> I want that calculator.
<dmbaturin> Even if I'm unable to figure out how the finite field it works with is organized.
<whitequark> you could call it "a war on education" *ducks*
<bjorkintosh> whitequark, if there are too many smart people in 'murrca, not enough would take the nonsense quietly.
<bjorkintosh> you want a dumb population, if control is your goal.
<Drup> bjorkintosh: duh, don't break the american dream.
<bjorkintosh> yes. quiet.
<bjorkintosh> people are sleeping.
<Drup> (not in the USA timezones)
koderok has quit [Ping timeout: 240 seconds]
<dmbaturin> On a side note, this probably can be used as math equivalent of fizzbuzz problem: http://www.riskliteracy.org/
oriba has joined #ocaml
samrat has joined #ocaml
dsheets has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
thomasga has joined #ocaml
<def`> dmbaturin: I tried your website, the french version…
<def`> "Cela signifie que vous avez alphabétisation relativement élevé de risque"
<def`> I guess it's humor, and quite a good one :)
<dmbaturin> Hhm, I don't speak french.
<def`> "It means you have alphabetisation relatively high of risk"
<def`> Hard to translate as the error is in the translation, but the almost got the correct set of words but put them in the wrong order…
hhugo has joined #ocaml
<def`> Which is funny in a sentence making assertion on alphabetisation.
<dmbaturin> By the way, how do the french pronounce acronyms? Specifically, how INRIA is pronounced?
<def`> It depends on the acronym (actually we make the distinction between "acronyme" and "sigle"… the former being mechanically derived from a list of words, the latter being closer to a brand)
_andre has quit [Quit: leaving]
Thooms has joined #ocaml
<def`> But for Inria you can pronounce it as if it was a word.
<dorei> I want to start playing with ocaml, but so far I've failed installing lwt/utop :(
<Drup> dorei: are you using opam ?
<Drup> dmbaturin: https://translate.google.com/#fr/en/INRIA the french pronunciation from google is correct.
<dmbaturin> dorei: The default top level is mostly usable, although not quite handy.
<dorei> Drup: yeap, but conf-libev fails to find my libev :(
<dmbaturin> Drup: That's what I thought.
<Drup> dorei: that's strange
ggole has quit []
travisbrady has quit [Quit: travisbrady]
* whitequark has got perfect score on that riskliteracy.org thing
<whitequark> to be honest, my trouble with statstics is that there are no sources for most of interesting decisions
<whitequark> try solving "should I go to college" with statistics.
yomimono has joined #ocaml
<dmbaturin> whitequark: Convince a reasonably large number of people to go to college, wait 10 years, collect data.
<whitequark> but the circumstances are rapidly changing themselves
<whitequark> and the outcome for 30-year-old me is different from 20-year-old test group
<pjdelport> whitequark: Is that supposed to have just the two basic questions?
<def`> well in France, on average going to college is a good decision, because it's not a big investment
<whitequark> pjdelport: (that) what?
<whitequark> def`: yes, merely six years of your life
<pjdelport> whitequark: that riskliteracy.org thing
<def`> whitequark: you don't have to attend:)
<whitequark> def`: HAHAHA
<whitequark> pjdelport: it's four questions, but, yes
<Drup> pjdelport: it was 2 questions for me
<whitequark> it doesn't even cover Bayes theorem
<whitequark> which is what I always have to doublecheck
<Drup> it's a fizzbuzz equivalent, why would you cover Bayes theorem
<pjdelport> Odd; i also just got the two questions. (the town choir, and the loaded die question)
<Drup> pjdelport: same
ollehar has quit [Ping timeout: 272 seconds]
<whitequark> pjdelport: town choir, loaded die, poisonous mushrooms
shinnya has quit [Ping timeout: 255 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
<whitequark> okay, maybe it was three
<Drup> def`: I have my own opinion on the whole "let's go to college, but don't actually attend to it"
<whitequark> def`: do they not check attendance in FR?
<Drup> def`: especially when it's followed by "and suck at my exam, because it was not that easy that what I though"
<Drup> whitequark: not in university
<whitequark> I think it used to be that way in RU, but now they watch it closely
<whitequark> which is quite annoying
<def`> whitequark: depends, you have to choose carefully
<dmbaturin> Drup: Are you a college professor? What exactly do you teach?
<def`> Drup: and what is your opinion? :)
<Drup> def`: that student should attend to classes, and that if they don't, it means classes suck pretty hard
<Drup> dmbaturin: no, just out of it (as a student)
<dmbaturin> Ah, I thought you are talking about students who fail your class.
shinnya has joined #ocaml
<Drup> no, just a pattern I have seen repeated enough.
travisbrady has joined #ocaml
ia0 has quit [Quit: leaving]
mcclurmc has joined #ocaml
ia0 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
Muzer has quit [Excess Flood]
elfring has quit [Quit: Konversation terminated!]
Muzer has joined #ocaml
mcclurmc has joined #ocaml
nlucaroni has quit [Quit: leaving]
philtor_ has quit [Ping timeout: 260 seconds]
jprakash has quit [Ping timeout: 240 seconds]
parcs has quit [Quit: WeeChat 0.4.3]
parcs_ has joined #ocaml
enquora has joined #ocaml
jao has quit [Ping timeout: 250 seconds]
travisbrady has quit [Quit: travisbrady]
enquora has quit [Remote host closed the connection]
enquora has joined #ocaml
thomasga has quit [Quit: Leaving.]
Simn has quit [Quit: Leaving]
iorivur has quit [Ping timeout: 272 seconds]
thomasga has joined #ocaml
iorivur has joined #ocaml
iorivur has quit [Ping timeout: 260 seconds]
joncfoo has joined #ocaml
hhugo has quit [Quit: Leaving.]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
iorivur has joined #ocaml
shinnya has quit [Quit: ZNC - http://znc.in]
jprakash has joined #ocaml
WraithM has joined #ocaml
Submarine has quit [Remote host closed the connection]
hhugo has joined #ocaml
travisbrady has joined #ocaml
eikke__ has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
dsheets has quit [Ping timeout: 255 seconds]
thomasga has quit [Quit: Leaving.]
hhugo has quit [Quit: Leaving.]
racycle has quit [Quit: ZZZzzz…]
rand000 has quit [Quit: leaving]
Kakadu has quit [Quit: Konversation terminated!]
travisbrady has quit [Quit: travisbrady]
maattdd has joined #ocaml
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
oriba has quit [Quit: oriba]
iorivur has quit [Ping timeout: 260 seconds]
tobiasBora has quit [Ping timeout: 245 seconds]
englishm has quit [Ping timeout: 245 seconds]
philtor_ has joined #ocaml
q66_ has joined #ocaml
avsm has joined #ocaml
q66 has quit [Ping timeout: 260 seconds]
cody__ has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
Thooms has quit [Quit: WeeChat 0.4.3]
joncfoo has quit [Ping timeout: 255 seconds]
gperetin has quit [Ping timeout: 260 seconds]
esden has quit [Ping timeout: 260 seconds]
hhugo has joined #ocaml
gperetin has joined #ocaml
eikke__ has quit [Ping timeout: 260 seconds]
yomimono has quit [Ping timeout: 255 seconds]
esden has joined #ocaml
eikke__ has joined #ocaml
darkf has joined #ocaml
claudiuc_ has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
madroach has quit [Ping timeout: 250 seconds]
claudiuc has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
lgm has joined #ocaml
<lgm> hello!
<lgm> Does anyone here know where dumpobj is installed on Mac OS X (mavericks) when using mac ports?
NoNNaN has quit [Remote host closed the connection]
<Drup> No, but ... it's not really an ocaml thingy, you know
<Drup> (at least not afaik)
NoNNaN has joined #ocaml
<troutwine> lgm: Somewhere in /opt/local, usually. The contents sub-command of port should tell you.
<lgm> @troutwine yeah, i went looking there.
philtor_ has quit [Ping timeout: 246 seconds]
eikke__ has quit [Ping timeout: 255 seconds]
philtor_ has joined #ocaml
iorivur has joined #ocaml
philtor_ has quit [Ping timeout: 260 seconds]