<astronut>
is there a way to split a list and return everything to the left and everything to the right of a pos?
<astronut>
other than sort and partition
<Smerdyakov>
I don't understand the question. Are you saying you don't know how to write a function that does that?
<astronut>
i'm asking if there is some library call i'm overlooking, it's pretty common
<astronut>
or some way of accessing a sublist
<astronut>
i'm new to ocaml sytnax
<Yoric[DT]>
Well, there's nothing in the syntax for that purpose.
<Smerdyakov>
I'm quite sure there is no special syntax for such a thing.
slash_ has quit ["leaving"]
<vixey>
astronut, (every library function is documented, the list ones are in the list module..)
<astronut>
is there no syntax to say l[0]-l[n]?
<astronut>
vixey: ack, i'm reading it, i'm just not 100% trusting my understanding of it
<Smerdyakov>
astronut, the OCaml language tends to use new syntactic forms sparingly.
<thelema>
hi Yoric[DT]
<Yoric[DT]>
Hi, how do you do?
* Yoric[DT]
has obviously made some error when packaging pa_string.
<hcarty>
Yoric[DT]: What is pa_string?
<Yoric[DT]>
hcarty: a version of estring adapted for Batteries.
<Yoric[DT]>
i.e. a syntax extension for writing and pattern-matching against Unicode
<hcarty>
Ah, ok. estring would be a nice addition.
<thelema>
Yoric[DT]: I'm pretty unsatisfied with charEncodings - shouldn't we use UChar.t streams as a common denominator?
<Yoric[DT]>
thelema: which ones?
<Yoric[DT]>
UChar.t Enum.t?
<Yoric[DT]>
Or IOClasses?
<thelema>
well, for input we have Enum.t
<thelema>
I haven't figured the right way to do output yet
<Yoric[DT]>
Then this answers your question for now :)
cads has quit [Connection timed out]
<thelema>
output streams really are the ones that have two encodings - the encoding of byte streams you give them and the encoding they produce as output.
<thelema>
input streams that are charset aware should probably spit out UChars
<Yoric[DT]>
Well, in that case, output streams should accept UChars.
<thelema>
If you're just passing data through to be transcoded, it doesn't matter what form it's in between the input stream and output, but UChar.t (or UTF8.t) seems the most natural intermediary
<Yoric[DT]>
I agree.
<thelema>
maybe both ends are transcoders, with an input and output encoding
<thelema>
right now, with one encoding specified... it seems that info is lacking.
ched has quit [Remote closed the connection]
<thelema>
n/m, it's not.
<thelema>
only when you try to convert, you get two encodings...
<thelema>
pre and post...
<thelema>
hmm, I guess you can convert to UTF8.t with the current infrastructure (and an unsafe cast)
vixey has quit [Network is unreachable]
<thelema>
maybe that's all we need, input and output transcoders that default to UTF8 and produce/consume UTF8.t
<Yoric[DT]>
Have you used pa_string?
rwmjones has quit [Read error: 110 (Connection timed out)]
<thelema>
not yet.
rwmjones has joined #ocaml
seafood has joined #ocaml
<thelema>
you mean pa_estring?
nacsucauz has quit []
<Yoric[DT]>
Well, the extension submitted by Jérémie.
<thelema>
yeah, estring
<Yoric[DT]>
Actually, I believe it's both :)
<thelema>
I've read through some of the code, although I'll admit that I've not learned camlp4
<Yoric[DT]>
For some reason, his extension doesn't seem to kick in when using the toplevel.
nuncanada has joined #ocaml
<thelema>
Yoric[DT]: his last email says that you have to comment that out to get it to compile in 310
<Yoric[DT]>
Well, I've switched to 3.11 :)
<Yoric[DT]>
I have a working version of Batteries with OCaml 3.11.
<Yoric[DT]>
The only missing things are two toplevel issues.
* thelema
builds the ocamlcore/master branch
Walee has quit [Read error: 110 (Connection timed out)]
* thelema
does ./configure properly this time
<thelema>
hmm, problem with Sexp_Conv
<Yoric[DT]>
Is there?
* Yoric[DT]
hoped he had fixed all the issues.
<thelema>
File "src/core/toolchain/batlib_Sexp_Conv.ml", line 20, characters 9-23:
<thelema>
Error: Unbound constructor Parse_error
<Yoric[DT]>
Gasp.
<Yoric[DT]>
You probably have yet another version of Sexp_Conv.
<Yoric[DT]>
Now that's annoying.
<Yoric[DT]>
The latest version of sexplib has renamed ParseError to Parse_error.
<thelema>
3.7.4 is what I'm running
<thelema>
eh? 4.2.6 release of sexplib?
* thelema
probably needs to upgrade his jane street libraries
* Yoric[DT]
using 3.7.5 .
<Yoric[DT]>
er, wait
willb has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
Yes, 3.7.5
* thelema
upgrades to 4.2.6
<thelema>
and rebuilds batteries
* Yoric[DT]
wonders why pa_estring_top.cmo is never loaded.
<thelema>
why do we need bin-prot again? prereq for sexplib only?
<Yoric[DT]>
I'm not 100% we need it.
* Yoric[DT]
planned to investigate this at some point.
<thelema>
ok.
<thelema>
works now.
* thelema
puts the sexplib version req in the README
<Yoric[DT]>
ok
<Yoric[DT]>
Well, I seem to have hacked pa_string into submission but that's not very nice.
<thelema>
works for me. Good job.
<Yoric[DT]>
Thanks.
<Yoric[DT]>
I'm trying to wrap up the documentation and release.
<Yoric[DT]>
Does your installation of the toplevel work?
<hcarty>
Yoric[DT]: Need testers?
<Yoric[DT]>
Sure.
<Yoric[DT]>
I won't have time to read feedback this night, though.
* Yoric[DT]
needs to get up in 4 hours for 7 hours of teaching...
<Yoric[DT]>
Let me just upload the files.
<thelema>
hcarty: clean build on ocaml311 should work now.
<thelema>
I'll start handling feedback
<Yoric[DT]>
Thanks.
<thelema>
hmm, #help;; doesn't work
<thelema>
maybe docs aren't installed properly
<Yoric[DT]>
You need to install documentation for #help to work.
<Yoric[DT]>
make instdoc, iirc
* thelema
realizes that [make reinstall] doesn't touch the docs
<thelema>
I found [make install-doc]
<thelema>
which is trying to rebuild the docs, it seems
<Yoric[DT]>
ok
<Yoric[DT]>
Yeah, that might need to be improved.
<hcarty>
thelema: Thanks! I can give it a test here now, if it would help
<thelema>
Yoric[DT]: any reason he shouldn't test from current git?
<Yoric[DT]>
Well, might as well test the tarball.
<thelema>
Yoric[DT]: can you tag the revision you're releasing from?
<Yoric[DT]>
Only if you remind me how to do that :)
<thelema>
5 minutes, and then you go to bed?
<thelema>
git tag beta1
<Yoric[DT]>
Well, alpha3 for now.
<thelema>
ok, git tag alpha3
<Yoric[DT]>
I hope we'll be able to promote it to beta next week.
* thelema
needs to make installation slick.
<Yoric[DT]>
Gasp, need to merge README.
<thelema>
that way we can get more users = more testers
<Yoric[DT]>
Yep.
<hcarty>
Yoric[DT] and thelema: Just let me know what would be most helpful to test
<Yoric[DT]>
thanks
<thelema>
hcarty: when yoric gets the release uploaded, grab that.
<Yoric[DT]>
Ok, should be good.
* Yoric[DT]
is testing a GODI version.
<Yoric[DT]>
Ok, failed.
<thelema>
huh, it got smaller
<thelema>
622K -> 616K
<Yoric[DT]>
Weird.
<Yoric[DT]>
Possibly because, this time, I didn't forget to \rm the .git :)
<thelema>
:)
<Yoric[DT]>
Ok, package compilation in progress.
<Yoric[DT]>
Time to go and take a shower.
<Yoric[DT]>
Compilation itself is complete, documentation generation in progress.
<Yoric[DT]>
Still not showered, though.
<hcarty>
"make all opt install install-doc" worked here. Hooray!
<hcarty>
Yoric[DT]: Init file not found: "/home/hcarty/Applications/godi/lib/ocaml/pkg-lib/camomile/../batteries/top.ml".
<thelema>
Yoric[DT]: did you mean to not run autoconf? (there's no configure in the tarball, only configure.ac)
<hcarty>
Yes, same here
<Yoric[DT]>
thelema: that's intended
<thelema>
so we could stick users with one more depenency?
<Yoric[DT]>
thelema: well, autoconf always needs a few include files, doesn't it?
* thelema
is used to having to run autoconf to compile from cvs, but having configure as the first step in installing from tarball
<thelema>
I don't know about include files w/ autoconf
<thelema>
I do know that I've run ./configure scripts just fine w/o autoconf installed
<Yoric[DT]>
Well, I don't mind adding configure to the tarball.
<thelema>
ok. Don't forget to sleep tonight.
Axioplase_ has quit ["brb"]
<thelema>
configure will go into beta tarballs
<Yoric[DT]>
Well, at the moment, I have patching issues.
<Yoric[DT]>
That will wait for some other day, then.
<Yoric[DT]>
In the meantime, I'll wish you a good night.
<thelema>
good night.
Yoric[DT] has quit ["Ex-Chat"]
<thelema>
10 downloads already.
<thelema>
looks like the lurkers in the channel are doing their job well.
sporkmonger has joined #ocaml
Smerdyakov has quit ["Leaving"]
sporkmonger has quit []
<sanguinev>
Anyone here familiar with threads, specifically how to link them in successfully using ocamlopt on linux?
nuncanada has quit ["Leaving"]
<thelema>
sanguinev: ocaml native threads?
<sanguinev>
thelema: Based on the documentation here (http://caml.inria.fr/pub/docs/manual-ocaml/manual038.html), I have been using the system threads. So far I've been successful using "ocamlc -thread" for single files, but after using "ocamlopt -thread" to build a .cmx I can't link it in now...
<sanguinev>
Bah, does it depend on the order you put the files in?!
<thelema>
yes
<thelema>
ocamlopt doesn't toposort args
<sanguinev>
Oh well, that's my lesson for today. Thanks heaps, probably saved me hours of frustration. ;)
Axioplase has joined #ocaml
<thelema>
that's what we're here for
<sanguinev>
:>
Guest27814 has quit ["Lost terminal"]
patronus has joined #ocaml
sporkmonger has joined #ocaml
seafood has quit []
cads has joined #ocaml
sporkmonger has quit []
hkBst has quit [Read error: 104 (Connection reset by peer)]
Palace_Chan has joined #ocaml
Palace_Chan has quit ["Palace goes to sleep"]
seafood has joined #ocaml
seafood has quit []
davelee has joined #ocaml
<davelee>
hey
<davelee>
quick question
<davelee>
once you learn ocaml, can you read it kind of easily?
<mrvn>
yes
vixey has joined #ocaml
seafood has joined #ocaml
_zack has joined #ocaml
Yoric has joined #ocaml
<Yoric>
Hi, I have a rather urgent question.
<Yoric>
How do I set the path so that it's used also by applications executed through buttons (i.e. Emacs)?
* Yoric
needs to setup his students' stations.
<kig>
aaaaa execve is how you'd do it with C (pass PATH=foo in envp)
ikaros has joined #ocaml
<flux>
yoric, set it before running emacs? so perhaps /etc/bashrc or ~/.bashrc, PATH="...:$PATH"
<flux>
actually setting it within emacs should work too, so perhaps ~/.emacs/init.el (setenv "PATH" (concat "SomePath:" (getenv "PATH"))) would work also
seafood has quit [Read error: 110 (Connection timed out)]
<Yoric>
Yeah, in the worst case, I'll add this to .emacs/init.l
pierre- has joined #ocaml
Guest13894 is now known as realtime
Associat0r has joined #ocaml
<Yoric>
I had them do it in .emacs, that should be sufficient.
vpalle has joined #ocaml
ikaros has quit [".quit"]
_zack has quit ["Leaving."]
vpalle_ has joined #ocaml
s4tan has joined #ocaml
vpalle_ has quit ["Leaving"]
vpalle has quit [Read error: 110 (Connection timed out)]
rwmjones_ has joined #ocaml
_zack has joined #ocaml
vixey has quit [No route to host]
rwmjones_ has quit [Read error: 104 (Connection reset by peer)]
Axioplase is now known as Axioplase_
<Yoric>
Grmph, my GODI package is failing at patching-time.
marmotine has joined #ocaml
cads has quit ["Ex-Chat"]
hkBst has joined #ocaml
Yoric has quit ["Ex-Chat"]
animist has quit [Remote closed the connection]
Associat0r has quit []
gim_ is now known as gim
realtime has quit [Read error: 110 (Connection timed out)]
_zack has quit ["Leaving."]
Snark has joined #ocaml
realtime has joined #ocaml
realtime is now known as Guest89713
_zack has joined #ocaml
vixey has joined #ocaml
kg4qxk has quit [Remote closed the connection]
Snark has quit ["Ex-Chat"]
l_a_m has quit [Read error: 104 (Connection reset by peer)]
itewsh has joined #ocaml
l_a_m has joined #ocaml
Stefan_vK has joined #ocaml
Stefan_vK1 has quit [Read error: 145 (Connection timed out)]
ppsmimram has quit [Read error: 104 (Connection reset by peer)]
ppsmimou has joined #ocaml
adam000 has joined #ocaml
pierre- has quit [Read error: 110 (Connection timed out)]
thelema has quit [Read error: 104 (Connection reset by peer)]
adam000 has left #ocaml []
willb has joined #ocaml
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
kg4qxk has joined #ocaml
ched has joined #ocaml
pierre- has joined #ocaml
s4tan has quit []
kelaouch1 has quit ["leaving"]
kelaouchi has joined #ocaml
Associat0r has joined #ocaml
chupish has joined #ocaml
thelema has joined #ocaml
Associat0r has quit [Read error: 60 (Operation timed out)]
_zack has quit ["Leaving."]
Associat0r has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
maskd has quit ["leaving"]
ikaros has joined #ocaml
ikaros_ has joined #ocaml
ikaros_ has quit [Client Quit]
OChameau has quit ["Leaving"]
psnively has joined #ocaml
<psnively>
Howdy.
<chupish>
g'day
<psnively>
Hello.
<mrvn>
(fun user -> send_msg user "Hello") "psnively"
<psnively>
Heh!
maskd has joined #ocaml
jonafan has quit [Read error: 104 (Connection reset by peer)]
jonafan has joined #ocaml
kelaouch1 has joined #ocaml
kelaouch1 has quit [Client Quit]
kelaouchi has quit ["leaving"]
kelaouchi has joined #ocaml
seafood has joined #ocaml
<chupish>
anyone have any experience with large sets of RegExs and any of OCaml's PCRE bindings?
pierre- has quit [Read error: 110 (Connection timed out)]
Guest89713 is now known as realtime
jeremiah has quit [Read error: 104 (Connection reset by peer)]
<brendan>
hmm. I am using a Hashtbl to store Int32 keys and Int32 values, and I'm finding the memory usage to be about 50x the number of elements in the table.
<brendan>
I tried using an Int32 Map and got about the same overhead.
jonasb has joined #ocaml
<brendan>
am I doing something wrong?
seafood has quit []
Yoric[DT] has joined #ocaml
seafood has joined #ocaml
<brendan>
ah, Yoric[DT] is here, maybe he knows :)
<brendan>
I am using a Hashtbl to store Int32 keys and Int32 values, and I'm finding the memory usage to be about 50x the number of words in the table.
<kig>
how many items? do you have several values with the same key? are you using add or replace to add entries?
itewsh has joined #ocaml
<brendan>
replace exclusively. at peak, about 6 million entries
<brendan>
with 6 million 4-byte words, RSS is about 1.2 GB
<brendan>
roughly the same with an Int32 Map
<Yoric[DT]>
hi
<brendan>
hi :)
<Yoric[DT]>
brendan: I have slept about 2h30 hours this night and since then, I've been teaching 7 hours, coding 2 hours and travelling the rest of the time.
<Yoric[DT]>
So don't ask complicated questions :)
<brendan>
ah, bad time to jump on you, sorry
<brendan>
I will try again when you've had some sleep. get some sleep :)
<Yoric[DT]>
:)
<kig>
i'd expect something like 300 megs for 6 million Int32 entries on 64-bit
<kig>
as the bucket implementation is Cons(key, data, *Cons)
<brendan>
32-bit here. let's see, (4 bytes per key + 4 bytes per value) * 2 for boxing is 96 MB minimum
<brendan>
not sure I follow that part. is it say 8 bytes per bucket * 6000000 buckets (I'm using Int32.to_int as the hash function and all the Int32 keys have the top bit set)
<brendan>
even if it's 16 bytes per bucket, I'm at 200 MB
<kig>
yeah, i don't get how it gets to 1.2GB
ikaros has quit [".quit"]
<sanguinev>
brendan: I don't suppose the code (or at least the bloat creating parts) are visible anywhere?
chupish has quit ["leaving"]
AxleLonghorn has joined #ocaml
kelaouch1 has joined #ocaml
kelaouch1 has quit [Client Quit]
<Yoric[DT]>
Batteries's binary seems to build...
<Yoric[DT]>
Now on to 20 minutes of building the documentation.
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
<AxleLonghorn>
why does ocamldoc take forever?
<Yoric[DT]>
I'm not quite sure.
<Yoric[DT]>
I've checked, it's the deserialization & rebuilding the graph that takes most of the time.
<Yoric[DT]>
Ahah, build complete.
<Yoric[DT]>
And there was a missing file in the tarball...
<Yoric[DT]>
It seems that ocamlc is slower with OCaml 3.11 but ocamldoc is faster.
alexyk has joined #ocaml
slash_ has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
thelema has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
Well, well, well.
<Yoric[DT]>
Installation seems to work.
psnively has quit []
middayc has joined #ocaml
alexyk has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has joined #ocaml
davelee has quit ["leaving"]
<Yoric[DT]>
Looking for testers.
<Yoric[DT]>
hcarty: ping
hkBst has quit [Read error: 54 (Connection reset by peer)]
sporkmonger has quit []
<Yoric[DT]>
mfp: ping
<brendan>
sanguinev: I could put it up. It's a little file that emulates x86 memory operations (load/store 8/16/32/64 bit values, with possible unaligned accesses)