<mjonsson>
Does ocamlbuild not understand local opens? (i.e. let open MyModule in ... / MyModule.(...))
pngl has quit [Ping timeout: 246 seconds]
<_habnabit>
mjonsson, ocamlbuild doesn't care about things like that
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
<mjonsson>
Hm. Okay, I will describe my concrete problem then
<mjonsson>
I have functions in module A (A.ml) that I use in module B (B.ml). It worked well when I was using direct A.function references but not with local opens. (I could be misdiagnosing the problem still.)
<mjonsson>
so actually, it is not ocamlbuild that is complaining, it is ocamlc
<hongboz>
wmeyer: I am also making revised syntax more like original syntax(if not ambiguity introduced), this is really trivial, but important IMHO
lggr has joined #ocaml
<wmeyer>
hongboz: is it included on your bitbucket branch?
<hongboz>
yes
<wmeyer>
hongboz: remember about point fixes :-)
<wmeyer>
i will check that later, still need to look at Fan
<hongboz>
wmeyer: sure, any non-trivial change I will do a fix point check
<wmeyer>
hongboz: ok :-)
lggr has quit [Ping timeout: 248 seconds]
<pippijn>
wmeyer: first of all, I like Qt
<pippijn>
wmeyer: secondly, I want to learn about ocaml/C++ bindings
<pippijn>
wmeyer: and the reason I'm doing it at all is that I want to make a gui for my C frontend
<wmeyer>
pippijn: not like I am offending
<wmeyer>
(i just personally don't like Qt)
<wmeyer>
pippijn: yes, sounds reasonable
<hongboz>
mjonsson: the output by ocamldep is un-reliable
<hongboz>
especially when you use functors heavily
hongboz has quit [Remote host closed the connection]
lggr has joined #ocaml
avsm has joined #ocaml
<pippijn>
wmeyer: I want to generate the entire (or as much as possible of the) binding
<wmeyer>
avsm: we have 80 people tomorrow for makespace
<wmeyer>
i think it's a bit extreme
<avsm>
wmeyer: nice! say hi to laura for me. i'll be over there in november
<wmeyer>
pippijn: sure, sounds like a fun project
<wmeyer>
avsm: will do, btw: i met dave chisnal today
<wmeyer>
didn't know he works in the lab
<avsm>
yeah, on our CPU-capability project...
<wmeyer>
avsm: but he is not involved in ocaml directly :) he does the smalltalk really
<avsm>
next step: OCaml/LLVM :-)
<pippijn>
can LLVM support ocaml's exceptions?
<wmeyer>
pippijn: what i heard today should
<pippijn>
because ocaml exceptions are super fast compared to C++ ones (supported by LLVM)
<wmeyer>
(that was one of the things we discussed on the llvm meetup)
<wmeyer>
pippijn: I don't think the llvm backend can be ever fast as the one we have, even given the optimisations it performs
<pippijn>
hmm
<wmeyer>
since ocaml generates a LOT of functions
<wmeyer>
and you know, llvm does not do interprocedural optimisations
lggr has quit [Ping timeout: 252 seconds]
<pippijn>
but llvm does inlining
<wmeyer>
(for the same reason i will not suport in the low level RTL functions at all)
<wmeyer>
pippijn: sure, basic one, compared to haskell
<wmeyer>
inlining helps
<wmeyer>
but does fix the deficiency that the optimisations are performed on a function level
<wmeyer>
(yes, i got your messages, aggresively inline to turn the functions into basic blocks and then to the classical ssa passes)
<pippijn>
yes
<wmeyer>
well it improves situation, but ocaml has higher order functions, that needs to be propagated somewhat as values
<wmeyer>
i really think we need a messiah :)
<pippijn>
by the way, ocaml really doesn't like this pattern: let f = function A a -> (function A a | B b | C c) | B b -> (function A a | ...
<pippijn>
I thought it was a good idea, but in fact this generates much better code: let f a b = match a, b with A a, A a -> ... | A a, B b -> ...
<bbrittain>
so I'm trying to figure out a problem that someone presented to me. I'm actually a little worried that it isn't possible... I'm not too familiar with oCaml, so some help would be appreciated.
<bbrittain>
the tree was supposed to represte a complete tree
<pippijn>
wmeyer: right.. higher order functions are dynamically allocated structures with function pointers in them, I suppose
lggr has joined #ocaml
<bbrittain>
I was attempting to write a map function for it, but does that tree type even represent a complete tree properly?
<wmeyer>
bbrittain: you have polymorphic recursion, start with some simplier definition; i suppose it's taken from try ocaml :)
<pippijn>
a generic (mostly C-targetted) framework like LLVM doesn't like optimising those at all
<wmeyer>
pippijn: yes. I'm implying LLVM currently does not support functional languages. Although GHC says it's brilliant and the benchmarks say so. Perhaps that was hard work and patches up stream.
<pippijn>
wmeyer: I think a specialised ocaml compiler can make a lot more assumptions on how things work than something like LLVM
<wmeyer>
pippijn: yes. The thing is that LLVM hits the sweet spot for C and C++ :)
<pippijn>
yes
<pippijn>
for now :)
<wmeyer>
pippijn: you know, single IR must be ssa. Functions must be also if it's single IR.
<wmeyer>
pippijn: not with current IR
<wmeyer>
pippijn: the only way to carry information across passes is to use meta data, and i don't think it's viable as of 2012
<wmeyer>
i know it's C++ so constructing another IL is pain
<wmeyer>
but it would cut just better if LLVM was lower level than what is now
<wmeyer>
than clang would have another IR
<wmeyer>
and every language implementor would need to have IR in between LLVM and frontend
<wmeyer>
(at least that's what i would do)
<pippijn>
of course, many languages could share one IR
lggr has quit [Ping timeout: 256 seconds]
<pippijn>
C and C++ could share one
<pippijn>
java could share the C/C++ one, too
<pippijn>
C#...
<wmeyer>
pippijn: so on my github project, the goal is to collect these
<wmeyer>
but the lowest one is RTL
<pippijn>
wmeyer: collect what?
<wmeyer>
IRs
<pippijn>
ah
<pippijn>
RTL in gcc?
<wmeyer>
so the backend of a language would look like this
<pippijn>
register t..something language
<pippijn>
transfer or something
<wmeyer>
<choose the right IR> -> RTL -> SSA RTL -> Mach RTL -> Machine
lggr has joined #ocaml
<wmeyer>
that's right, we would not need SSA at all in that case :)
<wmeyer>
ssa is cool for optimisations
<wmeyer>
and that's it
<pippijn>
gcc does a lot of optimisations on RTL, right?
<wmeyer>
for code generation is not cool
<pippijn>
ah, for code generation it's the worst :)
<wmeyer>
yes it does, mainly peephole; but remember you told me about BURG
<pippijn>
BURS is cool
<wmeyer>
so SSA RTL will be then translated into TREE RTL and then selection will happen
<wmeyer>
after that reg alloc
<pippijn>
it's ocaml-style pattern matching with weights
<wmeyer>
and flattening again
<wmeyer>
yep, that's what we will use
<wmeyer>
but hold on
<pippijn>
we?
<pippijn>
who are you?
<pippijn>
(plural you)
<pippijn>
and what exactly are you working on?
<wmeyer>
sorry; meant community
<pippijn>
ah
<wmeyer>
i am working on the compiler framework
<wmeyer>
in OCaml
<wmeyer>
that's why I am keen on your frontend
<wmeyer>
avsm: I just noticed somebody posted paper about ADL - Architecture Description Language
<wmeyer>
strangely that was the name i was thinking before
<wmeyer>
(they generate or want to generate LLVM backend boilerplate out of the single spec)
<pippijn>
ADL
<avsm>
that's kind of a general term. there was something released about 8 years ago called that too
<wmeyer>
but for some reasons i remain calm ;-)
<hcarty>
wmeyer: Regarding printing + camlp4 - Batteries's pa_string syntax extension has some impressive printing capabilities.
<hcarty>
wmeyer: And as hongboz mentioned, xstrp4 can do some nice things. I've done some hacking on xstrp4 to make it a bit more general and extensible.
<wmeyer>
hcarty: cool :) You know, the format strings can be parsed most of the time at compile time. So we either have static spec, which might be not a string but something more composable, or just use combinators for smaller amounts of code
<hcarty>
wmeyer: xstrp4's internals do something similar to what thelema suggested, although perhaps not as effcient
<wmeyer>
(in fact strings are barely composable; therefore the code produced is also difficult to compose)
<wmeyer>
hcarty: neeed to look at it
<pippijn>
funny.. yesterday it didn't segfault
<hcarty>
wmeyer: My hacks on xstrp4 allow for things like <<Interpolate here: ${foo_value, custom_foo_printer}>>
<hcarty>
or <:sql<select foo from table where date = ${date, d}>>
<wmeyer>
avsm: yes, i didn't know about this. Thanks for the link. Definitely it's a nice source of ideas.
<hcarty>
wmeyer: Unfortunately it's built on camlp4 which seems to constantly rise and fall in popularity and soundness of future
<wmeyer>
hcarty: Yes, but in general it's the right thing to do
<hcarty>
thelema: If anything were done with ocaml-pretty + Batteries I was thinking it would be instead of something built on format, not in addition to.
<wmeyer>
i am sure Hongbo will not make Camlp4 die
lggr has joined #ocaml
<hcarty>
That's my hope
<pippijn>
is camlp4 good?
<wmeyer>
hcarty: I will look into xstrp4 thanks - I didn't even know about it :-)
<pippijn>
I just tried to make something once but gave up due to a lack of motivation to learn about it
<wmeyer>
pippijn: it depends, what you want. Generally I think it's pretty cool. Nevertheless it could be much better.
<pippijn>
my C frontend is supposed to turn into a camlp4 for C, by the way
<wmeyer>
pippijn: once you have quotations, it's easy
<pippijn>
yes
<wmeyer>
you can have quotes at the left side of match
<wmeyer>
+ gives you enormous power to just generate nice C
<pippijn>
yeah :)
<hcarty>
pippijn: For OCaml + camlp4 + C, ciml is an interesting project. Not what you're talking about I don't think, but a pretty cool use of camlp4.
<wmeyer>
hcarty: ciml is limited ;-) (from what I see)
<wmeyer>
hcarty: but you know this :-) I think pippijn is also amused
<wmeyer>
hcarty: pippijn have full C ast
<wmeyer>
parsing that inside quotations would do the job :)
<hcarty>
wmeyer: Very limited! I've never taken the time to use it beyond compiling the included tests. But it's still interesting from a quick-and-dirty bindings perspective.
<pippijn>
pippijn is lazy about implementing type checking :\
<hcarty>
wmeyer: ciml won't quite compete with that :-)
<pippijn>
seeking around in the C standard is tiring
<pippijn>
I'm happy I'm not doing C++, though
* wmeyer
attempted to parse the C standard once (and never wanted to do this again)
<wmeyer>
oh C++ is even more horrific
<wmeyer>
(much more horrific)
<pippijn>
it's completely horrific
lggr has quit [Ping timeout: 244 seconds]
<hcarty>
pippijn: A tool combining the features of camlidl + saffire would be quite a thing to have (binding code generation + type checking of bindings)
<wmeyer>
hcarty: it looks like a dirty hack :)
<wmeyer>
hcarty: xstrp4 examples look nice, somewhat reminds me perl
lggr has joined #ocaml
<wmeyer>
hcarty: Great idea!
<wmeyer>
i suppose once pippijn have camlp4 extension sounds like a easy cake
<wmeyer>
i need to go to bed
<wmeyer>
tomorrow i have a lot of paperwork to do
<wmeyer>
which i've been gently avoiding for 2 weeks
<pippijn>
good night
<wmeyer>
it's 3:30 :P
<wmeyer>
pippijn: i suppose you will have lunch soon
<pippijn>
yes
<pippijn>
it's 10:33
* wmeyer
been to china quite few times
<pippijn>
:)
<pippijn>
by the way
<hcarty>
It's 10:34 here, but perhaps a different 10:34
bbrittain has quit [Remote host closed the connection]
Yoric has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
osa1 has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
gnuvince has joined #ocaml
mjonsson has quit [Quit: Leaving]
lggr has joined #ocaml
kba has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
avsm has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
cdidd has quit [Ping timeout: 265 seconds]
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
ankit9 has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
ankit9 has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
othiym23 has quit [Ping timeout: 260 seconds]
dgfitch_ has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
dgfitch has joined #ocaml
othiym23 has joined #ocaml
ankit9 has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
pango is now known as pangoafk
lggr has joined #ocaml
Yoric has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
ankit9 has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
ontologiae has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
ankit9 has joined #ocaml
lggr has joined #ocaml
Cyanure has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
ftrvxmtrx has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 264 seconds]
osa1 has quit [Quit: Konversation terminated!]
djcoin has joined #ocaml
ankit9 has quit [Remote host closed the connection]
lggr has joined #ocaml
sepp2k has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
eikke has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
Kakadu has joined #ocaml
lggr has joined #ocaml
mika1 has joined #ocaml
cago has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
ivan\ has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
err404 has joined #ocaml
ankit9 has joined #ocaml
ivan\ has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
ontologiae has joined #ocaml
lggr has joined #ocaml
ftrvxmtrx has joined #ocaml
lggr has quit [Ping timeout: 265 seconds]
Yoric has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
chambart has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
pngl has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
Kakadu has quit [Quit: Konversation terminated!]
lggr has joined #ocaml
madroach has joined #ocaml
tufisi has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
tufisi has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
Yoric has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
tchell has quit [Ping timeout: 245 seconds]
tchell has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
Oejet has joined #ocaml
thomasga1 has joined #ocaml
thomasga has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
tufisi has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
eikke has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
beckerb has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
eikke has joined #ocaml
lggr has joined #ocaml
_andre has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
chambart has quit [Read error: Operation timed out]
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 265 seconds]
madroach has quit [Quit: leaving]
madroach has joined #ocaml
lggr has joined #ocaml
Oejet has quit [Read error: Connection reset by peer]
Oejet has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
thomasga1 is now known as thomasga
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
ontologiae has joined #ocaml
chambart has joined #ocaml
Oejet has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
<hcarty>
thelema: The pp-patch/pull request goes into BatIO.Incubator. That seems like a safer option until a final layout and implementation is decided on.
<ansx_>
I don't understand how to use records in OCaml :(
<ansx_>
for instance how to read values in the record returned by Gc.stat
<fx_>
ansx_, let x = Gc.stat () in x.Gc.minor_words
<fx_>
record fields are qualified with module name
<ansx_>
wow.... didn't know that :)
lggr has quit [Ping timeout: 248 seconds]
<ansx_>
I also don't quite understand why you sometimes need to use ; but sometimes ;;
<ansx_>
also I don't really understand how is your line of code working
<flux>
ansx_, a file consists of blocks. each block is either a sequence of top-level statements or an expression. each block is separated by ;;.
<ansx_>
yeah but let number = 3
<ansx_>
and let number = 3;;
<ansx_>
is the same at the top level isn't it?
<flux>
examples of top-level statements: type i = int let a = 42
<flux>
yes
<flux>
basically top-level evaluates blocks only
<ansx_>
looks like some inconsistency to me
<flux>
you might get confused because of the two forms or let
<flux>
let a = 42 <- top-level statement
<flux>
let a = 42 in b <- an expression
<flux>
(OF let)
<ansx_>
well, even without the "in" I'm confused
<flux>
you can write let a = 42 let b = 55 let baz = a + b all day long to your toplevel
<ansx_>
why would "let a = 42;;" and "let a = 42" do the same thing?!
<flux>
but you need to type ;; to make it evaluate it
<ansx_>
ok... but if I don't use ;;, what would be the value of a ?
<flux>
well, you the toplevel doesn't evaluate it before you use ;;
<ansx_>
I don't really see a difference between the 2 cases when there is nothing to evaluate
<flux>
for example let a = print_string "hello" by itself doesn't output anything
<flux>
if you add a new string let b = print_string "world" it still doesn't output anything
<flux>
but when you type ;;, it outputs helloworld
<flux>
in fact, if you make a mistake in that block, say let type = fun, it will execute nothing
<flux>
it is as if you had never written the previous statements
<adrien>
but you have to remember that API has modelled POSIX and C
<adrien>
also, checkout the sources of ocaml
<adrien>
you'll find a windows implementation of Unix
<adrien>
"of the Unix module"
<ansx_>
are you aware of any way to lock memory in ocaml?
<fasta>
adrien: are all OCaml modules documented well .. in the documentation?
<ansx_>
any equivalent to the mlock/mlockall syscalls.
<hcarty>
fasta: The core stdlib modules are documented well
<adrien>
memory locking, check inside ocamlnet
<fasta>
hcarty: The documentation for Sys.remove could be better. It says it removes a 'file', but a directory is also a file, yet it doesn't remove those.
<hcarty>
fasta: You could submit a bug report
lggr has quit [Ping timeout: 240 seconds]
<adrien>
also, ocaml-fileutils has some nice function
<adrien>
s
osa1 has joined #ocaml
lggr has joined #ocaml
NMF has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
eikke has quit [Ping timeout: 265 seconds]
<fasta>
Is Array.length O(1)?
<fasta>
(another missing documentation item)
<flux>
fasta, yes
<flux>
actually it was one point I made when I familiarized myself with OCaml
<flux>
without knowhing how OCaml linked lists were implemented, it didn't seem obvious to me that List.length x must be O(n)
<adrien>
heh
<flux>
(whereas C++ templated datastructure libraries always tell their complexity)
<adrien>
as far as I'm concerned, I'm seeing it the other way round
nitraat has joined #ocaml
<adrien>
ocaml linked lists are linked lists, plain and simple :-)
<adrien>
so no weird tricks ;-)
<flux>
adrien, and how would you know that without looking how they are implemented?-)
lggr has joined #ocaml
<nitraat>
hi everyone! can someone help me out with a question about Scanf.bscanf ?
<adrien>
flux: it's canonical!
<flux>
adrien, so it follows from knowing the rest of the language :)
<flux>
adrien, so the documentation says ocaml linked lists are the plain canonical implementation of linked lists without no additional information?-)
<adrien>
flux: in doubt, they should :P
<fasta>
Which pattern catches this? Exception: Unix.Unix_error (Unix.ENOTEMPTY, "rmdir" ...
<flux>
fasta, cplusplus.com might not be the best reference but it says (http://www.cplusplus.com/reference/stl/list/size/): Constant (recommended). Linear in some implementations. - basically "implementation dependant"
<flux>
ansx_, I don't think it would work with ocaml data structures, because they can be moved around by gc
<fasta>
flux: the interpreter doesn't.
<adrien>
flux: actually I should go home since my screen look like an impressionist painting
<adrien>
very blurry :P
<ansx_>
I've seen some mlock implementation in xenstore (which is built it ocaml) but they have very specific needs and limitations
<flux>
ansx_, I suppose you could disable the compacting GC and then just write bindings for mlock (a simple task)
lggr has quit [Ping timeout: 245 seconds]
<ansx_>
yeah by c ompaction :)
<ansx_>
but I was wondering if you mark some object as being "non movable"
<adrien>
ansx_: what do you want to use it for?
<ansx_>
yeah that's what the Xen guys did
<ansx_>
but it's no good
<flux>
ansx_, I don't think you can pin your value down.. but what you can do is have a C pointer to an ocaml data structure, as long as the C pointer is marked as a GC root
<hcarty>
ansx_: I think the Ancient module can take a value out of the GC's reach. It's more focused on large, on-disk storage though.
<ansx_>
adrien: for storing cryptographic secrets
<flux>
ansx_, and then yuo can have memory allocated outside the ocaml memory management, as hcarty says
<flux>
but it's not as safe anymore as regular memory
<ansx_>
so ocaml by itself is not capable of storing cryptographic secrets ?
<ansx_>
neither from securely erasing them...
<flux>
ansx_, well, you can mlock the whole process I imagine, that doesn't require pinning values down
<flux>
(at least in principle, I haven't tried, and you still need a few lines of C to do it)
<ansx_>
yeah but that's not acceptable for production applications :)
lggr has joined #ocaml
<flux>
or you can keep the secrets in C-allocated memory and have a pointer to that in OCaml
<hcarty>
Bigarrays would be helpful there
<flux>
right, bigarrays could be mlocked, they are basically C-allocated data structures
<ansx_>
hm yeah but I'd rather avoid using any C
<flux>
bloody annoying how easily google eliminates 'boring' keywords
<flux>
such as mlock..
<adrien>
I'd really look at ocamlnet
<fasta>
flux: "mlock"?
<ansx_>
actually that's like saying "Java support monads if you implement them via a C extension"
<flux>
Lwt_mmap apparently has bindings for mlock
ftrvxmtrx has quit [Quit: Leaving]
<flux>
fasta, mlock is a system call instructing the kernel to never write the pages to disk
<fasta>
flux: I was explaining to you how to use a search engine.
<flux>
fasta, ah :)
<flux>
fasta, yeah, I do that
<flux>
it used to work to do +mlock, but now you need "mlock"
<flux>
but how should I guess which words it is going to ignore? "just" "quote" "everything"?
<ousado>
yes they removed '+', and more importantly '-'
<fasta>
+mlock and "mlock" have different results. I wonder who made that up.
<fasta>
ousado: no replacement for -?
<flux>
- works still
<flux>
according to my quick test
<fasta>
Yeah, it does so here too.
<adrien>
ddg!
<flux>
I actually tried ddg for a while as my default search engine, but noticed that too often I needed to swap to google to find what I wanted
<flux>
maybe I shall try bing next time!
<ousado>
huh yes
<_habnabit>
flux, ddg uses bing
<flux>
_habnabit, as its sole search engine?
<_habnabit>
IIRC yes
<flux>
so, I've tried bing already then.. well, google it is for me, then :(
<flux>
if I had a personal search engine that indexed all my history and bookmarks + 2 levels, I would be probably set pretty good for finding stuff
lggr has quit [Ping timeout: 255 seconds]
<flux>
or maybe not.. it might be difficult to determine relative 'importance' of data from such a small data set, even if the pages I'm looking for are there.
<fasta>
flux: you can install your own personal search engine, which indexes every page you visit.
<flux>
I used to have breadcrumps installed on my browser for a while
<flux>
but then I switched computers :)
<flux>
(breadcrumbs = stores every page I visit)
mika1 has quit [Quit: Leaving.]
cago has quit [Quit: Leaving.]
<flux>
also I should put the pages on some other machine instead of my limited-storag laptop..
<fasta>
flux: but you cannot search in breadcrumbs, I suppose?
<flux>
it has a primitive keyword search
<flux>
but I could put some indexer like glimpse do it as well
<flux>
fasta, did you have some suggestion for a personal search engine?
lggr has joined #ocaml
<fasta>
flux: Yacy can be used.
<fasta>
flux: I don't think it's that great.
<fasta>
flux: but it does scale to some degree.
<fasta>
Modern search engines require a ton of data to work correctly.
<fasta>
(and also use your usage patterns)
<hcarty>
flux: Do you have a pointer to Lwt_mmap?
<fasta>
(and the data patterns of other users)
<fasta>
For example, I am sure that Google basically just analyzes at every query what you are doing.
<fasta>
E.g. 'solving a problem', abandoning a problem, etc.
<fasta>
Then when you are done solving a problem the latest link you clicked on will get some positive reinforcement.
<flux>
bloodyhell, lwt_mmap -> no points, "lwt_mmap" -> first hit :P
<hcarty>
flux: Thanks :-)
<fasta>
That is then likely input as one signal in their ranking algorithm.
<flux>
(I really used just my orignial search to find it, but then tried that as well)
<hcarty>
That's interesting. It's not in the main online Lwt documentation.
<fasta>
Probably there are 100s of such signals.
<flux>
hcarty, maybe it's not part of the official lwt distribution.. "lwt-plus"
<flux>
fasta, hmm, 100s per person.. sounds a VERY big amount of data
<flux>
maybe fewer would do to differentiate from the competition
<flux>
and clearly it's not smart enough to understand that lwt and mmap are terms of my domain ;)
<fasta>
flux: there is also a thing called economics.
<fasta>
flux: same reason why you cannot search for full paragraphs.
<flux>
hmm, full paragraph search should be easy
<flux>
just pick a non-common part of it and search from the subset ;)
<fasta>
flux: yeah
<fasta>
flux: but apparently they didn't do that, because users can also do that.
<fasta>
flux: and hence save money.
<fasta>
flux: or they had more pressing concerns ;)
<flux>
maybe they want to rather learn how to search the right result without requiring the quotes
<fasta>
flux: yeah, very plausible.
lggr has quit [Ping timeout: 255 seconds]
<fasta>
Still, I think that Google will probably be taken over by some guy in a basement who will invent actual AI in 15 years or so.
<hcarty>
flux: lwt-plus was apparently merged with Lwt
djcoin has quit [Quit: WeeChat 0.3.7]
<hcarty>
flux: Perhaps Lwt_mmap didn't make the cut
<ansx_>
ok I'll take a look at lwt mmap tomorrow
<ansx_>
thank you for the insight
lggr has joined #ocaml
<flux>
ansx_, oh, it was an actual guestion, instead of just general interest ;)
<flux>
fasta, nice, there are even debian packages, maybe I shall try that Some Day(TM)
<fasta>
flux: there is also a version which you can use on the web.
<fasta>
flux: that is, a public web site.
lggr has quit [Ping timeout: 248 seconds]
<flux>
fasta, it seems quite interesting. I passed the link on, thanks for the pointer :)
<fasta>
flux: it also seems to suck less than two years ago.
<fasta>
flux: i.e., I can find things now. What was your query that Google had trouble with?
<fasta>
flux: never mind ;)
lggr has joined #ocaml
<fasta>
flux: you can also direct it to index some domains completely, but often you get banned for doing that.
<fasta>
flux: even if you are following the robot.txt.
Yoric has quit [Ping timeout: 265 seconds]
<flux>
fasta, I apparently got 83 results.. no actual results visible, though :). but maybe it works for local indexing ;)
lggr has quit [Ping timeout: 255 seconds]
<fasta>
flux: or all the nodes are overloaded.
err404 has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
Sablier has joined #ocaml
sivoais has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
beckerb has quit [Ping timeout: 260 seconds]
sivoais has joined #ocaml
<wieczyk>
Lame question, i Have src/Main.ml and want to produce binary named ,,Opifex'', how to do it by ocamlbuild? I ccanot see any -o option, I invoked 'ocamlbuild -Is src src/Main.native'
ftrvxmtrx has joined #ocaml
<fx_>
wieczyk, no way, use post-build step to rename the binary
<wieczyk>
;/
lggr has quit [Ping timeout: 255 seconds]
<flux>
I guess you -could- do that in myocamlbuild.ml
<flux>
no idea how :)
<fx_>
myocamlbuild - yes
<fx_>
but simple shell is simple
<wieczyk>
It is a bit weird that I cannot control binary name in build system.
lggr has joined #ocaml
eikke has joined #ocaml
chambart has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<wieczyk>
Another weird thing in Ocamlbuild is a file named "_tags". It is weird because we have a well-known tools for generating tags for editors like vim, emacs, etc. And tag,tags,_tag,_tags,TAG,TAGS etc are popular names for output of those tools.
<thelema>
I've seen TAGS, not _tags so much
<pippijn>
prefix _ is nice in sorted file lists
<pippijn>
just like .
<pippijn>
upper-case names are nice, too
<pippijn>
except when you use java, because then everything is uppercase
ski has quit [Ping timeout: 245 seconds]
ski_ has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
avsm has joined #ocaml
<pippijn>
oh boy..
<pippijn>
I think I'm doing something wrong
<pippijn>
the build is taking very long
<pippijn>
9 minutes now
<adrien>
generating C++ code?
<pippijn>
compiling ocaml code
<adrien>
recursive definitions?
<pippijn>
842M _build
lggr has quit [Ping timeout: 248 seconds]
eikke has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<pippijn>
I need an 8 core laptop
<adrien>
you need a desktop
<pippijn>
yes
<pippijn>
but I'm in china
<pippijn>
I don't have a desktop here
<pippijn>
I think it's the casting
thomasga has quit [Quit: Leaving.]
<pippijn>
yeah, it is the casting..
lggr has quit [Ping timeout: 246 seconds]
<pippijn>
or maybe it isn't
lggr has joined #ocaml
<pippijn>
I don't get it
<pippijn>
it *is* the casting
<adrien>
some things that I know can cost: objects, recursive definition, polymorphic variants, casting
<adrien>
among these, recursive (or very big) definitions are the worse
lggr has quit [Ping timeout: 245 seconds]
nicoo is now known as Link
<thelema>
what's the cost of casting?
<pippijn>
thelema: enormous
<thelema>
for what?
<pippijn>
I have no idea, but I'll give you numbers, soon
Link is now known as Guest57897
<thelema>
there's no runtime representation of typecasts
<adrien>
pippijn: also: casting or type constraints?
<pippijn>
adrien: :>
<thelema>
so you're talking only compile-time costs
<pippijn>
thelema: code size costs
<thelema>
but it shouldn't be any worse than having a function that converts from one to the other
<adrien>
well, I can picture it take time
<thelema>
code-size is increased by casts?
Guest57897 is now known as nicoo
<pippijn>
extremely
<adrien>
I cannot picture it turn the compilation O(n^2)
<adrien>
pippijn: your ocaml code is machine-generated, right?
lggr has joined #ocaml
<pippijn>
yes
<adrien>
so make the generator output code that is a bit less awful :P
<pippijn>
I tried
<pippijn>
I put the cast into its own function
<pippijn>
but I guess it inlines that
<pippijn>
it didn't help at all
<adrien>
you really really really need the casts everywhere?
<pippijn>
well
<pippijn>
no, I guess not
<pippijn>
I could let the client code cast
<adrien>
that's not what I meant :P
<adrien>
also, show the code
<pippijn>
110M _build
ontologiae has quit [Ping timeout: 256 seconds]
<pippijn>
thelema: 110M vs 842M
<thelema>
pippijn: wow, that's quite an overhead. all for casts?
<thelema>
that's odd; I thought that typecasts had no runtime representation, and they were type level constructs that got erased at some compilation stage (probably when the types were erased)
<pippijn>
if as_methods is defined as: let as_methods self = (self :> methods)
sepp2k1 has joined #ocaml
<pippijn>
110M becomes 842M
<adrien>
thelema: rule 1 of machine-generated code
<adrien>
it *SUCKS*
<adrien>
my eyes
<flux>
pippijn, maybe if you're 100% sure your casts are ok, maybe Obj.magic can speed them up?
<pippijn>
flux: I could do without casts
<flux>
oh, object casts
lggr has quit [Ping timeout: 256 seconds]
<adrien>
it's not because your code is generated that you can't use "module X = SuperLongName"
<pippijn>
yep
<flux>
maybe object casts actually result in code being generated
<pippijn>
adrien: hehe
<pippijn>
flux: apparently a lot of code, yes
sepp2k has quit [Ping timeout: 264 seconds]
<adrien>
pippijn: that's the whole code?
<pippijn>
adrien: no, there are more files like this
<adrien>
how many? what are the sizes for this one?
<flux>
pippijn, perhaps you should address the caml-list with this :)
<flux>
knowing qt there are probably hundreds of files like that..
<pippijn>
899,479 bytes in 207 files
<adrien>
*this* one
<pippijn>
o
<pippijn>
h
<pippijn>
67K (cmo) 47K (o) for no-cast
<flux>
so when we finally get to use the bindings, our binaries will be 900 megabytes :)
<flux>
(actually 110M is quite a lot already..)
<adrien>
pippijn: what about the base file?
<pippijn>
123K/47K for with casts
<flux>
was that byte code or native?
<flux>
with or without debug info?
<pippijn>
with
<thelema>
with debug info is the only correct way to compile a library for distribution
<pippijn>
by the way, I currently pass everything to C++ in the StackItem.value variant
<pippijn>
that's not strictly necessary
<pippijn>
I can Obj.magic everything
<pippijn>
but for now, I keep it this way, so I have runtime type checking on both sides
<pippijn>
that probably costs, too
<pippijn>
all those caml_allocs for the stack items
lggr has joined #ocaml
<flux>
if it's possible to compile just as working library with or without Obj.magic, the only hmm functional difference being the size, then perhaps it's something that could be implemented in the future
<pippijn>
sure
<pippijn>
while I'm developing it (and I don't really have a clue about ocaml FFI), I'm keeping it this way
chambart has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<thelema>
possibly having factored the cast out as a function is causing the debugging size to increase
<pippijn>
thelema: it doesn't matter, at all
<pippijn>
it's the same size as function or in-line
<thelema>
hmm, why do casts cost so much in .cmx size...
<thelema>
maybe something to do with the inliner...
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
<Ptival>
have people tried to lock some memory in OCaml?
<pippijn>
great.. of course C++ has mutual dependencies between modules
<Ptival>
thelema: in RAM
<pippijn>
that's just brilliant..
<pippijn>
bye bye static type checking
<doomlord>
how convinient is serializing in ocaml.. what does it have out of the box
<thelema>
pippijn: let rec module A : A_sig = Astr and B : B_sig = Bstr ...
<thelema>
doomlord: the module Marshal can serialize to string or IO channel arbitrary ocaml values, including function pointers and cyclic structures
<pippijn>
thelema: then I need to put all qt modules into one file
<thelema>
pippijn: probably, yes
<pippijn>
is that a good idea?
<thelema>
pippijn: it has its disadvantages
lggr has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<doomlord>
does it have a literal format for maps inbuilt like clojure { :key1 value1 .:key2 value2 ... } .. i like the JSON idea of a language with its own literals as a human readable serializing format, but would at least tweak json to not quote everthing in maps
<thelema>
doomlord: ocaml has list and array literals only, no literal format for maps. The Marshal format is not human readable.
<adrien>
pippijn: recursive modules won't compile fast either
<pippijn>
also, everything I call can potentially call back into ocaml
avsm has joined #ocaml
<pippijn>
and with Qt, it usually does
<pippijn>
because everything causes events
<pippijn>
const QDate& is easy
lggr has quit [Ping timeout: 248 seconds]
<pippijn>
that's just a value type like int
<pippijn>
it goes into a custom block and I'm done with it
<pippijn>
when it takes a const QSomething&, it means it will not keep the reference until after the call
<pippijn>
because it might be a temporary
lggr has joined #ocaml
<pippijn>
non-const references probably want to update a value
<pippijn>
so in ocaml, I could pass a ref and update it after the call
<pippijn>
or I could pass a value and return a tuple containing the updated value
<pippijn>
I have no idea what happens to pointers to const
<pippijn>
FILE* is something I probably can't handle at all
avsm has quit [Ping timeout: 260 seconds]
<pippijn>
QByteArray* is used in some objects that require me to manage the byte array's memory but they keep a reference to it
_andre has quit [Quit: leaving]
<pippijn>
so it's my job to make sure the byte array outlives that object
Xizor has joined #ocaml
<pippijn>
perlqt4 has a huge marshalling machinery
<pippijn>
really huge.. I don't think I'll need that much with ocaml
lggr has quit [Ping timeout: 252 seconds]
<pippijn>
because perl has to handle dynamic typing
lggr has joined #ocaml
<fasta>
pippijn: if you don't know the role of a parameter, can't you just generate some random code, inspect the memory map afterwards to derive its most likely effect and use that as information to generate a proper type signature?
lggr has quit [Ping timeout: 255 seconds]
Sablier has quit []
lggr has joined #ocaml
emmanuelux has joined #ocaml
pango has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 255 seconds]
pango has joined #ocaml
lggr has joined #ocaml
tizoc has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
avsm has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
cdidd has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
cdidd has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
eikke has joined #ocaml
Xizor has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
cdidd has quit [Ping timeout: 246 seconds]
cdidd has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
ontologiae has joined #ocaml
lggr has joined #ocaml
bobry has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
Cyanure has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
cdidd has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
cdidd has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
avsm has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 240 seconds]
eikke has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
Cyanure has joined #ocaml
nitraat has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
err404 has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
chambart has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
avsm has joined #ocaml
Cyanure has quit [Remote host closed the connection]
avsm has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
Yoric has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
cdidd has quit [Read error: Connection reset by peer]