ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
mcclurmc has quit [Remote host closed the connection]
<Tekk_> is there any sort of debug flag for the typechecker?
<Tekk_> like "you had a type error, I was expecting type foo. I inferred that this is type foo because of x"
BitPuffin has quit [Ping timeout: 255 seconds]
IbnFirnas has joined #ocaml
<Drup> No
<Tekk_> okay
<Drup> but there is a switch with improved error messages
pippijn has quit [Read error: Connection reset by peer]
<Tekk_> oh?
pippijn has joined #ocaml
<Drup> +improved-errors
pippijn has quit [Remote host closed the connection]
* Tekk_ wonders why it doesn't have improved-errors on by default..
pippijn has joined #ocaml
<Drup> because the patch has not been merged yet
<Tekk_> ah
<Tekk_> well
<Tekk_> I don't think it'd help here, the message is pretty straightforward
rgrinberg has quit [Quit: Leaving.]
yminsky has joined #ocaml
rgrinberg has joined #ocaml
AltGr has joined #ocaml
keen__________43 has joined #ocaml
mcclurmc has joined #ocaml
keen__________42 has quit [Ping timeout: 265 seconds]
jcloud has joined #ocaml
rand000 has quit [Quit: leaving]
osa1_ has quit [Ping timeout: 245 seconds]
osa1_ has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
Simn has quit [Quit: Leaving]
yminsky has quit [Quit: yminsky]
smtb has joined #ocaml
yminsky has joined #ocaml
<smtb> Hey are you yminsky from JS?
smtb has quit [Client Quit]
<AltGr> Hi there
<AltGr> Vim guru requested!
<AltGr> I attempted to put together some generic vim config for ocp-inde*,merlin etc. at https://github.com/OCamlPro/opam-user-setup/issues/5
rgrinberg has joined #ocaml
zwer_c_w is now known as zwer
enitiz has joined #ocaml
<avsm> Altgr: if you mail ill try tmrow
<avsm> zz now
<AltGr> 'night!
<AltGr> thanks
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
PamExx has joined #ocaml
<yminsky> smtb: yes.
cta_ has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
lordkryss has quit [Quit: Connection closed for inactivity]
<cta_> hi can someone help me understand a simple syntax error? https://gist.github.com/anonymous/d16ffaa1eae590ca9592
avsm has quit [Quit: Leaving.]
ivan\ has quit [Read error: Connection reset by peer]
<cta_> it's a test file, the function at first is irrelevant, im getting a syntax error on "with" in the small try with statement
ivan\ has joined #ocaml
<yminsky> The let binding inside the “with” statement is the problem.
<yminsky> Try this.
<yminsky> let value =
<yminsky> try Hashtbl.find myhash "h"
<yminsky> with Not_found -> Hashtbl.add myhash "h" []; []
<yminsky> ;;
<pippijn> what's the latest hotness for monads?
<pippijn> I'm starting a new project with async, and while I'm not too unhappy about >>=, if there is some pretty syntax these days, I might want to use it
jwatzman|work has joined #ocaml
<cta_> ahh, thank you yminsky. that indeed worked
<yminsky> cta_: Using Core, there’s an even nicer idiom for this.
<yminsky> open Core.Std
<yminsky> let myhash = Hashtbl.Poly.create ();;
<yminsky> let value = Hashtbl.find_or_add myhash "h" ~default:(fun () -> [])
PamExx has quit [Quit: Page closed]
<cta_> that would be much better; unfortunately I don't think I'm allowed to use Core for the assignment I'm working on :(
<cta_> if im correct in thinking it isn't really part of the standard library
<yminsky> It is not.
BitPuffin has joined #ocaml
reem has joined #ocaml
<pippijn> is there a simple recvfrom in async or do I need to use mutable data in the Udp loop?
IbnFirnas has quit [Read error: Connection reset by peer]
yminsky has quit [Quit: yminsky]
<flhs> Question: "type +'a t", what's the "+"?
<smondet> flhs: variance annotation
<smondet> (explained there for example: https://realworldocaml.org/v1/en/html/objects.html)
jao has quit [Ping timeout: 245 seconds]
<flhs> smondet: thanks!
jwatzman|work has quit [Quit: jwatzman|work]
laalko has left #ocaml ["Leaving"]
pyon is now known as pyon-k
yminsky has joined #ocaml
mattrepl has joined #ocaml
<yminsky> recvfrom_loop is I think the recommended form.
<pippijn> and then mutate some state outside?
<yminsky> You can easily write to a Pipe
shinnya has quit [Ping timeout: 245 seconds]
<pippijn> that sounds like something I may want
<yminsky> Pipe.write is your friend.
<pippijn> it sounds like something that lets me decouple the program logic from the protocol
<yminsky> Generally speaking, one shouldn’t be too afraid of mutation when doing concurrent programming. Concurrency itself is an effect, after all.
<pippijn> right, but I'm trying to limit it
<pippijn> in C++, I had a no-mutation implementation of this thing I'm now rewriting in ocaml
<yminsky> I can’t quite figure out what “no mutation” means when reading from a socket...
<pippijn> no mutation in the program logic
<pippijn> only in the low level socket code
<yminsky> Sure. But the actual networking is fundamentally imperative. No point in hiding from that.
<pippijn> right
<yminsky> Not just in the low level — the non-determinism is itself an effect.
<yminsky> Creating a pure model of the logic is totally sensible, but you need a non-deterministic (and therefore effectful) engine to tie it together.
<yminsky> (Maybe I’m just beating a dead horse here.)
<yminsky> Anyway, I think the pipe might give you want you’re looking for (even though Pipes are also imperative)
<pippijn> the program state graph is static and deterministic
HauntedC0de has quit [Quit: Leaving]
<pippijn> *which* transition is taken at what time is non-deterministic
<pippijn> it depends on network input
<pippijn> but for any given network input, the program always makes the same transition, given a state
<pippijn> (I'm saying obvious things here)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pippijn> wait for event => event happens => take state + event, produce new state => loop
darkf has joined #ocaml
<yminsky> Sure.
<pippijn> recvfrom_loop's callback returns unit, not unit Deferred.t
<pippijn> so the callback can't do IO?
<cta_> back again... working on parsing a list of dependencies into a hashtbl and am getting an expected type error
<cta_> wish all my classes the past year hadn't just been doing trivial stuff in python... PL is kicking my ass
dmiles_afk has quit [Ping timeout: 245 seconds]
dmiles_afk has joined #ocaml
<cta_> i know that the types of the expr in the try and in the with have to be the same but it's confusing me as to how to fix that
chouser has quit [Ping timeout: 245 seconds]
<yminsky> pippijn: Right, you can’t do any blocking (though you can of course do IO.
<yminsky> pippijn: in particular, you can put something on a pipe, or do a Writer.write. But you can’t return a deferred to the udp loop, because it can’t block.
<pippijn> makes sense
<pippijn> I'm going to be using pipes
claudiuc has quit [Ping timeout: 245 seconds]
destrius has joined #ocaml
<yminsky> pippijn: The thing to remember about deferreds is not that they represent IO, but that they represent non-deterministic blocking.
yminsky has quit [Quit: yminsky]
dmiles has joined #ocaml
dmiles_afk has quit [Ping timeout: 246 seconds]
IbnFirnas has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
keen__________44 has joined #ocaml
keen__________43 has quit [Ping timeout: 244 seconds]
oriba has quit [Quit: oriba]
chouser has joined #ocaml
<cta_> https://gist.github.com/anonymous/f5d2deb59632a8e1e3ba this is giving me a type error when i try to use "lines" as an argument to the function i wrote; can anyone help me understand why it expects a list of lists?
swgillespie has joined #ocaml
<chouser> cta_: what are the key and val types in your hashtable?
<cta_> string and string list
<cta_> i found one error, in line "with Not_found -> Hashtbl.add tbl hd snd; []" is supposed to be with Not_found -> Hashtbl.add tbl snd []; []
chinglish2 has joined #ocaml
<cta_> but i still get "Error: This expression has type string list ref but an expression was expected of type 'a list list" at line 33: parseLines deplists lines;
<cta_> and when i replace lines with [[]] it compiles and runs
<cta_> so it's inferring that the type of l in parseLiens is a list of lists but i can't see why or how to fix it
chinglish2 has quit [Client Quit]
<tcpc> cta_: "let newhdval = hdval @ snd" implies that snd is a list
<tcpc> (and so hd and so you have a list of list)
chinglish2 has joined #ocaml
chinglish has quit [Ping timeout: 276 seconds]
jcloud has quit [Quit: Connection closed for inactivity]
chinglish2 has quit [Client Quit]
<tcpc> you meant "let newhdval = hdval @ [snd]" maybe?
<cta_> ohhhh that is true i forgot about that about append
<cta_> yes i did indeed
<cta_> now the error is Error: This expression has type string list ref but an expression was expected of type 'a list
<cta_> is there a problem with lines being ref?
<tcpc> ye, u forgot a "!"
<tcpc> it's "parseLines deplists !lines;" and not "parseLines deplists lines;"
<cta_> oh!
<tcpc> (coz lines is a ref of list)
<cta_> ahhhh
<cta_> thanks that was very helpful
<tcpc> np
yminsky has joined #ocaml
chinglish has joined #ocaml
enitiz has quit [Quit: Leaving]
enitiz has joined #ocaml
q66 has quit [Quit: Leaving]
segmond has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
ygrek has joined #ocaml
osa1_ has quit [Ping timeout: 245 seconds]
segmond has joined #ocaml
BitPuffin has quit [Ping timeout: 272 seconds]
osa1_ has joined #ocaml
yminsky has quit [Quit: yminsky]
rgrinberg has quit [Quit: Leaving.]
vincom2 has joined #ocaml
rgrinberg has joined #ocaml
ivan\ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
ivan\ has quit [Changing host]
ivan\ has joined #ocaml
jabesed has quit [Ping timeout: 245 seconds]
IbnFirnas has quit [Read error: Connection reset by peer]
<S11001001> struktured: I can't believe sdegutis can tolerate any programming language or tool.
tobiasBora has quit [Quit: Kthxbye]
tobiasBora has joined #ocaml
manizzle has quit [Ping timeout: 240 seconds]
IbnFirnas has joined #ocaml
MrScout has quit [Ping timeout: 245 seconds]
osa1_ has quit [Ping timeout: 245 seconds]
mcclurmc has quit [Remote host closed the connection]
chouser has quit [Ping timeout: 252 seconds]
<rgrinberg> what's the syntax for 64 bit literals in ocaml?
<pippijn> rgrinberg: 123L
<rgrinberg> pippijn: thanks, keep forgetting this @_@
siddhart1v_away is now known as siddharthv
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
manizzle has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
cta_ has quit [Ping timeout: 246 seconds]
enitiz has quit [Quit: Leaving]
psy_ has joined #ocaml
ygrek has joined #ocaml
axiles has quit [Ping timeout: 246 seconds]
BitPuffin has joined #ocaml
BitPuffin has quit [Ping timeout: 276 seconds]
antkong has quit [Quit: antkong]
antkong has joined #ocaml
reem has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
IbnFirnas has quit [Read error: Connection reset by peer]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
ivan\ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
AlexRussia has quit [Ping timeout: 245 seconds]
IbnFirnas has joined #ocaml
dmiles has quit [Ping timeout: 245 seconds]
willy_ has joined #ocaml
wwilly has quit [Ping timeout: 240 seconds]
antkong has quit [Quit: antkong]
mearnsh has quit [Ping timeout: 272 seconds]
mearnsh has joined #ocaml
martintrojer has quit [Ping timeout: 255 seconds]
ygrek has joined #ocaml
martintrojer has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
jneen is now known as jneen|zzz
rgrinberg has quit [Quit: Leaving.]
tane has joined #ocaml
dmiles_afk has joined #ocaml
IbnFirnas has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 245 seconds]
ollehar has joined #ocaml
Haudegen has joined #ocaml
jonludlam has quit [Quit: Coyote finally caught me]
clog has quit [Ping timeout: 276 seconds]
_5kg has quit [Ping timeout: 255 seconds]
octachron has joined #ocaml
larhat has joined #ocaml
<destrius> hi... is anybody using the tuareg mode included in ubuntu 14.04 and having problems with its indentation?
<destrius> it incorrectly indents any operator starting with "|" (except for "||") as part of a pattern match, which gets really irritating when using the pipe operator
ollehar has quit [Quit: ollehar]
<companion_cube> interesting, I have the same problem in vim
IbnFirnas has joined #ocaml
flhs has quit [Ping timeout: 240 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
keen__________44 has quit [Read error: Connection reset by peer]
keen__________44 has joined #ocaml
ingsoc has joined #ocaml
avsm has joined #ocaml
thomasga has joined #ocaml
fraggle-boate has quit [Read error: No route to host]
_5kg has joined #ocaml
dsheets has joined #ocaml
AlexRussia has joined #ocaml
ggole has joined #ocaml
matason has joined #ocaml
lordkryss has joined #ocaml
gargawel_ is now known as gargawel
fraggle-boate has joined #ocaml
fraggle-boate has quit [Read error: No route to host]
ollehar has joined #ocaml
acieroid` is now known as acieroid
Kakadu has joined #ocaml
fraggle-boate has joined #ocaml
<def`> AltGr: I can test it too :)
_5kg has quit [Ping timeout: 272 seconds]
Simn has joined #ocaml
IbnFirnas has quit [Read error: Connection reset by peer]
mort___ has joined #ocaml
skinkitten has joined #ocaml
clog has joined #ocaml
jonludlam has joined #ocaml
willy_ has quit [Read error: Connection reset by peer]
wwilly has joined #ocaml
kapil__ has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
Haudegen has joined #ocaml
badon_ has quit [Remote host closed the connection]
jonludlam has quit [Ping timeout: 276 seconds]
jonludlam has joined #ocaml
badon has joined #ocaml
_5kg has joined #ocaml
IbnFirnas has joined #ocaml
_andre has joined #ocaml
<AltGr> def`: you'd be very welcome
Ptival has joined #ocaml
avsm has quit [Quit: Leaving.]
<rks`_> AltGr: merlin's vim plugin does depend on python
<rks`_> so yes, you could probably distribute the other ocp-ident plugin
<def`> I assume we have to turn it into an opam package?
destrius has quit [Quit: Leaving.]
<def`> (then, which name would you suggest? ocp-indent-vim make it sounds like it is an ocp package)
<rks`_> is there no way to merge it in the actual ocp-ident package?
<rks`_> (with a check that runs it if python is installed, and the other plugin otherwise)
ebzzry has quit [Remote host closed the connection]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 244 seconds]
manu3000 has quit [Ping timeout: 272 seconds]
manu3000 has joined #ocaml
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
IbnFirnas has quit [Read error: Connection reset by peer]
hellofunk has quit [Ping timeout: 256 seconds]
siddharthv is now known as siddharthv_away
ygrek has quit [Ping timeout: 264 seconds]
manizzle has quit [Remote host closed the connection]
hellofunk has joined #ocaml
IbnFirnas has joined #ocaml
hellofunk has quit [Remote host closed the connection]
hellofunk has joined #ocaml
contempt has quit [Ping timeout: 256 seconds]
AlexRussia has quit [Ping timeout: 264 seconds]
contempt has joined #ocaml
<pippijn> interesting, it seems ocaml removes side-effectful code in some cases
enitiz has joined #ocaml
<ggole> Uh, really?
<pippijn> let () = expr; otherexpr
<Drup> since when ocaml removes codes to begin with ?
<pippijn> Drup: 4.02 does that
<pippijn> let () = let () = expr in otherexpr <- this works, the sequence version doesn't
<Drup> I find that hard to believe, so much code would be completely broken with 4.02 it would be obvious
<ingsoc> still messing around trying to get OPAM installed version of ocaml libs recognised in OcalIDE (eclipse plugin). it seems the system install of /usr/lib/ocaml equates to ~/.opam/<version>/lib/ocaml where there is a large list of .ml/.mli files. What i don't understand is how opam version of ocaml knows how to include all subdirs of ~/.opam/<version>/lib/ as places to look for modules. I also don't understand how ~/.opam/<version>/lib/ocaml/
<Drup> pippijn: I can't reproduce
<ingsoc> did that get cut off ? if so where so i can repost :)
<ggole> pippijn: more info? Which version of ocaml?
<Drup> ingsoc: OCalIDE doesn't use ocamlfind ?
<Drup> did you took care of running eval `opam config env` before running ocamlIDE ?
Haudegen has quit [Ping timeout: 264 seconds]
<pippijn> Drup: it was in a specific case
<pippijn> let () = let () = main >>> fun () -> shutdown 0 in never_returns (Scheduler.go ())
<pippijn> works
<pippijn> let () = (main >>> fun () -> shutdown 0); never_returns (Scheduler.go ())
<pippijn> doesn't work
<Drup> what is >>> ?
<pippijn> does it matter?
<pippijn> it's something in async
<pippijn> it's a function
<rks`_> Drup: it's upon, it registers the second argument in the scheduler
<rks`_> then continues
<flux> hmm, those indeed seem like they should behave exactly the same
<ggole> Yeah :|
<flux> does ocaml -dlambda (was it called that..) point to something?
<rks`_> what do you mean by "doesn't work" ?
<ingsoc> Drup: it is a case of me being generally clueless about the tools and the language atm. I googled and found that to get the top level working correctly within the IDE I need to run opam-init if this does the same thing ?
<flux> whatever it means, I think it does mean they behave differently :)
Haudegen has joined #ocaml
<ingsoc> Drup: maybe i will mail the dev
<flux> of course, if it's some thread-related race condition, then small things could have big effects
<Drup> pippijn: did you checked -dlambda/emited code ?
oriba has joined #ocaml
enitiz has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
osa1_ has joined #ocaml
<pippijn> Drup: I'll check when I'm back home
<oriba> how to use Cookies in ocamlnet? I used it this way: let get_call = new get url in ... let cookies = Nethttp.Header.get_cookie (get_call # response_header) in ... and I get an empty list from a page which provides test-cookies.
<oriba> how to do it correctly?
<oriba> (I use Nethttp_client.get)
osa1_ has quit [Quit: Konversation terminated!]
osa1_ has joined #ocaml
yminsky has joined #ocaml
<MercurialAlchemi> Is ocamlnet synchronous?
hellofunk has quit [Ping timeout: 264 seconds]
mort___ has quit [Ping timeout: 265 seconds]
<oriba> not necessarily.
mort___ has joined #ocaml
<MercurialAlchemi> (from the little I've seen I'd rather suggest cohttp)
<oriba> does that affect the answer to my question?
<oriba> cohttp?
<oriba> MercurialAlchemi, cohttp? A library?
yminsky has quit [Quit: yminsky]
jabesed has joined #ocaml
yminsky has joined #ocaml
<ingsoc> is ocamlbuild the way to go to build projects ?
mort___ has quit [Quit: Leaving.]
IbnFirnas has quit [Read error: Connection reset by peer]
hcarty_ has quit [Ping timeout: 264 seconds]
<MercurialAlchemi> oriba: a web-client/server
<oriba> the API looks comparing ly easy, compared to ocamlnet
<MercurialAlchemi> I don't think it does everything ocamlnet does
<MercurialAlchemi> but from the little I've used it, it seemed easy enough to use
hcarty has joined #ocaml
hellofunk has joined #ocaml
AlexRussia has joined #ocaml
Submarine has joined #ocaml
Submarine has joined #ocaml
osa1_ has quit [Ping timeout: 245 seconds]
yomimono has joined #ocaml
mort___ has joined #ocaml
<MercurialAlchemi> ingsoc: I'm an Oasis man
<MercurialAlchemi> (maybe assemblage man one day)
<companion_cube> \o/
bernardofpc has joined #ocaml
Denommus has joined #ocaml
<MercurialAlchemi> assemblage man, this has a certain ring to it
<MercurialAlchemi> like superman, but with a screwdriver and ikea manual on the chest
<Leonidas> fullmetal assemblage man
<flux> ocamlnet is great though. with cohttp you get to use >> and stuff ;) (disclaimer: never used cohttp)
badkins has joined #ocaml
aluuu has joined #ocaml
rz has joined #ocaml
avsm has joined #ocaml
chouser has joined #ocaml
shinnya has joined #ocaml
<oriba> flux, ah, you used ocamlnet? a lot? what about using cookies? My code does not work. I thought it's simple, but I could not make it working
<pippijn> assemblage looks very ocaml-specific
<flux> I don't remember having used cookies with ocamlnet
<oriba> ah, hmhhh
<oriba> but you are fluent with the API?
<flux> can't say I am, it's been some time since I've used it
<oriba> hmhh
<oriba> thats, what I tried: http://pastie.org/9865470
<oriba> maybe you see something there?
<companion_cube> pippijn: I think ocaml is so complicated it can benefit from a build system that is specific to it
<companion_cube> that's what you end up using anyway with ocamlbuild :(
<oriba> I use OCamlMakefile
<pippijn> companion_cube: why is ocaml so complicated?
<oriba> is it?
<pippijn> yes
<companion_cube> well, .ml .mli .cmi .cmo .cmx .cmxa .cmxs .a for starters
<pippijn> .o
<pippijn> .cmt, .cmti, .annot
<companion_cube> also, dependencies, modules, packs, preprocessors, C bindings
<pippijn> companion_cube: I know all about ocaml's complexities
<pippijn> but why?
<companion_cube> oh
<companion_cube> no idea :D
IbnFirnas has joined #ocaml
<companion_cube> I'm not at Gallium, you should ask Xavier or Damien probably
<MercurialAlchemi> when you can't think of a reason, the usual culprit is called "legacy"
<pippijn> (old version.. new version is at home on my laptop)
<pippijn> that's just linking
BitPuffin has joined #ocaml
reem has joined #ocaml
<pippijn> that's compiling, and it's broken
<pippijn> "files x and y disagree on the interface of z"
<oriba> companion_cube, look here, page 202: http://caml.inria.fr/pub/docs/oreilly-book/ocaml-ora-book.pdf
<rks`_> :D
<oriba> for the file-extensions
reem has quit [Remote host closed the connection]
regnat has quit [Ping timeout: 272 seconds]
regnat has joined #ocaml
reem has joined #ocaml
uris77 has joined #ocaml
ygrek has joined #ocaml
reem has quit [Remote host closed the connection]
yminsky has quit [Quit: yminsky]
aluuu has quit [Ping timeout: 264 seconds]
regnat has quit [Ping timeout: 272 seconds]
wwilly has quit [Read error: Connection reset by peer]
bytbox has quit [Remote host closed the connection]
wwilly has joined #ocaml
regnat has joined #ocaml
hellofun` has joined #ocaml
oscar_toro has quit [Ping timeout: 276 seconds]
hellofunk has quit [Ping timeout: 264 seconds]
Thooms has joined #ocaml
osa1_ has joined #ocaml
rgrinberg has joined #ocaml
ingsoc has quit [Quit: Leaving.]
fraggle-boate has quit [Remote host closed the connection]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
fraggle-boate has joined #ocaml
oscar_toro has joined #ocaml
oriba has quit [Quit: oriba]
unix_beard has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 272 seconds]
ebzzry has joined #ocaml
Submarine has quit [Ping timeout: 255 seconds]
rgrinberg has quit [Quit: Leaving.]
Denommus has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
larhat has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
BitPuffin` has joined #ocaml
chinglish has joined #ocaml
rgrinberg has joined #ocaml
BitPuffin has quit [Ping timeout: 245 seconds]
BitPuffin` is now known as BitPuffin
IbnFirnas has quit [Read error: Connection reset by peer]
<ollehar> isn't ocaml just a bunch of ph.d:s on top of each other?
<ollehar> anyway, it's interesting how some complex languages get popular (c++) and some simple ones (c, php)
<companion_cube> I didn't know ocaml was so promiscuous
* adrien_znc picture companion_cube on top of drup on top of nicoo on top of gasche
<adrien_znc> (well, all of them soon)=
<companion_cube> :s
<ollehar> :D
<companion_cube> not yet
<adrien_znc> "soon"
<adrien_znc> but it'll definitely be fun to watch
<Drup> I didn't know C was simple.
<nicoo> ollehar: I didn't knew PHP was simple
<Drup> nor php.
<ollehar> nicoo: only one datastructure: array
<nicoo> ollehar: Can you explain me *simply* what < does, in PHP ?
<adrien_znc> C is simple
<adrien_znc> PHP isn't
<nicoo> ollehar: Nope, PHP doesn't have only arrays
<adrien_znc> you can make a C compiler quickly
<nicoo> adrien_znc: My PhD isn't about OCaml :o\
<nicoo> adrien_znc: Suuuuure. Including the parser ?
<ollehar> C is quite minimal, no? maybe only in my head.
<Drup> probably only in your head, yeah
<Drup> you're not the only one, though
<adrien_znc> nicoo: you could get a phd in biology, you'd still get a phd
<adrien_znc> Drup: nah, C is really a simple language
<nicoo> C has macros, a complicated type-system, a deliriously snafucated memory model and on top of that it has undefined and implementation-defined behaviour
<Drup> adrien_znc: the C semantic is not
<adrien_znc> nicoo: "memory model"? :P
<nicoo> (complicated type-system not as in powerful, but as in "you shall not parse and type separately")
<adrien_znc> Drup: but the C semantic was found 30 years after the language was created
<Drup> and ?
<adrien_znc> it's difficult to say the language was simple for 30 years and then became complicated
<Drup> that doesn't change anything, it's a complete nightmare
<nicoo> adrien_znc: The *formal* C semantics were. The English definition of the language is an informal semantic.
<adrien_znc> yup
<adrien_znc> but the metric I'm using isn't the format semantics
bytbox has joined #ocaml
<adrien_znc> emitting code for C isn't very difficult
<nicoo> I think that “it took 30 years for people to model what the C commitee meant” is a good argument in favor of “C is complicated”
thomasga has joined #ocaml
<Drup> adrien_znc: that's the wrong metric, emitting code for anything as long as you stick to a small reasonable subset
darkf has quit [Quit: Leaving]
<nicoo> adrien_znc: Ah, sure. If by “compiler” you mean something which sometimes manages to parse a program and emit correct code, sure
<nicoo> Writing a correct C compiler, though ...
jneen|zzz is now known as jneen
<nicoo> (and I'm not even talking about an optimizing compiler)
<ollehar> nicoo: what does php have except arrays? (and objects)
<Drup> I like these parenthesis :D
<nicoo> ollehar: http://php.net/manual/en/language.types.php -> the base types (bools, int, floats, strings), arrays, objects, resources, NULL, callables (this includes functions and methods)
<adrien_znc> nicoo: :]
<adrien_znc> oh, btw, you can upgrade your glibc :P
<ollehar> wtf is resources?
<def`> sockets, database handles, etc
<nicoo> ollehar: « A resource is a special variable, holding a reference to an external resource. » -> Don't you feel enlightened
<ollehar> bah
pyon-k has quit [Quit: fix]
companion_cube has quit [Ping timeout: 246 seconds]
<def`> "a resource is a special variable"… the author just put whatever was in is sick mind
<nicoo> def`: The author was probably a PHP coredev ... :>
<def`> "PHP coredev" lol
<nicoo> Drup: Do you still have the nice Hasse diagram for PHP's comparisons functions ?
kapil__ has quit [Quit: Connection closed for inactivity]
osa1_ has quit [Ping timeout: 264 seconds]
<Drup> no
<nicoo> There is https://i.imgur.com/kuWuk.png but it's incomplete (and doesn't show the non-transitivity)
<def`> (the cycles are already a bit scaring :P)
Rebelion has joined #ocaml
bytbox has quit [Ping timeout: 264 seconds]
Thooms has quit [Ping timeout: 252 seconds]
<ollehar> I think you PhDs confuse simple on paper and simple in developers minds
<Drup> the issue is that developers are wrong all the time about what is simple and what is not, and introduces bugs everywhere
<Drup> php and C are perfect examples of that
<ollehar> yeah
pyon has joined #ocaml
<ollehar> but even if the edge cases are complicated, you only have to care about them 1% of the time, no?
<Drup> segfault are totally 1% of the time.
<hcarty> How do I do the equivalent of this with ctypes? "char *foo = NULL; f(&foo); /* foo now points to a string allocated by f */"
<ollehar> manual memory management is not complicated from a language syntax point of view
<ollehar> easy to learn, difficult to master
<ollehar> ""
<Drup> hcarty: use "allocate" on a string, gives the pointer to the C function and then you're good
<def`> memory management in syntax is quite complicated :)
osa1_ has joined #ocaml
<MercurialAlchemi> PHP is an example of the infinite monkey theorem
<Drup> ollehar: """simple""" syntax doesn't make simple language, sorry
<MercurialAlchemi> (you don't seriously imagine infinite monkeys writing Shakespeare)
<Drup> a language goes with a semantic
<def`> (;))
<Drup> you can't separate them
<hcarty> Drup: Is it safe to use "ptr string" for the argument in this case?
<ollehar> so would you say ocaml is more simple than c or php?
<Drup> hcarty: well, it's safe if that's what your function takes
<Drup> ollehar: No, I wouldn't say so
<Drup> less insaine, though
<Drup> insane*
<def`> ollehar: define simple (good luck)
<ollehar> def`: scheme?
<ollehar> brainfuck...
<MercurialAlchemi> brainfuck
<ollehar> :)
<Drup> ollehar: the issue here is that it's not simple to program with.
<ollehar> especially if you use xbox connect as keyboard
<ollehar> jumping around in your room
IbnFirnas has joined #ocaml
<ollehar> "bodyfuck"
<ollehar> hm
<MercurialAlchemi> Drup: I don't know what I'd choose between brainfuck and PHP
<hcarty> Drup: That's what I had and thought it was causing a memory leak. Apparently not though, the issue is elsewhere.
<hcarty> Drup: Thanks for the help
<ollehar> MercurialAlchemi: easy - what's easiest to google a solution for?
<Drup> MercurialAlchemi: sometimes, the right move is not to play.
<MercurialAlchemi> it's much easier to write a brainfuck transpiler than a php transpiler
<MercurialAlchemi> ollehar: the only solution to PHP is rm
<MercurialAlchemi> Drup: good point
uris77 has quit [Read error: Connection reset by peer]
<MercurialAlchemi> (to go back to 'simple', 'simple' is not interesting, 'simple' is interesting in the context of a problem to solve - simple solutions that are too simple are fantastic complexity generators)
rgrinberg has quit [Quit: Leaving.]
* MercurialAlchemi mutters about magical attributes and dependency injection and transaction annotations in languages backed by large corporations
sigjuice_ has joined #ocaml
companion_cube has joined #ocaml
rgrinberg has joined #ocaml
shinnya_ has joined #ocaml
<ollehar> so you don't think php got popular because a feeling of simplicity?
shinnya has quit [Ping timeout: 276 seconds]
<ollehar> it's top 5, so what's the reason?
uris77 has joined #ocaml
<Drup> of, feeling, sure
<Drup> (also, success of php comes from that it's trivial to host)
aluuu has joined #ocaml
<def`> (yep)
<def`> easy, not simple ;')
<MercurialAlchemi> well, it's very forgiving
<MercurialAlchemi> I assume most installs have the "don't show errors on the page" setting
<Drup> it gives you a very large freedom on which parts of the body you wan to shoot yourself in.
<ollehar> would java be a statically typed language that feels easy?
<MercurialAlchemi> "look ma, I wrote hello world"
<MercurialAlchemi> ollehar: well, I guess
<MercurialAlchemi> the language itself is not that complicated
<ollehar> pyret, new name of that...
<ollehar> rocket?
<ollehar> racket
<Drup> (typed racked is probably good too, but I don't know enough about it to really say it's "simple")
slash^ has joined #ocaml
* pippijn just heard a haskell talk by don stewart
<Drup> pippijn: did it makes you a believer ? :p
<slash^> What do you people think about F#
<pippijn> yes
martintrojer has quit [Ping timeout: 245 seconds]
<pippijn> Drup: it did, in fact
<pippijn> it was a pretty awesome talk
<Drup> what was it about ? haskell in general ?
<hcarty> Drup: Never mind. That call does cause a memory leak...
<pippijn> haskell at large scale
<pippijn> 3 million lines of code in a globally operating company
martintrojer has joined #ocaml
<pippijn> Drup: I'm not going to use haskell, but I believe that haskell is a good language for his use case
<Drup> hcarty: it's a bit hard to answer without all the code
octachron has quit [Quit: Leaving]
<pippijn> jane street is doing similar things with ocaml
<pippijn> having the promise that no IO happens where you don't explicitly state it is a nice feature
Thooms has joined #ocaml
<pippijn> also being able to limit the kind of IO you do (read/write, read-only, memory-only)
hellofun` is now known as hellofunk
osa1_ has quit [Quit: Konversation terminated!]
osa1__ has joined #ocaml
<avsm> pippijn: isnt it a strict variant of Haskell — Mu?
<ollehar> slash^: never used it
<avsm> not vanilla haskell
<pippijn> avsm: yes
<pippijn> mostly-strict
ivan\ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
<slash^> ollehar: Seems like nobody in #ocaml did. :P
<hcarty> Drup: The full context is https://github.com/hcarty/ocaml-gdal/blob/master/src/spatial_reference.ml#L62 - it's far from minimal as it is sitting in a big glob of bindings
<ollehar> slash^: yeah :)
<ollehar> check out F#
<ollehar> #F#
<ollehar> hm
<ollehar> #fsharp?
<ollehar> no idea
<pippijn> Drup: it does make ocaml feel a little clumsy
<pippijn> maybe I can do more coq
rand000 has joined #ocaml
manizzle has joined #ocaml
<S11001001> slash^ ollehar: ##fsharp
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
<ollehar> S11001001: thx
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
<slash^> Ahh yes
Hannibal_Smith has joined #ocaml
<smondet> slash^: F# has null pointers; in 2014 this means weakly typed; echo 'F#' > /dev/null
osa1__ has quit [Ping timeout: 255 seconds]
<smondet> (and we are in 2015, but yeah the language was obsolete since the late 70s so... :) )
paradoja has joined #ocaml
<adrien_znc> ocaml has null pointers too
<adrien_znc> it's through ffi, you're getting even less safety through ocaml's ffi
<smondet> where?
<smondet> ah of courese
<smondet> yes can also `Obj.magic 0`
<adrien_znc> and that's why F# has a "null pointer"
<smondet> in F# a string can be null
<adrien_znc> it's for interop with other libraries
<adrien_znc> still checked
<adrien_znc> doesn't trigger undefined behaviour afaik
<smondet> not undefined, just like in java
<smondet> still painful
<slash^> Well what can happen in the worst case.
<slash^> Exception
<slash^> You get a stack trace
<slash^> And solve the issue
<smondet> well, the goal is to not have issues in the first place
<smondet> null pointers are like dynamic typing, they require trusting the human brain. Trusting the human brain is insanely stupid. :)
<adrien_znc> yeah, ocaml doesn't have that built-in
<adrien_znc> but it has Not_found
<adrien_znc> and Invalid_argument
paradoja has left #ocaml ["Killed buffer"]
nico__ has joined #ocaml
Hannibal_Smith has quit [Ping timeout: 256 seconds]
<smondet> adrien_znc: those are library problems, not the language
<adrien_znc> sure, if you avoid Pervasives
<adrien_znc> actually
<adrien_znc> I'm not even sure that pervasives is not from the language
<hcarty> adrien_znc: Outside of Obj.magic and the FFI, it is nice that (for example) a string is always a valid value in OCaml.
osa1__ has joined #ocaml
<adrien_znc> it's better in OCaml
<adrien_znc> but it's not perfect either :)
<hcarty> adrien_znc: Agreed :-)
flhs has joined #ocaml
mort___ has quit [Ping timeout: 265 seconds]
<hcarty> I've been happier with OCaml's compromises than I have with any other language's so far.
oscar_toro has quit [Ping timeout: 264 seconds]
<mrvn> For FFI use ctypes for example. There you specify that a function can return a null pointer and you get an option type out of it.
<mrvn> Which means you have to match the result (check for NULL) to use it. No danger of segfaults.
<adrien_znc> you're only solving the issue through additional process
ingsoc has joined #ocaml
<mrvn> Imho it's not an issue at all. It's just a different data representaion. In C you have null pointers, in ocaml you have options. 99.9% of the time that is the right mapping.
<mrvn> What I find far more challenging are void* usage in C.
psy_ has quit [Read error: Connection reset by peer]
vpm has joined #ocaml
psy_ has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
<hcarty> Drup: If you're interested, this seems to have fixed the leak - https://github.com/hcarty/ocaml-gdal/commit/1af9166437c58be7c07473d45b8f08ac057b5a8b
bytbox has joined #ocaml
<nicoo> ollehar: “even if the edge cases are complicated, you only have to care 1% of the time” -> In PHP, you have to care every time you sort anything, for instance. And “edge cases bugs” are better called, in my opinion, “security issues”. Like comparing two password hashes with == <3
regnat has quit [Ping timeout: 265 seconds]
<nicoo> slash^: F#n is OCaml with small wheels and .Net
<nicoo> F#, sorry
<nicoo> adrien_znc: How does “having a library for safer/saner FFI” becomes “solving the issue witgh additionnal process” ?
<slash^> Small wheels?
<mrvn> slash^: training wheels
<adrien_znc> nicoo: process means "human rules"
<adrien_znc> not processing
<adrien_znc> afk
<slash^> Well
<mrvn> I should finish my C compiler that does bounds checks on allocated regions.
regnat has joined #ocaml
<nicoo> adrien_znc: If by that you mean “rules not enforced by the compiler”, sure. We could/should make a ppx to issue a warning on use of Obj or the FFI
<mrvn> nicoo: you hardly use Obj by accident. No point warning about it.
<nicoo> mrvn: Do you also do type checks (i.e. check whether the cast involves UB or IDB)
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
<nicoo> mrvn: You can't use the FFI by accident either
<mrvn> nicoo: you mean like a cast from int to void* back to long?
<nicoo> It was meant as a provocative point for adrien_znc
<nicoo> For instance, yes
<nicoo> (At least on allocated blocks)
Submarine has joined #ocaml
<mrvn> nicoo: No. That would require runtime type infos beyond allocated block sizes.
<nicoo> It sure would. Was just wondering what kind of trade-offs your compiler makes
<mrvn> nicoo: I just changed the pointer representation to be { void *start; size_t size; void *pos; }
reem has joined #ocaml
<ggole> There have been C compilers with fat pointers like that before
<ggole> Works well, but is quite a performance hit.
<nicoo> ggole: Yes ;_;
IbnFirnas has quit [Read error: Connection reset by peer]
<mrvn> ggole: not so much on modern cpus and I realy don't care. A buffer overflow is more serious.
avsm has quit [Quit: Leaving.]
osa1__ has quit [Ping timeout: 245 seconds]
<ollehar> mrvn: valgrind?
<ollehar> maybe not enough
<ollehar> would it be possible to make a type-obsessed language that "feels" as easy as php?
<mrvn> ollehar: if you patch it to abort on error instead of just reporting it.
<ollehar> or state it differently: why doesn't ocaml feel as easy as php?
<ollehar> /haskell
<whitequark> mrvn: (C compiler) there are already multiple
flhs has quit [Remote host closed the connection]
aluuu has quit [Ping timeout: 252 seconds]
<mrvn> A nice IDE that interactively shows you the types and lets you annotate and trace type errors would be nice.
<whitequark> simplest is to use clang -fsanitize=address
<mrvn> whitequark: does that add bounds checks on all pointers?
<ollehar> how advanced is clang, really?
<ollehar> seems so capable
<whitequark> mrvn: essentially
<ollehar> mrvn: what do you mean with annotate type errors?
<mrvn> By trace I mean you get an error at point A that something is a 'a list list and then you highlight the "'a list" and it shows you at what point in the code it infered that part for example.
<whitequark> mrvn: it detects buffer overflows and use-after-frees
<whitequark> -fsanitize=memory also detects access to uninitialized memory
<mrvn> ollehar: say you get an error that something has type int but float was expected. Then I want to annotate that is should be int and have it show me where it got the float from.
dsheets has quit [Ping timeout: 255 seconds]
<mrvn> ollehar: i.e. tell it the infered expectation is wrong and not the type at that point.
<mrvn> whitequark: nice
q66 has joined #ocaml
<ollehar> mrvn: can't you just make `a : int` or whatever?
leowzukw has joined #ocaml
<ggole> I wonder whether these tools to find undefined behaviour will lead to things like Rust being adopted less than they otherwise would
<mrvn> ollehar: In ocaml that changes nothing. It will usualy still tell you it expects float.
<ollehar> mrvn: ok
<mrvn> ollehar: like (1 : int) is quite pointless.
<ollehar> hacklang has a trace for type errors like that in its IDE
<ollehar> I think
<jwatzman|work> ollehar: yep
<jwatzman|work> hack's type errors were designed by folks who have had exactly these sort of fights with ocaml to find the root cause of problems ;)
<whitequark> ggole: probably not. valgrind was available for years
<ollehar> ggole: rust also fixes race conditions in concurrency
<ollehar> also, rust have awesome syntax stuff like pattern matching
<mrvn> There is also a big difference between finding bugs at runtime and compiletime.
Anarchos has joined #ocaml
<mrvn> Most security bugs only trigger a detection when they are exploited. Which means you already know there is a bug.
<mrvn> (you == the exploiter)
<ggole> whitequark: well, valgrind probably had some of that effect
<mrvn> doesn't valgrind have a concurrency race condtition module too?
<ggole> Yeah
<ggole> But it's the same kind of dynamic check as the memory stuff.
jwatzman|work has quit [Quit: jwatzman|work]
Haudegen has quit [Ping timeout: 240 seconds]
aluuu has joined #ocaml
Haudegen has joined #ocaml
ivan\ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
osa1__ has joined #ocaml
<ollehar> with splint you can annotate c programs with ownership and such
<ollehar> not maintained any more, though
nico__ has quit [Quit: Leaving]
Hannibal_Smith has joined #ocaml
IbnFirnas has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
ollehar has quit [Ping timeout: 244 seconds]
ygrek_ has quit [Ping timeout: 276 seconds]
<IbnFirnas> nicoo: F# is quite diverged from OCaml at this point. It's just a different language that looks like an ML, IMO.
Thooms has quit [Quit: WeeChat 1.0.1]
dmiles_afk has quit [Ping timeout: 245 seconds]
willy_ has joined #ocaml
dmiles_afk has joined #ocaml
wwilly has quit [Ping timeout: 255 seconds]
dmiles has joined #ocaml
bytbox has quit [Ping timeout: 240 seconds]
dmiles_afk has quit [Ping timeout: 265 seconds]
bytbox has joined #ocaml
reem has quit [Remote host closed the connection]
chris2 has quit [Quit: trotz alledem!]
chris2 has joined #ocaml
reem has joined #ocaml
enitiz has joined #ocaml
dmbaturin has quit [Quit: "let (+) 2 2 = 5 in 2 + 2"]
oscar_toro has joined #ocaml
jwatzman|work has joined #ocaml
manizzle has quit [Ping timeout: 264 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
struktured has quit [Ping timeout: 245 seconds]
dmbaturin has joined #ocaml
icicled has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ggole has quit []
<nicoo> IbnFirnas: Yes. I just meant that as a feeling you get as a dev, feature-wise and syntax-wise
osa1__ has quit [Ping timeout: 272 seconds]
icicled has joined #ocaml
verthandi has joined #ocaml
osa1__ has joined #ocaml
dsheets has joined #ocaml
osa1__ has quit [Client Quit]
_andre has quit [Quit: leaving]
osa1__ has joined #ocaml
<Drup> whitequark: ok, this -fsanitize is interesting, is it really mature (and since when is it in clang ?)
<Drup> hcarty: ah, yes, char ptr instead of string, I'm not completely surprised
<Drup> cf the documentation about string.
osa1 has joined #ocaml
osa1__ has quit [Read error: Connection reset by peer]
osa1 has quit [Client Quit]
rgrinberg has quit [Quit: Leaving.]
osa1 has joined #ocaml
aluuu has quit [Ping timeout: 240 seconds]
struktured has joined #ocaml
<whitequark> Drup: yes, and long, long ago
<whitequark> there are tsan, msan, asan, ubsan
<whitequark> for race conditions, uninitialized memory, out of bounds accesses and undefined behavior
<Drup> (my interest is for pedagogic purposes)
struktured has quit [Ping timeout: 252 seconds]
icicled has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
enitiz has quit [Ping timeout: 245 seconds]
<Drup> err, nevermind, the stack trace given by clang is far too terrifying for students
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
pyon is now known as pyon-k
antkong has joined #ocaml
manizzle has joined #ocaml
struktured has joined #ocaml
zwer_h has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
zwer has quit [Ping timeout: 250 seconds]
enitiz has joined #ocaml
leowzukw has quit [Quit: Lost terminal]
Denommus has joined #ocaml
IbnFirnas has joined #ocaml
bytbox has quit [Remote host closed the connection]
bytbox has joined #ocaml
_whitelogger__ has joined #ocaml
bitbckt_ has joined #ocaml
bytbox has quit [Remote host closed the connection]
esden_ has joined #ocaml
bitbckt has quit [*.net *.split]
_whitelogger_ has quit [*.net *.split]
Leonidas has quit [*.net *.split]
rom1504 has quit [*.net *.split]
esden has quit [*.net *.split]
esden_ is now known as esden
psy_ has quit [Ping timeout: 272 seconds]
<ingsoc> I am looking at the lib/core folder
psy_ has joined #ocaml
<ingsoc> I am not sure how you are able to reference List.map and be using the core implementation rather than builtin after issuing open Core.Std. if I look in the folder I see core_list, core_array etc.
antkong has quit [Quit: antkong]
vanila has joined #ocaml
<ingsoc> i thought the module referenced e.g. List would be named list on the flesystem
<Drup> look at the definition of Core.Std
matason has quit [Quit: leaving]
osa1 has quit [Ping timeout: 272 seconds]
ivan\ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
enitiz has quit [Ping timeout: 272 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
<ingsoc> Drup: ok, so modules can be referenced by a different name. So "Core" refers to top level dir "/.opam/<ver>/lib/core" and "Std" refers to the std.ml which does "include Core_kernel.Std_kernel" which redefines/overrides the standard modules of those names, and then adds additional stuff to the local namespace
<ingsoc> ok, i get it now. but what happens if I was to write a List module, what are the rules for which List version gets defined/is usable in my module when I reference it
osa1 has joined #ocaml
Leonidas_ is now known as Leonidas
dsheets has quit [Ping timeout: 244 seconds]
<Drup> the rule is "you can't have multiple modules with the same Path, period."
Denommus has quit [Ping timeout: 252 seconds]
osa1 has quit [Ping timeout: 265 seconds]
osa1 has joined #ocaml
rock_neurotiko has joined #ocaml
rock_neurotiko has quit [Remote host closed the connection]
IbnFirnas has quit [Ping timeout: 244 seconds]
milosn has quit [Ping timeout: 256 seconds]
matthewhill has joined #ocaml
milosn has joined #ocaml
matthewhill has quit [Client Quit]
sdegutis has joined #ocaml
<sdegutis> So, in my search for my next favorite language, it was almost gonna be OCaml but there were too many times when I cringed over a feature, and at one point I just couldn't overlook all these cringes anymore.
<sdegutis> So now I'm a Haskeller. It's really, really awesome.
<sdegutis> Just thought I'd update since I was in here for a while and there might be other people in here looking to decide between the two languages.
<Drup> did you wrote anything in haskell ?
<adrien> Drup: did you write anything in English?
* adrien ducks :D
<sdegutis> Ha adrien.
sdegutis has left #ocaml ["Leaving..."]
<adrien> "lol"
sdegutis has joined #ocaml
sdegutis has left #ocaml ["Leaving..."]
<Drup> adrien: only frenglish
sdegutis has joined #ocaml
<sdegutis> Drup: I wrote as much in both languages.
<adrien> I see you're bilingual :)
<adrien> Drup: ^
sdegutis has left #ocaml ["Leaving..."]
willy_ has quit [Read error: Connection reset by peer]
<vanila> if people ar edeciding between ocaml and haskell I hope they don't pick haskell based on your analysis there
<Drup> he's flickering
willy_ has joined #ocaml
<vanila> it would be good if you writeup your actual analysis as a blog post or something
<vanila> just 'i cringed at certain features' isnt' thorough
<S11001001> vanila: I doubt it would be coherent, from experience in here.
<Drup> well, he didn't wrote more than 50 lines of code in both languages ...
ivan\ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
sh1ken_ has quit [Quit: leaving]
sh1ken has joined #ocaml
<chouser> Huh. Anyone have a clue why input_line might read lines in reverse order? I'm clearly doing something wrong.
<pippijn> chouser: you're prepending to a list
<pippijn> (my guess)
<chouser> good guess, but I'm pretty sure not: https://gist.github.com/Chouser/27306a7cb653a9a11d1c
<pippijn> yep
<pippijn> you're doing this:
<pippijn> loop out_str ^ (input_line ic) ^ "\n"
<pippijn> which is
<pippijn> ((loop out_str) ^ (input_line ic)) ^ "\n"
<chouser> ah!
<chouser> parens! brilliant!
<chouser> pippijn: thanks
<chouser> I was thinking maybe some kind of lazy evaluation, or ...
<chouser> anyway, thanks.
<chouser> BTW, is there a saner way to read a text file?
jonludlam has quit [Quit: Coyote finally caught me]
<pippijn> you can use a list, collect all lines, then reverse, then concat
<pippijn> or you can use the Buffer module
<pippijn> both are linear time, whereas your implementation here is quadratic
<chouser> because of string copying?
<pippijn> yes
<mrvn> collect all lines and sum the size. Then allocate the final string and blit the lines into it. Or ignore the lines from the start and read blocks.
<pippijn> mrvn: String.concat does that
<chouser> pippijn: I didn't know about string concat. Thanks again!
<chouser> there's no collection that has fast append (instead of fast prepend like list has)?
<pippijn> chouser: Queue
<chouser> oh, mutable! hm.
IbnFirnas has joined #ocaml
artagnon has joined #ocaml
thomasga has quit [Quit: Leaving.]
<pippijn> chouser: if you need fast append and fast remove from end, then use list
<Drup> mrvn: use Buffer instead, it's the same, but quicker and safer
<artagnon> whitequark: Do you know a setup in which the lib/ocaml build artifacts won't be created?
<artagnon> cmake and Linux.
<Drup> chouser: I advise you the Buffer method
<whitequark> yes
<whitequark> you need ocamlfind and ctypes 0.3
<pippijn> I agree with Drup
<artagnon> whitequark: Thanks!
<chouser> Clojure has a nice immutable vector that is fast to append, and fast to iterate from beginning to end. Like a built-in reverse.
* artagnon looks at that
<pippijn> chouser: append to immutable vector?
<chouser> yep
<pippijn> how?
<artagnon> whitequark: Where is that dependency written down?
<chouser> uses very wide trees internally.
<whitequark> artagnon: what do you mean?
<Drup> chouser: it's present in alternate standard libraries
<pippijn> I see
<chouser> But Buffer looks perfect for my needs here.
<pippijn> yes
<artagnon> whitequark: How does cmake decide whether or not to emit those artifacts?
<artagnon> Where is the information fed into the cmake tree?
MercurialAlchemi has quit [Ping timeout: 244 seconds]
<whitequark> FindOCaml
<Drup> It should be in the stdlib, and it's in almost every "stdlib replacement", but it's not :/
rgrinberg has quit [Quit: Leaving.]
<Drup> pippijn: for the sake of consistency, you should call choice "either" ;)
<Drup> (and the constructor "Left" and "Right" ;)
<chouser> Drup: heh, thanks! Do you write all that just for me?
<Drup> It's not the first time I had to wrote it =')
<pippijn> Drup: yeah, maybe
<pippijn> Drup: any idea how to write this in coq?
<chouser> heh.
<chouser> why 27?
<Drup> but it can be annoying to figure out the minimal way to write it correctly, so I though it was a better idea to give it to you
<Drup> chouser: pick a magic number you like
<pippijn> chouser: 31 is better
<Drup> It's going to grow on demand anyway
<Drup> pippijn: why in hell do you want to write that in coq ?
<artagnon> whitequark: Found it; but the machine reports "-- OCaml bindings enabled." and those artifacts are missing.
enitiz has joined #ocaml
sh1ken has left #ocaml [#ocaml]
<whitequark> that's odd
<artagnon> Perhaps an older version of llvm?
<pippijn> Drup: maybe I don't
<whitequark> if the bindings are enabled, they should be there
* artagnon scratches his head
<Drup> pippijn: for your sanity, you probably don't :D
<pippijn> Drup: I've never succeeded in making anything useful with coq
rgrinberg has joined #ocaml
<pippijn> I always run into so much pain that I eventually quit and use ocaml
<pippijn> but I'd really like to write at least part of a program in it
<Drup> well, it's not the same purpose at all ...
<pippijn> maybe later, when my program is finished
<Drup> coq is not for writing programs.
uris77 has quit [Quit: leaving]
<pippijn> you can write programs in it, though
<whitequark> artagnon: can you do `make ocaml_llvm` ?
<Drup> Sure, but it's not its purpose
<Drup> hence not convenient for it
<pippijn> in particular, I could write most of the pure logic in it
<vanila> I wish it were earsier to write programs in coq
<artagnon> whitequark: I don't have access to the machine now, but I'll try it when I get access to it next time.
<pippijn> the things that don't deal with reading and writing bytes to streams
<Drup> there are other dependently type languages that are made to actually write programs
<pippijn> usable ones?
<vanila> Drup, there was a really promising one (epigram) but they could not complete it
<Drup> I think Idris is usable :p
<artagnon> whitequark: In any case, I should have the results in a few days.
enitiz has quit [Read error: Connection reset by peer]
<Drup> Agda ... it's a bit usable, but not too much
<pippijn> idris
ingsoc has quit [Quit: Leaving.]
<vanila> i can't cope with agda because no tactics, how are you expected to do any nontrivial proofs?
<pippijn> requires me to build it from source
<Drup> vanila: you prove things by exhibiting a term that inhabit the types that correspond to your property.
<pippijn> alright
<pippijn> Drup: have you used idris?
<Drup> Idris as a small tactic language, iirc
<artagnon> whitequark: Another thing I wanted to ask: is it possible to migrate a codebase from OCaml to C++ gradually? Do you have any ideas other than doing it all-at-once?
<Drup> pippijn: never seriously
<pippijn> what is it compiled to?
thomasga has joined #ocaml
<Drup> llvm, so whatever
<pippijn> that's nice
<vanila> Drup, yes but how can you do that for a soething that takes a large number of proof steps all of which are tedius and could be automated with tactics
<Drup> (there is a js compiler too, but I think it's a bit experimental)
<pippijn> I might try it
<vanila> with Coq you can prove some things for which the proof term is gigantic
<Drup> vanila: you use implicits arguments to your advantage
<whitequark> artagnon: probably possible, unclear if desirable
<vanila> I do not think that resolves my question
<Drup> vanila: but as you pointed out
<artagnon> I see. Can you elaborate on the second part?
<Drup> Coq is better for pure proof
<vanila> luckily idris has tactics (yet you are told not to use them..)
<artagnon> I need to bind to LLVM more tightly, and I have a lot of non-codegen code in OCaml.
<Drup> Agda is more convenient for "certified programs" for which the type itself will give you lot's of property
<artagnon> The big wall I'm hitting up against is the inferiority of variants/records compared to C++ classes.
<vanila> I wish Coq just has better pattern matching, then it' would be the best of both worlds
<artagnon> I want to do things like type inference, closely tied to LLVM types.
<artagnon> If everything is an llvalue, it doesn't tell me much.
<Drup> artagnon: I started doing something like that
eyyub has joined #ocaml
<artagnon> ... and?
<Drup> and it's a lot of work and it's complicated
<pippijn> Drup: I want to write a secure peer-to-peer instant messenger
<artagnon> I don't mind.
<pippijn> Drup: would you use agda or idris?
<artagnon> I think C++ would ease the pain to a large extent.
<artagnon> Inheritance is very powerful, I think.
<Drup> pippijn: I wouldn't do something like that to begin with because I care about my sanity
<Drup> :D
<pippijn> meh
<vanila> pippijn, I am not sure if dependent types would help with that? What about just doing it in ocaml?
<pippijn> vanila: maybe
<Drup> vanila: it's not verified then
<vanila> I saw there was a good OTR and things in ocaml
<vanila> verified is good, but just not writing in C is like 90% better than pigdin
<pippijn> I think I'll write the first version in ocaml
<Drup> pippijn: I think that's a good idea
<artagnon> whitequark: Any insights?
<pippijn> you can get quite far with phantom types and gadts
<Drup> because you will have an idea how to do it and what you want to prove about it
<pippijn> right
<vanila> https://pond.imperialviolet.org/ oh im sorry its in Go
<Drup> proving things in Agda/Idris/Coq is a very difficult and long process, do not underestimate it.
<vanila> but there is https://github.com/hannesm/ocaml-otr and it may be useful
<pippijn> vanila: I'm using crypto_box
<whitequark> artagnon: dunno
<whitequark> ask Drup instead
<pippijn> I don't really want to prove things about my program yet
<Drup> this is what I started
<pippijn> the reason I wanted to use dependent types is that it's easy to express things like "non-empty list"
<Drup> it's easy with gadts too
<Drup> annoying, but easy
<pippijn> in ocaml, I end up with a bunch of assert false, because I know for sure, by data flow, that the list is not empty
<pippijn> with gadts, it's ugly, and not native
<Drup> actually, it's pretty much the same in both
nicoo has quit [Remote host closed the connection]
<pippijn> you can do it with your own list, but not with ocaml list
<vanila> hmm
<Drup> just that the idiom is more common in dependently typed langauges
<artagnon> Interesting.
<Drup> but it's quite the same otherwise
nicoo has joined #ocaml
<vanila> maybe something static analysis with SMT/refinement types could solve these impossible cases in a different way
<artagnon> Drup: ... but it's a crazy breaking change, no?
<pippijn> I can prove "non-empty list" by passing head and tail separately
<Drup> artagnon: ah yeah, just assume it's in another file
<artagnon> A tllvm interface.
<Drup> artagnon: you can just define a new interface in order not to break the old one
<pippijn> val nonempty : 'a list -> ('a * 'a list) option
<pippijn> the advantage of coq is that I can extract ocaml code, so I can write things in ocaml and other (pure) things in coq
<Drup> indeed
<artagnon> Drup: Thanks for a good start; I'll see if I can take this forward.
<artagnon> Then again, I'm not sure how to do things like type unification without inference.
<Drup> what ?
<artagnon> Er, inheritance.
<Drup> ah
<Drup> polymorphic variant magic
<Drup> you can emulate the inheritance hierarchy by using phantom types + polymorphic variant, which is what I started
<pippijn> Drup: cool
<Drup> Important note : I did not say it was a good idea.
* artagnon nods
<pippijn> I like it
<Drup> (it's probably not)
<Drup> but, if you are willing to spend time doing it, go on. I know how to do it but you need to basically rewrite all the functions and give them new types, and I didn't took the time to do it
<artagnon> Nah, I won't take it forward unless it's decidedly a good idea; wouldn't want to paint myself into a corner.
<Drup> the issue is that it's a bit hard to know if it's a good idea before actually using it.
<artagnon> ... but this is pretty cool.
sinelaw has joined #ocaml
bitbckt_ is now known as bitbckt
bitbckt has quit [Changing host]
bitbckt has joined #ocaml
<Drup> the other issue to this approach is that it doesn't give you an adt to pattern match on if you want to do code transformations.
bytbox has joined #ocaml
bytbox has quit [Remote host closed the connection]
<Drup> which ... really annoys me
<Drup> (it's around this time ggole started his GADT-ssa, so I waited to see how that would go to make a decision)
jao has quit [Ping timeout: 265 seconds]
raphaelss has joined #ocaml
<Leonidas> can someone explain me the version scheme of core?
<Leonidas> it seems strict monotonic increasing by a random amount.
Kakadu has quit [Remote host closed the connection]
<pippijn> is there a bitstring/bitmatch ppx extension for ocaml?
<whitequark> not yet
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
endiruna has joined #ocaml
claudiuc has joined #ocaml
raphaelss has left #ocaml [#ocaml]
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
enitiz has joined #ocaml
thomasga has quit [Quit: Leaving.]
IbnFirnas has quit [Ping timeout: 244 seconds]
<struktured> pippijn: you can however, just not use the extensions for the time being if you want to avoid campl4 but take advantage of bitstring api
artagnon has left #ocaml [#ocaml]
<pippijn> struktured: I wanted it for the syntax
<struktured> pippijn: yeah the syntax almost *IS* the api
<pippijn> I found that I can't use it anyway
<pippijn> the syntax, that is
<pippijn> because it calls Char.code
<pippijn> and Core.Std.Char doesn't have that, so I'd have to do module Char = Caml_char and now I'm doing something else anyway
<struktured> pippijn: yeah I witnessed similar tactics in the riakc library when using bitstring.
<struktured> pippijn: he seemed to have wrapped the whole bitstring stuff into a "non-core" transaction
<pippijn> yeah, I was going to do that
<pippijn> but then I got too annoyed at ocp-indent hating syntax extensions
<pippijn> so now I use Binary_packing from core
<struktured> suppose that makes sense, given your using core already
sinelaw has quit [Quit: Leaving]
fraggle-boate has quit [Read error: No route to host]
swgillespie has joined #ocaml
Denommus has joined #ocaml
tane has quit [Quit: Verlassend]
Thooms has joined #ocaml
osa1 has quit [Ping timeout: 245 seconds]