gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
boscop has quit [Ping timeout: 264 seconds]
Associat0r has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
Associat0r has quit [Quit: Associat0r]
arubin has joined #ocaml
brendan has joined #ocaml
Edward__ has quit []
mfp has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
lamawithonel_ has quit [Ping timeout: 264 seconds]
lamawithonel_ has joined #ocaml
vivanov has quit [Ping timeout: 250 seconds]
vivanov has joined #ocaml
lopex has quit []
enthymeme has joined #ocaml
arubin has quit [Quit: arubin]
astory has joined #ocaml
<astory> total newb question; if I want to see some moderately complex object during execution for debugging purposes, is there a way I can turn it into the same sort of string representation that the interpreter gives you?
philtor has quit [Ping timeout: 240 seconds]
philtor has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
dnolen has quit [Read error: Connection reset by peer]
dnolen has joined #ocaml
fraggle_ has quit [Ping timeout: 276 seconds]
<kaustuv> astory: not as such because at runtime there are no types. However, if it's only for debugging then you could just use camldebug
fraggle_ has joined #ocaml
dnolen has quit [Quit: dnolen]
<rwmjones> astory: try extlib's Std.dump function (there is also something similar in Batteries Included)
<rwmjones> astory: it's not going to be the same as what the toplevel prints, because types are discarded in the runtime binary, but it should give you a good idea for debugging purpoess
<rwmjones> purposes
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
ygrek has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
Cyanure has joined #ocaml
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 264 seconds]
larhat has joined #ocaml
Yoric has joined #ocaml
edwin has joined #ocaml
Yoric has quit [Quit: Yoric]
ikaros has joined #ocaml
Yoric has joined #ocaml
<f[x]> rwmjones, are you planning to develop extlib? i.e. incorporate bugfix patches?
<rwmjones> not unless the earth starts spinning more slowly
<rwmjones> with a few extra hours each day, I'd have the time
<f[x]> would you like someone to do this - review patches in bugtracker and make a release?
<rwmjones> sure ... extlib isn't really "my" project
<f[x]> you seem to be the one most easily reached so I ask you :)
<f[x]> I can't seem to find the way to request to join the project on googlecode
Yoric_ has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Yoric_ is now known as Yoric
avsm has joined #ocaml
ftrvxmtrx has joined #ocaml
Yoric_ has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Yoric_ is now known as Yoric
Fullma has quit [Quit: Fullma]
avsm has quit [Quit: Leaving.]
ikaros has quit [Quit: Leave the magic to Houdini]
_andre has joined #ocaml
lopex has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
<flux> has batteries yet resolved the Batteries_uni/Batteries situation?
<milosn> what situation is that?
Yoric has joined #ocaml
<flux> if you don't use threads, you must use module Batteries_uni, otherwise Batteries
<milosn> hmm interesting
<milosn> i imagine its a major PITA
<adrien> there's no 'val pi' in the stdlib, right?
Yoric_ has joined #ocaml
Yoric has quit [Ping timeout: 272 seconds]
Yoric_ is now known as Yoric
<flux> for some incomprehensible reason, correct
<flux> this works: let pi = 4.0 *. atan 1.0
<flux> but actually I figured one puny reason for it not being there
tnguyen has joined #ocaml
<flux> if you calculate it locally, you might get extra accuracy for it is in in the fp registers
<flux> but...
<adrien> I used acos ;-)
<adrien> extra precision? that sounds a bit surprising that it'd be the reason
ikaros has joined #ocaml
<mrvn> and only if atan generates that extra precision.
<mrvn> adrien: x86 cpus have 96bit registers and ocaml uses 64bit doubles in memory.
<f[x]> 80bit iirc
tnguyen has quit [Remote host closed the connection]
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
tauntaun has joined #ocaml
Oejet has joined #ocaml
<rwmjones> f[x]: that was you that just sent me the email?
<f[x]> yes
<rwmjones> what's your googlecode account name?
<f[x]> same as mail
<rwmjones> ok I added you as a committer
<f[x]> thanks!
<thelema> flux: can't be resolved until 2.0. The patch is already in the 2.0 branch of batteries
<thelema> f[x]: should I watch your improvements to extlib so I can apply them to batteries too?
<f[x]> for now I plan only bugfixes
<thelema> then I'll definitely keep an eye on your changes
krktz_ has left #ocaml []
<thelema> rwmjones: any chance of fixing the spam in the commits mailing list?
tauntaun has quit [Quit: Ex-Chat]
<thelema> I guess it's been fixed as of late Nov
ikaros has quit [Ping timeout: 246 seconds]
ygrek has quit [Remote host closed the connection]
alpounet has joined #ocaml
alpounet has quit [Client Quit]
<vivanov> is there a library that has functions to check if a file exists, if a file is empty? or i'll have to use standard Unix module to write the functions ?
<thelema> sys can check if a file exists, iirc
astory has left #ocaml []
<thelema> Sys.file_exists
<vivanov> ok i see -- thanks
<vivanov> by the way -- regarding my threads question everything works great -- was my mistake
<thelema> as far as emptiness, let is_empty fn = (Unix.stat fn).Unix.st_size = 0
<vivanov> great! thanks so much
<flux> of course, you better do those in one swoop, to avoid race conditions
<flux> so, catch the exception Unix.stat throws if there is no such file
<thelema> or just fail (gracefully) if the user is doing stupid things like deleting the file between checking for its existence and checking for its size
<vivanov> :) ok will do thanks
arkadir has joined #ocaml
mnabil has joined #ocaml
<mrvn> don't use fn for a file handle.
dnolen has joined #ocaml
<thelema> mrvn: fn = filename
<mrvn> still a bad name. fn is usualy used for function.
<mrvn> if you open the file then better use fstat
<thelema> really? I usually use f for function
<mrvn> that too
<kaustuv> let is_empty fn = let st = Unix.stat fn in st.Unix.st_kind = Unix.S_REG && st.Unix.st_size = 0
Yoric_ has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Yoric_ is now known as Yoric
boscop has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
oriba has joined #ocaml
<gildor> vivanov: there is also ocaml-fileutils
<gildor> with Size_equal_to or Size_not_null
<gildor> + find
<gildor> or test
<gildor> vivanov: ^^^
<thelema> I look forward to being able to have more than just one dependency for batteries so I can use fileutils
<thelema> gildor: ^^^
<thelema> gildor: also, it would help some people to link version 0.4.2 from http://le-gall.net/sylvain+violaine/ocaml-fileutils.html
<gildor> thelema: so many things to do ;-)
<thelema> or link to the ocamlforge page
<thelema> yup. not a priority, just a little annoyance
<gildor> I look forward to being able -> you mean you would like to be able to wrap ocaml-fileutils with batteries ?
<gildor> thelema: ^^^
<thelema> yes
<thelema> it seems to be good, useful code.
<gildor> yes, I know, I still have this in mind, I need to provide next operator to iterate
<gildor> I should also use oasis with it and move the whole thing to the OCaml Forge
<thelema> no rush - we can add that in time
<thelema> step 1) make it work, step 2) make it work better
edwin has left #ocaml []
<gildor> thelema: 1) publish ocsigen-bundler and 2) publish ocamlcore-api
<vivanov> gildor: thanks, ill have a look at fileutils
<gildor> 3) organize OCaml Meeting, 4) publish oasis-db
<thelema> I noticed the bundler - that looks like some good code
<gildor> ocsigen-bundler -> very simple code and very useful
<thelema> gildor: I still have to roll my eyes at the ocamlcore api
<thelema> no argument on the bundler
<gildor> still some glitch like missing mime files, but you can live with it
<gildor> the ocamlcore-api is ~4 functions, 1 to get account, 1 to get session, 1 to get a box displaying links for login and 1 to get a box displaying information for account
<gildor> very simple -- but a lot of code behind to make the link with the OCaml Forge database
<thelema> how is this useful outside ocamlcore?
er98052 has joined #ocaml
<gildor> thelema: not very useful, still you can connect to any FusionForge installation but I doubt it will be used anywhere else
<er98052> hi, I am encountering this error: Type Padsc.ploc_t = Padsc.ploc_s is not compatible with type Pads.span_info
<gildor> FusionForge people do prefer PHP code
<thelema> sounds like wasted effort to make it general
<er98052> while trying to use padsml (padsproj.org). OTOH, the sources clearly define -- "type span_info = Padsc.ploc_t" and later "and ploc_t = ploc_s". I have "open Pads" and "open Padsc" at the head of my program.
oriba has quit [Quit: Verlassend]
<er98052> any ideas as to why this might be happening?
<thelema> er98052: I can't download the code to help you.
<er98052> seems like a bug
<er98052> thelema: um, good morning/evening to you as well
<thelema> er98052: good morning
<thelema> I looked into this last night and the pads/ml code is inaccessible to the public
<thelema> as far as your specific problem, it's *much* more likely a problem with your code than the compiler
<gildor> thelema: but the ocamlcore-api is one step to publish things like activity-monitor which can make the link between github's OCaml world and planet.ocamlcore.org
<er98052> thelema: thanks for looking into it. I'll try isolating a smaller test case.
<arkadir> er98052: is there any chance that you have multiple copies of module Pads in your include paths?
<thelema> gildor: not convinced of the usefulness at all. what activity monitor?
yezariaely has joined #ocaml
<gildor> thelema: activity-monitor has been designed by Arlen Cuss (and a little bit by me) to fetch commits/project creations related to OCaml on github and publish them on planet.ocamlcore.org
<er98052> arkadir: i can't rule that out. I just wanted to check if there's a well-known scenario. I'll dig into this further.
<gildor> thelema: ocamlcore-api already help to use SSO with the forge, on the long run, it is better than many sites with a login per site
<gildor> thelema: if we want to create many small website
<thelema> gildor: per-commit planet messages is probably too much traffic.
<thelema> gildor: but an interesting idea, nonetheless
<gildor> thelema: nope, weekly report
<thelema> ah, much better. nevermind then
<arkadir> er98052: I've seen this happen with modules appearing twice, and the code using Pads from the first and Padsc from the second occurence (so their internal types would be distinct)
<er98052> thelema: pads/ml is a really great tool if you want to check it out sometime - I am not sure why you were unable to download it. http://padsproj.org/ml-download-src-1.1.html
<er98052> it will ask you for a username/password which can be found at the bottom of the license agreement
<thelema> as far as SSO, I'm all for that, I'm just arguing that it doesn't benefit from being public (or generalized)
<thelema> er98052: I have no license agreement... ahhh, the general license agreement has the username/password at the bottom.
<thelema> I read that as each person/organization's license agreement would have username/password
<thelema> my fault, and my apologies for being so brusk.
<thelema> er98052: do wait longer for responses on #ocaml
<thelema> er98052: although we do appreciate you asking your question well.
<gildor> thelema: you mean that there is no need to publish it ?
<gildor> thelema: no need to publish ocamlcore-api ?
<thelema> gildor: yes, nor to make it more than single purpose.
<gildor> thelema: oh, that is not a big priority (except to make it clear for me when I first use it, i.e. to have a tag)
<thelema> If you get time, sure - clean it up and make it available to the 2 other people in the world that might use it
<gildor> thelema: and it only targets ocaml-meeting/oasis-db for now
tauntaun has joined #ocaml
<thelema> but I wouldn't put that as higher priority over the conference. (IMNSHO)
<gildor> that wasn't but higher, but now that I book the room, the only thing is advertising/convincing people to give talks
<thelema> that said, it's not my place to set your priorities, and I apologize for presuming so much.
<gildor> in fact, all the delay for the conference announcement was due to the fact that Telecom ParisTech didn't confirm the price before ~23 February
<thelema> sure. I've run a conference before, and there's more to do than speakers, audience and a room.
<gildor> thelema: what is the list of things to do ? (wouldn't want to miss something)
tauntaun is now known as tautaun_away
cthuluh has quit [Quit: test]
<arkadir> gildor: what kind of talks are you looking for?
<gildor> arkadir: any talks about OCaml
<gildor> arkadir: I'll do a talk about OASIS-DB (a CPAN for OCaml)
<thelema> gildor: http://www.bls.gov/oco/ocos298.htm <- "Nature of work"
<thelema> arkadir: gildor is already signed up for that talk, iirc
<gildor> arkadir: there is the usual talk by the OCaml core team about the future of OCaml
<arkadir> gildor: would "benefits of OCaml in Agile" qualify?
cthuluh has joined #ocaml
<gildor> thelema: most of the points of this document has been already solved
<gildor> (e.g. sponsoring = CAML consortium, no printed material, negociation with Telecom about the price are ok...)
<thelema> gildor: if the room, signup, AV, speakers and advertising is done, consider name badges, special activities for attendees to mix better, how to get feedback from participants about making it better, what they want, etc.
<gildor> arkadir: benefits of OCaml in Agile -> why not, could you send me a longer description
<thelema> plus whatever work you want to do in helping give good talks
<gildor> thelema: you want to help ?
<thelema> I don't think I can go
<gildor> advertisement/getting people to submit talks doesn't need to come
<gildor> (name badges is a 1h matter)
<thelema> maybe a flash-presentation session
dnolen has quit [Quit: dnolen]
<thelema> "lightning talks"
lopex has quit []
<gildor> thelema: try this last year, only 1 volunteer to do it
<gildor> thelema: but maybe, that was due to lack of advertisement
<arkadir> thelema: you mean, as in a BarCamp?
<thelema> group hacking sessions
<gildor> thelema: try this last year (OCaml Hacking day)
<thelema> arkadir: probably - ~5 min per person, done
<gildor> the hacking day is nice, but I need someone to organize it (cannot handle both)
<arkadir> thelema: thanks
<thelema> gildor: would it be easier if it were just a couple hours?
<gildor> thelema: the problem is to find a room for it
<gildor> couple of hours or a day, doesn't make a big difference about it
<gildor> if people agree to come at my office, it should be ok though (but I don't live in Paris)
<thelema> that complicates doing it with the conference in paris...
<gildor> I live next to Paris (25 minutes)
<gildor> French people won't have any problem to come
<thelema> if you can start arranging carpools, this might work out.
<gildor> no carpools, we use public transportation
<thelema> unless there's public transit well
<thelema> of course
<thelema> American thinking.
<gildor> (car is not the best way to go in Europe)
<thelema> okay, "transit leaders" who volunteer to help people get to and from
<gildor> I am ~1hour away from Paris in car
<thelema> maybe detailed, tested directions on paper
<gildor> yes, maybe
<thelema> (foreigner-tested)
<gildor> though, I'll wait to have people asking me to do it
tautaun_away is now known as tautaun
<gildor> I don't want to organize something that takes a lot of time, just for 1 or 2 people
<thelema> true - it depends on the attendees
<thelema> so extend your signup form to ask if people would take transit to go to a hackathon
<thelema> find out if there is interest
<thelema> maybe even post to caml-list
Yoric has quit [Quit: Yoric]
<adrien> gildor: how did you get the room at lip6 last year?
<gildor> adrien: Mehdi Dogguy helps me (he organized the day in fact)
<gildor> helps/helped
<hcarty> Would some sort of live streaming of the talks be possible?
<hcarty> ustream or something along those lines
<gildor> hcarty: if someone volunteer to do it, yes
<gildor> hcarty: though, I have a webcam and can afford for a webex session -- if someone volunteer to help
<hcarty> gildor: Can webex provide a mix of computer display + webcam video?
<hcarty> gildor: As in live slides + video/audio
<gildor> hcarty: I think so, but we will probably setup 2 webcams, one for the screen and one for the speaker
<gildor> (and ONLY if someone volunteer to do it)
<hcarty> gildor: I may be able to help, depending on what help is required. I can't make it in person, but I would love to see the talks.
<gildor> hcarty: I understand, if you are able to convince someone to help in live, that would be perfect
<gildor> hcarty: you can create a wiki page with links from the main OCamlMeeting2011 page to organize yourself
<gildor> hcarty: like how to setup/what is needed/who can do it at the conference
lopex has joined #ocaml
sepp2k has joined #ocaml
larhat has quit [Quit: Leaving.]
tautaun has quit [Ping timeout: 264 seconds]
ttamttam has joined #ocaml
ulfdoz has joined #ocaml
ttamttam has left #ocaml []
ulfdoz has quit [Ping timeout: 240 seconds]
yezariaely has quit [Quit: Leaving.]
ygrek has joined #ocaml
coucou747 has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
mnabil has quit [Ping timeout: 252 seconds]
ottbot has joined #ocaml
ottbot has left #ocaml []
lopex is now known as lkb
lkb is now known as lopex
papers has joined #ocaml
agarwal1975 has joined #ocaml
Yoric has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
mnabil has joined #ocaml
<thelema> hmm, I seem to need a polymorphic empty array, what's the best way to generate this? (i.e. is there a way to do it without Obj.magic)
<hcarty> thelema: This is a guess ... would wrapping it in an option help?
<thelema> hcarty: Obj.magic would be better
<mrvn> thelema: let f () = Array.make 0 (Obj.magic 0)?
tauntaun has joined #ocaml
kaustuv_ has joined #ocaml
<thelema> mrvn: thanks
<mrvn> Do you have a real use for a size 0 array?
<thelema> type 'a node = {tree: hash_f; paths: hash_f; children: 'a node array; decisions: 'a array}
Pepe_ has quit [Quit: leaving]
<mrvn> thelema: why not a list?
<thelema> need fast direct indexing
<mrvn> hashtbl?
<hcarty> thelema: Why doesn't a normal, non-magic'd array work there?
<thelema> indexing by ints
Pepe_ has joined #ocaml
<thelema> the hash function is encoded in the node
<mrvn> thelema: you can make an int,'a hashtbl :)
<thelema> (actually, two hash functions)
<kaustuv_> don't be magicing arrays if you ever intend to store floats in them
<thelema> kaustuv_: yes sir. no floats
<mrvn> hcarty: how would you create the decisions array?
<thelema> hcarty: need an empty node with no children or decisions
<thelema> kaustuv_: I can't imagine using floats for decisions. I'll put warning labels on the code
<mrvn> thelema: what you really want is a resizable array.
<thelema> well, I'm doing insertions into the array the hard way.
<kaustuv_> 'a array option is too expensive for you?
<thelema> I want a data structure with fast insertion/deletion (indexed) and fast indexing
<mrvn> thelema: shouldn't you merge children and decisions into on array?
<mrvn> +e
<er98052> thelema, gildor: I found the issue. The .mli file for the Pads interface in the current distribution is outdated. Regenerating it does the trick. There was a "type span_info" in that file, which did not equate it to the other type
<thelema> kaustuv_: extra indirection... :(
<thelema> er98052: ah, good find.
<kaustuv_> if you're worried about the space, that's a non issue. If you are worried about the branch mispredictions, you better be writing graphics or realtime code
<hcarty> mrvn: I'm not sure I understand... why doesn't { foo = [||]; bar = [||] } work?
<thelema> mrvn: no, I'm doing Longest Prefix Matching, so they're different
ulfdoz has joined #ocaml
<thelema> hcarty: hmm, I forgot about array literals...
ygrek has quit [Remote host closed the connection]
<mrvn> hcarty: that is actually even better than Obj.magic.
<mrvn> let f () = [| |];; val f : unit -> 'a array = <fun>
<thelema> hcarty: that was the answer I was looking for. Wow, it's been forever since I've used an array literal
<thelema> kaustuv_: I'm optimizing for space and time heavily - FIB IP lookup code, I guess that's realtime
<kaustuv_> and you are not worried about major collections or compactions?
<mrvn> thelema: prefix tree over int64.t?
<mrvn> aeh, int32.t I mean
ygrek has joined #ocaml
<thelema> kaustuv_: I plan on optimizing out all allocations (except on update)
<mrvn> I imagine that is nearly impossible.
<thelema> mrvn: we'll see.
<thelema> I really only have to prevent data from making it to the major heap
<mrvn> thelema: the tree will probably move there once.
<thelema> and it's not really for production, just for analysis.
<thelema> yes, the tree will sit there, and as it gets updated, there'll be garbage that accumulates
<mrvn> do you use wireshark output or ulog?
<kaustuv_> what was your initial problem again? You just want polymorphic empty arrays?
<mrvn> kaustuv_: he wanted [||]
<thelema> kaustuv_: yes.
<thelema> let null_node () = {tree=H.empty; paths=H.empty; children=[||]; decisions=[||]}
<thelema> I don't think it's going to get any prettier than that.
<thelema> sadly I'll have to defunctorize my code sometime
<thelema> but hopefully I can get as far as possible with it still functorized
<mrvn> functorized should potentially be faster
<thelema> huh?
<thelema> I thought there was no inlining and an extra level of indirection for functorized code
<kaustuv_> Holy shit:
<kaustuv_> # Obj.tag (Obj.repr ()), Obj.tag (Obj.repr [| |]) ;;
<kaustuv_> - : int * int = (1000, 0)
<mrvn> you can optimize more than when you pass around closures
<kaustuv_> [| |] is a tuple with no fields. Not sure if you can construct something like that any other way
<thelema> I don't plan on passing around any closures either - I've learned those are pretty slow too)
<kaustuv_> I guess Array.of_list [] works too...
<thelema> kaustuv_: that's more like what I was expecting someone to help me with.
<thelema> kaustuv_: I was trying to think about Array.of_enum (...)
<mrvn> Doesn't Obj.tag only make sense on blocks?
<mrvn> thelema: how do you know the size of an enumeration?
<kaustuv_> yes, () is not a block, but [| |] is. However, (a, b) and [| a; b |] have the same representation (assuming neither is a float)
<thelema> mrvn: Enum.count
<mrvn> kaustuv_: How does Array.of_list work? You need to know if the list if floats.
<mrvn> s/if/is/
<kaustuv_> It special cases on the first element of the list (if one exists)
<kaustuv_> if the first element is a float, then it's a float array, otherwise it's an ordinary block
<mrvn> So Array.of_list ([] : float list) returns the wrong tag
<kaustuv_> Well, "wrong"
<mrvn> I guess for a block size 0 it doesn't matter
<kaustuv_> there is no runtime effect as you can't cause a memory error by getting or setting in to an empty array
kerneis has quit [Ping timeout: 260 seconds]
ikaros has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
<thelema> thanks all
<kaustuv_> here's an idle wednesday challenge: what is the smallest OCaml program that can cause the runtime to seg fault? You may use Obj to your heart's content.
<kaustuv_> doing stuff like sending kill -SEGV to Unix.getpid() is allowed too
<thelema> (Obj.magic 3).(2);;
* thelema is good at segfaults
<thelema> although maybe this only segfaults the toplevel
<kaustuv_> yeah, that seems like it. There's no way to get [||].(1) to segfault even with ocamlopt -unsafe
<kaustuv_> ps, you can shave two chars by dropping the ;;
<thelema> for ocamlopt, sure.
<kaustuv_> haha, beat you by a lot:
<kaustuv_> "a".(1 lsl 60)
<kaustuv_> err, "a".[1 lsl 60]
<kaustuv_> compile with -unsafe, of course
coucou747 has joined #ocaml
agarwal1975 has quit [Read error: Connection reset by peer]
agarwal1975 has joined #ocaml
<thelema> kaustuv_: I have to optimize that:
<thelema> "".[1 lsl 60]
papers has left #ocaml []
<thelema> and one more character: echo \"\".[9999999] > x.ml
cthuluh has quit [Quit: "Our life is frittered away by detail... Simplify, simplify" -- Thoreau]
Tobu has quit [Ping timeout: 260 seconds]
<thelema> and a few more characters: "".[99999]
<kaustuv_> I guess all that remains is to suggest adding this to the shootout
papers has joined #ocaml
<adrien> "".[-9999]
<thelema> adrien: a tie with my 99999
<adrien> yeah, I was pretty sad to see you posted an updated one ;p
<kaustuv_> we could even go one char fewer if only 1E10 were an integer literal
<kaustuv_> 1E9 even
mnabil has quit [Ping timeout: 252 seconds]
<thelema> odd, .[51215] doesn't segfault, while .[51216] does
<thelema> 16 + 100 * 512?
<kaustuv_> depends on how big the generated code section is
<kaustuv_> as "" is statically "allocated"
<thelema> sure
<thelema> but that seems a surprising size
<kaustuv_> maybe the initialized data section is 100 words from the end of a page? + 2 words for header + string size
<adrien> haha!
<adrien> "".[-999]
cthuluh has joined #ocaml
<thelema> adrien: on my system, the negative boundary is between -6128 and -6129
<thelema> i.e. -6128 runs fine, while 6129 segfaults
<thelema> kaustuv_: 100 words != 100*512
<kaustuv_> err, 100 * 64 I must have meant
<adrien> ah, not working anymore ='(
<adrien> anyway =)
<thelema> 3 is prime, 5 is prime, 7 is prime, 9 is test error, 11 is prime, ...
<adrien> ;-)
<kaustuv_> 9 is prime squared!
<adrien> now, the inverse for the Hilbert curve...
<adrien> btw, anyone aware of an ocaml project centered around fractals? (besides Daniel de Rauglaudre's, which name I've forgotten)
<kaustuv_> mlbrot?
<thelema> adrien: harrop likes using mandelbrot for his benchmarks
<kaustuv_> oh, that's by DdR. Never mind.
<adrien> kaustuv_: yup, that one
<adrien> ;-)
<adrien> need to move a small robot around an area and I was thinking about using a space-filling curve for the trajectory, and I might try some others than the Hilbert curve
<adrien> kaustuv_: right; I'll maybe see if we can share code (the hilbert curve sure doesn't look incredibly sexy, but it can be useful)
<thelema> adrien: sounds like you need a mobility model.
<kaustuv_> a real robot or a simulated one?
<kaustuv_> what do those circular robotic vacuum cleaners use?
<thelema> kaustuv_: roomba
Oejet has quit [Ping timeout: 240 seconds]
<adrien> a real robot
<thelema> http://gizmodo.com/#!5246099/long+exposure-shot-of-a-roombas-path-shows-beautifully-organized-chaos
<adrien> with obstacles
<adrien> currently in the phase "I want to invent my own model" ;-) but I'll keep these in mind: mine might not work terribly well in the end ;-)
papers has quit [Ping timeout: 240 seconds]
<thelema> no more roomba links from me
<adrien> but the robot will be limited: only C or assembler in it, unless I can use -output-obj but I doubt it
<adrien> (8051 from intel, 8bit, ...)
<thelema> yeah, ocaml would be tough
papers has joined #ocaml
<orbitz> woudl it be evil to make a tarnsformer where you could do like var foo : ....; let foo ... = and it would apply the types to foo so you could separate out defintion and type?
<kaustuv_> does it have a sensor to sense fear in hu-mans?
Oejet has joined #ocaml
<kaustuv_> orbitz: I'm on board if you do s/var/val/
<orbitz> oh val is wha ti meant
<kaustuv_> you can already mostly do it now though: let foo : type_of_foo = ...
<orbitz> hrm, how bad would that be to do in caml4p
<thelema> orbitz: You might also allow forward declarations through judicial use of rec and and
<adrien> the roomba algorithm looks nice but I don't think I'll be able to use that: following the hilbert curve was easy
<thelema> but that would be much harder
<kaustuv_> automatically find the sccs and add recs? that sounds useful, and also dangerous
Cyanure has quit [Quit: Quitte]
<thelema> adrien: it's important that you recalculate your algorithm 67 times per second like the roomba. Why? I don't know, but it sounds cool.
<adrien> the idea was to follow it until there's an obstacle, avoid it and try to go back to the curve as quickly as possible
<orbitz> hahaha
<orbitz> woops wrong window
Cyanure has joined #ocaml
<thelema> adrien: hmm, how to get back to the curve...
<thelema> and wouldn't some obstacles eliminate parts of the curve?
<orbitz> thelema: i'm thinking a minimal level of beign able to specify a type might be a good start. camlp4 sounds easiet fo this right (i don't know any camlp4)
<adrien> thelema: heheh, it sure sounds cool but it'll be annoying to code
<thelema> orbitz: then "val foo : ..." -> "type type_of_foo = ...
<adrien> plus the wheels might not be perfect
<kaustuv_> orbitz: you can specify types already with .mlis, though
<orbitz> is a .ml typechecked agaisnt its .mli?
<kaustuv_> of course!
<orbitz> of coures of course
<orbitz> maybe it's just a temporal problem, early in aproject i seem to just have the .ml beacuse i want to be really nimble in changign types
<kaustuv_> ocamlc -i foo.ml > foo.mli
<adrien> thelema: well, the obstacles might eliminate one point, so it'll be "try to move around the obstacle, and go to the next \"hilbert point\", and if you make a full turn around it (or have a timeout, or distance-out), go to the next point
<kaustuv_> that's usually how I start writing my .mlis anyhow
<orbitz> kaustuv_: what about things i'm not exporting in the .mli?
<kaustuv_> then edit it by hand
<thelema> kaustuv_: bah, I only write mlis for things I share with the world.
<thelema> I rarely need to hide things from myself
<orbitz> part of me thinks it would be nice to have type's closer to defintions, especially if i'm not sharing teh function iwth the world
<kaustuv_> keeping the types separate does reinforce the concept that types are not code, though.
<kaustuv_> but I do enjoy having the ability to keep them close in Haskell and wouldn't mind it in OCaml too
<ccasin> of course, you can annotate an ocaml definition by annotating each argument and putting a return type
<ccasin> it's just ugly :(
<orbitz> yeah
<ccasin> also it's not the "right" kind of annotation
<orbitz> the idea i'm suggesting would be val foo : int -> int;; let foo x = x + 1
<kaustuv_> not that ugly. let foo : a -> b -> c = fun a b c -> ...
<kaustuv_> err, fun a b -> ...
<ccasin> in that ocaml only checks that your type unifies with the inferred type, not that it is an instance of the inferred type
<orbitz> the transformation from that to kaustuv_'s seems pretty easy
<kaustuv_> you definitely don't want the latter. You want your code to be *more general* than its specified type
<ccasin> kaustuv_: right, so the typechecker should make sure any annotation given is an instance of the most general type
<kaustuv_> it does that if you explicitly quantify your type variables in 3.12
<ccasin> but in ocaml, you can write: fun (x : 'a) -> x + 1
<ccasin> which is silly
<kaustuv_> let f : 'a. 'a -> 'a = fun x -> x + 1 won't typechecl
<ccasin> (and makes it very hard to find type errors in polymorphic functions)
<ccasin> kaustuv_: neat, I didn't know that
<ccasin> well, but will
<orbitz> what is the difference?
<ccasin> let f : 'a.'a -> int?
<ccasin> becuase that is the problem I am complaining about
<thelema> ccasin: yes, that too
<kaustuv_> # let f : 'a. 'a -> int = fun x -> x + 1 ;;
<kaustuv_> Error: This definition has type int -> int which is less general than 'a. 'a -> int
<kaustuv_>
<ccasin> thelema: that annotation checks, or is rejected?
<ccasin> awesome
<ccasin> amen
<orbitz> ah so 'a. is sayign for all 'a but the type checker realizes that is impossible?
<ccasin> right
<ccasin> sadly, that is not the default behavior for polymorphic type annotations in ocaml
<ccasin> only the ones that are explicitly quantified, apparently
<orbitz> wheres let f (x : 'a) = x + 1 -- 'a is whatever you decide it should be, dear compiler/
<ccasin> still, a step in the right direction
<kaustuv_> yes, I don't like the default either. It's the thing that I really had to get used to, coming from SML
agarwal1975 has quit [Read error: Connection reset by peer]
agarwal1975 has joined #ocaml
ftrvxmtrx has joined #ocaml
waern has quit [Ping timeout: 250 seconds]
waern has joined #ocaml
kerneis has joined #ocaml
mfp has quit [Ping timeout: 276 seconds]
_andre has quit [Quit: leaving]
arkadir has quit [Remote host closed the connection]
mfp has joined #ocaml
Associat0r has joined #ocaml
vk0 has quit [Ping timeout: 240 seconds]
vk0 has joined #ocaml
Associat0r has quit [Quit: Associat0r]
agarwal1975 has quit [Quit: agarwal1975]
<_habnabit> In ocamlyacc, is there a way to have a rule that's executed on any syntax error?
<_habnabit> I tried to have an `| error EOF` rule on my terminal, but that doesn't seem to do a thing.
<thelema> _habnabit: there's an error token
<_habnabit> Yes, that's what I'm using.
<thelema> | error EOF usually won't match
<thelema> unless your error is that there's no more data
<thelema> try just |error
<_habnabit> Yes, that's the error I'm trying to match.
<thelema> | error { printf "ERROR(line %d): couldn't parse term\n%!" ($startpos.pos_lnum); exit 1 }
<thelema> an example of how I deal with errors
<_habnabit> Yeah, with just | error on my terminal, I'm not getting anything on incomplete data.
<thelema> pastebin?
<_habnabit> Hang on a sec.
<_habnabit> Oh, that's what I thought it might be. Another one of my error rules was screwing it up.
ygrek has quit [Ping timeout: 252 seconds]
<_habnabit> On a non-terminal node, I had | LBRACK error RBRACK
<_habnabit> Removing that made my | error EOF rule match.
<thelema> okay then'
<thelema> threat of code exposure fixes another bug
<adrien> anyone used ocamlbuild (3.12) with findlib and lablgtk2, with threads?
ymasory has quit [Ping timeout: 264 seconds]
enthymeme has joined #ocaml
<hcarty> adrien: Maybe? :-)
<adrien> can't find what to put in my _tags when using ocamlbuild -use-ocamlfind
<hcarty> adrien: I've used OCaml 3.12 + ocamlbuild + findlib + lablgtk2 with threads compiled in (Batteries rather than Batteries_uni), but no real thread use taking place.
<hcarty> Ah, this was using a findlib'd myocamlbuild.ml
<hcarty> I haven't switched over to -use-ocamlfind because there are still some threads-related bugs
<adrien> well
<hcarty> Those bugs (or at least some of them) are fixed in 3.12-dev thanks to xclerc
<adrien> think I'll use the pre-3.12 support
seafood has joined #ocaml
<adrien> works ok =)
tauntaun has joined #ocaml
<thelema> very odd - I'm getting an error where Batteries_config is missing: http://pastebin.com/Lcn5Cj8y
<thelema> I just recompiled batteries and my project from scratch
<thelema> and still it errors
eye-scuzzy has quit [Read error: Operation timed out]
<adrien> it's not on the command-line...
eye-scuzzy has joined #ocaml
<thelema> adrien: it's in batteries_uni.cmxa
<thelema> at least it's definitely in batteries_uni.mllib, I assume it's in the cmxa
<_habnabit> thelema, nah, I run a help channel on freenode as well. I just have a lot of code to try to pare down.
<adrien> hah, I had misread
<thelema> well, I can get rid of the use of Batteries_config...
avsm has joined #ocaml
seafood has quit [Quit: seafood]
er98052 has quit [Quit: er98052]
Amorphous has quit [Ping timeout: 240 seconds]
Cyanure has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
Amorphous has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
papers has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
lamawithonel__ has quit [Remote host closed the connection]
<adrien> this was mentionned on reddit not so long ago and nice list of data structures, probably worth mentionning it again: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-851-advanced-data-structures-spring-2010/lecture-notes/
<hcarty> adrien: Thanks for sharing
myu2_ has joined #ocaml
myu2 has quit [Ping timeout: 240 seconds]
shachaf has quit [Ping timeout: 272 seconds]
shachaf has joined #ocaml
wchicken2 has joined #ocaml
<wchicken2> hey guys, not sure if this is the place to ask beginner ocaml questions -- if not, could you point me in the right direction?