adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jwatzman|work has quit [Quit: jwatzman|work]
Haudegen has joined #ocaml
eikke has quit [Ping timeout: 244 seconds]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mcclurmc has joined #ocaml
grouzen has quit [Ping timeout: 246 seconds]
keen__________18 has joined #ocaml
keen__________17 has quit [Ping timeout: 256 seconds]
micrypt has left #ocaml ["."]
obadz- has quit [Ping timeout: 244 seconds]
ollehar1 has joined #ocaml
ollehar has quit [Ping timeout: 268 seconds]
ollehar1 is now known as ollehar
jao has joined #ocaml
rgrinberg has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 244 seconds]
psy_ has quit [Ping timeout: 246 seconds]
MrScout has joined #ocaml
fluter has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
ril is now known as ril[away]
ril[away] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ollehar has quit [Quit: ollehar]
jao has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Ping timeout: 268 seconds]
mac10688 has quit [Ping timeout: 255 seconds]
kushal has quit [Quit: Leaving]
rgrinberg has joined #ocaml
<IbnFirnas> mfp: are you sure you weren't looking at the 'orddict' module (which is just an association list)?
mcclurmc has joined #ocaml
<IbnFirnas> mfp: companion_cube: erlang's 'dict' module, in the stdlib, implements a hash table
darkf has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
mcclurmc has quit [Remote host closed the connection]
MrScout has quit [Ping timeout: 244 seconds]
mcclurmc has joined #ocaml
johnf__ has joined #ocaml
mcclurmc has quit [Ping timeout: 268 seconds]
ontologiae has joined #ocaml
AltGr has joined #ocaml
MrScout has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
ontologiae has quit [Ping timeout: 265 seconds]
rgrinberg has quit [Ping timeout: 244 seconds]
RichN has quit [Ping timeout: 256 seconds]
RichN has joined #ocaml
MercurialAlchemi has joined #ocaml
MrScout has quit [Ping timeout: 246 seconds]
chris2 has quit [Ping timeout: 252 seconds]
ygrek_ has joined #ocaml
fluter has quit [Ping timeout: 246 seconds]
fluter has joined #ocaml
chris2 has joined #ocaml
f[x] has joined #ocaml
ygrek_ has quit [Ping timeout: 250 seconds]
fluter has quit [Quit: WeeChat 1.2]
ygrek_ has joined #ocaml
fluter has joined #ocaml
ggole has joined #ocaml
f[x] has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
johnf__ has quit [Read error: Connection reset by peer]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
ygrek_ has quit [Ping timeout: 252 seconds]
native_killer has joined #ocaml
Ben4738 has joined #ocaml
Ben4738 has left #ocaml [#ocaml]
xet7_ has quit [Remote host closed the connection]
xet7_ has joined #ocaml
grouzen has joined #ocaml
fluter has quit [Quit: WeeChat 1.2]
fluter has joined #ocaml
zpe has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 272 seconds]
monod has joined #ocaml
frankier has joined #ocaml
cdidd has quit [Ping timeout: 250 seconds]
damason has quit [Remote host closed the connection]
monod has quit [Quit: Sto andando via]
<frankier> Hi all, I'm trying to get Syntastic to highlight Ocaml type errors in vim. The way I'm building my projects is with a Makefile calling corebuild with a bunch of libraries passed to `-pkg`. I then have build: make in my opam file and pin the package which seems to work. The current Syntastic checker: https://github.com/scrooloose/syntastic/blob/master/syntax_checkers/ocaml/camlp4o.vim doesn't seem to deal with packages beyond Jane St
<frankier> core at all. My question is twofold: is there a way to do `opam build` for the current directory assuming it's pinned? If so this could be a drop in replacement for ocamlbuild in this syntastic checker. If not what's the best/quickest way to get the value of build from the opam file? I was about to start messing around with sed/vim regexp but maybe there's an easier way?
<frankier> Total Ocaml noob so excuse me if I'm going about things in a particularly odd/unusual way.
cdidd has joined #ocaml
cdidd has quit [Ping timeout: 246 seconds]
<companion_cube> frankier: I assume you read real world OCaml
<companion_cube> you should give a try to merlin
<companion_cube> it's awesome
Haudegen has quit [Ping timeout: 255 seconds]
Kakadu has joined #ocaml
Simn has joined #ocaml
cdidd has joined #ocaml
<frankier> Oh - I see. Merlin actually has some kind of Syntastic integration
<frankier> Neat
Grezeh has joined #ocaml
<frankier> Shame it's a bit awkward to install
cdidd has quit [Ping timeout: 260 seconds]
<frankier> Ah, it can be installed by opam
<frankier> Much better
ollehar has joined #ocaml
Haudegen has joined #ocaml
Grezeh has quit [Quit: Grezeh]
whirm has joined #ocaml
<companion_cube> yeah, opam install merlin, a bit of conf, and that's it
whirm has quit [Client Quit]
<frankier> Okay, very nice now. I don't really like that the required packages have to be specified in 3 places (Makefile, opam, .merlin) - is there a normal way to cut down on that? but apart from that pretty smooth
ollehar has quit [Ping timeout: 260 seconds]
<companion_cube> I don't like it either
<companion_cube> but still, merlin is awesome
cdidd has joined #ocaml
<hannes> frankier: companion_cube: certainly some people want to solve this.. https://github.com/samoht/assemblage but that's not ready yet..
<frankier> Oh nice. Yeah I guess I'll hold off since I've actually finally got something working now, but nice to have it on my radar
lobo has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
ollehar has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
<companion_cube> anyone has slides for presenting OCaml to users of other languages?
Haudegen has joined #ocaml
t4nk584 has joined #ocaml
<apache2> type mystring = string
<apache2> class test =
<apache2> method getstring = mystring
<apache2> <-- is that only a "getter", or can I set it as a mutable field?
<mrvn> how should a method be a type?
Haudegen has quit [Ping timeout: 272 seconds]
<apache2> ah sorry, it's value
<mrvn> you can have a method setstring
Pepe_ has quit [Ping timeout: 240 seconds]
<apache2> class myclass = let mystring = "hey" in object(self) method getstring = mystring end
<ollehar> companion_cube: what other language? it should matter.
t4nk584 has quit [Ping timeout: 246 seconds]
<apache2> can I extend that class to be able to modify the value returned by mystring, mrvn?
<companion_cube> java, mostly
<mrvn> apache2: then mystring isn't even part of the object, only bound to it
<companion_cube> it will be informal, maybe I'll just show the examples on ocaml.org and comment them
Pepe_ has joined #ocaml
<mrvn> apache2: class foo : object val bar : int end
<apache2> I guess I can override getstring and make a setstring and have them both return the value of a mutable field?
<mrvn> apache2: but that can only be used internally, not from extern. you need getter/setter.
<apache2> that's fine, thank you
<apache2> I need a "!" after "method" to override, right?
<mrvn> apache2: do you want the contents of the string to be mutable (i.e. bytes) or replace the string itself?
<apache2> I want to replace the string
<mrvn> so # class foo = object val mutable mystring = "" end;;
<mrvn> and then add a setter
<apache2> thank you
<apache2> and the syntax for the setter would be something like: method set_mystring s = self#mystring <- s
<apache2> ?
<mrvn> something like that
<mrvn> But I think you have to do that in the original class. I don't think you can override that properly.
<apache2> yeah hm fuck
Haudegen has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
AltGr has left #ocaml [#ocaml]
kushal has joined #ocaml
mcclurmc has joined #ocaml
mal`` has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mac10688 has joined #ocaml
ontologiae has joined #ocaml
kushal has quit [Ping timeout: 268 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
BitPuffin|osx has joined #ocaml
native_killer has quit [Quit: Leaving]
mal`` has joined #ocaml
mac10688 has quit [Read error: Connection reset by peer]
Simn has quit [Read error: Connection reset by peer]
psy_ has joined #ocaml
Haudegen has joined #ocaml
tnguyen has quit [Read error: Connection reset by peer]
tnguyen has joined #ocaml
larhat1 has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
<ollehar> companion_cube: hm, I think I wrote a blog post called "From Java to OCaml". I think it's shit.
psy_ has quit [Ping timeout: 256 seconds]
<ollehar> mention the principle differences, like type-inference, row-polymorphic objects, functors, pattern-matching.
<companion_cube> heh
<ollehar> I would prefer a top-down learning material.
<ollehar> personally
<companion_cube> it's only for a presentation, not a full lecture :)
<companion_cube> they'll be more sold on scala anyway
<ollehar> scala... too complex ><
<ollehar> well, if they know about scala you could mention some differences between scala and ocaml.
<companion_cube> sure
<ollehar> also, why not post it on r/ocaml when done? would be nice to read :)
<mrvn> And mention that ocaml can't have null pointer exceptions
Rebelion has joined #ocaml
<ggole> fst (Obj.magic 0) says you're wrong
<companion_cube> tss
<ollehar> Not_found
huza has joined #ocaml
snyp has joined #ocaml
frankier has quit [Ping timeout: 244 seconds]
ollehar has quit [Ping timeout: 260 seconds]
<apache2> "Obj.magic" ? :P
rgrinberg has joined #ocaml
<mrvn> ggole: I excluded willfull destruction
huza has quit [Quit: WeeChat 0.3.8]
<mrvn> apache2: Obj.magic tells the type checker to believe you no matter what the type inference thinks.
<companion_cube> Obj.magic isn't really part of OCaml, it's a black magic function for compiler wizards
<mrvn> by the way why does "fst (Obj.magic 0)" segafult? # ((Obj.magic []):int);;
<mrvn> - : int = 0
<mrvn> [] is encoded internally as 0
<companion_cube> because fst expects a tuple, which is a 2-words block
<companion_cube> so it dereferences its argument
<mrvn> ahh, I was thinking List.*
<ggole> Yeah, it was a cheap laugh rather than a serious comment
LnL has joined #ocaml
<ggole> Of course there's also unsafe array accesses
ousado has quit [Remote host closed the connection]
lobo has quit [Quit: leaving]
tmtwd has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
ousado has joined #ocaml
<apache2> mrvn: yes, I know
<apache2> but it doesn't really count as part of the language
<apache2> that's like claiming that java has unmanaged memory allocations [through the use of C bindings]
<mrvn> exactly
<apache2> :D
<apache2> I'm glad we all agree that was a joke!!
<mrvn> Anyone know of a webservice to generate a perfect hash function for known input?
kalzz has quit [Ping timeout: 244 seconds]
<ggole> There's a GNU library for that iirc
<companion_cube> gperf, right?
<ggole> Uh, gperf
<ggole> Right
<mrvn> gperf seems to generate a hash char* -> int. I need int->int
<companion_cube> oh
<companion_cube> well you can encode an int in a char[8]
<mrvn> well, actually I need "tic-tac-toe board" -> int. But my internal representation of the board is uint32_t.
frankier has joined #ocaml
kalzz has joined #ocaml
<companion_cube> are you trying to write the most efficient tic-tac-toe ever? :_
<companion_cube> :)
<boegel> happy birthday!
<mrvn> trying to get all the data for teh AI into 2k ram (including the stack and other variables)
Haudegen has joined #ocaml
<companion_cube> mrvn: what for, if you can talk about it? :)
<mrvn> playing tic-tac-toe
<companion_cube> and your machine only has 2k of ram? :D
deavid has quit [Ping timeout: 260 seconds]
jun has quit [Ping timeout: 264 seconds]
<mrvn> companion_cube: Yep. Arduino Nano. (ATMega 328p)
<apache2> can't you just bitmask?
<apache2> 9 fields, three possible states, a "naive" bitmap would be 18 bit
<mrvn> apache2: too big.
<mrvn> I need one bit per reachable board position. Thats 764 boards. Without compacting those 18 bit a bitmap would use too much ram.
shinnya has joined #ocaml
<companion_cube> and would a sorted array be too slow?
<mrvn> companion_cube: that would require saving the board itself, meaning 19 bit per board. round up to 24 and you get 2292 byte for the array.
<companion_cube> heh :D
<apache2> why round up?
<companion_cube> alignment?
<mrvn> yep
<apache2> can't you just mask and combine?
<mrvn> That's still 1814 byte and I need some other vars and stack too.
deavid has joined #ocaml
ollehar has joined #ocaml
<apache2> hmm
<apache2> mrvn: 3**9 = 19683 possible configurations. so that fits in 15 bits (with 13085 excess configurations)
<apache2> not all those configurations are legal though (max 3 x, max 3 o)
<mrvn> apache2: which would need 4096 byte for a bitmap
<apache2> how about making a tree structure?
<mrvn> apache2: that would need 764 16bit pointers
<apache2> 15bits x 764 would need 1433 byts
<apache2> do you need them all at once?
<mrvn> apache2: 16 bits with the data bit. thats 1528 byte. Maybe possibly but verry tight.
<mrvn> apache2: they are the memory of the AI so probably most of them
<mrvn> If I use "a mod x" then the smallest x that makes a perfect hash is 11963. :(
<companion_cube> do you have to store that many things in memory? can't you replace some memory with computations?
<mrvn> companion_cube: no. then I wouldn't have a learning AI but a perfect tic-tac-toe player. Which would be boring.
<apache2> :D
<companion_cube> oh, learning on an arduino
<companion_cube> good luck!
<bernardofpc> there's a reason a human brain has more bits than that ;-)
<mrvn> Hah. I tried encoding each field as 2 bits because then the math is simpler. But when I use a base 3 system I get "a % 7786" as perfect hash function. That 974 bytes for a bitfield. That should do.
genkito has joined #ocaml
genkito has quit [Client Quit]
Haudegen has quit [Ping timeout: 268 seconds]
<mrvn> I wonder how dumb I should make the AI initially. Should it complete 2 Os in a row when it can or should it learn that? Should it block 2 Xs in a row or learn that?
Haudegen has joined #ocaml
ontologiae has quit [Ping timeout: 250 seconds]
johnf__ has joined #ocaml
lobo has joined #ocaml
Guest38 has joined #ocaml
Guest38 has quit [Quit: Textual IRC Client: www.textualapp.com]
snyp has quit [Quit: WeeChat 1.3]
larhat1 has quit [Quit: Leaving.]
teiresias has quit [Ping timeout: 260 seconds]
teiresias has joined #ocaml
jun has joined #ocaml
obadz- has joined #ocaml
JuggleTux has joined #ocaml
Kakadu has quit [Quit: Page closed]
funk has joined #ocaml
<funk> Hi. best way to get wxocaml on ubuntu >= 14.04? tried that ocamlpro stuff but didnt get ocp-build to run
<funk> is that project still alive?
darkf has quit [Quit: Leaving]
johnf__ has quit [Read error: Connection reset by peer]
tane has quit [Quit: Verlassend]
psy_ has joined #ocaml
Algebr has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
MercurialAlchemi has joined #ocaml
obadz- has quit [Ping timeout: 255 seconds]
Kakadu has joined #ocaml
Lis has joined #ocaml
Haudegen has joined #ocaml
malc_ has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 244 seconds]
rgrinberg has quit [Ping timeout: 244 seconds]
mac10688 has joined #ocaml
ril has joined #ocaml
Algebr has quit [Ping timeout: 250 seconds]
shinnya has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
johnf__ has joined #ocaml
psy_ has quit [Ping timeout: 268 seconds]
malc_ has quit [Quit: leaving]
Algebr has joined #ocaml
johnf__ has quit [Read error: Connection reset by peer]
ollehar has quit [Quit: ollehar]
<apache2> does anyone have a guide to getting the ocaml extensions to work in vim?
<apache2> my friend had something that displayed type annotations next to identifiers; that seemed extremely useful
<Maelan> Which extension are you trying to use apache2 ?
<Drup> apache2: that just sounds like merlin
<apache2> ah, thank you
tane has joined #ocaml
ggole has quit []
shinnya has joined #ocaml
fds has quit [Remote host closed the connection]
Algebr has quit [Ping timeout: 240 seconds]
obadz- has joined #ocaml
ril is now known as ril[away]
ril[away] is now known as ril
igoroliveira has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
grouzen has quit [Ping timeout: 264 seconds]
ygrek_ has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
ygrek_ has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
raj1 has joined #ocaml
frankier has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
LnL has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
MercurialAlchemi has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
obadz- has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Verlassend]
Dzyan has joined #ocaml
Rebelion has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
lobo has quit [Ping timeout: 250 seconds]
MercurialAlchemi has quit [Ping timeout: 246 seconds]
rajk has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
Guest21325 is now known as johnelse
Haudegen has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
MrScout has joined #ocaml
Kakadu has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
johnf__ has joined #ocaml
BitPuffin|osx has joined #ocaml
larhat1 has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml