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
badon has quit [Ping timeout: 250 seconds]
badon_ is now known as badon
_5kg has quit [Ping timeout: 264 seconds]
thomasga has quit [Quit: Leaving.]
badon_ has joined #ocaml
jwatzman|wor has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
badon has quit [Ping timeout: 240 seconds]
badon_ is now known as badon
enquora has quit [Quit: enquora]
jwatzman|work has quit [Ping timeout: 240 seconds]
philtor_ has joined #ocaml
ontologiae has joined #ocaml
oriba has quit [Quit: oriba]
jwatzman|wor has quit [Quit: jwatzman|wor]
troutwine is now known as troutwine_away
bytbox has quit [Remote host closed the connection]
philtor_ has quit [Ping timeout: 260 seconds]
groovy2shoes has joined #ocaml
badon_ has joined #ocaml
johnnydiabetic has joined #ocaml
badon has quit [Ping timeout: 240 seconds]
badon_ is now known as badon
Thooms has quit [Quit: WeeChat 0.4.3]
cody__ has joined #ocaml
jwatzman|work has joined #ocaml
badon_ has joined #ocaml
badon has quit [Ping timeout: 240 seconds]
jwatzman|work has quit [Ping timeout: 272 seconds]
badon_ is now known as badon
badon_ has joined #ocaml
jprakash has quit [Ping timeout: 255 seconds]
badon has quit [Disconnected by services]
badon_ is now known as badon
cody__ has quit [Quit: Leaving]
BitPuffin has quit [Ping timeout: 255 seconds]
hhugo has quit [Quit: Leaving.]
claudiuc has quit [Ping timeout: 240 seconds]
jwatzman|work has joined #ocaml
huza has joined #ocaml
jwatzman|work has quit [Ping timeout: 245 seconds]
vanila has quit [Quit: Leaving]
samrat has joined #ocaml
q66 has quit [Quit: Leaving]
jwatzman|work has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
ontologiae has quit [Ping timeout: 255 seconds]
jwatzman|work has quit [Ping timeout: 245 seconds]
groovy2shoes has quit [Ping timeout: 246 seconds]
jwatzman|work has joined #ocaml
samrat has joined #ocaml
jwatzman|work has quit [Ping timeout: 255 seconds]
badon_ has joined #ocaml
badon has quit [Ping timeout: 245 seconds]
badon_ is now known as badon
_5kg has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
jwatzman|work has joined #ocaml
srcerer has quit [Ping timeout: 272 seconds]
yacks has quit [Quit: Leaving]
jwatzman|work has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
badon_ has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
badon has quit [Disconnected by services]
badon_ is now known as badon
shinnya has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
shinnya has joined #ocaml
samrat has joined #ocaml
jwatzman|work has joined #ocaml
ggole has joined #ocaml
jwatzman|work has quit [Ping timeout: 255 seconds]
madroach has quit [Quit: leaving]
madroach has joined #ocaml
araujo has quit [Quit: Leaving]
Simn has joined #ocaml
MercurialAlchemi has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
jwatzman|work has joined #ocaml
jwatzman|work has quit [Ping timeout: 260 seconds]
_5kg has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
jwatzman|work has joined #ocaml
jwatzman|work has quit [Ping timeout: 240 seconds]
yacks has joined #ocaml
axiles has quit [Quit: Quitte]
zpe has joined #ocaml
wwilly has joined #ocaml
hhugo has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
huza has quit [Quit: WeeChat 0.3.8]
ontologiae has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
jwatzman|work has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
jwatzman|work has quit [Ping timeout: 240 seconds]
hhugo has quit [Quit: Leaving.]
badon_ has joined #ocaml
badon has quit [Ping timeout: 245 seconds]
badon_ is now known as badon
samrat has joined #ocaml
rgrinberg has joined #ocaml
BitPuffin has joined #ocaml
Kakadu has joined #ocaml
johnnydiabetic has quit [Ping timeout: 240 seconds]
Kakadu has quit [Ping timeout: 260 seconds]
badon_ has joined #ocaml
dsheets has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
ontologiae has quit [Ping timeout: 240 seconds]
BitPuffin has quit [Ping timeout: 255 seconds]
maattdd has joined #ocaml
hhugo has joined #ocaml
maattdd has quit [Ping timeout: 272 seconds]
jwatzman|work has joined #ocaml
jwatzman|work has quit [Ping timeout: 246 seconds]
pminten has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
eikke__ has joined #ocaml
dsheets has joined #ocaml
maattdd has joined #ocaml
hhugo has quit [Quit: Leaving.]
samrat has quit [Ping timeout: 260 seconds]
shinnya has quit [Quit: ZNC - http://znc.in]
shinnya has joined #ocaml
shinnya has quit [Quit: ZNC - http://znc.in]
shinnya has joined #ocaml
jwatzman|work has joined #ocaml
rand000 has joined #ocaml
pminten|2 has joined #ocaml
badon_ has joined #ocaml
jwatzman|work has quit [Ping timeout: 250 seconds]
badon has quit [Disconnected by services]
samrat has joined #ocaml
yearzero has joined #ocaml
pminten has quit [Ping timeout: 250 seconds]
badon_ is now known as badon
BitPuffin has joined #ocaml
pminten has joined #ocaml
Kakadu has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
pminten|2 has quit [Ping timeout: 272 seconds]
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
rand000 has quit [Ping timeout: 264 seconds]
zarul has joined #ocaml
hhugo has joined #ocaml
samrat has quit [Ping timeout: 245 seconds]
Thooms has joined #ocaml
sgnb has quit [Remote host closed the connection]
badon_ has joined #ocaml
sgnb has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
<Unhammer> if foo.ml says `let x = "hi"` and bar.ml says `open Bar;; let y = print x`, how can I run y from utop?
<Unhammer> I just get Error: Reference to undefined global `Bar'
<Unhammer> (that's after compiling with -linkpkg bar.ml at least once)
<ggole> Compile it, then load it with #load
rand000 has joined #ocaml
yearzero has quit [Ping timeout: 246 seconds]
<Unhammer> aha, thank you ggole :)
<ggole> Alternatively, use a build system like ocamlbuild to construct a toplevel containing what you want
<Unhammer> aha
<Unhammer> I've just been using a plain Makefile for now, wanted to get to know the basic tools first
<Unhammer> seems like there's a lot of choice in build systems …
<ggole> Not a bad idea, it's always good to understand (at least a part of) what the build system is automating for you
pminten has joined #ocaml
bezirg has joined #ocaml
eikke__ has quit [Ping timeout: 260 seconds]
samrat has joined #ocaml
ontologiae has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
darkf has quit [Quit: Leaving]
isBEKaml_mobile has joined #ocaml
dsheets has quit [Ping timeout: 255 seconds]
isBEKaml_mobile has left #ocaml [#ocaml]
isBEKaml_mobile has joined #ocaml
isBEKaml_mobile has left #ocaml [#ocaml]
<marvin-hh> Unhammer: if OCaml build systems are so great, why isn't the rest of the world using those?
<marvin-hh> The answer is that they aren't that great.
<marvin-hh> In fact, they are quite awesomely bad.
q66 has joined #ocaml
<marvin-hh> Nobody has even ever looked at an OCaml build system and used it as inspiration for their own tool.
<ggole> I was under the impression that exactly that was responsible for our current glut of build systems...
<whitequark> I don't know, I like ocamlbuild
<marvin-hh> What makes you think OCaml developers know what other systems are out there?
<whitequark> it's not the fastest thing and the interface is somewhat arcane, but it is so much better than Makefiles
<whitequark> and other build systems? what are you talking about? make? autoconf? cmake? hahahahaha
hhugo has quit [Quit: Leaving.]
<marvin-hh> whitequark: about exactly your response.
hhugo has joined #ocaml
<parcs> gnu make is quite great
<marvin-hh> whitequark: if any of those ocaml systems had been designed, why can't I read about their designs and the complexity of every operation?
<whitequark> parcs: it is great if the limit of your complexity is a bunch of C files in a same place
<marvin-hh> The purpose of a build system should be to allow the efficient construction of software and in particular the compilation of said software.
<whitequark> go over that and you'll see some custom-built monstrosity in any project you'll look at
<marvin-hh> If a system needs to inspect all files for changes before it starts, it has already lost for example.
<marvin-hh> If someone writes a build system and doesn't document its exact complexities, I consider it to be an amateuristic hack.
<marvin-hh> Additionally, if someone doesn't do a comparison with other systems, it's not even proper research, let alone a product.
<marvin-hh> If you don't do the above things and still decide to publish, you are nothing but a fool.
<whitequark> then there are no build systems at all
<marvin-hh> I don't agree with that assertion, but indeed, within the OCaml community there is no such open-source system.
lordkryss has joined #ocaml
<whitequark> no, I assert that there are no (open-source. who the heck wants a closed-source one) build systems at all
<mrvn> 99% of all open source falls under that, if not 100%
<whitequark> you're welcome to give a counterexample
<mrvn> Name one open source project that is fully documented
<parcs> whitequark: i'm not surprised that a complex build process will have a complex implementation
<whitequark> mrvn: sqlite is a good example in this regard
<marvin-hh> sqlite received USAF funding and has been made by one guy on a mission.
<mrvn> whitequark: that gives O(), o() and omega() notations for every functiuon call?
<whitequark> mrvn: oh, in that sense
<marvin-hh> The C++ standard library also is of acceptable quality.
<whitequark> then there are probably just no software that falls under that definition
<whitequark> certainly not C++ stdlib.
<mrvn> 14:06 < marvin-hh> whitequark: if any of those ocaml systems had been designed, why can't I read about their designs and the complexity of every operation?
<whitequark> mrvn: I interpreted "every" in not such an absurdly absolute sense
<mrvn> Who cares about the complexity of every operation? Does it work? Does it do what I want? Is it fast?
<ggole> Nobody bothers documenting complexity because it captures so little of the performance characteristics of real software.
<ggole> For data structure libraries it's probably a good idea.
<whitequark> good point.
<marvin-hh> No, they don't document it, because they are sloppy.
<marvin-hh> Sloppy thinkers ~ sloppy writers.
<mrvn> A build system shouldn't have such a high number of targets/files that the complexity becomes meaningfull beyond wether it has to stat every file.
<marvin-hh> Leslie Lamport did a presentation on that topic recently.
<mrvn> marvin-hh: a lot of the time you also don't easily know the complexity.
zpe has quit [Ping timeout: 245 seconds]
<marvin-hh> mrvn: and is there any OCaml build system which doesn't need to stat every file?
<mrvn> and an easy guess is so hight to be useless.
<whitequark> "complexity of accidentally starting Photoshop: O(fuck!)"
<mrvn> marvin-hh: Is there any such build system?
<marvin-hh> mrvn: multiple.
<mrvn> marvin-hh: then how do they detect that a file has changed? You need to touch it at least once
<whitequark> mrvn: inotify/fsevent
<marvin-hh> mrvn: kernel interfaces.
<mrvn> that only works for repeated builds though
<mrvn> with a daemon running all the time
<whitequark> I don't really see a problem with lstat() calls per se. do you not have a disk cache?
<whitequark> ocamlbuild's problem lies in poor parallelization, as I see it
<mrvn> whitequark: for something like the linux kernel it takes quite a while to stat every file even with cache
<mrvn> whitequark: part of that is ocamls fault
<marvin-hh> No the fault lies entirely with the author of the tool.
<mrvn> specifically .cmi generation
zpe has joined #ocaml
<marvin-hh> He should have known in advance what the limitations of his language of choice were.
<marvin-hh> As a result he should have reconsidered and abandoned the project.
<whitequark> mrvn: doesn't ocamlbuild md5 the files rather than just lstat them?
<mrvn> marvin-hh: the problem is that if you compile foo.ml for both bytecode and binary in parallel then one of them will fail.
<mrvn> whitequark: possibly.
<marvin-hh> mrvn: the compiler has been misdesigned too in that case.
<whitequark> though seriously, get an SSD already
<mrvn> whitequark: ocamlbuild has quite a high startup time before it compiles anything at all
<marvin-hh> Linux also touches over 5000 files while it is booting.
<mrvn> whitequark: SSD won't change a thing. all my sources are in ram
<marvin-hh> There is no need to have an SSD other than lazyness.
<whitequark> or more RAM, indeed
<whitequark> marvin-hh: by this logic, all software should be written in assembly.
<ggole> Laziness of that kind is actually one of the best reasons to buy hardware
<marvin-hh> whitequark: no, we have compilers for that.
<whitequark> and we have hardware for fixing slow things
<marvin-hh> It's a good thing we don't work together.
<mrvn> I would love to see the stdlib, core and batteries add O() notations to their API docs.
hhugo has quit [Quit: Leaving.]
<ggole> I dunno. It's not like you'll keel over and die if Array.get fails to state it is O(1).
shinnya has quit [Ping timeout: 245 seconds]
<ggole> List.find: linear! OMG!
<whitequark> mrvn: indeed, I prefer to get things done
<whitequark> er, marvin-hh ^
<ggole> For less obvious operations there's value, fair enough.
<marvin-hh> whitequark: I prefer to do things only once.
<marvin-hh> whitequark: I also prefer to not have to explain to someone why something doesn't work.
<whitequark> I have these things called "deadlines"
<ggole> Those things that make a whooshing noise as they fly past?
hhugo has joined #ocaml
<whitequark> yep.
rand000 has quit [Quit: leaving]
<marvin-hh> Every single time I have given in to 'practical considerations' it has turned into a problem.
<marvin-hh> Practical considerations *always* come from people who have no foundation.
<marvin-hh> If I would ever propose OCaml to be used, I am sure someone could come back and ask me why the Java people were able to build various IDEs and why in OCaml they have nothing to show for it.
<mrvn> because ocaml already has IDEs
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
shinnya has joined #ocaml
<whitequark> did you just bring up Java as an example of good design on a strong foundation?
<marvin-hh> whitequark: no, I did not.
<marvin-hh> mrvn: name one.
<mrvn> .oO(emacs, vi)
<ggole> Must be because they document their complexities (and not because, say, there are millions of Java programmers from which to make money)
<marvin-hh> mrvn: those are not IDEs.
<marvin-hh> mrvn: and giving that as a reply will get people laugh at you.
<ggole> There's things like ocalide and, what it it called, camelia?
<marvin-hh> Also, vi. LOL
<ggole> They don't have the same effort put into them as the big Java IDEs.
<marvin-hh> You do know that there is a difference between vi and vim, right?
<mrvn> and that one wich lets you inspect the types and results as you type
<mrvn> marvin-hh: nobody uses vi
<marvin-hh> mrvn: you said vi, not me.
<whitequark> such an adorable attempt at trolling
<mrvn> marvin-hh: when somebody says vi they mean vim or similar
<marvin-hh> mrvn: which ide let you inspect types?
<ggole> I'd actually like the OCaml tools to move towards something like slime rather than Eclipse
<marvin-hh> mrvn: I know of one which claimed to be able to do it, but in practice did not actually work.
<mrvn> marvin-hh: emacs, vi. The new thing was that it showed the type while you enter code, not just after compiling
<whitequark> merlin
<marvin-hh> If there is one thing I don't like, it's misrepresentation.
<whitequark> sublime-ocp-index has it too
<marvin-hh> Why are there multiple systems if one is a proper system?
<mrvn> because proper is subjective
<marvin-hh> I am just guessing here, but I am fairly sure that if I were to install merlin again, that I would find something wrong with it in 10 minutes.
<ggole> merlin isn't an IDE, nor is it finished or polished
<ggole> It is useful though.
<marvin-hh> Ah, there we go.
<marvin-hh> So, we went from 'yes' to 'no'.
<marvin-hh> Next time, just say that OCaml has no working IDEs.
<marvin-hh> It's the only correct answer to the query.
<marvin-hh> It has some hobbyist projects, but none which you would want a co-worker to use.
<marvin-hh> Because, if you suggest the tool, they will come complaining to you.
<marvin-hh> That's also why I don't quite understand you would even want to list broken tools.
<marvin-hh> I would keep my mouth shut about people creating inferior broken shit in my programming language of choice.
<whitequark> I would certainly recommend sublime-ocp-index. it is enough for productive work and it works well.
<marvin-hh> whitequark: because you wrote it?
<mrvn> marvin-hh: You are right, emacs is no IDE. It's better. :)
<whitequark> marvin-hh: because it works
hhugo has quit [Quit: Leaving.]
<whitequark> I wrote plenty of things that do not.
<marvin-hh> mrvn: emacs doesn't make use of multiple cores.
<def`> :DDDDDD
<marvin-hh> mrvn: don't talk about emacs as if it is any good. Emacs has received no innovation since some MIT guy built it.
<marvin-hh> I am saying that as an expert Emacs user, btw.
<marvin-hh> I likely know more about Emacs than you will ever do.
<whitequark> I would grade this at about two Dijkstras
<asmanur> marvin-hh: is that what causes the urge to come and troll entire IRC channels?
<def`> with what you said earlier, how couldn't I trust you (and I am saying that as guy spending time on IRC mainly to trust people)
<mrvn> marvin-hh: an expect in eamcs. great. How do you tell it to not replace 8 spaces with tabs when indenting?
<ggole> emacs is a mess, sure enough
<ggole> It hasn't stopped evolving though
<marvin-hh> mrvn: TABS need to die.
<marvin-hh> mrvn: and it would be easy to change that.
<mrvn> so much for being an expert
<marvin-hh> mrvn: I actually misread.
<marvin-hh> mrvn: my Emacs doesn't do that.
<marvin-hh> mrvn: and default Emacs also doesn't do that.
<marvin-hh> mrvn: and I don't care for trivia.,
<whitequark> yes, you only care for Foundations.
<marvin-hh> mrvn: my custom compiled Emacs has about 5000 lines of custom configuration.
<marvin-hh> mrvn: some of those are major modes I wrote myself and the rest is just convenience functionality.
<marvin-hh> whitequark: indeeed, I care for people who are like Dijkstra.
<whitequark> marvin-hh: care to show your Turing Award, then?
<marvin-hh> whitequark: I already told people who received Turing Awards that they are wrong.
<marvin-hh> whitequark: did you?
<marvin-hh> whitequark: (and I have some academic heavy weight to back up my statement regarding them being wrong.)
<whitequark> marvin-hh: doi of publication?
<marvin-hh> I never told Dijkstra he was wrong, because ... he is Dijkstra.
<marvin-hh> whitequark: I never cared to go for the publishing route.
<mrvn> marvin-hh: you are wrong. There, I told you. What do I get now?
<marvin-hh> mrvn: about what?
<mrvn> marvin-hh: who cares? I just told you "you are wrong."
<marvin-hh> mrvn: indeed, nobody cares.
<ggole> I'll say.
SHODAN has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<Unhammer> I wish my irc client could ignore both the troll and the responses to the troll.
<mrvn> Unhammer: it can most of the time
SHODAN has joined #ocaml
<Unhammer> yeah I suppose
<whitequark> it's pretty hilarious
zpe has quit [Ping timeout: 245 seconds]
sirssi_ has joined #ocaml
t4nk088 has joined #ocaml
<t4nk088> Hi, does anyone here have experience with js_of_ocaml ?
t4nk088 has quit [Ping timeout: 246 seconds]
ontologiae has quit [Ping timeout: 245 seconds]
pminten has joined #ocaml
dsheets has joined #ocaml
Thooms has quit [Quit: WeeChat 0.4.3]
samrat has quit [Quit: Computer has gone to sleep.]
zpe has joined #ocaml
hhugo has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
maattdd has quit [Ping timeout: 246 seconds]
samrat has joined #ocaml
fold has quit [Ping timeout: 250 seconds]
shinnya has quit [Ping timeout: 260 seconds]
cdidd has quit [Ping timeout: 240 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
cdidd has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
samrat has quit [Ping timeout: 255 seconds]
paddymahoney has quit [Ping timeout: 240 seconds]
jabesed has joined #ocaml
ebzzry has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
fold has joined #ocaml
ebzzry has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
maattdd has joined #ocaml
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
zpe has joined #ocaml
zpe_ has quit [Read error: Connection reset by peer]
Nahra has quit [Remote host closed the connection]
Nahra has joined #ocaml
samrat has joined #ocaml
hhugo has quit [Quit: Leaving.]
ontologiae has joined #ocaml
samrat has quit [Ping timeout: 240 seconds]
ontologiae has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
maattdd has quit [Ping timeout: 255 seconds]
hhugo has joined #ocaml
englishm has joined #ocaml
Submarine has joined #ocaml
hhugo has quit [Quit: Leaving.]
badon has quit [Ping timeout: 240 seconds]
badon has joined #ocaml
pminten has joined #ocaml
mort___ has joined #ocaml
Hannibal_Smith has joined #ocaml
fold has quit [Ping timeout: 255 seconds]
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
slash^1 has joined #ocaml
leowzukw has joined #ocaml
slash^ has quit [Ping timeout: 245 seconds]
slash^ has joined #ocaml
englishm has quit [Remote host closed the connection]
slash^1 has quit [Ping timeout: 250 seconds]
englishm has joined #ocaml
yacks has joined #ocaml
ygrek has joined #ocaml
bytbox has joined #ocaml
fold has joined #ocaml
cody__ has joined #ocaml
_0xAX has joined #ocaml
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<leowzukw> Hi, is it possible to write a function like this http://pastebin.com/jfVuSjUL ?
thomasga has joined #ocaml
<thomasga> def`: is there a way to tell merlin to support the `with sexp, compare, …` syntax?
<def`> M-x merlin-extension-enable
englishm has quit [Remote host closed the connection]
<def`> … though it might not be enabled in the 2.00 branch
englishm has joined #ocaml
<thomasga> ha I was missing a PKG in my .merlin actually
<thomasga> works now, thanks!
<thomasga> (why does "with bin_io" needs the "bin_prot" package … ?)
<def`> bin_io steps refers to definitinos from bin_prot?
<def`> stubs*
<thomasga> yep
<ggole> leowzukw: no, but you could create field accessors and pass them
ygrek has quit [Ping timeout: 272 seconds]
willy_ has joined #ocaml
samrat has quit [Ping timeout: 245 seconds]
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
wwilly has quit [Ping timeout: 240 seconds]
englishm has quit [Read error: Connection reset by peer]
englishm has joined #ocaml
fold has quit [Ping timeout: 260 seconds]
Rohan_14 has joined #ocaml
<Rohan_14> Write a program maxint: unit -> int , that reports the largest int value that OCaml permits. [Hint: keep doubling the value until there is an over ow] (Both input and output has to be in the same base.)
<mrvn> 1) what input?
<mrvn> 2) why not just print the constant ocaml provides?
<Rohan_14> mrvn: ok make no input just print the max int value it can store
<Rohan_14> mrvn: how to do it can you show ?
<ggole> The hint pretty much tells you how to do it.
<mrvn> the hint also gets you the wrong answere
<Rohan_14> mrvn: i know that's why i asked can you give me the correct soloution
<Rohan_14> mrvn: doubling the value will skip max int size
leowzukw has quit [Ping timeout: 260 seconds]
<Rohan_14> ggole: can you give me the code /
nico159_ has joined #ocaml
<mrvn> take the largest you can get by doubling. Then add half of that if it doesn't overflow, a quarter, 1/8th, 1/16th ...
leowzukw has joined #ocaml
<mrvn> and I'm not doing your homework
<Rohan_14> mrvn: why not to increment one and make a recusion and print value at the overflow point ?
<mrvn> Rohan_14: # max_int;;
Hannibal_Smith has quit [Ping timeout: 255 seconds]
<mrvn> - : int = 4611686018427387903
<mrvn> you think that will ever finish?
nico159_ has quit [Client Quit]
samrat has joined #ocaml
Hannibal_Smith has joined #ocaml
<ggole> Rohan_14: no, but I'll give you a hint: you need to accumulate the numbers you are doubling somehow
<Rohan_14> mrvn: can i directly print the max_int like you did ?
<mrvn> Rohan_14: I bet that won't get you any points in the exercise
<Rohan_14> mrvn: lol i just want to know for myself
ontologiae has joined #ocaml
<mrvn> then just print it
badon_ has joined #ocaml
samrat has quit [Ping timeout: 260 seconds]
<Rohan_14> mrvn: i mean is there any constant that already stores max_int value ??
<mrvn> yes, max_int
<mrvn> let rec maxint ?(acc=1) () = let t = 2 * acc + 1 in if t < acc then acc else maxint ~acc:t ();;
<mrvn> assumes ocaml uses 2th complement binary.
cody__ has quit [Remote host closed the connection]
<mrvn> or rather than the max is 2^n - 1
badon has quit [Disconnected by services]
<mrvn> s/than/that/
badon_ is now known as badon
ontologiae has quit [Ping timeout: 250 seconds]
<ggole> Pretty much what I had: let maxint () = let rec loop i sum = if i < 0 then sum else loop (i * 2) (sum + i) in loop 1 0
englishm has quit [Remote host closed the connection]
<mrvn> ggole: note the +1
<mrvn> no need to have 2 variables
englishm has joined #ocaml
<ggole> Except you introduce a second variable? :)
<mrvn> and don't try that in python :)
<ggole> There's a funny story about that, actually
<ggole> (About Lisp, another language with large integers)
samrat has joined #ocaml
<mrvn> the size of a bignum isn't a bignum?
<leowzukw> ggole: (Sorry for the delay) Thank you very much, it works!
<Rohan_14> ggole: can you please explain me you code it would be great help i am new
<Rohan_14> mrvn: can you please explain me you code it would be great help i am new
<Drup> ahah, I just read the backlog, this was funny
<Drup> how to spot a troll
<Drup> > Says X is shit and FOO community does it better
<Drup> > Is asked for specific examples of better designs
<Drup> > Answer another question.
<mrvn> Rohan_14: i double the value and add one till it isn't getting bigger
maattdd has joined #ocaml
<mrvn> It's also written so that newbies can't use it for their exercises because it uses features they won't be able to explain
<Rohan_14> mrvn: yeah i can see that can you write the same in simple language please !
<Drup> mrvn: <3
<mrvn> Rohan_14: if it is an exercise then solve it yourself. Otherwise just use max_int.
englishm has quit [Remote host closed the connection]
<mrvn> you aren't going to learn by copying.
englishm has joined #ocaml
<Rohan_14> mrvn: just one last time !
<Rohan_14> mrvn: ok can you explain me the ggole's code ?
<Rohan_14> ggole: can you explain the code ?
<mrvn> ggole: ^^
<mrvn> Now for more fun: Compute the length of the largest string. :)
samrat has quit [Quit: Computer has gone to sleep.]
<mrvn> And not on 32bit, that is boring.
<mrvn> hmm, I have some time to kill before Dr. Who.
<Rohan_14> mrvn: can you explain ggole's code please
<ggole> Rohan_14: it adds each power of two until they wrap
<Rohan_14> ggole: what do you maen by until it wrap
<bytbox> I notice that I can perform structural comparisons on first-class modules, to test if a module passed as an argument is the same as another module. Is there a way to do this in pattern matching?
samrat has joined #ocaml
<ggole> OCaml ints are fixed size. When a calculation is too big, it will wrap.
<bytbox> i.e., I want to write (match my_module with | Mod1 -> 1 | Mod2 -> 2 | _ -> 0)
<ggole> Try max_int - 1, max_int, max_int + 1, max_int + 2 in the repl
<mrvn> bytbox: isn't that just a physical equality?
<bytbox> mrvn: yeah, actually it might be the same.
<mrvn> bytbox: you can't match on values, only literals.
<mrvn> Not sure if modules count as literals
<bytbox> mrvn: ok. I don't think they do. Shame that I'll have to use nested if/then
bezirg has quit [Ping timeout: 255 seconds]
<def`> the only matching that can be done on module is unpacking
<def`> abd it is irrefutable
<mrvn> bytbox: why not have a type module = Mod1 | Mod2 | Mod3 | Unknown of Mod.t?
<mrvn> bytbox: and then pass in the varian instead of the module.
<bytbox> mrvn: I think I actually might do that. And then have a function that takes module and returns an actual module
<def`> and since at runtime a module is just a record of its fields, you're a doing structural comparison on values that are likely to be functions
<mrvn> Not sure why you would want that but that would be the way to go.
<def`> meaning it might raise an exception sooner or later
<mrvn> def`: functions have equality
<bytbox> def`: yeah, I can see that that might be evil :)
<mrvn> bytbox: equivalent modules also won't be equal
<bytbox> mrvn: two blank modules, defined separately, are. I haven't tested anything else.
<bytbox> ah well - the 'type module' thing is the way to go
<def`> mrvn: you're mixing physical and structural equality
<mrvn> # (fun () -> ()) = (fun () -> ());;
<mrvn> Exception: Invalid_argument "equal: functional value".
<mrvn> - : bool = false
<mrvn> # (fun () -> ()) == (fun () -> ());;
<mrvn> def`: you mean that?
<def`> yes
<mrvn> I would expect the same for first class modules
<ggole> It's fine if they don't contain functions
<mrvn> Can you structurally compare 2 modules that have no functions?
<ggole> But that's a strange thing to rely on.
<def`> see my message above
<ggole> mrvn: they're really just records
<mrvn> yeah
badon_ has joined #ocaml
<Rohan_14> ggole: you said value will wrap is wrap equal to overflowing ?
<Rohan_14> ggole: there ?
<ggole> Amusingly, if you let m () = (module struct let v = 0 end : One) let r () = { v = 0 } the two values will be merged
<ggole> I guess the compiler does a bit of numbering now or something
badon has quit [Disconnected by services]
badon_ is now known as badon
<Rohan_14> ggole: how do i make my teachers understand that what do i mean by wrap ?
ontologiae has joined #ocaml
<ggole> Rohan_14: do you understand what you mean by wrap?
<Rohan_14> ggole: no ! i'm not able to get what exaclty is wrap
<Rohan_14> when i did max_int+1 it gave me 2^62
<Rohan_14> ggole: max_int+1 gave em 2^62 =4611686018427387904
<ggole> In OCaml?
<Rohan_14> yeah
<ggole> O_o
<ggole> I wonder if you've given max_int a funny binding
<Drup> Rohan_14: you're sure you didn't redefined max_int ?
<ggole> Does max_int = Pervasives.max_int?
mort___ has quit [Quit: Leaving.]
<Drup> yes
<Drup> actually ...
<ggole> Drup: I was asking him :)
<ggole> Rohan_14: anyway, max_int + 1 is supposed to "wrap around" and give you a negative number
<ggole> That behaviour is what I meant by wrapping.
<Rohan_14> ggole: just like it does in C language :)
<mrvn> actually the bahaviour of max_int + 1 is undefined
<ggole> mrvn: where does it say that?
<ggole> (Unless you meant in C.)
<mrvn> ggole: C standard. ocaml doesn't specify most of this stuff and just inherits C behaviour
<ggole> What? OCaml doesn't "inherit" anything.
<mrvn> ggole: A few month back I had this code: char c=1; while(c != 0) { ... c++; }
<Rohan_14> cool thanks for you time fella my problem is solved
<Rohan_14> fellas
Rohan_14 has quit [Remote host closed the connection]
<mrvn> ggole: never completes since c got optimized into a register and that overflows at 64bit.
<ggole> That's C for you
<ggole> Nothing to do with OCaml though.
<mrvn> ggole: if you run ocaml of a system with 1th complement integers then max_int + 1 == 0
<mrvn> -0 to be precise
<mrvn> not sure what it would do on a terniary system
<ggole> Can you demonstrate this? :)
<mrvn> ggole: buy me a cpu with 1th complements.
<ggole> I'll have to build one, brb.
englishm has quit [Ping timeout: 240 seconds]
<mrvn> 0x80000000 on 1th complement is -0.
<pyon> Does OCaml have analogs of Standard ML's "andalso" and "orelse" operators?
<pyon> I mean, they ought to be short-circuiting -- if the left operand fully determines the result of the expression, the right operand ought not to be evaluated.
maattdd has quit [Ping timeout: 264 seconds]
<mrvn> not lazy forms of and and or?
<ggole> && and ||
ollehar has joined #ocaml
<pyon> mrvn: ggole: Oh, nice! Thanks.
<ollehar> is there an ml dialect with manual memory management?
<ggole> Yeah, ATS
<mrvn> ollehar: unlikely
<mrvn> (but not impossible :)
<ggole> Well, I dunno if I would call it an ML dialect
<ggole> It's leaning a bit in that direction.
<ollehar> ATS stands for itself, no?
<mrvn> people sure are crazy
<ggole> There's also LinearML, but I don't know much about that.
<pyon> ollehar: Do linear types count as "manual memory/resource management" in your book?
<NoNNaN> linear typing is also a kind of memory management
samrat has quit [Ping timeout: 260 seconds]
<pyon> Aw, ninja'd
<ggole> \o/
<ollehar> pyon: does it have malloc and free? that's pretty much what I ment
<mrvn> NoNNaN: that just an optimization to do the GC bit statically.
<ollehar> maybe rust is the closest
<pyon> ollehar: Linear types effectively force you to malloc and free. Except you get a type error if you forget to free or use-after-free.
<ollehar> pyon: yeah, that's cool. I've used splint a little bit for C, which also throws errors in such situations
<ollehar> although splint is not maintained at the moment.
<pyon> ollehar: A static error or a runtime one?
<ollehar> pyon: splint analyses the code statically. you have to help it a bit with annotations.
<pyon> Ah, nice!
<ollehar> yeah, I really like it! it check for bounds too.
<pyon> And, yeah, Rust is probably the closest... at least amongst actually viable alternatives.
<mrvn> I've been thinking (for a while) about a ocaml/C dialect where types could change by using them. E.g. "close fd" changes the type of fd from file_descr to invalid
_0xAX has quit [Remote host closed the connection]
<ollehar> so you basically get the rust/C++ idiomatic functionality with owned pointer and such.
<pyon> mrvn: The easiest thing is to actually make the file descriptor go out of scope after you use it.
parcs has quit [Remote host closed the connection]
<pyon> ollehar: Ah!
<ollehar> mrvn: you can do stuff with that in ocaml already with phantom types wrapped in monades.
<mrvn> pyon: In this case. but there can be other transformations
<ollehar> *monads
<mrvn> ollehar: no. that always leaves fd as is
<mrvn> ollehar: close fd; close fd; won't give a compile error
<pyon> mrvn: After you make the old thing go out of scope, you can return a new thing. If the compiler is aware that things that go out of scope cannot be reused, the new thing can even be stored in the same place in memory where the old thing was.
<marvin-hh> mrvn: any dependently typed programming language can do that.
zpe has quit [Read error: Connection reset by peer]
<mrvn> marvin-hh: then show me in ocaml
samrat has joined #ocaml
<marvin-hh> mrvn: ocaml is not a dependently typed programming language.
zpe has joined #ocaml
<mrvn> marvin-hh: then what are GADTs
<pyon> Perhaps he means a dependently typed language with full blown inductive families?
<mrvn> or a meta type system
<marvin-hh> mrvn: an extension of ADTs.
<pyon> marvin-hh: GADTs are a lightweight form of dependent typing, really.
<marvin-hh> mrvn: they do not transform OCaml into a dependently typed programming language.
<mrvn> anyway. What I've been thinking is to have syntax a bit like this: function socket(host : string, port : int, socket : unit -> sock_t); function close(sock_t -> unit);
<mrvn> So argument types can either stay the same or get transformed
<marvin-hh> Yeah, we definitely need another programming language!
* marvin-hh facepalms
<ollehar> mrvn: You can do that with phantom types, I think. I made a module which statically check the length of a stack when communicating with Lua. check out this short tutorial: http://till-varoquaux.blogspot.de/2007/06/phun-with-phantom-types.html
parcs has joined #ocaml
<ollehar> so the state of the stack is checked statically. heh.
<mrvn> ollehar: nope. you can't change the type of a binding in ocaml
<ollehar> mrvn: you change the phantom type, not the type
<mrvn> ollehar: you can't make close take the FD out of scope
<mrvn> ollehar: phantom types are just types that take no memory
dsheets has quit [Ping timeout: 250 seconds]
<ollehar> mrvn: you can make the fd unusable to other functions in the same module, though.
<mrvn> ollehar: but that only gives you a runtime error
<ollehar> no
<ollehar> but without monads, you would have to do `fd = close(fd)`
<Drup> mrvn, pyon : no, GADT are not dependent types
<Drup> you can do some stuff with GADT that are dependent-y
<ollehar> with monads, each call could fetch the fd state. but I never did that.
<Drup> but if you have ever programmed in some dependently typed langages, it doesn't realy compare ...
<mrvn> ollehar: then you create a new binding (also called fd) shadowing the old one. That doesn't prevent code like "let fd2 = close fd in close fd
<ollehar> mrvn: that's true
<mrvn> maybe one could do some ppx magic to make "close fd" become "let fd = close fd in" automagically. But what do you do with "foo (x+1)" then?
<Drup> pyon: do you now about mezzo too ?
<pyon> Drup: Nope.
* pyon duckduckgoes
<Drup> it's another ML like language with ownership and stuff
* mrvn waits for DrWho to appear on the internet
<Drup> pyon: Rust is quite ML-like, except when it comes to modules
* Tekk_ really dislikes rust
<pyon> Drup: Yeah. Rust's lame module system annoys me to no end. (Although it is certainly an improvement over C++.)
<ollehar> about linear types in ocaml, I got a great answer from gasche about this on stackoverflow: http://stackoverflow.com/questions/15620411/linear-types-in-ocaml
<Tekk_> actually I guess that ocaml for C++ programmers isn't the worst possible description when you put it that way, Drup
<Tekk_> java and C++ programmers
<Drup> I never said anything like that
<Tekk_> yeah
<Tekk_> but when you said that it kinda clicked to me
<Tekk_> and it occurred to me that I was decidedly not in the target audience for rust, hence not liking it :P
<Tekk_> I do like the lifetimes thing though
<Tekk_> but that came from ATS iirc
<Drup> not from ATS, no
parcs has left #ocaml ["WeeChat 0.4.3"]
<Drup> it's an old idea
<ollehar> mrvn: you could use monads, check the example from gasche in the link, it's pretty cool.
<ggole> It's from cyclone and similar research efforts afaik
<mrvn> ollehar: that comes down to "let fd = close fd"
<ollehar> mrvn: yeah, I guess :)
<mrvn> prevents some accidental misuse though
<ollehar> and you don't have to invent a new language! stuff like this should be even easier in haskell, probably (I don't know haskell). maybe even with c++ templates, if you're evil ^^
<mrvn> don't think so. definetly not c++
<mrvn> ollehar: in C++ you would wrap the file in a class object and the destruction of the object would close the file.
<mrvn> but delete fd; delete fd; still segfaults
<Drup> ollehar: they do this sort of stuff in haskell already. It's not as good as you might hope, however, because monad combinators™
<ollehar> Drup: yeah, type-level hackery seems more usual there than in ocaml. kinda feel bad for not taking my time to learn it... but now I learn coq, so! it's all good.
zpe has quit [Ping timeout: 250 seconds]
zarul has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zpe__ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe__ has quit [Remote host closed the connection]
zpe has joined #ocaml
leowzukw has quit [Quit: leaving]
Hannibal_Smith has quit [Quit: Sto andando via]
zpe has quit [Ping timeout: 272 seconds]
troutwine_away is now known as troutwine
badon_ has joined #ocaml
yacks has quit [Ping timeout: 260 seconds]
badon has quit [Ping timeout: 250 seconds]
badon_ is now known as badon
yacks has joined #ocaml
Thooms has joined #ocaml
bytbox has quit [Remote host closed the connection]
samrat has quit [Quit: Computer has gone to sleep.]
ollehar has quit [Quit: ollehar]
sh1ken has quit [Quit: leaving]
Submarine_ has joined #ocaml
Submarine has quit [Ping timeout: 245 seconds]
tane has quit [Quit: Verlassend]
sh1ken has joined #ocaml
badon_ has joined #ocaml
badon has quit [Ping timeout: 246 seconds]
badon_ is now known as badon
Tekk_ is now known as shorty
shorty is now known as Tekk_
Tekk_ is now known as minimus
minimus is now known as Tekk_
Tekk_ is now known as ubot`
ubot` is now known as mubot
mubot is now known as Tekk_
Submarine_ has quit [Quit: Leaving]
bytbox has joined #ocaml
axiles has joined #ocaml
<MercurialAlchemi> I have a weird opam problem (1.2 beta)
mort___ has joined #ocaml
<MercurialAlchemi> I have a package which builds just fine (using oasis) in its own directory
<MercurialAlchemi> When trying to install it with opam, it generates a .depends file with no dependencies
<MercurialAlchemi> And fails predictably when it meets the first 'lwt foo' in the file
troutwine is now known as troutwine_away
zpe has joined #ocaml
Nahra has quit [Remote host closed the connection]
Nahra has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
ontologiae has quit [Ping timeout: 272 seconds]
Simn has quit [Quit: Leaving]
<pyon> Is "value" a keyword?
<pyon> I thought only "val" was.
jabesed has quit [Ping timeout: 260 seconds]
englishm has joined #ocaml
jabesed has joined #ocaml
ggole has quit []
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
jabesed has quit [Ping timeout: 255 seconds]
axiles has quit [Remote host closed the connection]
jabesed has joined #ocaml
willy_ has quit [Remote host closed the connection]
zpe has joined #ocaml
burgobianco has joined #ocaml
badon_ has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
badon has quit [Disconnected by services]
badon_ is now known as badon
lopex has quit [Quit: Connection closed for inactivity]
jabesed has quit [Quit: Konversation terminated!]
jabesed has joined #ocaml
lopex has joined #ocaml
zozozo has joined #ocaml
oriba has joined #ocaml
<Drup> pyon: it's not
<Drup> maybe in camlp4r, but nobody care about that
<pyon> Ah, for some reason GitHub highlights it as if it were a keyword.
<pyon> I am not using camlp4 anyway. :-)
MercurialAlchemi has quit [Ping timeout: 250 seconds]
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
zpe has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
philtor has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
voila has joined #ocaml
Muzer has quit [Excess Flood]
voila is now known as voila-afk
Muzer has joined #ocaml
shinnya has joined #ocaml
zarul has joined #ocaml
philtor has quit [Ping timeout: 250 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
cody__ has joined #ocaml
pyx has joined #ocaml
darkf has joined #ocaml
Unhammer has quit [Ping timeout: 244 seconds]
Unhammer has joined #ocaml
ivan\ has joined #ocaml
ollehar has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
zpe has joined #ocaml
Thooms has quit [Quit: WeeChat 0.4.3]
voila-afk has quit [Quit: voila-afk]
cody__ has quit [Remote host closed the connection]
eikke__ has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
eikke__ has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 255 seconds]
BitPuffin has quit [Ping timeout: 255 seconds]
ollehar has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 240 seconds]