lihaitao has quit [Remote host closed the connection]
mcclurmc_ has quit [Read error: Connection reset by peer]
jonathandav has quit [Read error: Connection reset by peer]
jonathandav has joined #ocaml
tufisi has joined #ocaml
<gildor>
hcarty: oasis-db will support 0.3 a week or two after the release of 0.3
<gildor>
mrvn: it is not possible to include external file like _tags_oasis in _tags
* gildor
5 min of internet in the WE, sorry I'll probably be AFK in a couple of minutes
<adrien>
enjoy your week-end ;-)
<gildor>
thx
zcero has joined #ocaml
<zcero>
Hello. I'm writing some c stubs and need help to figure out how to manage memory when returning a double* as a bigarray (ocaml should take ownership of the returned array). Any pointers?
Cyanure has joined #ocaml
skchrko has joined #ocaml
zcero has left #ocaml []
<mrvn>
gildor: what uses _tags?
ikaros has joined #ocaml
<adrien>
mrvn: what do you mean? it's ocamlbuild
ikaros has quit [Client Quit]
<mrvn>
So option 1: change ocamlbuild to read in _tags_oasis and _tags, option 2: compile _tags from _tags_oasis and _tags_custom
<mrvn>
option 3: add an include statement
<adrien>
3: no :-)
<adrien>
(it's going to be too ugly ;-) )
<adrien>
depending on your uses, you can use -tag, -tags, or -tag-line when calling ocamlbuild
<adrien>
also, _currently_, I'd advise to use only one _tags file (or you can use _tags file in subdirectories too)
<adrien>
but I agree it causes issues
<adrien>
I'd had issues myself
<adrien>
I've seen other peoples have issues
lamawithonel__ has quit [Ping timeout: 246 seconds]
<mrvn>
And myocamlbuild.ml should include myocamlbuildoasis.ml
<mrvn>
or the other way around.
<adrien>
there's also the possibility of myocamlbuild.ml.in and _tags.in
<adrien>
but
<adrien>
I think I prefer not to have that since we have ocaml which is more powerful
<mrvn>
I just hate having patch being 10 times as big because of all the generated files.
<adrien>
I usually do a separate commit for that
<adrien>
works fine enough
emmanuelux has joined #ocaml
lamawithonel__ has joined #ocaml
err404 has quit [Remote host closed the connection]
Xizor has joined #ocaml
Ulrar has left #ocaml []
<gildor>
mrvn: this is issue has been under discussion on oasis-devel ML
<mrvn>
any consensus?
<gildor>
mrvn: in oasis 0.3 you'll have the option of a standard setup.ml, a setup.ml that weak-depends on oasis (so you can checkout any VCS without needing to install oasis, except if you change _oasis) and an ultra-light setup.ml that need oasis installed but the generate ~0 lines of diff when you change something in _oasis
<gildor>
mrvn: I'll suppose you'll go for the ultra-light version
<mrvn>
I'm fine with requireing oasis for a git clone.
<gildor>
e.g 30 lines for setup.ml, just don't forget to run 'oasis setup' when you prepare the tarball
<mrvn>
That would be an improvement.
lihaitao has joined #ocaml
<mrvn>
gildor: doesn't solve the _tags issue though does it?
<mrvn>
or myocamlbuild.ml
<gildor>
mrvn: BTW, this is possible to have myocamlbuildoasis.ml because you have to change the way ocamlbuild compile myocamlbuild.ml (i.e. you have to compile 2 files)
<gildor>
mrvn: what is the _tags issue ?
<gildor>
the ultra light option will not leave all file blanked
<gildor>
i.e. maybe it will create an _tags but its content will be #OASIS_START\#OASIS_STOP
<gildor>
nothing in it
<gildor>
will not leave -> will leave all file blanked
<mrvn>
but when I compile the source it would fill that in or not?
<gildor>
off course, otherwise ocamlbuild cannot work
<mrvn>
or would it create _build/_tags?
<gildor>
no _build/_tags is not in the file scanned by ocamlbuild
<mrvn>
then that isn't a solution. It must not alter any file that is tracked in git.
<gildor>
but after the run, it will restore it
<gildor>
it is a "cp _tags _tags.bak; oasis setup; ocamlbuild; mv _tags.bak _tags"
<mrvn>
ugly.
<gildor>
well to be more precise it is mv _tags _tags.bak; cp _tags.bak _tags to preserve
<mrvn>
and failure prone when the build aborts
<gildor>
file property
<gildor>
mrvn: I am waiting a better solution/patch that will work without changing ocamlbuild
<mrvn>
gildor: why not change ocamlbuild?
<gildor>
mrvn: you can, I just won't do it
<mrvn>
gildor: Then have a _tags.in and generate _tags from that
<gildor>
mrvn: ok, send me a patch
<mrvn>
the ocambuild -tags option. Does that expect file names or actual tags?
avsm has joined #ocaml
<gildor>
mrvn: heu, -tags doesn't do that at al
<gildor>
mrvn: it just add a couple of tags to all target
<gildor>
mrvn: -tag is equivalent to a line in _tags
<gildor>
ps: don't call it _tags.in, call it _tags.oasis
<mrvn>
fiNo, the _tags.in would be the users tags.
<mrvn>
-fi
Tobu has quit [Remote host closed the connection]
<mrvn>
The extunix _tags now contains:
<mrvn>
<test/*.ml{,i}>: pkg_bigarray
<gildor>
pps: don't drop the default scheme, just check the presence of _tags.oasis and trigger your behavior if it is present
<mrvn>
<test/*.ml{,i}>: use_extunixba
<mrvn>
But only test/testba.ml needs that.
<gildor>
mrvn: you can add <test/*.ml{,i}>: -pkg_bigarray
<mrvn>
Shouldn't oasis be more specific with those tags?
<gildor>
"test/extunixbe.ml{,i}": pkg_bigarray
<mrvn>
gildor: Then test/testba.ml is not getting that
<mrvn>
It is not something I should have to manually specify. That is what _oasis is for.
<gildor>
mrvn: that is an executable and I have corrected this
<gildor>
the current version of oasis is not the one that is set to last forever, this is a tool in evolution
<gildor>
this version fits my need but not yours, lets discuss and improve that
<mrvn>
gildor: sure. Great if it is already improved. On that note: /usr/bin/oasis: unknown option `--version'.
<gildor>
oasis 0.3: 'oasis version'
<gildor>
already fixed
iago has joined #ocaml
<mrvn>
Lets hope debian gets a new oasis soon then :)
<gildor>
oasis 0.3 is only ~rc3
<mrvn>
.oO(experimental)
<gildor>
but feel free to join the oasis-devel ML if you want to have a more open discussion
<mrvn>
gildor: nothing to discuss. you are already doing what I want. :)
<gildor>
mrvn: use the darcs version to send me a patch for the _tags.oasis stuff you want
<mrvn>
At the moment I just want to get extunix finished so I can get back to my own stuff.
<gildor>
(this file need to contain #OASIS_START/STOP section which will be the replaced part and you can generalize that to all file generated: myocamlbuild.ml, foo.mllib...)
<gildor>
mrvn: the more simple solution: move extunixba.ml into src/bigarray/
<gildor>
1 min change and all will work (different library in different directory)
Kakadu has quit [Ping timeout: 245 seconds]
<mrvn>
would also avoid the name conflicts between files for standard and bigarray functions.
<gildor>
mrvn: indeed
* gildor
got to go
<mrvn>
got to write bindings for read, writem recvmsg, sendmsg with bigarrays
<avsm>
mrvn: Lwt_bytes has bindings for all those, if you're using Lwt
<avsm>
mrvn: or are you creating alternative non-string versions of the Unix library or something (that would be useful too)
<mrvn>
avsm: I'm not and I'm not convinced lwt does it right.
oriba has joined #ocaml
<avsm>
alternatives always good; but i haven't seen any quite as complete as lwt yet
<mrvn>
avsm: kind of. Except Unix doesn't have pread/pwrite/recvmsg/sendmsg
<mrvn>
args lwt has pread/write that are flavours of popen() and not bindings for pread() and pwrite()
<mrvn>
avsm: The lwt read/write bindings don't release the runtime system so they are not thread capable.
<mrvn>
So read/write always blocks everything. Totaly unusable imho.
<adrien>
I quite like the fact that setup.ml should be complete and in the VCS
<mrvn>
I guess lwt assumes it only has to handle non-blocking sockets and pipes and real file IO takes no time.
<adrien>
it's a bit annoying for the developer but for people building, it's pretty good
<adrien>
actually, it's like with gobject-introspection
<adrien>
a number of files get generated but it's actually a nightmare for the packagers and it's not needed
<mrvn>
adrien: That is why you include it in tarballs. But in git it is fine to just generate it as needed.
<adrien>
it doesn't even make that much sense to have everyone generate them
<adrien>
it'll be forgotten at some point, and more often than not
<adrien>
or not in sync
<mrvn>
adrien: can't be out-of-sync if it is not in git. can't be forgotten if the make tarball target creates them.
<adrien>
but with it all the time, a git clone and git pull will bring a working setup.ml and friends
<adrien>
if the file should be the same everywhere, why not generate it only once, including in the VCS
<adrien>
there not doing so introduces so many new occasions for bugs to appear
<mrvn>
adrien: I disagree
lihaitao has quit [Quit: Ex-Chat]
cyphase has quit [Read error: Connection reset by peer]
<diml>
mrvn: lwt handles differently non-blocking sockets and pipes vs the rest
<mrvn>
diml: where?
<diml>
in the ocaml functions, it checks whether the Lwt_unix.file_descr is blocking or not and choose what to do
Kakadu has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
<diml>
but if you are not using lwt, it is better to write your own stubs that always assume the operation is blocking
oriba has quit [Quit: oriba]
<mrvn>
diml: from what I can tell on blocking channels ltw creates a job for the read and calls execute_job. Does that fork?
<diml>
mrvn: the job is executed in the current thread (blocking all lwt threads if it blocks) or in another preemptive thread
<diml>
you can control that locally or globally
<diml>
by default it is executed in another thread
<diml>
(and there is also a third method, which has better performances, but it is an ugly hack)
datkin has joined #ocaml
<diml>
the best solution would be threadlet but it was never included in the kernel...
<mrvn>
or do async io.
<diml>
yes, but async ios are not implemented on all file systems, they transparently fallback to blocking ios and there is way to tell whether it is supported or not :/
<mrvn>
diml: posix async IO uses threads anyway.
<mrvn>
And what filesystems under linux don't support the async IO functions?
datkin has quit [Remote host closed the connection]
<diml>
i checked that a long time ago, i should have another look
<diml>
btw, in my tests, if you increase the buffer size to at least 64KB, you get the same results with or without threads
datkin has joined #ocaml
<mrvn>
diml: the difference comes when you fire of 1000 requests. Threads simply stop at 16 or so and put the rest in a queue for later.
<mrvn>
And you need to use bigarrays to avoid the extra memcpy() operations needed with strings.
<diml>
mrvn: i did tests with sequential reads/writes when everything is cached (the worst case when using threads)
<mrvn>
diml: no, the worstcase is random reads that aren't cached but collectively end up being sequential.
<diml>
and i did use bigarrays
<mrvn>
with threads that causes tons of seeks, with linux aio it can scatter gather them back to sequential.
<diml>
mrvn: i mean the worst case for threads vs non threads
<diml>
if the call really blocks it is not a problem to use threads, if it doesn't then threads are a big overhead
<mrvn>
except when the low number of threads you have causes extra seeks. You get that for p2p stuff where you easily have 100-1000 clients.
<chambart>
I imagine that it would be possible to delay the launch of the threads such that you can reorder things a bit
<chambart>
but that would increase latency for normal cases
<mrvn>
That assumes you have knowledge of the physical layout of the blocks
Snark has joined #ocaml
<mrvn>
think raids or fragmented files
<chambart>
if you have things that looks sequential, the kernel can helps you a bit for that
<chambart>
but when you want to do agressive stuff like that it is probably better to use a mmaped file interface
cdidd has joined #ocaml
<mrvn>
chambart: verry bad for writing.
<chambart>
mrvn: why ?
<mrvn>
chambart: The linux aio interface allows you to just send 1000 requests to the kernel and let the kernel split them up, merge or reorder as needed for the physical devices.
<flux>
doesn't that happen with mmapping?
<flux>
it's not like mmap = synchronous
<mrvn>
chambart: When you write 4k to a mmaped file the first byte causes the page to first be read and the modified.
<flux>
the benefit of AIO is that yuo know when the write has happened
<mrvn>
plus mmap blocks on access if the page isn't present
<chambart>
you can do batch write on mmaped files
<mrvn>
chambart: how?
<chambart>
it is why you should use mincore/madvise to help the kernel ordering reads and avoid blocking
<mrvn>
chambart: that doesn't supress the unneccessary read when you write a full page.
<chambart>
you should use msync to write
<mrvn>
chambart: s/should/must/
<flux>
so writing 10 MB to a mmapped device results in 10 MB of reads as well?
<mrvn>
flux: yes
<mrvn>
catching errors with mmap is also a pain. on read you get a segfault. on write I think msync fails.
ulfdoz has quit [Quit: brb]
<mrvn>
Phantom type question. Anyone have an example of a container with phantom types for both the container itself and the objects it contains? So that one can have a hashtbl of const strings or a const hashtbl or mutable records or a const set or mutable hashtbl of const strings and so on.
<mrvn>
Something that works recursively.
ulfdoz has joined #ocaml
jimmyrcom has joined #ocaml
mcclurmc_ has joined #ocaml
Zedrikov has quit [Quit: Bye all, see you next time!]
jamii has joined #ocaml
Tobu has joined #ocaml
albacker has quit [Quit: Leaving]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
<hcarty>
gildor: Thanks for the update. I'll hold off on trying to push anything to oasis-db using a newer oasis until then.
Tobu has quit [Ping timeout: 260 seconds]
KenC has joined #ocaml
asdfhjkl has quit [Quit: Leaving]
KenC has quit [Client Quit]
skchrko has quit [Quit: ChatZilla 0.9.88.1 [Firefox 11.0/20120314111819]]
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
Drakken has quit [Ping timeout: 248 seconds]
iZsh has quit [Quit: Coyote finally caught me]
Ulrar has joined #ocaml
<Ulrar>
Hi, just saw that ** is an operator for pow, but does it exist for int ?
<mrvn>
# ( ** );;
<mrvn>
- : float -> float -> float = <fun>
<mrvn>
should be called **.
<Ulrar>
Yeah, so there is no pow operator for int ?
<mrvn>
not that I'm aware of. Wouldn't be that usefull given the limited range of int.
<Ulrar>
Okay, thanks.
<mrvn>
# let ( ** ) x y = int_of_float ((float_of_int x) ** (float_of_int y));;
<mrvn>
val ( ** ) : int -> int -> int = <fun>
<mrvn>
# 4 ** 4;;
<mrvn>
- : int = 256
Drakken has joined #ocaml
iZsh has joined #ocaml
bili has joined #ocaml
bili has quit [Ping timeout: 246 seconds]
bili has joined #ocaml
djcoin has joined #ocaml
albacker has quit [Quit: Leaving]
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
albacker_ has joined #ocaml
albacker_ has quit [Remote host closed the connection]
djcoin has quit [Quit: WeeChat 0.3.2]
Tobu has joined #ocaml
krktz has quit [Ping timeout: 276 seconds]
krktz has joined #ocaml
snearch has joined #ocaml
asdfhjkl has joined #ocaml
albacker has left #ocaml []
albacker_ has joined #ocaml
albacker_ has quit [Remote host closed the connection]
Cyanure has quit [Ping timeout: 260 seconds]
jamii has quit [Ping timeout: 276 seconds]
bili has quit [Quit: Leaving]
jderque has joined #ocaml
krktz has quit [Ping timeout: 264 seconds]
krktz has joined #ocaml
Snark has quit [Quit: Quitte]
<Juzor>
mrvn: hi, again
jderque has quit [Quit: leaving]
snearch has quit [Quit: Verlassend]
Kakadu has quit [Quit: Konversation terminated!]
datkin has quit [Ping timeout: 265 seconds]
jamii has joined #ocaml
Xizor has quit []
datkin has joined #ocaml
rmmh has left #ocaml []
cyphase has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
datkin has quit [Read error: Connection reset by peer]