dan2 changed the topic of #ocaml to: OCaml 3.08.2 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
lodewijk has left #ocaml []
shawn has quit [Connection timed out]
async has joined #ocaml
CosmicRay has quit [Remote closed the connection]
<async> what is =:= ?
<async> it seems to be used for objects
<mfurr> I don't think that is part of the standard syntax, its probably a user-defined infix op
vezenchio has quit ["haibane · renmei"]
<judge> let [ smac ; sip ] = map q [6 ; 4] <-- is there a way to make this not create compiler warnings?
<judge> i know i could do it with match
<judge> but is there a consise way to do this?
<mfurr> no, you need to use pattern matching if you're using lists
<judge> match with is just a terribly long way to do a short thing
<mfurr> for that paticular line, you could do: "let smac = q 6 in let sip = q 4 in"
<judge> yeah
<judge> but i generally have about 8 items in these lists
<judge> so match with is still more concise
<judge> i could do
<judge> (smac, sip) = (q 6, q 4), but then i depend on order of eval
<judge> at least with using map this way i know it's left to right
drz has quit [Read error: 110 (Connection timed out)]
<judge> what's the most correct way to break up a string into a char list?
<judge> using Stream seems like overkill
mfurr has quit ["Leaving"]
<judge> why isn't there a string_of_char?
stef_ has joined #ocaml
<pango> string_of_char could be easy to add, but it wouldn't be an efficient primitive... so why promote its use by putting it in the standard lib...
drz has joined #ocaml
<pango> let map2 f (x, y) = (f x, f y)
<pango> let smac, sip = map2 q (6, 4)
Smerdyakov has joined #ocaml
<pango> or let map2 f (x, y) = let fx = f x in let fy = f y in (fx, fy) if order matters, but you get the idea
<pango> lists are never the same thing as tuples, even when their size is known at compile time
Smerdyakov has quit ["lists are never the same thing as tuples"]
<pango> god bless elitists
<dan2> hmm
<dan2> whats the best way to a do a directory poll
drz has quit [Read error: 60 (Operation timed out)]
async has quit ["Lost terminal"]
drewr has quit ["bed"]
kinners has joined #ocaml
Shammah has joined #ocaml
<dan2> gnite everyone
kinners has quit [Read error: 110 (Connection timed out)]
KrispyKringle has quit ["Get MacIrssi - http://www.g1m0.se/macirssi/"]
<judge> yah i know lists cant be the same as tuples
<judge> that's too bad, because sometimes it would be nice to use map and such on tuples
<pango> or the compiler to be smart enough to check that returned list *will* have 2 elements, and not spit out a warning in that specific case
<judge> yeah, it does seem like a difficult task
<judge> but the compiler already has superfancy sprintf support :)
mlh has joined #ocaml
Herrchen has joined #ocaml
smimou has joined #ocaml
mlh has quit [Client Quit]
gim has quit [Read error: 60 (Operation timed out)]
gim has joined #ocaml
vezenchio has joined #ocaml
gim has quit ["x restart brb"]
gim has joined #ocaml
pango has quit [Remote closed the connection]
Herrchen has quit ["bye"]
pango has joined #ocaml
slashvar1lri] has quit [Read error: 60 (Operation timed out)]
zxy_ has joined #ocaml
zxy has quit [Connection timed out]
FriedBob has joined #ocaml
bzzbzz has joined #ocaml
<FriedBob> make world seems to work, but make bootstrap or make opt keep failing, saying something about "no rule for target to ../boot/ocaml needed by pervasive.ocm" or somethign like that.
<FriedBob> Trying to install the current stable ocaml on slack 10 kernel 2.6.7 no TK and no X11
Shammah has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
ita has joined #ocaml
<ita> hello
<FriedBob> G'mornign
<ita> i hate that : Fatal error: exception Stack_overflow
<pango> bytecode or native ?
<ita> native
<ita> looks like it does not like sorting lists with millions of elements
<pango> depends whether the implementation is tail recursive or not
<ita> good idea
<FriedBob> Any ideas why ocaml won't compile for me?
* ita is modifying his code
<ita> FriedBob: give the error ?
<FriedBob> "no rule for target ../boot/ocaml needed by pervasives.ocm"
<ita> ouch
<FriedBob> When I do make bootstrap or make opt after make work
<ita> in make world ?
<FriedBob> Err
<FriedBob> make world
<FriedBob> No, after that.
<FriedBob> make world "seems" to work w/o errors.
<ita> FriedBob: make world, make opt does work then ?
<FriedBob> I'm on slackware 10, kernel 2.6.7, no X and no TK/TCL
<FriedBob> Make world seems to work, make opt gives that error
<FriedBob> and so does make bootstrap
<FriedBob> and make world.opt works for a while, then gives that error.
<ita> FriedBob: i'd say rm -rf the dir, and re-untar, configure and make :-/
<FriedBob> OK.
<FriedBob> The configure script should make allowances for the fact that I don't have X installed, right?
CosmicRay has quit [Remote closed the connection]
<ita> Fatal error: exception Invalid_argument("Array.make")
<ita> ouch
<ita> let noise2 = Array.init 8000000 (fun x -> {alid=100+Random.int 80000; time=Random.int 604800}) in
<vincenz> too big?
<ita> yep
<ita> 4. 10^6 does it though
<FriedBob> Only reason I'm installing ocaml is that it's a dependancy for a component of something else I want to install.
<ita> FriedBob: aren't there packages for slackware ?
<ita> FriedBob: what is the stuff you want to install ?
<vincenz> I think with 32bit, max size is 16mb for strigs, if we translate that to words thats 4Mwords, and I think therefore you can only do arrays of 4M elemets, one element being a word (pointer)
<FriedBob> SELinux
<ita> vincenz: good to know, thanks
<FriedBob> And I try not to install binary packages for anything other than my base system, and then only the stuff from the install CD. Everything else I do from source.
<ita> enjoy the mess :)
<FriedBob> What will be real fun is when I add LDAP/PAM to slack.
<FriedBob> And I don't recall seeing any slack packages for ocaml at the download site. So if they exist, they would be 3rd party from slackpackages.net or something liek that, unless I overlooked them.
<FriedBob> And I've heard a lot of bad things about that site, mostly screwy options on the packages listed there.
<FriedBob> world is currently making.
<FriedBob> BTW
<FriedBob> would it make any difference (other than time it takes) to be using "make -j3" instead of just "make" ?
<pango> ita: the Humps has a "Generic_Array" entry that points nowhere (404)
<ita> FriedBob: can be
<FriedBob> So make -j3 can cause problems, or shouldn't?
<ita> it can
<FriedBob> Well, I forgot to add it this time when I did make world, so we'll see
<dan2> FriedBob: the formula for currency is processors*2
<dan2> FriedBob: if you have one processor, run -j2
<FriedBob> I have dual P90s, so make -j3
<FriedBob> CPU * 2?
<FriedBob> I was told num CPU + 1
<dan2> no
<dan2> make that -j4
<FriedBob> And I think that's what smp.txt
<FriedBob> says from the kernel docs/source.
* ita does not like make
<FriedBob> Yeah, I just checked, and the smp.txt from Documentation of the 2.6.7 kernel source says use make -jN, where N = Number of CPUs + 1
<FriedBob> I can try -j4 though, see what sort of difference that makes.
<ita> that makes -j4 :)
<FriedBob> I have a dual proc, 2 cpus. So number of CPUs + 1 is 3.
<dan2> FriedBob: what makes you think smp guys can do math?
<dan2> if you can run -j2 on one processor system
<dan2> then -j4 will be fine on a dual processor
<FriedBob> dan2: Ok.
drewr has joined #ocaml
ne1 has joined #ocaml
<FriedBob> Hmm, make bootstrap seems to be working this time, we'll see if it finishes.
async has joined #ocaml
async is now known as mbh
mrvn_ has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]
FriedBob has quit ["Client exiting"]
fab__ has quit [Read error: 113 (No route to host)]
smimou has quit ["?"]
smimou has joined #ocaml
mrsolo_ has quit [Read error: 54 (Connection reset by peer)]
mrsolo has joined #ocaml
mbh has quit ["Lost terminal"]
<judge> does ocaml have non-userlevel threads?
<judge> or is that still being worked on?
<pango> pthreads, when you compile to native code
<judge> cool
KrispyKringle has joined #ocaml
pango has quit ["Leaving"]
mattam has joined #ocaml
Smerdyakov has joined #ocaml
pango has joined #ocaml
ita has left #ocaml []
Herrchen has joined #ocaml
kuribas has joined #ocaml
FriedBob has joined #ocaml
<FriedBob> Well, this time the bootstrap worked, now waiting on make opt && make opt.opt to finish
<Smerdyakov> I don't have any context for that. Where are you compiling this?
<FriedBob> Slackware 10 kernel 2.6.7 (custom), dual P90. In the process of installing OCAML
<FriedBob> Earlier, make world seemed to work, but make bootstrap and make opt were failing, now they aren't.
<Smerdyakov> Can't you get a binary package for Slackware?
<FriedBob> Possibly, but if I wanted to install everything from binaries, I'd use RH/Fedora, Lindows/linspire or windows.
<FriedBob> I install my base system from bins, then compile everything else.
<Smerdyakov> Why wouldn't you use Debian?
<FriedBob> Didn't come to mind.
<FriedBob> I'm not quite anti-binary that I use Gentoo though
<FriedBob> I don't recall seeing a Slack package on the download site, which means I'd have to get a 3rd party one from somewhere like linuxpackages.net
<FriedBob> That and I don't have X or TK/TCL installed
<Smerdyakov> Yup. Which is why I can't see using any distro that doesn't support Debian or RH packages.
<KrispyKringle> actually, there are more packages in the gentoo portage tree than in either of the other two apt repositories. ;)
<KrispyKringle> including ocaml, which works fine.
<Smerdyakov> How many in Gentoo vs. Debian unstable?
<FriedBob> Slack suits me, and it works well with my hardware. I've hard problems installing other distros.
<KrispyKringle> Smerdyakov: oh, i don't really know. how many are in debian unstable?
<KrispyKringle> im a fan of debian, ill admit. the advantages of from-source are somewhat lost if a) you don't make use of them and b) you spend a long time compiling.
* Smerdyakov checks.
Submarine has joined #ocaml
<KrispyKringle> also, gentoo does have arch flags, so if you use debian unstable, you should count things marked ~arch (i.e. unstable on that arch).
<drewr> I get about 21100 in Sid.
<Smerdyakov> Debian unstable seems to have 17693.
<drewr> Hm.
<drewr> $ dpkg -l \* | egrep '^[uipr]' | wc -l
<drewr> 21115
<KrispyKringle> holy shit.
<KrispyKringle> i take it back, then.
<Smerdyakov> I downloaded this and counted lines: http://packages.debian.org/unstable/allpackages.en.txt.gz
<KrispyKringle> im only getting 9830 ebuilds in my portage tree, though it may not be complete.
<KrispyKringle> i did for f in /usr/portage/*
<KrispyKringle> ls $f|wc -l
<KrispyKringle> well, into a tmp file first, since that just gives me the sums per category.
<avlondono> according to the gentoo-portage website the count is close to 17.000
<Smerdyakov> Nothing else in the world, for any operating systems, comes anywhere close to the number of packages for Debian.
<KrispyKringle> yeah, i think my portage tree is incomplete.
<Smerdyakov> I guess I might have to make that "binary packages."
<avlondono> heh
<Smerdyakov> But Debian is where the action is, if you want other people to do the work for you in getting software to run!
<KrispyKringle> true
<KrispyKringle> the only compile flags of any real value are PIE and SSP (-fPIE and -fstack-protector, in my case).
<KrispyKringle> i wouldn't mind compile flags to save me some trouble.
<KrispyKringle> im looking at this package, pms, because i want something to fill the niche. but it doesn't use mlock.
<Smerdyakov> What niche is that?
<KrispyKringle> whoops/ wrong channel.
<KrispyKringle> heh
<KrispyKringle> and by compile flags, i meant binary packages
<KrispyKringle> sorry. im a mess. ;)
<drewr> With all its faults, Debian is still the most convenient OS. I spend less time manipulating installed software, period.
<KrispyKringle> true.
<Smerdyakov> It's even better if you get Debian preinstalled on your new machines, with 2 year support contracts. :)
<KrispyKringle> for a server, it's great. and debian unstable's a fine choice for a desktop.
<Smerdyakov> I use testing. Works great for me.
<drewr> Furthermore, I can only remember one time where running Unstable caused me a morning worth of work to clean up from a sucky package.
<Smerdyakov> drewr, are you learning OCaml now?
<drewr> Smerdyakov: Yes I am!
<KrispyKringle> is there a way to do something akin to mlock in ocaml?
<KrispyKringle> if i have sensitive data i don't want to swap to disk (like passwords)?
<Smerdyakov> KrispyKringle, mlock asks the OS not to swap specified pages to disk?
<KrispyKringle> yep
<Smerdyakov> KrispyKringle, you probably need to manage that data with C code and access it with the FFI.
<KrispyKringle> ah
<KrispyKringle> ok, thanks.
<Smerdyakov> KrispyKringle, OCaml uses a copying garbage collector, which makes it hard to do what you want for OCaml-managed objects.
<KrispyKringle> yeah, figured. makes sense.
<Smerdyakov> You might still have problems with temporary copies of the data in OCaml's address space.
<KrispyKringle> might be better to just write this in C, then. i was just curious.
<KrispyKringle> i was looking at this software that is a "password manager" (to take the place of gpg, which i currently use), but, as i accidentally said in this channel, it doesn't use mlock (though if it zeros the passwords after storing them, it's at least somewhat more secure). so i was thinking of writing something to do that, but ocaml wouldn't be suited, i suppose.
<Smerdyakov> Yeah. It doesn't sound like a technically challenging thing to support, but I don't know of anyone who's done the work yet.
<Smerdyakov> I don't like this whole concept of writing pages to disk without consulting with applications, in the common case, anyway. :P
<KrispyKringle> right
<KrispyKringle> i was browsing freshmeat, thinking, oh, someone must've written this already.
<Smerdyakov> These kludgey monolithic operating systems.
<KrispyKringle> but most of them were gui apps, which i don't want, and the only one that isn't doesn't utilize mlock, which, while i'm not terribly paranoid about it, does make me abit nervous.
<KrispyKringle> Smerdyakov: why? that kind of transparency is necessary to abstract the low-level memory management from the userspace applications.
<KrispyKringle> i'm not sure i've ever heard someone argue against it, but im curious to hear your point :)
<Smerdyakov> See, I would have thought that before I took a graduate course on computer systems.
<KrispyKringle> and?
<Smerdyakov> Try writing a high-performance database server that way
<Smerdyakov> A number of things on the reading list talk about the issues: http://www.cs.berkeley.edu/~brewer/cs262
<KrispyKringle> well, ok. but the needs there are relatively different than those of a general purpose desktop or server OS.
<Smerdyakov> Part 2, mostly
<Smerdyakov> Why would you want to have multiple operating systems for these different classes?
<KrispyKringle> i'm not saying you would, but the needs of the application developer are relatively different. i trust a database vendor to manage memory effectively, but i don't necessarily trust a browser maker or a office productivity software maker.
<Smerdyakov> And OCaml is a great example of a system that would benefit from application-level control of virtual memory.
<Smerdyakov> You don't want the OS to bother paging out the half of the memory space that isn't being used, due to a semi-space copying collection scheme.
<KrispyKringle> right, but in that case, you're saying, "I trust applications written in OCaml because they use OCaml, which I trust," which really is just moving the level of abstraction up one layer from the OS to the compiler.
<KrispyKringle> it's not significantly different.
<Smerdyakov> No, you misunderstood what I said.
<Smerdyakov> Maybe the follow-up line will clear that up. :-)
<KrispyKringle> oh, sorry.
<KrispyKringle> yeah, i got that right after i hit enter ;)
<KrispyKringle> ok, that's fair. but you're still arguing, i think, for a situation that maybe would be optimal with *optional* OS control.
<KrispyKringle> my only point was that for many cases, particularly on the desktop, you *can't* trust applications to manage memory properly.
<Smerdyakov> No, because that complicates things unnecessarily.
<Smerdyakov> Much preferable is application-level control with helpful default control libraries that you can link in when you don't care.
<KrispyKringle> control to what level? do we still have virtual memory addressing, but no swapping to disk?
<Smerdyakov> Why can't you trust them? Make them come with proofs that they manage memory properly.
<drewr> Which library is really_input in?
<Smerdyakov> KrispyKringle, application-level control of virtual memory mappings is good.
<Banana> drewr: in the Pervasives module which is loaded by default.
<KrispyKringle> how can you do application-level control? doesn't that require giving the applications access to the physical memory address space?
<KrispyKringle> that's fundamentally undesirable.
<Smerdyakov> KrispyKringle, it is with UNIX, but who wants to run UNIX?
<KrispyKringle> haha
<Smerdyakov> KrispyKringle, seriously, read some of those papers I referenced..
<KrispyKringle> it is with a mutli-user system that allows users to arbitrarily run code.
<Smerdyakov> KrispyKringle, no. Read the papers!
<KrispyKringle> ok, ok, ok
<KrispyKringle> :P
<KrispyKringle> which should i start with?
<KrispyKringle> application-controlled ...?
<Smerdyakov> KrispyKringle, this looks like what I'm remembering: http://www.cs.berkeley.edu/%7Ebrewer/cs262/hc.ps
<KrispyKringle> good. that's the one i clicked.
<KrispyKringle> ill good lord. that's an ugly ps.
<KrispyKringle> or at least, apple turned it into an ugly pdf.
<drewr> Banana: Thanks.
<Smerdyakov> The details aren't so interesting to me, but they give a presentation of a traditional kind of scheme that allows for application control of VM.
<Smerdyakov> I'm more interested in using static checking to do that more elegantly. (Possible thesis topic!)
<KrispyKringle> but you're insisting that all applications run are in some form of proof-carrying code, no?
<Smerdyakov> Yes
<KrispyKringle> ok, so it's a fantastic idea, and it doesn't sacrifice any security at all, but it's entirely incompatible with every existing general purpose system ;)
<Smerdyakov> Good. The existing systems show horrible security and reliability problems.
<KrispyKringle> true
<KrispyKringle> i can see why you like ocaml :P
<KrispyKringle> ill check this paper out as soon as my ghostviewer downloads, since preview makes such a bad pdf.
<KrispyKringle> back in a few. nice talking to you, as usual, Smerdyakov
smimou has quit ["?"]
Smerdyakov has quit ["eat"]
kuribas has quit ["Leaving"]
<drewr> I don't quite get what the Some expression is doing in this block:
<drewr> let readdir_no_ex dirh =
<drewr> try
<drewr> Some (readdir dirh)
<drewr> with
<drewr> End_of_file -> None;;
<drewr> I know that the try block must return the same type as the expected exception, but how does that apply to this case?
FriedBob has left #ocaml []
<KrispyKringle> drewr: i believe the some means that it could return that, or not, which makes the with expression valid in that it returns none (the try could return none), thus it is type-valid.
<KrispyKringle> but i'm pretty new to ocaml, so don't take my word on it ;)
Submarine has quit ["Leaving"]
<vincenz> drewr: it uses the type option
<avlondono> no, Some and None are the constructors for an option type which is a builtin type in Ocaml.
<vincenz> type a' option = None | Some of a'
<KrispyKringle> ah
<KrispyKringle> right
<drewr> Yeah, I read about the type option, but it hasn't sunk in yet.
_fab has joined #ocaml
<drewr> So what's the point of the option type?
Herrchen has quit ["bye"]
<Riastradh> It is a way to express either success with a value or failure.
smimou has joined #ocaml
<drewr> I see. So it's like in Perl where you can express truth by using any scalar that isn't equivalent to a null value?
<pango> just 10 times less hackish, but yes ;)
<drewr> pango: As I'm discovering about everything with Caml!
<pango> option types are a special case of sum types, see sum types
<pango> it will be hard to use Perl as a reference for type concepts, because ocaml and perl have almost opposite approaches to typing
<KrispyKringle> heh
<drewr> I can see what you mean.
<drewr> Does Caml have a docstring convention?
<pango> standard is probably ocamldoc (http://caml.inria.fr/ocaml/htmlman/manual029.html), I haven't used that yet
<drewr> Cool.
<drewr> I haven't gotten to much of the manual yet. I'm still working on a couple of tutorials.
<pango> I really liked "developing applications with objective caml"
<drewr> I will probably get into that next. I'm reading some stuff that is less comprehensive just to get a feel for the language.
<dan2> pango: none of the example pages looked good in my web browser
<pango> try another browser ;)
<drewr> dan2: Same here with Firefox.
<dan2> drewr: gonna try with opera
<dan2> khtml is a better parsing engine than mozilla, and much faster too
<dan2> works fine in opera
<dan2> which means it will work fine in konqueror
<drewr> Hm, you got anything else?
<dan2> drewr: it has to be a khtml browser
<drewr> Are those the only two?
<dan2> no...
<dan2> safari on mac os x
<drewr> I guess I could install konqueror. I just didn't want all the libs that come with it.
<dan2> drewr: download opera
<dan2> i know its not free, but its free as in beer
<dan2> drewr: its much faster than firefox
<dan2> it uses Qt
<drewr> How big is the ad scroller thingy?
<dan2> but not kde
<dan2> drewr: as big as the one on top of any sourceforge page
<dan2> drewr: unnoticeable for me
<drewr> I'll try it too. konqueror's coming now.
* drewr wishes he could just have one be-all browser.
<dan2> you use debian I take it
<drewr> dan2: Aye.
<dan2> drewr: opera or IE
<dan2> :)
<dan2> drewr: I'm about ready to buy a license of opera, I like it so much
<pango> I can't stand ads
<drewr> I tried Opera a few years ago and it was terible. I assume it's gotten better.
<pango> hopefully security-wise too
<drewr> Or I could just read the PDF! (slaps head)
<dan2> hmm
<pango> pages were generated by hevea LaTeX -> HTML, but w3c validator is not too happy with the result
<drewr> konqueror displays a problematic page the same way Firefox does on my online banking.
<drewr> opera liked it though.
<drewr> Ack, pop-ups everywhere.
drewr has quit ["home"]
KrispyKr1ngle has joined #ocaml