adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
milosn has joined #ocaml
milosn_ has quit [Ping timeout: 245 seconds]
darkf has joined #ocaml
ontologiae has joined #ocaml
ahokaomaeha has quit [Ping timeout: 245 seconds]
ahokaomaeha has joined #ocaml
ahokaomaeha has quit [Ping timeout: 260 seconds]
ontologiae has quit [Ping timeout: 255 seconds]
emmanuelux has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
cdidd has quit [Remote host closed the connection]
yacks has joined #ocaml
pango has quit [Ping timeout: 246 seconds]
pango has joined #ocaml
ahokaomaeha has joined #ocaml
ahokaomaeha has quit [Ping timeout: 248 seconds]
q66 has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
ahokaomaeha has joined #ocaml
gnuvince has quit [Remote host closed the connection]
gnuvince has joined #ocaml
myx has joined #ocaml
ivan\ has quit [Ping timeout: 255 seconds]
ivan\ has joined #ocaml
cyball1 has quit [Remote host closed the connection]
yacks has quit [Quit: Leaving]
Yoric has joined #ocaml
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
ahokaomaeha has joined #ocaml
yacks has joined #ocaml
gnuvince has quit [Ping timeout: 248 seconds]
Yoric has quit [Ping timeout: 252 seconds]
mcclurmc has quit [Ping timeout: 248 seconds]
Kakadu has joined #ocaml
darkf has quit [Ping timeout: 244 seconds]
dEPy has joined #ocaml
mye has quit [Quit: mye]
darkf has joined #ocaml
Simgate has joined #ocaml
ttamttam has joined #ocaml
Snark has joined #ocaml
chambart has joined #ocaml
mrpantoufle has quit [Ping timeout: 256 seconds]
mrpantoufle has joined #ocaml
ollehar has joined #ocaml
<adrien> anyone has a 32bit ocaml? could I see the .s file for ocaml's int64.ml?
ottbot has joined #ocaml
<adrien> actually, less than that
<adrien> I'd like to see the assembly corresponding to this code:
mrpantoufle has quit [Ping timeout: 240 seconds]
<adrien> let min_int = 0x8000000000000000L
<adrien> vpm: merci !
<adrien> the big difference is that my assembly has:
<adrien> .long-9223372036854775808
<adrien> while yours has:
<adrien> .long 0
<adrien> so, now, to find which place of the compiler emits that
<adrien> and is arch-dependant
<adrien> finally found the culprit but I don't have the solution yet:
<adrien> # Nativeint.to_string Nativeint.max_int;;
<adrien> - : string = "9223372036854775807"
<adrien> this won't work on a 32bit assembler
<adrien> and now I'm wondering if people doing cross-compilers were running 32bit archs and targetting 32bit archs too...
Yoric has joined #ocaml
mrpantoufle has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
ulfdoz has joined #ocaml
osa1 has joined #ocaml
mrpantoufle has quit [Ping timeout: 264 seconds]
mrpantoufle has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
mrpantoufle has quit [Ping timeout: 264 seconds]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
mrpantoufle has joined #ocaml
mrpantoufle has quit [Ping timeout: 252 seconds]
cdidd has joined #ocaml
mrpantoufle has joined #ocaml
ahokaomaeha has joined #ocaml
answer_42 has joined #ocaml
ollehar has quit [Ping timeout: 248 seconds]
ollehar has joined #ocaml
mrpantoufle has quit [Ping timeout: 252 seconds]
mrpantoufle has joined #ocaml
leoncamel has joined #ocaml
|jbrown| has joined #ocaml
jbrown has quit [Ping timeout: 264 seconds]
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 248 seconds]
ollehar has quit [Ping timeout: 240 seconds]
Anarchos has joined #ocaml
q66 has joined #ocaml
ocp has joined #ocaml
Yoric has joined #ocaml
ocp has quit [Ping timeout: 252 seconds]
leoncamel has quit [Ping timeout: 256 seconds]
Yoric has quit [Ping timeout: 252 seconds]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
ahokaomaeha has joined #ocaml
ontologiae has joined #ocaml
mcclurmc has joined #ocaml
Yoric has joined #ocaml
ahokaomaeha has quit [Ping timeout: 255 seconds]
leoncamel has joined #ocaml
Kakadu has quit []
ontologiae has quit [Ping timeout: 260 seconds]
chambart has quit [Ping timeout: 256 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ottbot has quit [Ping timeout: 256 seconds]
leoncamel has quit [Ping timeout: 252 seconds]
Tobu has quit [Ping timeout: 245 seconds]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
Tobu has joined #ocaml
Simgate has quit [Quit: Quit]
ahokaomaeha has joined #ocaml
ahokaomaeha is now known as Guest31528
darkf has quit [Quit: Leaving]
<adrien> it woooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooorks! \o/
ulfdoz has quit [Read error: Operation timed out]
gnuvince has joined #ocaml
UncleVasya has joined #ocaml
<zorun> :)
<zorun> adrien: still working on your cross-compiler
<zorun> ?
Guest31528 has quit [Ping timeout: 256 seconds]
<adrien> no, I'm done :D
ollehar has joined #ocaml
<invariant> adrien, from where to where?
<invariant> adrien, from heaven to hell, IIRC.
gnuvince has quit [Ping timeout: 248 seconds]
<invariant> adrien, but which heaven and which hells, I don't recall.
gnuvince has joined #ocaml
bholst_ is now known as bholst
<adrien> I'm definitely not on the road to hell right now :-)
<adrien> I think I started working on cross-compiler support almost 2 months ago
<adrien> although cloning an 15-yo SVN repo with git-svn definitely feels like hell
ulfdoz has joined #ocaml
gnuvince has quit [Remote host closed the connection]
osa1_ has joined #ocaml
osa1 has quit [Read error: Connection reset by peer]
Simgate has joined #ocaml
emmanuelux has joined #ocaml
ottbot has joined #ocaml
Simgate has quit [Quit: Quit]
pango has quit [Remote host closed the connection]
sysopfb has joined #ocaml
tane has joined #ocaml
pango has joined #ocaml
sysop_fb has quit [Ping timeout: 252 seconds]
trep has joined #ocaml
sysopfb has quit [Ping timeout: 255 seconds]
sysop_fb has joined #ocaml
trep has quit [Ping timeout: 256 seconds]
sysopfb has joined #ocaml
sysop_fb has quit [Ping timeout: 252 seconds]
Simgate has joined #ocaml
answer_42 has quit [Write error: Connection reset by peer]
osa1_ has quit [Ping timeout: 252 seconds]
osa1__ has joined #ocaml
<orbitz> avsm: you around?
notk0 has joined #ocaml
<notk0> hello
<notk0> is it true that you can use ocaml to program GUIs?
<orbitz> sure
<orbitz> I'm not aware of a language you can't use for that
<notk0> orbitz: would it be possible to write a GUI interface to track an IP address in OCaml?
<orbitz> obviously
<notk0> orbitz: could you point me on how I could achieve that
<orbitz> for writing gui's your best bet is probably lablgtk
<orbitz> i don't know anythign about tracking Ip addresses
<notk0> gtk is linux only no?
<notk0> I mean it's mostly linux is not really true multi-platform
<orbitz> gtk works on windows, I don't know if lablgtk does
<notk0> well it seems that due to ocaml lack of popularity compared to other languages it lacks libraries, last time I worked with Ocaml I used some curl bindings and it didn't even have documentation
<orbitz> it can be a problem, sure
<notk0> that among other things is keeping me from using ocaml more often
<orbitz> notk0: ok
<notk0> the other thing is lack of experience and knowledge in ocaml of course
<notk0> at my university we mostly study java, in 5 years of university we had basically multiple courses per semester using Java, and only 3 I think that we had to program in Ocaml
<orbitz> ok
<notk0> orbitz: do you program a lot in OCaml?
<orbitz> only personal projects
<notk0> well I wish to program personal projects in ocaml as well, but I rarely program personal stuff due to lack of initiative/motivation and I instinctively don't choose Ocaml as my language
<orbitz> ok
<orbitz> well, seems like you've got some soul searching to do or something
<notk0> orbitz: well when I get some free time, have studies to do and stuff
<notk0> orbitz: can you tell me how I should start such a soul searching?
<orbitz> no. if you don't want to program in ocaml, don't program in ocaml. if you want to prgoram in ocaml, program in ocaml.
<notk0> it's more of a change of way of life, to manage my time properly, and try to program in my free time
<notk0> I play videogames or browse the web instead of programming
<orbitz> take a class on time management then
<notk0> orbitz: but how do you motivate yourself to do it? find the thrill etc?
<orbitz> i sit down and do it
<notk0> I see
<notk0> well I guess I should try and do that
<orbitz> you can try starting simple than a cross platform gui tool
<notk0> I had this idea to re-write stuff I did years ago in another language say Ocaml, to see how much I improved
yacks has quit [Quit: Leaving]
<orbitz> notk0: so do it?
<notk0> orbitz: I will try
<orbitz> notk0: I just find a problem i have and solve it in ocaml
<orbitz> that way i'm killing two brids with the same stone
<notk0> I see
chambart has joined #ocaml
UncleVasya has quit [Ping timeout: 260 seconds]
ahokaomaeha has joined #ocaml
notk0 has quit [Remote host closed the connection]
Cyanure has joined #ocaml
sysopfb is now known as sysop_fb
Anarchos has joined #ocaml
Simgate has quit [Quit: Quit]
Snark has quit [Quit: Quitte]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
ahokaomaeha has joined #ocaml
Anarchos has quit [Remote host closed the connection]
<orbitz> What are my options if I want to do a bunch of nasty c-like bit manipulations on integers?
<adrien> Pervasives, Int32, Int64, Nativeint ?
<orbitz> I really need a nice unsigned integer type
<|jbrown|> I noticed a "uint" opam package, not checked it out though
<orbitz> For example, in Int32, shifting -4 left gives me -2, but I want to shift the signed bit with it
<orbitz> nice looking at it now
cyball1 has joined #ocaml
<invariant> Isn't doing such manipulations from OCaml really slow?
<|jbrown|> ssh! Heh.
<invariant> I am seeing at least a factor 10 slowdown in the socalled innerloops.
<invariant> I looked only at ocaml-uint.
<invariant> I think such types need compiler support.
<|jbrown|> yeah
<invariant> |jbrown|, and currently there isn't, right?
<|jbrown|> I guess not. I'm not even sure if the bundled Int32, etc. have compiler support
<invariant> At that point you can better build an interpreter :)
<|jbrown|> (might be terrible misinformation, don't take my word for it :-))
<orbitz> invariant: might be, but i'm dealing with a network protocol so not so concerned with it right now relative to I/O
<adrien> you can do it in C
<invariant> adrien, what?
<|jbrown|> the compiler does appear to know about int32, so that was misinformation. Apologies!
<orbitz> I'm not sure how Int32 and Int64 are implemented, a boxed type I imagine?
<|jbrown|> yes, normally, but it looks like the compiler can unbox them at least in some cases
<adrien> the compiler knows int32 and int64 which are signed and boxed
<adrien> you don't need compiler support for such things: just use C
ttamttam has left #ocaml []
<orbitz> that's seems to be what uint does
<invariant> adrien, let's say you have a networking protocol and you need to do things really fast, then it means your whole system needs to be written in C.
<invariant> I guess this is why LinearML kind of systems are needed.
<adrien> the compiler supports int32/64 so that you can write 1l, 1L, 1n (nativeint) and because the compiler itself needs them afaiu
<adrien> invariant: if you want fast bit-fiddling, yeah, go C or ASM
<adrien> but everything else can be in ocaml
<|jbrown|> I suggest using Uint*, and if it's not fast enough, adding support for unsigned types to the compiler :-).
<adrien> good luck on that :P
<|jbrown|> heh
<invariant> Why are there no unsafe unsigned types in the compiler?
<invariant> Because everyone wants to keep it safe?
<|jbrown|> as long as you're only adding, subtracting & doing bit-ops, you can probably get away with Int32, I guess.
<adrien> not that it would be rejected but because it'd be a lot of work
<|jbrown|> there's shift_right_logical of course
<adrien> invariant: what would that bring compared to a library in C
<adrien> ?
<invariant> adrien, the problem with a library in C is that you would have to do the network parsing bits in C too.
<adrien> why
<adrien> ?
<invariant> adrien, in short, a substantial part of the system is going to be C.
<thizanne> |jbrown|: there is no shift_left_logical apparently
<adrien> no, no, no
<adrien> open ocaml's int64.ml
<invariant> adrien, before you know it, you will hear: why not do everything in C?
<|jbrown|> thizanne: there's no need for it.
<adrien> in stdlib/
<thizanne> apparently orbitz needs it
<adrien> go look at it: it proves it doesn't have to be like what you're saying
<|jbrown|> thizanne: there isn't in C either -- there's only one kind of left shift.
<thizanne> yes but in C it works the way orbit wants
<|jbrown|> I think he typo'd left for right.
<invariant> adrien, what int64 is that? Is that the same kind you get in C?
<adrien> invariant: unsigned, boxed
<adrien> ocaml-4.00.1/stdlib/int64.ml
<thizanne> |jbrown|: shift_left (-1) 1 gives you -2
<thizanne> oh wait
<|jbrown|> of course it does :-).
<thizanne> forget it, i'm just stupid :=
<invariant> adrien, I think we were talking about unboxed ones.
<thizanne> :)
<adrien> you won't have unboxed ones in ocaml
<thizanne> I definitely need sleep.
<invariant> adrien, GHC has them. Why can't OCaml?
<orbitz> adrien: int64 is signed, unboxed ,i thought
<invariant> In a strict language, I also don't see the point of the boxes for native types.
<orbitz> invariant: the gc requires it AFAIK
<invariant> orbitz, that's only for user defined types.
<orbitz> invariant: no it isn't
<adrien> "There are some restrictions on the use of primitive types, the main one being that you can't pass a primitive value to a polymorphic function or store one in a polymorphic data type."
<pippijn> the GC requires it by design, not by definition
<adrien> Performance notice: values of type int64 occupy more memory space than
<adrien> values of type int , and arithmetic operations on int64 are generally
<adrien> slower than those on int . Use int64 only when the application
<adrien> requires exact 64-bit arithmetic.
<adrien> .
<adrien> http://www.macs.hw.ac.uk/~dsg/gph/docs/4.06/users_guide/ghc-language-features.html clearly states the limitations of these unboxed types
<orbitz> adrien: int64 is signed, not unsigned, I beleive
<adrien> oh, yeah, sorry, I meant signed =/
<orbitz> Where is the c impl for int32/64?
<adrien> open stdlib/int64.ml
<adrien> notice the functions which are "external"
<adrien> grep for the associated name ;-)
<adrien> ah, they're primitives
<orbitz> primitives?
<invariant> adrien, did you mean to say that the #types in GHC are the same as those in OCaml (int64)?
<adrien> no
<invariant> adrien, you did point at 8+ year old documents, but I suspect nothing changed there.
DanHarmon has joined #ocaml
<DanHarmon> Hello
<orbitz> hi
<adrien> orbitz: I think the best definition is that they're provided by the compiler
<orbitz> adrien: ah k
<adrien> they're not in external C libraries/objects
<DanHarmon> Do you know how to find the integer part of one Q.t number (zarith)
<orbitz> I'm curious what it means for ocaml to shift right a negative number since this is implementation defined in C
<DanHarmon> The syntax is normally the same than the int32/int64 one
<thizanne> orbitz: ocaml has 2 operations for it
<thizanne> one strictly shifting, one dealing differently with the sign bit
<orbitz> thizanne: yeah, i'm trying to track them down so I can see how it does it
<thizanne> I guess it's not that hard, since the C's high weight bit is not used by OCaml
<orbitz> thizanne: in int32/64 it would be
ahokaomaeha has quit [Ping timeout: 256 seconds]
<orbitz> depending on what you mean
<thizanne> orbitz: if i understood correctly, int32/64 are not "just C integers"
<orbitz> they are boxed integers from what I understand
chambart has quit [Ping timeout: 256 seconds]
<orbitz> integers are hard!
ollehar has quit [Ping timeout: 260 seconds]
osa1__ has quit [Quit: Konversation terminated!]
ottbot has quit [Ping timeout: 245 seconds]
<DanHarmon> Fatal error: exception Z.Overflow
Yoric has quit [Ping timeout: 256 seconds]
<DanHarmon> yyyeaaah.
ollehar has joined #ocaml
ahokaomaeha has joined #ocaml
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
ahokaomaeha has joined #ocaml
ahokaomaeha is now known as Guest18304
Guest18304 has quit [Client Quit]
Playground has joined #ocaml
ottbot has joined #ocaml
Playground is now known as ahokaomaeha
<DanHarmon> Do you know if something like pow (pow : t -> int -> t) exist for big_int ? (something like pow1: t -> big_int -> t)
adotbrown has joined #ocaml
Cyanure has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 240 seconds]
dEPy has quit []
ontologiae has joined #ocaml
q66 has quit [Remote host closed the connection]
iZsh has quit [Ping timeout: 240 seconds]
DanHarmon has quit [Remote host closed the connection]
iZsh has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
ahokaomaeha has quit [Ping timeout: 252 seconds]
ottbot has quit [Ping timeout: 248 seconds]
lusory has quit [Read error: Connection reset by peer]
ollehar has quit [Read error: Operation timed out]
darkf has joined #ocaml
ahokaomaeha has joined #ocaml