gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
boscop has quit [Ping timeout: 272 seconds]
agarwal1975 has quit [Read error: Connection reset by peer]
mnabil has joined #ocaml
myu2 has joined #ocaml
mnabil has quit [Ping timeout: 260 seconds]
joewilliams is now known as joewilliams_away
arubin has quit []
arubin has joined #ocaml
mnabil has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
wuj has quit [Read error: Operation timed out]
lopex has quit []
smerz has quit [Quit: Ex-Chat]
tauntaun has quit [Quit: Ex-Chat]
ski has quit [Ping timeout: 264 seconds]
ski has joined #ocaml
npouillard has quit [Ping timeout: 260 seconds]
Edward has quit []
npouillard has joined #ocaml
npouillard has quit [Remote host closed the connection]
npouillard has joined #ocaml
hcarty has quit [Ping timeout: 250 seconds]
hcarty has joined #ocaml
clog has quit [Ping timeout: 240 seconds]
clog has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
enthymeme has joined #ocaml
tnguyen has joined #ocaml
ski has quit [Ping timeout: 264 seconds]
ski has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
arubin has quit [Quit: arubin]
philtor has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
ski has quit [Ping timeout: 264 seconds]
ski has joined #ocaml
Snark_ has joined #ocaml
npouillard has quit [Read error: Operation timed out]
npouillard has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
Cyanure has quit [Remote host closed the connection]
Snark_ is now known as Snark
<f[x]> mfp, what I find missing in extprot is an ability to map some generated types to host ones. e.g. think of 'a option - I want to use ocaml's option, not the generated one and have to use to_maybe/of_maybe to map all messages back and forth
<f[x]> this is quite cumbersome, taking into consideration ocaml's record fields naming restrictions
<f[x]> so I am thinking of adding ability for the host language to map extprot type to some host type
ttamttam has joined #ocaml
sepp2k has joined #ocaml
eye-scuzzy has quit [Ping timeout: 246 seconds]
eye-scuzzy has joined #ocaml
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
tnguyen has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
edwin has joined #ocaml
ikaros has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Yoric has joined #ocaml
kaustuv_ has quit [Remote host closed the connection]
krktz_ has quit [Remote host closed the connection]
svenl has joined #ocaml
ftrvxmtrx has joined #ocaml
_andre has joined #ocaml
krktz has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
seafood has joined #ocaml
seafood has quit [Read error: Connection reset by peer]
seafood has joined #ocaml
<mfp> f[x]: there's an undocumented mechanism to equate types from the extprot protocol to other OCaml types
<f[x]> I am all ears
<mfp> it looks like this: type opt 'a = None | Some 'a options "ocaml.type_equals" = "option"
<mfp> there's also a way to apply of_t/to_t functions automatically on (de)serialization, so the generated type is not exactly the low-level one used in the protocol
<mfp> e.g. type uuid = string options "ocaml.type" = "Uuid.t, Uuid.of_string, Uuid.to_string"
<f[x]> ouch!
* f[x] removes half of yesterday's code
<mfp> sorry
<f[x]> that's pretty cool, thanks!
mnabil has quit [Ping timeout: 240 seconds]
<mfp> it's not documented because it's very ad-hoc and thought I'd probably change it (e.g. to use a tuple in actual OCaml syntax instead of a comma-separated string), but in the end it stayed that way
<f[x]> I thought of doing it in separate file from .proto cause it is not really protocol thing but more like mapping annotation
* f[x] should have thought that it is already implemented
<mfp> that'd indeed be cleaner, conceptually, but in practice keeping it in the .proto is convenient
<f[x]> yes :)
<mfp> btw, in case you bump into this need, there's another undocumented thing IIRC
<mfp> polymorphic record types
<mfp> they look like
<mfp> type error 'data = { data : 'data; desc : string }
<mfp> then you can define messages using message foo_error = error<some_message_or_type>
<f[x]> ok
<f[x]> btw I forgot to add extprot.a in ocamlfind patch
<mfp> i.e. polymorphic record types allow to define message types conveniently, but, as other types (not messages), do not have associated (de)serialization functions
<mfp> because the communication is always done with concrete messages, not with polymorphic ones
* f[x] understands
<mfp> and forcing the basic unit of communication to be a message ensures we can extend it later (by adding fields, other constructors, etc.)
<f[x]> is there a way, given two proto files, to check whether they are back/forward compatible?
<mfp> not atm.; I meant to write one, but never managed to
* f[x] finds extprot pretty useful now, will see how it goes
<mfp> most serialization formats either do not support rich types (tuples, sum types) or give no thought to compatibility :-/
<f[x]> sum types are a killer feature
<flux> I guess it'd be fair to say that most serialization formats are at the level of C structs..
<flux> serialization seems to be a recurring topic, though
<flux> how many serialization/deserialization solutions are there for ocaml already?-)
<f[x]> concerning compatibility I would prefer speed - i.e. smth like keeping all history of protocol revisions and generating readers for each protocol version into latest data format
<f[x]> so deserialization is possible only with proto file (and history)
mfp has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
mnabil has joined #ocaml
<adrien> in emacs, it looks like that when a paragraph ends with a line with non-zero indentation, the following line keeps the indentation instead of being actually empty
<adrien> does anyone know if it's something needed/wanted or just that noone cared?
<adrien> (it breaks some things in vim: ) and ( in particular)
<kaustuv> "following line"? You mean if you use C-j?
mfp_ has joined #ocaml
<adrien> ah, my bad, it's not emacs, it's camlp4: I keep on forgetting that lablgtk2's src/gtkSignal.ml is actually generated from src/gtkSignal.ml4 (and I always edit the wrong file too >< )
mfp has quit [Ping timeout: 240 seconds]
mnabil has quit [Ping timeout: 250 seconds]
ttamttam has left #ocaml []
<adrien> rixed: you mentionned something with ocaml-text and lwt on the godi list recently, did you have this issue: "source package godi-lwt requires godi-ocaml-text>=0.4"?
mnabil has joined #ocaml
<adrien> ok, "just" have to upgrade all, I'm not sure why I got that now, 33 packages to recompile
seafood has quit [Quit: seafood]
mnabil has quit [Ping timeout: 272 seconds]
mnabil has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
<adrien> heheh: http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=lablgtk/lablgtk.git;a=shortlog;h=refs/heads/adrien/react , and now it's possible to have a nice API for FRP in lablgtk2
<adrien> "let _id, text = Y.text e#as_entry in let foo = React.S.map print_endline (Obj.magic text) in" (yeah, I'm aware of the Obj.magic, will have to check what's going on)
lopex has joined #ocaml
boscop has joined #ocaml
<f[x]> mfp_, minor tweak : http://pastebin.com/7wxa7N4M
tauntaun has joined #ocaml
ccasin has joined #ocaml
yezariaely has left #ocaml []
ikaros has quit [Quit: Leave the magic to Houdini]
lopex has quit [Ping timeout: 245 seconds]
boscop has quit [Read error: Connection reset by peer]
_andre has quit [Ping timeout: 272 seconds]
_andre has joined #ocaml
boscop has joined #ocaml
cthuluh has quit [Ping timeout: 260 seconds]
ymasory has joined #ocaml
cthuluh has joined #ocaml
pdhborges has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
<pdhborges> Hi!
<pdhborges> the code for the bytecode runtime is shared with the native runtime correct?
Cyanure has joined #ocaml
Znudzon has joined #ocaml
philtor has joined #ocaml
<flux> what code?
<flux> source code for standard library, sure
<flux> there can be some differences in the c library calling conventions
<flux> also there's a different threading library
<pdhborges> flux: the code under byterun
<pdhborges> is used for the asm runtime
<pdhborges> ?
<flux> pdhborges, I'm not certain what you mean
<flux> philtor, bytecode runs with an interpreter
<flux> native code is assembler
<flux> so the interpreter is not used
<pdhborges> I'm taking about ocaml's source code
joewilliams_away is now known as joewilliams
<pdhborges> s/taking/talking/
<flux> a lot of code (parsing etc) is shared
<pdhborges> in the repo
<pdhborges> there is a asmrun folder
<kaustuv> The runtime library is mostly the same. Some bytecode stubs are different
<pdhborges> and a byterun folder
<pdhborges> a
<flux> pdhborges, well, I imagine they dont't have a lolt of code
<pdhborges> okay
<orbitz> Hello, are there any good documents/books for how to design software in ocaml? I find I don't quite grok modules and functors (I'm used to modules in the Python/Java sense)
<flux> most being in other directories
<kaustuv> orbitz: You can use pretty much everything in Larry Paulson's book Standard ML for the Working Programmer
<orbitz> Ok
<orbitz> I've looked at soem of teh Core code and I don't really grok what they are doing somtimes (or how it is useful to me) like having comparable sub modules in List/String
<kaustuv> Bob Harper also has a boko (also for SML) that has a lot of stuff on the module system: http://www.cs.cmu.edu/~rwh/smlbook/online.pdf
<kaustuv> s/boko/book/
<orbitz> kaustuv: 404
<pdhborges> ?
<kaustuv> Replace online.pdf with book.pdf
<kaustuv> He must have changed it too recently for Google to have caught up: http://www.cs.cmu.edu/~rwh/smlbook/
<orbitz> ah looks lik ei already had the 2005 version of this book
<orbitz> thanks
<kaustuv> However, I am not sure how much it will help you grok the Core code, given that Core has essentially zero documentation.
<kaustuv> And anyway Core has a more SML-y design than other OCaml modules
pdhborges has quit [Ping timeout: 245 seconds]
<kaustuv> The Comparable etc. stuff is a kind of poor man's type classes. Basically, if a module M ascribes to Comparable (i.e, this typechecks: module MC : Comparable = M), then you can use M as an argument to any functor that expects a Comparable
<orbitz> Ok
<orbitz> I have my first real Ocaml program and I need to refactor it out ot be much les sof the kludge that it is
Znudzon has quit [Ping timeout: 272 seconds]
<thelema> orbitz: don't worry about module structure - factor into functions first and then group related functions in modules
<orbitz> ok
<thelema> if you wanted to rewrite your program to use a more complex architecture, then you might consider module types and functors
<thelema> but before doing this, have a really good understanding of the working parts of your current solution and their relationships to each other and to the data types
philtor has quit [Ping timeout: 240 seconds]
arubin has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
lopex has joined #ocaml
<kaustuv> xkill
<kaustuv> ugh
kaustuv has quit [Quit: Something something Tannhauser gate]
tauntaun has joined #ocaml
cyy has quit [Quit: cyy]
bzzbzz has quit [Quit: leaving]
mcclurmc has quit [Ping timeout: 240 seconds]
mikemc has quit [Ping timeout: 240 seconds]
mikemc has joined #ocaml
rup has quit [Ping timeout: 240 seconds]
hyperboreean has quit [Ping timeout: 240 seconds]
rup has joined #ocaml
hyperboreean has joined #ocaml
mcclurmc has joined #ocaml
smerz has joined #ocaml
mnabil has quit [Ping timeout: 250 seconds]
Yoric has quit [Ping timeout: 255 seconds]
Yoric has joined #ocaml
Yoric has quit [Client Quit]
ymasory has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
cyy has joined #ocaml
kaustuv has joined #ocaml
<kaustuv> If Jane St. is so successful, why aren't other Wall St. firms adopting OCaml? Or are they?
<thelema> kaustuv: ocaml is just a tool - how you use the tool is the critical part.
<thelema> I don't think jane street is so successful that their every detail will be copied by others
<thelema> and ocaml is just one detail.
<kaustuv> reading threads like http://news.ycombinator.com/item?id=2235204 gives me the impression that a lot of people think that OCaml is a great language to learn if you want to work in computerized finance
olauzon has joined #ocaml
<orbitz> F# is used by a few firms
<orbitz> and Goldman uses Haskell for a few things I think
mnabil has joined #ocaml
<thelema> ocaml is just a bit hard to work with because of 1) confusing compiler error messages and 2) lack of polymorphic print (anything else the most troubling to new users?)
<kaustuv> I would have said ocaml's byzantine build system is more immediately problematic, in comparison to Hakell say where dependencies are automagically loaded and compiling is no harder than ghc --make
<thelema> agreed, ocaml dependencies are in the dark ages, but is it really any worse than C/C++?
<adrien> I use a _tags file...
<kaustuv> And I find OCaml's error messages much clearer than GHC's. If I do 1 + "hello", OCaml says that "hello" is not an int. Haskell would say "there is no instance for Num [Char]"
* adrien didn't know you could do worse than ocaml
<thelema> adrien: in order to do that, you have to use a magical myocamlbuild.ml that integrates with findlib
<adrien> thelema: use ocaml 3.12 and ocamlbuild -use-ocamlfind
<thelema> adrien: okay, you still have an external dependency and a magical build flag
<kaustuv> ocamlbuild + ocamlfind still doesn't do dependency resolution across packages
<adrien> and then, 'pkg(lablgtk2-react, mikmatch), syntax(camlp4o)' iirc
<thelema> and declare your dependencies outside your source files and probably use a makefile to give the full ocamlbuild command to build your main file
<adrien> kaustuv: I don't think it's a big issue
<adrien> maybe documentation more
<adrien> or showing that to newcomers
<thelema> ocamlbuild + findlib helps a lot in using a library that's already installed (that supports findlib)
<thelema> many ocaml libraries still don't support findlib, and we're waiting on oasis-db for installing the library we need
<thelema> oh yeah, and ocamlbuild has problems on win32, iirc
<adrien> I've been building yypkg in msys without issues
<adrien> less features maybe but no issue
<kaustuv> The thing is, if I want to use Wiz.Bang.Zoinks in cabal package flurble in Haskell, I would just put import Wiz.Bang.Zoinks at the top, hit C-c C-l, and ghci would load flurble automatically. The issue of explicit #require, #load, etc. just never shows up in ghci
<thelema> adrien: maybe the issues are fixed.
<thelema> yes, dependencies in the ocaml toplevel are extra miserable, especially dependencies on your own code
<adrien> thelema: I'm pretty sure that there's still issues but it works well enough
<thelema> I don't use the toplevel to debug my code because loading all my code into the toplevel to use it is so hard.
<kaustuv> Maybe an oasis+findlib aware toplevel should be considered
<adrien> kaustuv: imho it's not the most critical thing: you'll probably get an error because you've forgotten to edit the build config but it's easy to fix it
<kaustuv> adrien: I am not saying it's the most critical thing. Thelema asked about new user problems.
<thelema> kaustuv: findlib already integrates pretty well in the toplevel. as I said, in-project (non-findlib) dependencies
<thelema> having to load each cmo in the right order
<adrien> kaustuv: yes, but for this I tend to think it's rather the visibility of docs and howtos
<kaustuv> well, for that you can just build a .cma with ocamlbuild and load that instead
Inazad has joined #ocaml
<kaustuv> but there is still the issue of saying #directory "../_build/src" and all the subdirs thereof
<adrien> we probably need some testers and ask them to try to start learning ocaml and see what they do and what they get
<kaustuv> I'm sure we get a fresh batch of "testers" at the start of every college semester
<thelema> yup, they show up pretty regularly
<kaustuv> question is are they motivated to learn or to do just enough to get by
<thelema> Maybe we should ask them for contact info on their profs so we can get more info there
<thelema> the profs would know best common problems
<adrien> I think you don't need to look very far: take anyone with five or ten minutes free and see what they do and get
cyy has quit [Quit: cyy]
ymasory has joined #ocaml
ikaros has joined #ocaml
Inazad has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Po-ta-to, boil em, mash em, stick em in a stew.]
Cyanure has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
tauntaun has quit [Quit: Ex-Chat]
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
ymasory has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
tauntaun has joined #ocaml
mnabil has quit [Remote host closed the connection]
srcerer has joined #ocaml
srcerer has quit [Read error: Connection reset by peer]
ulfdoz has joined #ocaml
Snark has quit [Quit: Ex-Chat]
ulfdoz has quit [Ping timeout: 240 seconds]
philtor has joined #ocaml
srcerer has joined #ocaml
Yoric has quit [Quit: Yoric]
ulfdoz has joined #ocaml
thieusoai has quit [Remote host closed the connection]
edwin has quit [Remote host closed the connection]
enthymeme has joined #ocaml
tauntaun has quit [Ping timeout: 255 seconds]
Morphous has quit [Ping timeout: 272 seconds]
Morphous has joined #ocaml
tauntaun has joined #ocaml
ccasin has quit [Quit: Leaving]
tauntaun is now known as tautaun_away
ikaros has quit [*.net *.split]
cthuluh has quit [*.net *.split]
npouillard has quit [*.net *.split]
jsk has quit [*.net *.split]
npouillard has joined #ocaml
cthuluh has joined #ocaml
ikaros has joined #ocaml
olauzon has quit [Quit: olauzon]
olauzon has joined #ocaml
olauzon has quit [Client Quit]
ikaros has quit [Quit: Leave the magic to Houdini]
arubin has quit []