gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
lorilan has quit [Quit: Quitte]
avsm has quit [Read error: Connection reset by peer]
avsm1 has joined #ocaml
iago has quit [Quit: Leaving]
datkin has quit [Read error: Connection reset by peer]
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
datkin has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
lusory has quit [Ping timeout: 248 seconds]
datkin has quit [Read error: Connection reset by peer]
datkin has joined #ocaml
Submarine has joined #ocaml
oriba has quit [Quit: oriba]
twittard has joined #ocaml
twittard has quit [Quit: twittard]
snearch has joined #ocaml
ezyang has joined #ocaml
<ezyang> What do I have to do to make jumping between ml and mli definitions in OCaml happen in Vim?
ulfdoz has joined #ocaml
<ezyang> Looks like it's BACKSLASH s
twittard has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
ulfdoz has quit [Read error: Operation timed out]
NaCl has quit [Ping timeout: 265 seconds]
avsm has joined #ocaml
avsm1 has quit [Read error: Connection reset by peer]
MaskRay has quit [Ping timeout: 260 seconds]
everyonemines has joined #ocaml
snearch has quit [Quit: Verlassend]
yroeht has quit [Ping timeout: 265 seconds]
thomasga has joined #ocaml
yroeht has joined #ocaml
pango is now known as pangoafk
everyonemines has quit [Quit: Leaving.]
Submarine has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
Xizor has joined #ocaml
twittard has quit [Quit: twittard]
TerTar has joined #ocaml
<TerTar> hello
<TerTar> is it true that Ocaml is one of the best languages there are?
<_habnabit> sure
<Drakken> Yes. OCaml is the best language in the world for large-scale development. :)
<TerTar> but for small programs, is it still good?
<TerTar> is it better than Java for example
<adrien> yes; I've used it for a number of scripts too
emmanuelux has quit [Ping timeout: 245 seconds]
<_habnabit> everything is better than java
<TerTar> at my university they make us learn ocaml
<Drakken> good
<TerTar> but I am not used to it cause some things are hard
<_habnabit> it's less of 'hard' and more of 'something you\'re not used to'
<Drakken> they're hard at first, but they're easier and more fun after you learn them.
<Drakken> things people aren't used are hard.
<Drakken> until they get used to them :)
<Drakken> used TO
<TerTar> for example, yesterday I had to implement deques and in java it's easy, double pointed linked list, but in Ocaml you have to do it with two lists that revert each other
<TerTar> it sux
<TerTar> and for my compilation course they made us use menhir instead of yacc for example
<_habnabit> why do you think you have to use two lists
<TerTar> I mean nobody uses menhir in real life
<_habnabit> you could make a doubly-linked list in ocaml if you wanted
<TerTar> _habnabit: they told us to use it in a functional way, without references
<_habnabit> okay, so?
<TerTar> so Ocaml should take some stuff from Java, and evolve
<TerTar> like Classes
<_habnabit> ocaml has classes
<_habnabit> also that's kind of a non sequitur
<TerTar> but we are discouraged to use them, I never saw one teacher use them before
<_habnabit> that seems awfully silly
<_habnabit> there's no reason to avoid using them
<TerTar> the syntax and the language itself is not object friendly, even if the language supports it
<_habnabit> what does that even mean
<Drakken> objects aren't very important for most applications
<_habnabit> how is java 'object friendly'
<Drakken> why do you need objects for a deque if it's just a doubley linked list?
<Drakken> doubly
<adrien> TerTar: menhir is mostly like ocamlyacc which in turns is mostly like yacc
<_habnabit> also doubly-linked lists are super easy: module DoublyLinkedList = struct type 'a t = Node of 'a t option * 'a * 'a t option end
<adrien> of course there are differences because of the language but they're really minor
<TerTar> and why does ocaml have a gtk+ library in it, but not a socket one
<TerTar> it's silly
<_habnabit> 'in it' ?
<_habnabit> anyway your trolling is boring
<adrien> lablgtk(2) is not "in" ocaml
<adrien> there's labltk however
<TerTar> by in it I mean in the standard library
<_habnabit> there's no gtk+ in the ocaml stdlib
<adrien> and no tk either
<TerTar> let me recheck
<adrien> it's aside
asdfhjkl has joined #ocaml
<TerTar> then my teacher lied to me when he told me there is a gtk+ library for ocaml
<adrien> there is one but it's not in the standard library
<adrien> it's called lablgtk
<adrien> and is hosted at http://lablgtk.forge.ocamlcore.org
<TerTar> I wish there was a qt library for ocaml
<Drakken> _habnabit or type 'a t = Bottom of 'a * 'a t | Cons2 of 'a t * 'a * 'a t | Top of 'a t * 'a
cdidd has joined #ocaml
<TerTar> I think Ocaml needs more public support or something
<Drakken> it needs generic printing.
<_habnabit> Drakken, you need an empty cell
<_habnabit> for a totally empty deque
<_habnabit> (but I'd just use the double-option.)
<Drakken> sorry. type 'a t = Nil2 | Cons2 of 'a t * 'a * 'a t
<Drakken> or not
TerTar has quit [Quit: Page closed]
twittard has joined #ocaml
<Drakken> Wait, that's just an alist. You can put low values in the fsts and high values in the snds. That's how interval heaps work, except with a list instead of a heap.
ftrvxmtrx has joined #ocaml
cago has joined #ocaml
<Drakken> Nil2 | Odd2 of 'a | Cons2 of 'a * 'a * 'a t
edwin has joined #ocaml
djcoin has joined #ocaml
ocp has joined #ocaml
wagle has quit [Ping timeout: 245 seconds]
avsm has quit [Quit: Leaving.]
<Ptival> wow
<Ptival> my OCaml program segfaulted :s
<adrien> gdb it ;-)
<adrien> or you're using too much memory
<Ptival> it's a fuzz-test so it'll be hard to reproduce :(
wagle has joined #ocaml
<kaustuv> A segfault can also be caused by too much non-tail recursion
<adrien> always run your fuzz tests under gdb then ;-)
<Ptival> maybe I should print the seed used or something
<adrien> yes, too ;p
<Ptival> kaustuv: since I had it loop 100k times before, I'm pretty sure the tail recursion is going on well
<Ptival> 0x000000000041c2dc in caml_interprete ()
<Ptival> watdo?
<adrien> "bt"
<adrien> and show the backtrace
<Ptival> #0 0x000000000041c2dc in caml_interprete ()
<Ptival> #1 0x000000000040a630 in caml_main ()
<Ptival> #2 0x000000000041b294 in main ()
<adrien> that's, huh, nice
<adrien> I doubt it but can you reproduce it with native code?
<Ptival> I can try
<Ptival> http://ocaml.xelpaste.org/4644 < there it went
<Ptival> Bitstring is the culprit? :)
Xizor has quit [Ping timeout: 260 seconds]
<Ptival> I think I know what can be going on here
<adrien> say, say ;-)
kaustuv has left #ocaml []
<Ptival> oh I just triggered a stack overflow elsewhere
<adrien> oh? it didn't appear in gdb's bt
<Ptival> yeah it must have happened because of a particular byte fuzzed :)
<Ptival> I'll try to debug that first
<Ptival> wow the stack is crazy huge
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<Ptival> it's neverending :)
avsm has joined #ocaml
<Ptival> k so it ends at 999 999
<djcoin> :)
<djcoin> Almost the million ! Too bad
<Ptival> are asserts still there in native code?
<adrien> why would they not?
<Ptival> just asking
<Ptival> ok got that bug!
Zedrikov has joined #ocaml
<Ptival> so this one was a real non terminating loop
<Ptival> and the previous one is:
<Ptival> I wanted to check that a bitstring was completely full of zeroes
<Ptival> and the "dirty easy way" was to create a zeroed bitstring and compare for equality
<Ptival> (same size)
<adrien> :p
<Ptival> but upon fuzzing my input executable
<Ptival> it made my tester believe the bitstring should be 2 gigabytes long :)
<Ptival> don't do that at home kids
KDr2 has quit [Remote host closed the connection]
<adrien> heheh :-)
<adrien> also, 32bit?
<Ptival> I'm running 64bit here
<adrien> 32bit would probably have crashed at bigstring creation
<Ptival> on 32 bit I think it would have choked at around 16MB because of the underlying string limitations
<adrien> oh, you're using a regular string, ok
<Ptival> I'm using ocaml-bitstring by rwmjones
<Ptival> but its underlyign representation is just a (string * int * int)
rixed has joined #ocaml
KDr2 has joined #ocaml
Cyanure has joined #ocaml
_andre has joined #ocaml
mcclurmc_ has quit [Excess Flood]
benozol has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
Cyanure has quit [Remote host closed the connection]
ocp has quit [Read error: Operation timed out]
metasyntax|work has quit [Ping timeout: 248 seconds]
<hnrgrgr> win 3
<hnrgrgr> oups
ikaros has joined #ocaml
<Ptival> :)
metasyntax|work has joined #ocaml
Submarine has quit [Ping timeout: 272 seconds]
pps has joined #ocaml
pps has quit [Client Quit]
ppseafield has joined #ocaml
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
milosn has quit [Read error: No route to host]
milosn has joined #ocaml
letrec has joined #ocaml
letrec has quit [Remote host closed the connection]
ikaros_ has joined #ocaml
letrec has joined #ocaml
ikaros has quit [Ping timeout: 245 seconds]
<Drakken> What do I do after I've defined my camlp4 syntax extensions? Do I have to write out the file-handling code for my parser program by hand?
<Drakken> A custom parser is a standalone program, right? I feed it to ocamlc -pp?
smondet has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
avsm has quit [Quit: Leaving.]
Tobu has quit [Ping timeout: 260 seconds]
mort___ has joined #ocaml
Zedrikov has quit [Ping timeout: 240 seconds]
Tobu has joined #ocaml
KDr2 has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 260 seconds]
zcero has joined #ocaml
<zcero> Hello. What's the practice of using ocamldebug with oasis built projects? I get "No source file" when trying to set a breakpoint.
Tobu has joined #ocaml
<csmrfx> whats oasis?
MaskRay has quit [Quit: leaving]
emmanuelux has joined #ocaml
<zcero> csmrfx: A meta build tool, like cabal. haven't tried it?
<csmrfx> no
<zcero> csmrfx: It's pure brilliance. http://oasis.forge.ocamlcore.org/index.php
<thelema> zcero: since oasis uses ocamlbuild, all the files ocamlebug needs are in _build/ - maybe use -I _build/ when running ocamldebug?
djcoin has quit [Quit: WeeChat 0.3.2]
<zcero> thelema: Yup. That seems to be the problem. Haven't used ocamldebug that much. Seems like i haven't built my libraries with debug info.
<zcero> thelema: hmmm.. ocamldebug cannot find some modules (third party libraries). Am I right in assuming they are build without debug info, or is there a way to add them so oacmldebug can find them?
cago has quit [Read error: Connection reset by peer]
<csmrfx> ok
<csmrfx> is Oasis defacto?
<csmrfx> (is it *the* build tool for OCaml?)
<zcero> csmrfx: It wraps several of the other build systems. ocamlbuild is one of them that comes with the compiler from INRIA.
<NaCl> s/several/one/
<NaCl> unless the others have been implemented
<csmrfx> so, ocamlbuild is the 'rake' of OCamlworld
<csmrfx> or will Oasis be that?
<zcero> I thouhgt it did wrap others? ocamlbuild works so I haven't tried any other.
<csmrfx> ok
<zcero> csmrfx: probably. But OCaml Pro is working on some kind of package manager. Don't know anything about the plans for that though.
<csmrfx> wait, package manager? you mean oasisdb?
<zcero> csmrfx: No another one I think. At least there is a github repo for one. Forgot about oasisdb. If it's half as good as oasis it's going to be great.
<zcero> starting to sound like a oasis groupie now, but it's really working very well.
fraggle_ has quit [Remote host closed the connection]
<zcero> gah.. I'm trying to debug a module using stuff from jane streets core library and ocamldebug keeps saying "Cannot find module Core.Std". I use GODI to install packages. Am I right in assuming that GODI doesn't build libraries with debug info?
ulfdoz has joined #ocaml
fraggle_ has joined #ocaml
benozol has quit [Quit: Konversation terminated!]
The_third_man has quit [Ping timeout: 248 seconds]
letrec has quit [Ping timeout: 244 seconds]
Zedrikov has joined #ocaml
zcero has left #ocaml []
mort___ has quit [Ping timeout: 244 seconds]
Zedrikov has quit [Ping timeout: 260 seconds]
ftrvxmtrx has quit [Quit: Leaving]
ulfdoz_ has joined #ocaml
ikaros_ has quit [Quit: Ex-Chat]
Submarine has joined #ocaml
ulfdoz has quit [Ping timeout: 248 seconds]
ulfdoz_ is now known as ulfdoz
Xizor has joined #ocaml
probst has joined #ocaml
probst has quit [Client Quit]
mrvn has joined #ocaml
<mrvn> Can anyone help with first class modules? I can't get rid of the Obj.magic in http://paste.debian.net/159014/
<thelema> mrvn: do you have to unpack the module?
<mrvn> what do you mean by unpack?
<thelema> what you're doing on L25
<mrvn> all the examples I found do it
<thelema> do the Obj.magics go away if you put next inside the let () =?
<mrvn> nope. still: Error: This expression has type task but an expression was expected of type M.a
<hnrgrgr> mrvn: on line 15 use: module M : DList with type a = task = struct
<hnrgrgr> otherwise M.a is abstract.
<mrvn> thx.
<mrvn> that was it.
<_habnabit> hnrgrgr, hum, what's the difference?
<mrvn> you can't access abstract types from outside the module or cast the type
Zedrikov has joined #ocaml
<_habnabit> ah
<hnrgrgr> The type signature (M : DList) hides the concrete type definition of type a. And outside the module M, the type 'M.a' is not equal to 'task' anymore.
<_habnabit> right, okay
<hnrgrgr> another solution is to remove the type constraint: module M = struct ... end
<mrvn> Now I can do nice things: http://paste.debian.net/159021/
<mrvn> hnrgrgr: stupid me wanted to make sure the type fits DList
<thelema> yay, recursive values aren't so hard.
Snark has joined #ocaml
Zedrikov has quit [Quit: Bye all, see you next time!]
<mrvn> When I use a first class module does ocaml pass in a tale of function pointers for the generic function or does that get optimized away?
<mrvn> s/tale/table/
<thelema> IIRC, modules share the same representation as records
ikaros has joined #ocaml
Zedrikov has joined #ocaml
<thelema> as the indirection can't be optimized away in general, I expect little attempt is made to optimize this
<mrvn> So in the end passing 'module type Foo = sig val get : a -> b end' is the same as 'type foo = { get : a -> b; }?
<thelema> the typing isn't quite the same, but I believe the underlying data is the same
pangoafk is now known as pango
Zedrikov has quit [Quit: Bye all, see you next time!]
<mrvn> thelema: yeah, with modules you can cast the module to a subtype.
<mrvn> What is the syntax to return a module from a function?
<_habnabit> same as returning any value
mcclurmc- has joined #ocaml
<_habnabit> (module X: Y) is how you get a value out of a module, etc.
asdfhjkl has quit [Quit: Leaving]
mcclurmc- has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
lorilan has joined #ocaml
twittard has quit [Quit: twittard]
Snark has quit [Quit: Quitte]
<pippijn> hey
Tobu has quit [Ping timeout: 272 seconds]
<pippijn> who wanted that thing with error messages in menhir again?
Snark has joined #ocaml
<pippijn> I implemented it for the table based engine
ftrvxmtrx has joined #ocaml
Tobu has joined #ocaml
twittard has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
NihilistDandy has joined #ocaml
chambart has quit [Ping timeout: 248 seconds]
Snark has quit [Quit: Quitte]
chambart has joined #ocaml
The_third_man has joined #ocaml
snearch has joined #ocaml
_andre has quit [Quit: leaving]
andreypopp has joined #ocaml
metasyntax|work has quit [Quit: The Spark of Deity ignites in our hands!]
andreypopp has quit [Read error: No route to host]
Drup has joined #ocaml
edwin has quit [Remote host closed the connection]
lorilan has quit [Quit: Quitte]
ppseafield has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
redline6561 has joined #ocaml
redline6561 has left #ocaml []
ulfdoz has quit [Ping timeout: 244 seconds]
EmmanuelOga has joined #ocaml
<thelema> it doesn't like my for loop.
<pippijn> what does it look like?
<thelema> for (int i = 0; i<10; i++) printf("Foo");
<pippijn> it parses GNU89
<pippijn> that's a C99 loop
<thelema> ah, ok.
<thelema> nice. pulling the declaration out of the loop works.
<thelema> the deparsing is pretty stingy with whitespace
<thelema> for(i=0;i < 10;i++)printf("Foo");
<pippijn> yes, it's not perfect, yet
<thelema> It's pretty good for a javascript program
<pippijn> it's an ocaml program
<pippijn> my first ocaml program at that
<thelema> what's the "code samples for missing error messages" box for?
<pippijn> for me
<thelema> ok
<pippijn> if you enter some code for which there is no error message, it adds that to the box
<pippijn> so I can then generate error messages for it
<thelema> AH
<pippijn> I modified menhir to support syntax error messages :)
<pippijn> right now I'm lazy and I feed the samples into gcc and copy its output
<pippijn> but it has potential
<thelema> :)
<pippijn> http://paste.xinu.at/92o/ <- generated
<thelema> better to use clang's error messages - they're much better
<pippijn> thelema: yes, but they are too good
<pippijn> they contain too much context information
<pippijn> so I can't use them
<pippijn> besides
<pippijn> this is just a temporary solution
<pippijn> so I have anything at all
<thelema> I've been thinking about improving the ocaml parser so it could produce clang-quality error messages
<pippijn> with a generated parser, you're not going to get there so easily
cdidd has quit [Ping timeout: 245 seconds]
<thelema> how hard could writing a custom parser for ocaml be? <cough, cough>
<pippijn> not that hard, I think
<pippijn> but then making it produce good error messages is
<pippijn> ocaml doesn't seem to be a very difficult language to parse
Tobu has quit [Ping timeout: 260 seconds]
<pippijn> type checking is more difficult, but that's already there
<thelema> true. That said, the grammar has its problems
<pippijn> like what?
<thelema> a missing ; gives an error far away
<thelema> rather, an extra ;
<pippijn> ah
<thelema> missing the semicolon at the end of a printf gives an amazingly complex error message
<pippijn> right
<pippijn> with the format type
<pippijn> but that's a type error
<thelema> granted.
<thelema> what else... if/then/else has no terminator
<thelema> which is great for very short if/then/else, but terrible when you try to put a debug statement in your else, and the code that was there is always run
<pippijn> that's true
<thelema> total lack of single-line comments is annoying sometimes
<thelema> but syntax highlighting deals with that okay
<Drakken> you definitely have to remember that if has higher precidence than ;
<pippijn> sometimes I want to comment out large blocks of code that contain strings with (* in them
<Drakken> unlike try, let, and match
<Drakken> or sml for that matter
<thelema> Drakken: the best part is that using 'let' directly inside your 'then' allows ; sequences
<thelema> if b then let a = b in foo; bar else baz
djcoin has joined #ocaml
Tobu has joined #ocaml
<Drakken> thelema I don't have a strong opinion on the subject yet. I just try to remember what the current rules are :)
snearch has quit [Quit: Verlassend]
<pippijn> http://paste.xinu.at/aIbf/ <- this fills the symbol table
<pippijn> I was happy to see that the functional way (first building a list of symbols and then adding them all to the hash table in one go) is roughly as fast as the imperative way (adding symbols while traversing)
<pippijn> and this way, it's much nicer :)
<pippijn> by the way, I've noticed that the number of times something compiles and works the first time I type it in is much higher in ocaml than it is in C++
<pippijn> I'm more and more amazed by that fact
ikaros has quit [Quit: Ex-Chat]
<Drakken> yep
thomasga has quit [Quit: Leaving.]
djcoin has quit [Quit: WeeChat 0.3.2]
<ousado> pippijn: you said you wrote a C++
<ousado> .. parser?
<thelema> ousado: C89
Drup has quit [Quit: Leaving.]
<ousado> lemme check the backlog ..
Tobu has quit [Ping timeout: 260 seconds]
<ousado> yep: [21:18] <pippijn> I've written a C++ parser in C#
<ousado> that was yesterday
<pippijn> ousado: yes
<ousado> pippijn: just wanted to ask, a complete one?
<pippijn> pretty much
<ousado> wow..
<pippijn> template templates have issues in certain situations
<pippijn> but libstdc++ can be parsed
<pippijn> boost can't
<ousado> I see
<ousado> still, remarkable
mjonsson has joined #ocaml
Tobu has joined #ocaml
NihilistDandy has quit []
letrec has joined #ocaml
The_thir- has joined #ocaml
The_third_man has quit []
<alpounet> there's another at https://github.com/fgoujeon/scalpel
<alpounet> this one isn't finished yet though
Xizor has quit [Ping timeout: 260 seconds]
letrec has quit [Ping timeout: 272 seconds]
Tobu has quit [Ping timeout: 260 seconds]
smondet has quit [Ping timeout: 265 seconds]
KDr2 has joined #ocaml
ivan\ has quit [Ping timeout: 252 seconds]
Tobu has joined #ocaml
ivan\ has joined #ocaml