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
<alexyk> kaustuv: beautiful, thanks!
<EM03> how does say ocaml's purely interpreterd mode compare to python and ruby?
<kaustuv> OCaml doesn't have a purely interpreted mode
<kaustuv> If you mean the bytecode interpreter, it is much faster than both python and ruby, but not as fast as the JVM or the .Net cli because it doesn't do any rum-time code generation
Oejet has quit [Ping timeout: 276 seconds]
<EM03> can I run it from a file kaustuv ?
<EM03> or do I have to compile it via bytecode first?
<EM03> I always compiled into bytecode
<kaustuv> sure, you can write a file with #!/usr/bin/ocaml at the top. However, internally it will compile every phrase before executing it.
_y_ has quit [Ping timeout: 255 seconds]
kaustuv has quit [Remote host closed the connection]
<alexyk> kaustuv: I run the code using load_mlbx via make -j3, and after a few successful reads, got Fatal error: exception Unix.Unix_error(23, "fork", "")... is it due to a limit of file descriptors? I'm using your last version closing processes...
Associat0r has quit [Ping timeout: 246 seconds]
owst has joined #ocaml
<alexyk> ulimit -u shows an enormous number -- why would I get the fork error 23 from load_mlbxz?
arubin has joined #ocaml
<alexyk> actually, I set huge memory options, so fork probably dies when it can't satisfy those...
<thelema> large stack per process?
EM03 has left #ocaml []
alexyk has quit [Quit: alexyk]
owst has quit [Quit: WeeChat 0.3.4]
owst has joined #ocaml
<owst> Is it possible to do hide certain members when opening a module? Something like: open List hiding (split);; ?
<owst> I want to open both Str and List, but use the split method of List.
<owst> *of String
<owst> I can order the opens so Str is after List, but that seems a bit unpredictable.
<thelema> owst: don't open them both.
<thelema> module L = List module S = Str
<thelema> and use L.foo and S.bar
<thelema> also, even after you open them both, List.split is still available
<owst> Ah, ok, that seems the neatest way. I was hoping to be able to not have to use a prefix to identify the correct method.
<owst> I didn't know about module - thanks!
enthymeme has joined #ocaml
myu2 has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 246 seconds]
alexyk has joined #ocaml
<alexyk> thelema: yes, I usually run with OCAMLRUNPARAM=h=7G;s=1G;b1
<thelema> that would cause problems
<alexyk> and I get fork error after about 10 processes, when actual RAM consumption reaches physical RAM; when I don't define OCAMLRUNPARAM, I'm OK
<alexyk> how exactly are h and s related, and to RAM? h seems OK with many processes, when total actual usage reaches physical RAM, system jut swaps
<thelema> s is minor heap size, h is major heap size
<thelema> Both measured in words (= x8 for 64-bit, x4 for 32-bit)
lopex has quit []
alexyk has quit [Read error: Connection reset by peer]
tauntaun has quit [Quit: Ex-Chat]
kanak has joined #ocaml
<kanak> Hi, is there a way to tell the ocaml compiler not to produce any executable but just display the errors and warnings (similar to ghc's -fno-code option)?
<thelema> kanak: only -c to compile a .cmo/cmx
joewilliams is now known as joewilliams_away
<kanak> thelema: Thanks. is there a way to not produce even the cmo/cmx files? (I'm using basically trying to hook up the ocaml compiler with emacs so that it displays warnings on my code on the fly, but I currently have all these files created by the compiler lying around)
<thelema> kanak: I wish you luck in your project, but afaik, there's no way to do that.
alexyk has joined #ocaml
<kanak> thelema: thank you for your help. I'll just try to get emacs to delete the temp files.
tauntaun has joined #ocaml
metasyntax has quit [Quit: ♫ In our sky there is no limits, and masters we have none; heavy metal is the only one! ♫]
alexyk has quit [Read error: Connection reset by peer]
kanak has quit [Remote host closed the connection]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
tauntaun has quit [Quit: Ex-Chat]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
smerz has quit [Quit: Ex-Chat]
emmanuelux has joined #ocaml
alexyk has joined #ocaml
surikator has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
_y_ has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
myu2 has joined #ocaml
myu2_ has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
myu2 has quit [Ping timeout: 255 seconds]
enthymeme has quit [Quit: brb]
alexyk has joined #ocaml
philtor has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
arubin has quit [Quit: arubin]
owst has quit [Ping timeout: 246 seconds]
enthymeme has joined #ocaml
ulfdoz has joined #ocaml
alexyk has joined #ocaml
<adrien> $4.99
<adrien> Category: Developer Tools
<adrien> Released: Mar 09, 2011
<adrien> Version: 4.0
<adrien> crap
<adrien> sorry
seafood has joined #ocaml
alexyk has quit [Quit: alexyk]
willb has quit [Read error: Operation timed out]
ulfdoz has quit [Ping timeout: 250 seconds]
yezariaely has joined #ocaml
seafood has quit [Quit: seafood]
ftrvxmtrx has joined #ocaml
<strlen> does anyon ehave (unofficial) .debs of ocaml 3.12 for ubuntu?
<strlen> using the unofficial debian-sid ones didn't work :(
yezariaely has left #ocaml []
_y_ has quit [Ping timeout: 252 seconds]
vivanov has quit [Ping timeout: 264 seconds]
surikator has quit [Quit: Scientific discovery is just maximal compression of random strings. Nothing more, nothing less.]
seafood has joined #ocaml
Cyanure has joined #ocaml
seafood has quit [Quit: seafood]
Oejet has joined #ocaml
edwin has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
rixed_ has quit [Ping timeout: 276 seconds]
larhat has joined #ocaml
ikaros has joined #ocaml
enthymeme has quit [Quit: g'night]
vouillon has quit [Read error: Operation timed out]
vouillon has joined #ocaml
Yoric has joined #ocaml
Snark has joined #ocaml
ftrvxmtrx has joined #ocaml
sepp2k has joined #ocaml
_2x2l has quit [Remote host closed the connection]
_2x2l has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
vivanov has joined #ocaml
ftrvxmtrx has joined #ocaml
avsm has joined #ocaml
_y_ has joined #ocaml
npouillard has joined #ocaml
npouillard has quit [Client Quit]
npouillard has joined #ocaml
vouillon has quit [Read error: Connection reset by peer]
_y_ has quit [Ping timeout: 252 seconds]
Oejet has quit [Quit: Leaving.]
lopex has joined #ocaml
metasyntax has joined #ocaml
_andre has joined #ocaml
vivanov has quit [Ping timeout: 252 seconds]
_y_ has joined #ocaml
vivanov has joined #ocaml
tauntaun has joined #ocaml
vouillon has joined #ocaml
rixed has joined #ocaml
sepp2k1 has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
sepp2k has quit [Ping timeout: 255 seconds]
larhat has quit [Remote host closed the connection]
larhat has joined #ocaml
owst has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
owst has quit [Ping timeout: 252 seconds]
ikaros has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx__ has joined #ocaml
ftrvxmtrx has quit [Disconnected by services]
ftrvxmtrx_ has quit [Disconnected by services]
ftrvxmtrx__ has quit [Client Quit]
ftrvxmtrx has joined #ocaml
myu2_ has quit [Remote host closed the connection]
munga has joined #ocaml
ikaros has quit [Ping timeout: 276 seconds]
ikaros has joined #ocaml
robthebob has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 255 seconds]
seafood has joined #ocaml
owst has joined #ocaml
dnolen has joined #ocaml
eelte has quit [Quit: 0x2a]
munga has quit [Ping timeout: 252 seconds]
mcclurmc has joined #ocaml
seafood has quit [Ping timeout: 276 seconds]
boscop has joined #ocaml
ttamttam has joined #ocaml
myu2 has joined #ocaml
willb has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Read error: Operation timed out]
munga has joined #ocaml
munga has quit [Ping timeout: 250 seconds]
dnolen has quit [Quit: dnolen]
er98052 has joined #ocaml
xl0 has quit [Remote host closed the connection]
tauntaun has joined #ocaml
tauntaun has quit [Read error: Connection reset by peer]
joko has joined #ocaml
<joko> Hello, what would be the best way to read a text file in OCaml?
<thelema> joko: do you want a list of strings (one per line) or one huge string for the whole file or a bigarray of characters?
<joko> thelema: My text file has a certain format: I have to read x lines after a specific line and the width of each line is not fixed.
<thelema> well, input_line seems appropriate for you - it reads one line from an in_channel as a string
eye-scuzzy has quit [Ping timeout: 248 seconds]
<joko> thelema: the format could be similar to that: http://pastebin.com/Wbz05MME
<thelema> while line := input_line ic; !line <> "USEFUL" do () done;
<thelema> <handle lead line>
<thelema> while line := input_line ic; !line.[String.length !line - 1] <> ';' do process useful lines; done
vivanov has quit [Ping timeout: 255 seconds]
vivanov has joined #ocaml
<joko> thelema: many thanks
lopex has quit []
tauntaun has joined #ocaml
tauntaun has quit [Read error: Connection reset by peer]
larhat has quit [Quit: Leaving.]
_andre has quit [Quit: leaving]
avsm1 has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
avsm has quit [Ping timeout: 260 seconds]
myu2 has quit [Remote host closed the connection]
avsm has joined #ocaml
lopex has joined #ocaml
lopex has quit [Ping timeout: 260 seconds]
ftrvxmtrx has quit [Quit: Leaving]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
munga has joined #ocaml
<vivanov> does file descriptor Unix.stdout has a filename so that i can open it with smth like let s = openfile "stdout_name" [O_RDONLY] 0 ?
<thelema> vivanov: s = Unix.stdout, why do you want to reopen it?
<mrvn> 1) why would you need to? 2) /dev/stdout, /proc/self/fd/1 on some systems
<thelema> wait, you want to read from stdout?
<vivanov> nono
<vivanov> write
<vivanov> my mistake
<thelema> you don't need to open stdout again - it's already open
<vivanov> i have a function that takes strings as arguments -- the filenames -- and opens them
<thelema> I wouldn't use that function for stdout
<vivanov> its just a minor function and it was interesting to know
<vivanov> thanks a lot
<mrvn> vivanov: if name = "-" then Unix.stdout else openfile name [O_WRONLY] 0
<vivanov> mrvn, ok -- ill try this one -- thanks :)
<mrvn> vivanov: under unix the "-" is usualy used in place of a filename when stdin/stdout should be used. So it is a good convention to follow.
philtor has joined #ocaml
lopex has joined #ocaml
<vivanov> mrvn, thanks -- did like you said -- works great
ikaros has quit [Quit: Leave the magic to Houdini]
_y_ has quit [Ping timeout: 250 seconds]
<joko> Hmm, now I have strings like this one:
<joko> Hmm, now I have strings like this one: {field1=field1_data; field2=field2_data}. How to parse them and create the relevant records?
avsm has quit [Quit: Leaving.]
tauntaun has joined #ocaml
<thelema> joko: remove the first and last characters, split on ;, split each substring on =
DimitryKakadu has joined #ocaml
<mrvn> write a deterministic automaton.
ymasory has quit [Quit: Leaving]
smerz has joined #ocaml
joewilliams_away is now known as joewilliams
ttamttam has quit [Remote host closed the connection]
owst has quit [Ping timeout: 240 seconds]
EM03 has joined #ocaml
<EM03> Back to ocaml
<EM03> I love how ocaml has a bytecode interpreter and a compiler, almost feels like python in a way but better
<thelema> EM03: except for printing - ocaml does lack nice printing facilities
<thelema> and not nearly as OO
<EM03> looks like there is some solid cgi/fastcgi libs as well
<EM03> python is not all OO either really
<EM03> Django barely uses OO
<thelema> if you can do "abc".length, it's OO
<EM03> thelema: you can do that in Python?
<thelema> I assumed you could.
<EM03> you can't
<EM03> its len("abc")
<thelema> I guess it's only ruby where things get that crazy.
<bitbckt> len("abc")
<bitbckt> in python.
<EM03> yes
<bitbckt> Ruby prefers "abc".size.
<bitbckt> but length is an alias.
<EM03> smalltalk also has it
<bitbckt> Ruby inherits Smalltalk's calling convention and object model.
<EM03> and javascript with like prototype
<emias> You can do " ".join(["foo", "bar"]) so I'd say it's weird OO.
<EM03> bitbckt: I <3 smalltalk i know :)
<EM03> and it inherits some parts bitbckt
<bitbckt> indeed.
<EM03> by all means not even half
* bitbckt works on the Ruby interpreter for Twitter
ikaros has joined #ocaml
<EM03> they use their own ruby interpreter?
<bitbckt> It's a fork of REE.
<bitbckt> Mostly GC-related changes.
<thelema> bitbckt: nice.
<EM03> for web I use PHP .....I need a Great reason to switch languages for web ...ocaml is a pretty good one for personal projects
<thelema> bitbckt: get any ideas from ocaml's GC?
<EM03> the tight integration between apache and PHP is priceless although passenger did make things better
<bitbckt> thelema: Some.
<EM03> although I have used rails grails and django heavily
<bitbckt> Not many concepts apply.
<bitbckt> MRI has no abstraction between an object's address and its identity.
<bitbckt> so compaction and copying are impossible.
<thelema> ah. :(
<bitbckt> yeah.
<thelema> that must make handling fragmentation hard
<bitbckt> extremely.
<thelema> lots of size pools?
<bitbckt> I'm working on an arena allocator based on some profile-guided runs for object size pooling.
<bitbckt> But right now, we don't differentiate on object size.
<bitbckt> we make some bets on object lifetime, but not size.
<thelema> profile to get object size distribution -> pool object size distribution, pool sizes
tauntaun has quit [Quit: Ex-Chat]
<bitbckt> right.
<thelema> interesting. 140B string size sets a nice limit on object size, no?
<bitbckt> heh. Strings are currently a major problem.
<bitbckt> they're a thin veneer over char*.
<thelema> of course
<bitbckt> most string operations we perform are fixed size buffer allocations and string appends.
<thelema> but you could have a tweet pool with 140B (+ epsilon) object size
<bitbckt> that isn't really applicable.
<thelema> string appends? interesting...
<bitbckt> the tweet _body_ is 140B.
<thelema> sure, and everything else is fixed size pointers, no?
<bitbckt> the tweet is much larger due to metadata overhead, depending on which cached format you're dealing with.
<thelema> metadata like the client software version, etc?
<bitbckt> like user id, timestamps, geo data...
<thelema> anyway, if most of your work is string appends, maybe ropes are for you?
<bitbckt> exactly.
<bitbckt> for those cases.
<thelema> but this'll require a lot of rewriting basic libraries that are expecting char*
<bitbckt> ropes in the rendering engine, buffers in protocol parsers.
<bitbckt> presumably.
<bitbckt> our backend services are mostly Scala, and Ruby is being squeezed out.
* thelema is doing work on high speed protocol parsing (well, field extraction, one step lighter than protocol parsing)
<bitbckt> So, I may not have to deal with those issues.
ftrvxmtrx has joined #ocaml
<bitbckt> I'm also working on scalac.
<bitbckt> Which has its own issues.
<thelema> sure. sounds like fun. I've been tempted by scala from time to time, but then I remember it runs on the JVM and come back to my senses
<bitbckt> good. :)
<bitbckt> slow. as. mud.
<bitbckt> (the compiler)
<thelema> generated code isn't so bad, no?
<bitbckt> No. It's okay.
avsm has joined #ocaml
<bitbckt> The collections library was absolute shit until 2.8.
<bitbckt> Otherwise, the runtime code is decent.
<thelema> I'm sure the 10K man-years that's been put into the JVM doesn't hurt
<bitbckt> Not at all. :)
<bitbckt> Odersky wrote the original javac.
<bitbckt> The biggest issues really are with the libs.
<bitbckt> Written by grad students who don't know any better.
<thelema> lol
<thelema> yup, I'm looking at scala's docs - the ocaml world could learn from these API docs
<thelema> at least batteries...
<bitbckt> That's perhaps the worst part of using OCaml - the libraries and usage documentation.
* thelema needs to get the source code for generating this: http://www.scala-lang.org/api/current/index.html
<bitbckt> that's scaladoc
<thelema> scaladoc generates all that javascript?
<bitbckt> Oh, you want the whole interface?
<thelema> yes
<bitbckt> :)
<thelema> we have ocamldoc, we don't have anything as nice as this
<bitbckt> I'll see if I can pry it out of the EPFL's hands.
<thelema> that said, the libraries that come with ocaml could fit on the head of a pin compared to this
munga has quit [Read error: Operation timed out]
<thelema> But it'd be nice to have a "all ocaml libraries" compendium
<mrvn> I don't mind each package bringing its own docs. They just could be nicer.
<bitbckt> both the packages and the docs. :P
<mrvn> Modules should also come with examples on how to use them imho.
<bitbckt> I wish I had more time to contribute around here.
trch has joined #ocaml
<thelema> mrvn: yes, but imagine a central repo for all ocaml docs - if you're looking for a particular function, it might be findable in this library, and you'd know what package to odb install
<mrvn> thelema: make them so they can be gathered into a larger collection. If they are generated that shouldn't be too hard.
<EM03> do you guys consider ocaml to be a sane language?
<thelema> mrvn: exactly, most projects have ocamldocs
<bitbckt> EM03: in which sense?
<thelema> EM03: usually - what's the insanity you're experiencing?
<EM03> that it makes sense? and is a replacement for another language of your choice
<EM03> I like scheme but I don't think its a sane language :P
<thelema> EM03: it's what I use for my programming.
<bitbckt> As long as I stay out of the object system, I like it.
<mrvn> EM03: it can certainly replace scheme.
Oejet has joined #ocaml
<EM03> I like how ocaml keeps in a unix environment
<EM03> and I know there is many schemes etc but still
<adrien> don't really the object system either, but I have to use it
<bitbckt> I've been thinking about rewriting the Thrift compiler for OCaml to offer an alternative.
<bitbckt> That's the only time I'm forced into the object system, right now.
<EM03> bigloo scheme is by the same research foundation as ocaml right?
<thelema> EM03: if it's INRIA, then yes
<EM03> i would like to become a scheme and more of an ocaml master :)
<thelema> well, pick one, as mastering two things at once is distracting
<mrvn> and scheme is rather useless. It is a nice language to teach basic functional programming but nothing for real life.
<EM03> well I can become just "ok" in both as well :P
<EM03> bigloo has a ton of libraries
<mrvn> scheme is something you learn, understand and never use again. :)
<EM03> why do you want to ruin the party? hehe
<flux> atleast you learn to configure emacs.
ulfdoz has joined #ocaml
<adrien> writing ocaml actually taught me lisp ;-)
<mrvn> not that much of a similarity
<mrvn> It isn't a proper lisp program if it doesn't end in 10 closing parens.
Smerdyakov has joined #ocaml
ymasory has joined #ocaml
<thelema> mrvn: hmm, lisp could benefit from |>
_y_ has joined #ocaml
Associat0r has joined #ocaml
<hcarty> thelema: I think Gerd has a searchable, rather large suite of OCaml documentation grouped together
<hcarty> EM03: Regarding "scripting" OCaml - there is also ocamlscript which allows you to run an OCaml program like a script, but it automatically compiles the program to native code on execution.
<EM03> ah nice
<thelema> hcarty: this is the data I'm interested in, now to make it nicer...
<EM03> i do like ocaml i really do always haved
<EM03> it seems cool and useful
<EM03> scheme I must say seems just more cool than useful hehe
<hcarty> thelema: Agreed
<hcarty> EM03: OCaml needs a (working) DrOCaml... then maybe it will be as cool as scheme
Smerdyakov has left #ocaml []
avsm has quit [Quit: Leaving.]
<thelema> http://docs.camlcity.org/docs/godipkg/3.11/godi-missinglib <- this part is particularly unfriendly
<EM03> hcarty: this is an app that is similar
<thelema> also, pretty printing the .mli file doesn't count as good documentation
<bitbckt> +1
<EM03> looka likw drscheme as well
<hcarty> thelema: Definitely
<hcarty> EM03: Yes, unfortunately (a) I think it's written in C++ and (b) I don't think it's maintained
<EM03> yea
<hcarty> EM03: A very cool project none the less
<EM03> sitll works though hcarty :)
<hcarty> Oh cool - I didn't know that
<hcarty> EM03: Doesn't seem to build here (Ubuntu 10.04 64bit), but I haven't put much time in to it
<EM03> I know qt , i used it a bunch back with kde 3.5
<EM03> 3.x
<EM03> and thats the version its built with ...i will take a look for sure
DimitryKakadu has quit [Remote host closed the connection]
willb has quit [Read error: Connection reset by peer]
Snark has quit [Quit: Ex-Chat]
<mfp> thelema: this might be relevant http://sphinx.pocoo.org/
rproust has joined #ocaml
<_y_> thelema, mind if I /msg you?
waern has left #ocaml []
<mfp> thelema: note that the site is Created using Sphinx 1.0.7+/e718cc9843bc.
<thelema> _y_: generally better to leave things public so that others can learn
<_y_> ok, although it's a bit more loquacious than usual
<thelema> mfp: sphinx documentation seems nice so far, but the scala documentation is much better presented
<thelema> _y_: that's fine
<_y_> so in my binary program analysis framework, I require control flow graphs which are adorned with a variety of types of information, such as raw assembly language from various platform, or various IRs, etc. for this, I have created a module called CFG which has the type of the instructions abstracted out, and a "make" functor which produces a module corresponding to a specific type of information. this all works fine.
<mfp> thelema: scala's looks like a prettier ocamldoc (i.e., API-oriented) to me, sphinx seems able to manage non-API documentation better
<_y_> over the past two days, I wrote a function which generically produces a control flow graph, given as input a disassembler function which produces the aforementioned information types (i.e. X86.insn) and also some representation of the flow of control coming out of each individual instruction. using a piece of advice you gave me yesterday, and some thinking / researching, I was able to turn this into a module as well, so it can produce a CFG of a
<thelema> mfp: what I want is a prettier http://docs.camlcity.org/docs/index.html
<thelema> s/prettier/more usable/
<_y_> however, I wrote the individual disassembler instances inside of the CFGBuild.ml file, and for the sake of code cleanliness I would like to move these to other files. this leaves me in the pickle of having to write a proper signature for this stuff that I can put in a header file, and I am baffled
<thelema> _y_: you don't *have* to write .cmi files, and if you want, ocamlc can produce them for you with the -i flag
<_y_> I'm aware of that, but what -i produces is hideous, it's a complete expansion of the CFG module
<thelema> okay. what baffles you?
<mrvn> _y_: you then take that and clean it up
<_y_> there's the CFG module, which works: http://pastebin.com/N85rXuGT (you can see the type-specific stuff at the very end) here's the graph-building part, which works: http://pastebin.com/eKW1Fbtv (ditto)
<_y_> I'm so confused writing the signatures for this stuff that I am having a hard time even putting my confusion in the form of a proper question
<thelema> the question sounds like: "how do I make signatures for this stuff", no?
<_y_> yes
<mrvn> Your module types are already nice. Just cut&paste them into the mli file and adjust the syntax.
<thelema> more specifically, you want a signature for X86CFGBuilder?
<_y_> I would like MakeGraphBuilder to be in one .ml/mli file, and X86CFGBuilder to be in another one
<thelema> so what's the problem - move the last 7 lines from the GraphBuilder file into a new mli file and open GraphBuilder at the top of it
<thelema> or just module X86CFGBuilder = GraphBuilder.MakeGraphBuilder(LangX86)
<_y_> I guess my question is, how would I write a "sig" corresponding to the "struct" of MakeGraphBuilder
<mrvn> compile with -i and then beautify.
<_y_> because the return type of build is a module
<_y_> an instance of a module
<mrvn> if it resolves to much then move modules into seperate files
<_y_> k, sec
<thelema> sure, but it has a module type. Is there only part of that result that you want to expose?
<_y_> I don't know how to declare the type of the build function: int32 -> what?
<mrvn> _y_: what does -i use?
<_y_> sec
<_y_> http://pastebin.com/V98yXJJG :: output of `ocamlc -I ../Util -I ../X86 -i CFGBuild.ml > CFGBuild.mli`
<mrvn> shouldn't be too hard to take the output to get the syntax right and then replace the basic types with the aliases you like to see.
<thelema> C.G.V.label -> (C.G'.t, C.G'.vertex CFG.LabelMap.t, Language.t list CFG.LabelMap.t) CFG.ccfg * (int32, unit) Hashtbl.t
<_y_> yeah, that's the rather hideous internal representation of the graph ... would be nice to just say "it's a CFG with type lang = whatever"
Samuel___ has joined #ocaml
<mrvn> _y_: I'm afraid that you have to beautify yourself.
<thelema> ah, maybe adding some annotations to your functor types will help...
Samuel___ is now known as HoraseLunums
vivanov has quit [Quit: Lost terminal]
<thelema> hmm, maybe not...
<thelema> yes, I think you might be stuck prettifying things.
mnabil has joined #ocaml
<_y_> I was hoping I could declare a module type right in the signature (i.e. module C = CFG.CFG with type language = t) and then reference C.G.t in the type signature, but it seems impossible to put a module declaration into a module signature
<thelema> ? it should be possible
<thelema> module C : CFG.CFG with type language = t
<thelema> well, if you actually have that module defined.
<thelema> you can't just add type aliases into module signatures
<thelema> s/type/module type/
<_y_> CFG.CFG exists, if that's what you're saying; it's from the pastebins from above
<thelema> you want to simplify your last pastebin, right?
vivanov has joined #ocaml
<_y_> yeah
<_y_> tremendously
<thelema> in your .ml file, specify a module type for the output of MakeGraphBuilder
munga has joined #ocaml
<thelema> then the types come out nicely
<_y_> oh, that does look simple and elegant
<_y_> alright, I'm going to go back to beating on this, you might hear more about this over the next day or two ... and I appreciate your help, you and mrvn both
<thelema> good luck
<_y_> thank you
korya has joined #ocaml
ygrek has joined #ocaml
<hcarty> Is there a simpler way than this to strip modules from a module? http://pastebin.com/AjMSWfDQ
<hcarty> Once Batteries moves to requiring OCaml >=3.12.0, this kind of stripping of submodules could make updating Batteries to match new stdlib changes a bit easier.
<thelema> hcarty: ? stripping submodules? we do our best to only add to stdlib
<hcarty> thelema: But in order to extend a module like Bigarray.Array1, you need to copy and paste all of the signature and contents of the Bigarray module
trch has quit [Read error: Operation timed out]
<thelema> include + extend
vivanov has quit [Quit: leaving]
<hcarty> thelema: If the submodules were stripped, then each one could be handled separately. So there would be no need (or significantly less need) to copy and paste code
<thelema> fair enough.
<hcarty> Adding a map function to Bigarray.Array1 requires reproducing the entire contents of the Bigarray module as BatBigarray, for example
_y_ has quit [Ping timeout: 250 seconds]
<thelema> Bigarray is the only module I'm particularly worried about on this - the other modules we do this on: Set, Map, Hashtbl will likely get re-implemented by us
<thelema> and by us, I mean bluestorm
<hcarty> I'm wondering about this outside of Batteries as well - extending any submodule becomes messy.
<hcarty> Maybe namespace support can help with this
<thelema> well, one good way done by other language is to allow child packages, which have access to the internals of the package to be extended
korya has quit [Read error: Connection timed out]
Cyanure has quit [Remote host closed the connection]
korya has joined #ocaml
HoraseLunums has quit [Remote host closed the connection]
ymasory has quit [Ping timeout: 252 seconds]
agarwal1975 has joined #ocaml
munga has quit [Ping timeout: 246 seconds]
philtor has quit [Ping timeout: 255 seconds]
tauntaun has joined #ocaml
myu2 has joined #ocaml
Oejet has quit [Ping timeout: 276 seconds]
HoraseLunums has joined #ocaml
HoraseLunums has quit [Remote host closed the connection]
korya has quit [Ping timeout: 240 seconds]
korya has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
jonafan_ has joined #ocaml
jonafan has quit [Ping timeout: 264 seconds]
ulfdoz has quit [Ping timeout: 240 seconds]
alpounet has quit [Ping timeout: 248 seconds]
edwin has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 246 seconds]
alpounet has joined #ocaml
er98052 has quit [Quit: er98052]
ygrek has joined #ocaml
owst has joined #ocaml
owst has quit [Ping timeout: 255 seconds]
jonafan_ is now known as jonafan
ygrek has quit [Ping timeout: 246 seconds]
Amorphous has quit [Ping timeout: 248 seconds]
philtor has joined #ocaml
Amorphous has joined #ocaml
Yoric has quit [Quit: Yoric]
__marius1_ has quit [Ping timeout: 240 seconds]
__marius__ has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
Pepe_ has quit [Read error: Operation timed out]
Pepe_ has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]