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
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
lopex has quit []
dnolen has quit [Quit: dnolen]
ymasory_ has joined #ocaml
philtor has quit [Ping timeout: 276 seconds]
lamawithonel has quit [Read error: Connection reset by peer]
wagle has quit [Ping timeout: 260 seconds]
wagle has joined #ocaml
fraggle_laptop has joined #ocaml
ymasory has quit [Quit: Leaving]
fraggle_laptop has quit [Quit: Quitte]
Modius has quit [Quit: "Object-oriented design" is an oxymoron]
ankit9|zzz has quit [Ping timeout: 240 seconds]
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]
bzzbzz has quit [Quit: leaving]
philtor has joined #ocaml
ymasory_ has quit [Quit: Leaving]
ymasory has joined #ocaml
emmanuelux has quit [Quit: Ex-Chat]
vivanov has joined #ocaml
ygrek has joined #ocaml
mjonsson has quit [Ping timeout: 276 seconds]
mcclurmc_home has joined #ocaml
hto_ has joined #ocaml
jderque has joined #ocaml
hto has quit [Ping timeout: 240 seconds]
spicey has joined #ocaml
<spicey> How exactly to get a new slice of a flat c/int8 bigarray? I have a blob loaded from file and would like to extract a block (len, offs) to a new byte array to pass to external function, but am confused at how to do that
<spicey> (i.e. apart from creating a new array and manually copying via loop, byte after byte)
<adrien> spicey: Bigarray.Array1.sub?
<spicey> yes, thank you! (aargh, looked at Bigarray.Genarray, but didn't look into obvious Bigarray.Array1)
<adrien> =)
Snark has joined #ocaml
jderque has quit [Quit: leaving]
Cyanure has joined #ocaml
mcclurmc_home has quit [Ping timeout: 246 seconds]
philtor has quit [Read error: Operation timed out]
jamii has joined #ocaml
hto_ has quit [Ping timeout: 258 seconds]
ikaros has joined #ocaml
mattam has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Quit: Associat0r]
vivanov has quit [Ping timeout: 276 seconds]
vivanov has joined #ocaml
hto has joined #ocaml
jderque has joined #ocaml
hto has quit [Ping timeout: 240 seconds]
edwin has joined #ocaml
Rolands has joined #ocaml
Rolands has quit [Ping timeout: 240 seconds]
jamii has quit [Ping timeout: 248 seconds]
edwin has quit [Quit: Leaving.]
edwin has joined #ocaml
wieczyk has quit [Quit: leaving]
vivanov has quit [Ping timeout: 240 seconds]
vivanov has joined #ocaml
impy has quit [Quit: impy]
emmanuelux has joined #ocaml
boscop_ is now known as boscop
orbitz has quit [Ping timeout: 240 seconds]
lopex has joined #ocaml
orbitz has joined #ocaml
ymasory has quit [Quit: Leaving]
lopex has quit [Ping timeout: 240 seconds]
oriba has joined #ocaml
impy has joined #ocaml
lopex has joined #ocaml
pdhborges has joined #ocaml
jderque has quit [Quit: leaving]
emmanuelux has quit [Ping timeout: 248 seconds]
pdhborges has quit [Quit: Leaving.]
vivanov has quit [Quit: Lost terminal]
impy has quit [Quit: impy]
hto has joined #ocaml
jderque has joined #ocaml
impy has joined #ocaml
smerz has joined #ocaml
mjonsson has joined #ocaml
vivanov has joined #ocaml
Associat0r has joined #ocaml
philtor has joined #ocaml
drunK has joined #ocaml
hto has quit [Ping timeout: 246 seconds]
_habnabit has joined #ocaml
ymasory has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
impy has quit [Quit: impy]
philtor has quit [Ping timeout: 240 seconds]
pdhborges has joined #ocaml
pdhborges has quit [Client Quit]
__marius__ has joined #ocaml
lpereira has quit [Ping timeout: 260 seconds]
mfp has quit [Ping timeout: 248 seconds]
mfp has joined #ocaml
Associat0r has quit [Quit: Associat0r]
__marius__ has quit [Remote host closed the connection]
jderque has quit [Quit: leaving]
jderque has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<adrien> does anyone know if the Str module uses low-level functions that wouldn't be available early in the boot process (_right_ after init)
Associat0r has joined #ocaml
<flux> by boot process you mean operating system boot?
<adrien> yes, sorry for not mentionning it
<flux> I don't see what it could possibly use that aren't available there
<flux> init typically links against libc.
<flux> there could be some room if you mean 'the first init' in a booting linux system, in an initrd configuration
<flux> but even then..
<adrien> I'm making slackware boot zomgfast and I'm using bootchart to get a profiling but it uses bash scripting and it's too slow for the resolution I need
<adrien> the way to use bootchartd is: init=/sbin/bootchartd (replace init)
<adrien> anyway, rebooting now, with strace
<flux> I wonder how far you'll get :)
<adrien> currently, I'm trying to find where I can write strace's output
<thelema> even if Str made wierd kernel calls, they're all available when init is running
Cyanure has quit [Ping timeout: 240 seconds]
<adrien> I wasn't really thinking that was the issue but Str is a bit weird and it's hard to get infos that early in the boot
<adrien> think I can have strace's output now
eye-scuzzy has joined #ocaml
<thelema> adrien: str is pure ocaml except for a backtracking NFA interpreter written in C
Cyanure has joined #ocaml
<adrien> looks like it's a call to rt_sigaction
impy has joined #ocaml
Snark has quit [Quit: Ex-Chat]
nantralien has joined #ocaml
vivanov has quit [Ping timeout: 276 seconds]
nantralien is now known as Anarchos
goodside has quit [Quit: Lost terminal]
impy has quit [Quit: impy]
<NaCl> is there a way to "open" a module in a function?
<flux> in 3.12 you can do let open M in ..
<NaCl> ooooohh
<NaCl> kewl
* NaCl is not used to type inference
* NaCl thought that it could infer from previous uses of a variable
<thelema> it can
<NaCl> in this case, it seems not to be doing so
ygrek has quit [Ping timeout: 246 seconds]
<NaCl> It probably doesn't help that I am using the same fields within a record
ztfw has joined #ocaml
<NaCl> I reference fields up and right in the previous two lines, which are unique to that type, but the moment I use "direction", ocaml thinks the type has somehow magically changed
<flux> are you using the toplevel, btw?
<NaCl> not here
<NaCl> compiling with ocamlbuild
<NaCl> (to native)
<flux> can you give a small example demonstrating the issue?
<NaCl> sure, one moment
ymasory has quit [Quit: Leaving]
<Anarchos> NaCl you can also do local modules : let L = module X in L.f();;
<NaCl> Anarchos: I am close to doing that, but Module.(+) doesn't look pretty
<NaCl> adrien: are record accesses like whatever.x interpreted like a function "get_x whatever"?
<NaCl> because that would explain the problem
<flux> nacl, yes, sharing field names doesn't really work
<flux> it's not different, from ocaml's point of view, than sharing value names or type names
<NaCl> ah.
<flux> works in a similar fashion: new definitions shadow older ones
<NaCl> do objects have this limitation?
<flux> no
<flux> what I do is that I prefix field names with some memento
<flux> it can nice when reading code as well: you always know what type the code is referring to
<NaCl> gotcha
<flux> alternatively you can pack the types into their own modules
<NaCl> hm
<flux> module Foo = struct type t = { x : int; b : int } end
* NaCl is still a relative newbie :P
<flux> and then let a = { Foo.x = 42; y = 15 }
<flux> or let extract_x foo = foo.Foo.x
__marius__ has joined #ocaml
<flux> so it gets a bit more verbose. the local open in 3.12 should remedy that a bit.
<flux> nacl, don't worry about it, this is something I think most newcomers will bump into sooner or later :)
<NaCl> So, for infix operators, it would just be "a Module.(+) b"?
<adrien> Module.(+) a b
<adrien> when you write (+), you get a "regular" function: (+) a b
<flux> hey, I learned something new here as well :)
<flux> but typically infix operators have non-infix aliases as well
<NaCl> blah
* NaCl was trying to make this pretty
<NaCl> oh, well
<flux> nacl, btw, the another syntax for local open might help
<flux> nacl, you can do this: SomeModule.(a + b)
<flux> ..in 3.12
<NaCl> flux: that's a lot better. Yeah, I've got 3.12
* NaCl has 16 ocaml packages in openSUSE
<flux> ah, I just installed debian on my new shiny SSD
<flux> ..and now I have easy access to 3.12 as well \o/
<flux> (I used to run ubuntu 9.10)
__marius__ has quit [Remote host closed the connection]
<flux> there isn't an ocaml meta package around to install all useful stuff for me, is there?
__marius__ has joined #ocaml
<NaCl> I wouldn't know. I've avoided debian since I realized how much they mess with packages.
<flux> so, other distributions mess less? or you just don't know that about them?-)
<NaCl> Well...
<NaCl> I came from Slackware, which messes with nothing
<NaCl> I wouldn't like to run SUSE on a server too much
oriba_ has joined #ocaml
<NaCl> I haven't tried server apps too much, but on debian, the default module layout made me headdesk for about 2 hours
<NaCl> and I have no idea what they did to pure_ftpd
Cyanure has quit [Remote host closed the connection]
oriba has quit [Ping timeout: 246 seconds]
<adrien> to be fair, in the case of ocaml, I don't think there can be many complains about ocaml on debian =)
<NaCl> flux: ask gildor. :P
<NaCl> adrien: probably true
<NaCl> adrien: the problem with caml in suse is that, well, I don't want to maintain 15 extension modules
<adrien> yeah, it's too much for only one, except some of the people in the slackware team maybe :P
<NaCl> There's more group ownership there
impy has joined #ocaml
<adrien> ah, reminds me I had to find an ocsigen developper and force her to stop it from messing with my /dev/null during build (or maybe it's only with the godi package)
<NaCl> adrien: nice thing about suse is that I can recycle RPM spec files
* NaCl thanks rwmjones
<adrien> yeah, and the packages are pretty good too
<NaCl> yeah. they only require minimal modification
<NaCl> adrien: I doubt they will be accepted into the distribution, though. I use the internal RPM dep generator.
<NaCl> SuSE doesn't
<adrien> (no idea what that means ;p )
<NaCl> adrien: suse uses shell scripts to resolve dependencies. by default, rpm (and thus fedora) use a builtin generator
<adrien> hmmm, ok
<adrien> bootchart(.org) is really limited: the "sensor" uses so much shell scripting that it doesn't "scale"
<NaCl> quick! reimplement the whole thing in ocaml!
* NaCl is having to do a lot of typecasting
<NaCl> uh
<adrien> NaCl: of course I'm rewriting it in ocaml =)
lamawithonel has joined #ocaml
<Anarchos> adrien hello
<adrien> hi Anarchos
<Anarchos> adrien i found a solution
<Anarchos> adrien use a ref declared in lexer.mll
<Anarchos> and open it as a local module which i can modify at will
<NaCl> adrien: you know what ould be nice? If there were imagemagick bindings for ocaml
<adrien> there are gd graphics and hllll
<NaCl> hllll?
<adrien> typo: 'l' and 'm' are adjacent on azerty keyboard
<adrien> s
<NaCl> ah
<adrien> and http://www.linux-nantes.org/~fmonnier/OCaml/ImageMagick/ but it might not cover the whole API
<NaCl> hm
<NaCl> How could I keep the graphics window open?
<Anarchos> NaCl don't close it lol
<NaCl> heh
<NaCl> I mean, I have a program that creates the window, but it just closes immediately
<NaCl> when the program exits
<Anarchos> NaCl don't exit the program : do an infinite loop at the end
<NaCl> hm
<Anarchos> adrien i hope to find a better solution to put inner global variables into the lexer module ...
<NaCl> Anarchos: yeah, that would do it, thanks
<adrien> Anarchos: I can't remember: menhir didn't work?
<Anarchos> adrien i want to stick to standard ocaml
<Anarchos> so no menhir even if it seems to be my solution
<adrien> ok
<NaCl> Anarchos: problem I'm having is that the image isn't getting mapped to the output buffer before the loop
<NaCl> that be the new problem
<adrien> NaCl: double buffering?
<adrien> it's not on by default iirc however
<Anarchos> NaCl flush or sync ?
<NaCl> uh...
* NaCl looks at how to do that
<NaCl> woo documentation
<NaCl> yay thanks
<NaCl> adrien: I'll have something to demo in a few minutes
<adrien> =)
impy has quit [Quit: impy]
<Anarchos> NaCl it is an axiom : graphics or output something ALWAYS use a synchronization mechanism
impy has joined #ocaml
<NaCl> Anarchos: indeed, thanks much
oriba_ is now known as oriba
<Anarchos> NaCl what are you drawing ?
<NaCl> Anarchos: making a simple ray tracer
<Anarchos> NaCl sounds nice :)
<Anarchos> NaCl 3 D with quaternions ?
<NaCl> iirc, quaterions were used for animation.
* NaCl is going for still objects
<NaCl> but my knowledge of graphics is semi-minimal
<Anarchos> NaCl i suggest you to use vectors in 4 dimension
<Anarchos> NaCl you can do translation and rotation this way, look for projective geometry on internet
<NaCl> Anarchos: yeah I know all about those
<Anarchos> ok, nice
<NaCl> Those aren't exactly quaternions, but yeah, I am going to need to use 4D vectors when I get to transformations
<NaCl> I'm just trying to get ray-object intersection working
<Anarchos> NaCl jon harrop already did a ray tracer in ocaml
<NaCl> The purpose of this is to learn the language
<Anarchos> NaCl no pbm
jderque has quit [Ping timeout: 276 seconds]
<NaCl> yay printf debugging
<Anarchos> NaCl my favorite :)
<NaCl> indeed
<NaCl> is there an ocaml debugger?
<flux> there is. a time traveling one!
<NaCl> silly question
<flux> unfortunately otherwise gdb beats it in usability
<flux> IMHO at least :)
<NaCl> gdb is like the standard or something
<flux> there was a patch floating around that allowed to use GDB on native ocaml binaries
<flux> alas, I don't think that has been yet integrated
<flux> (the patch simply added the debug information that GDB requires)
<flux> ((for some value of "simply"))
<NaCl> "indeed"
<NaCl> adrien: found out what my most recent bug is
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
<thelema> flux, NaCl: I use gdb on ocaml binaries all the time
<adrien> NaCl: what was it?
<flux> thelema, oh, cool
<NaCl> adrien: some value isn't being correctly calculated in a constructor.
<thelema> flux: it's not perfect, but it gets me a stack trace on segfaults and lets me poke at some things
<NaCl> uh...
<flux> thelema, ah, right. but the patch AFAIK enabled single-stepping etc.
<flux> my ocamlopted test binary doesn't seem to let gdb see any symbols?
<flux> ocamlopt .. -g should do it, right?
<NaCl> adrien: rather, the value isn't even being dumped into the constructor
<NaCl> ...wtf
* adrien thinks he's going to use gdb in a minute
<thelema> flux: yes, it should
<adrien> NaCl: code?
<flux> thelema, strange. so echo 'let main () = print_string "hello world" let _ = main () ' > foo.ml; ocamlopt -o foo -g foo.ml; gdb ./foo gives you symbols?
__mariu__ has joined #ocaml
__marius__ has quit [Ping timeout: 276 seconds]
<NaCl> adrien: no, it's me being a moron
<NaCl> I think
<adrien> =)
__mariu__ has quit [Ping timeout: 260 seconds]
<thelema> flux: only enough symbols to do things like set breakpoints on functions and step with very bad accuracy
<Anarchos> thelema i never use a debugger cause inever put bugs in my programs :p
<NaCl> adrien: so, should my constructors be functions?
<NaCl> adrien: like, should they end with ;; ?
<adrien> NaCl: for records?
<NaCl> yes
<adrien> why not simply write "{ field1 = var1; field2 = var 2 }" when you need to build a value?
<adrien> or, instead of "{ a = a; b = b }", simply "{ a; b }"
<Anarchos> adrien have you read the standard doc about records ?
<adrien> Anarchos: what do you mean?
__marius__ has joined #ocaml
<Anarchos> adrien caml.inria.org, ocaml manual
<adrien> Anarchos: but do you have something in particular in mind?
<Anarchos> adrien the section about records syntax :)
<NaCl> adrien: uh, my math is right, but the output buffer is all white
<adrien> Anarchos: you mean one the syntax I gave is wrong?
<Anarchos> adrien i don't know, we should try
dnolen has joined #ocaml
<NaCl> adrien: buffering images
<NaCl> is my problem
<NaCl> bleh
dnolen has quit [Client Quit]
<adrien> Anarchos: if you're wondering about { a; b }, it's new in 3.12 unless I'm mistaken
<Anarchos> adrien oh ok
<adrien> (I avoid it in yypkg because of that iirc)
edwin has quit [Remote host closed the connection]
<NaCl> adrien: ditching the graphics module and dumping ppms instead
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<NaCl> # #load "Scene.cmo" ;;
<NaCl> The files _build/Scene.cmo and _build/Scene.cmo disagree over interface Scene
<NaCl> that's useful
<adrien> yeah, I like it too
<adrien> it's getting too late for me to think
* NaCl found the problem
<NaCl> rather, where it is
* NaCl just got burned by the order of operations
<NaCl> at least it consistently doesn't work
<NaCl> now
smerz has quit [Quit: Ex-Chat]
<adrien> good night and good luck
<NaCl> thanks
__marius__ has quit [Remote host closed the connection]
ztfw has quit [Remote host closed the connection]
ymasory has joined #ocaml
hto has joined #ocaml
Amorphous has quit [Ping timeout: 246 seconds]
dnolen has joined #ocaml
chegibari has joined #ocaml
lopex has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
lopex has joined #ocaml
Amorphous has joined #ocaml
drunK has quit [Remote host closed the connection]
oriba has quit [Quit: oriba]
chegibari has quit [Read error: Connection timed out]
chegibari has joined #ocaml
ulfdoz_ has joined #ocaml