peddie has quit [Read error: 113 (No route to host)]
seanmcl has quit []
peddie_ has quit [Remote closed the connection]
Associat0r has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
valross_ has quit [Remote closed the connection]
Amorphous has joined #ocaml
Ched has quit [Read error: 110 (Connection timed out)]
seanmcl has joined #ocaml
thrasibule has joined #ocaml
Associat0r has quit []
valross has quit [Remote closed the connection]
valross has joined #ocaml
seanmcl has quit []
caligula_ has joined #ocaml
duryodhan has joined #ocaml
<duryodhan>
hi .. I am trying to write a simple program using OCAML and ExtLib .. but ocamlc says Unbound Module Extlib on open Extlib ;; .. how do I tell ocamlc that I have extlib ?
<rwmjones>
ah, looks like it needs an update ocaml-fileutils package ... let me go and fix that one first
<rwmjones>
gildor, no problem - building against fileutils 0.4.0 fixed that
julm_ has quit [Read error: 110 (Connection timed out)]
ygrek_ has joined #ocaml
tmaeda0 is now known as tmaedaZ
seanmcl has joined #ocaml
Yoric[DT] has joined #ocaml
Yoric has quit ["Leaving"]
Yoric[DT] has quit [Client Quit]
svenl has quit [Read error: 60 (Operation timed out)]
svenl has joined #ocaml
munga has quit ["Ex-Chat"]
rwmjones is now known as rwmjones-lunch
BiDOrD has quit [Read error: 104 (Connection reset by peer)]
shr3kst3r has joined #ocaml
kaustuv has quit [Read error: 113 (No route to host)]
kaustuv has joined #ocaml
thrasibule has quit [Connection timed out]
Vital303` has joined #ocaml
Vital303` has left #ocaml []
tmaedaZ is now known as tmaeda0
infoe has quit [Read error: 54 (Connection reset by peer)]
ikaros has joined #ocaml
jimmyb2187 has left #ocaml []
jimmyb2187 has joined #ocaml
rwmjones-lunch is now known as rwmjones
Modius has quit [Read error: 110 (Connection timed out)]
Vecklock has joined #ocaml
david has joined #ocaml
david is now known as Guest53782
Snark_ has joined #ocaml
infoe has joined #ocaml
th5 has joined #ocaml
reid97 has joined #ocaml
BiDOrD has joined #ocaml
Submarine has quit ["Leaving"]
albacker has joined #ocaml
<gildor>
rwmjones: do you see the difference with ocaml-gettext 0.3.2 ?
ygrek_ has quit [Remote closed the connection]
<rwmjones>
gildor, I built it for fedora today but tbh I didn't really try it out except the tests ... we'll get round to compiling something which needs it soon enough though
<gildor>
ok, you'll see that I have made the format string more type checked than before
Guest53782 is now known as Yoric
<Yoric>
hi
<Camarade_Tux>
hi Yoric :)
seanmcl has quit []
<thelema>
hi Yoric. Is it good?
mishok13 has quit [Read error: 110 (Connection timed out)]
<Yoric>
Fine, thanks.
<Yoric>
Doing some deep compiler work :)
<Yoric>
(well, deep into the compiler, not deep into anything else)
<thelema>
excellent.
<Yoric>
What about you, how are you?
<thelema>
It's a better world with more people understanding ocaml's internals.
<thelema>
I'm well. I'm finishing up my NSF Fellowship application.
<Camarade_Tux>
Yoric: btw, do you have optic fiber at home?
Guest85063 is now known as ezra
ezra is now known as Guest64118
Guest64118 is now known as release
release has quit ["leaving"]
<Yoric>
Camarade_Tux, not that I know of.
<Yoric>
I believe that my parents do.
<Yoric>
thelema, good luck
<thelema>
thank you.
<Camarade_Tux>
Yoric: ok, I don't have to hate you then ;p
* Camarade_Tux
recently tried to get optic fiber but his building wasn't set up for that
<Yoric>
:/
<Yoric>
thelema, what kind of application is that, exactly?
<kaustuv>
Camarade_Tux: Pray that Numéricable doesn't have a monopoly on fibre where you live...
<Camarade_Tux>
kaustuv: it doesn't, it's just that I just moved in (I'm alone) and I'm never going to get it installed (I'm not going to bother with the "syndic")
<Yoric>
thelema, sounds good
<thelema>
Yoric: of course it'd be good to get, but it's rediculously competitive.
ikaros_ has joined #ocaml
_unK has joined #ocaml
Vital303 has quit [Read error: 113 (No route to host)]
<infoe>
Camarade_Tux: fios?
<Camarade_Tux>
infoe: fios? what do you man?
mattiase has joined #ocaml
kaustuv has quit [Read error: 113 (No route to host)]
<orbitz>
Fiberoptic Operationg System
<infoe>
:/
<infoe>
nevermind, youre in france
<Camarade_Tux>
I was referring to optic fiber at home 100MB/20MB for 20 euros per month
<infoe>
yes, fios is a verizon product
<infoe>
which is us territories
<infoe>
it is 50MB/20MB tho
<mrvn>
and what traffic limit do you get?
<Camarade_Tux>
unmetered :)
<mrvn>
and if you use the bandwidth how long till they kick you anyway?
<Camarade_Tux>
never heard of anything like that here
<mrvn>
or shape your P2P into the ground :)
_zack has quit ["Leaving."]
<mrvn>
WHat does the % mean in external foo ... = "%foo_stub"?
<Camarade_Tux>
they'd like to but they don't
<mfp>
mrvn: just posted to the ML about that --- it's a compiler primitive
<mfp>
mrvn: those primitive are hardcoded in C-- in the compiler, so it can generate the code directly instead of using a function call
ikaros has quit ["Leave the magic to Houdini"]
<mrvn>
mfp: where? I tried to rgrep for the name but that didn't find anything.
<mfp>
asmcomp/cmmgen.ml
<mfp>
see for instance around line 914, Pbigarrayset
<mrvn>
thx.
<mfp>
if you find a way to inject C-- expressions into external declarations, you could extend the set of primitives, at least on a per-compilation-unit basis
<mrvn>
mfp: Would be ncie to add some primitives for type conversion.
<mrvn>
and endian conversion.
<mfp>
the primitives are listed in translcore.ml
<mfp>
+set of
<mrvn>
A syntax to have polymorphic and specialized versions of a function would be nice I think.
<mfp>
yes, monomorphization would be very helpful at times
<mattiase>
mrvn: Do you mean on the primitive level or in ocaml?
seanmcl has joined #ocaml
<mrvn>
mattiase: in ocaml.
<mrvn>
e.g. a ('a, 'b) Hashtbl.t and (int, 'b) Hashtbl.t
<mattiase>
mrvn: Yes yes, I know. It's quite a taller order
<mrvn>
and then what to do if you have (int, 'a) t and ('a, int) t and the user uses (int, int) t
<mattiase>
mrvn: this has been explored so often in other contexts, but isn't a generally solved problem
<mrvn>
Here is something else to think about. Say you have a double-linked list type. In C code I often have struct Foo { DList primary, secondary, other; int data; }
<mattiase>
mrvn: There should be some mechanism on the primitive level - I haven't verified exactly how it's done - but it's probably fairly ad-hoc, to monomorphise comparisons etc
<mrvn>
How do I do that in ocaml so I can iterate/map/fold over the primary, seconday or other list?
<mattiase>
mrvn: but do you actually want that? It's a low-level C hack to include the membership of objects in themselves
<mattiase>
mrvn: but it shouldn't be hard to do that in ocaml, actually
<mrvn>
how else do I get from an object to any of the three lists?
<mattiase>
mrvn: first define 'a dlist = 'a dlist ref * 'a dlist ref * 'a (say)
<mattiase>
mrvn: and then it would be clear to fold over such a dlist
<mattiase>
mrvn: You need bidirectional references here: from Foo to each of its three dlist nodes, and from each dlist node to its corresponding Foo
<mattiase>
mrvn: (And here it would be better to make 'a dlist into a record with mutable prev/next members)
<mrvn>
so DList is { prev, next, 'a } and 'a has 3 'a DList.
ttamttam has quit ["Leaving."]
<mrvn>
dlist must be mutable obviously. Otherwise you could only have static lists.
<mattiase>
mrvn: Yes, prev and next must be mutable fields, but not the 'a part
<mrvn>
The nice thing of the C hack is that it has a low memory footprint.
<mrvn>
Time to catch a train and think about this some more.
<mattiase>
mrvn: Well, allocating an object directly inside another is nice. Sometimes. It goes both ways.
Yoric has quit [Remote closed the connection]
iZZy_ has joined #ocaml
tmaeda0 is now known as tmaedaZ
tmaedaZ is now known as tmaeda0
iZZy_ has quit [Client Quit]
ikaros has joined #ocaml
ikaros_ has quit [Read error: 110 (Connection timed out)]
tmaeda0 is now known as tmaedaZ
mfp has quit [Read error: 104 (Connection reset by peer)]
tmaedaZ is now known as tmaeda0
mfp has joined #ocaml
tmaeda0 is now known as tmaedaZ
kaustuv has joined #ocaml
thelema has quit ["ubuntu upgrade"]
ztfw has joined #ocaml
ygrek_ has joined #ocaml
thelema has joined #ocaml
ccasin has joined #ocaml
ttamttam has joined #ocaml
<mrvn>
but even if I put the DList inside the 'a it will still just be a pointer to a boxed DList record. So not really inside.
<thelema>
mrvn: correct, that's the ocaml value model.
<mrvn>
again a towsided sword. :)
<ygrek_>
flux, extlib doesn't use str
jonafan has quit [Read error: 110 (Connection timed out)]
Guest28077 is now known as fremo
Vital303 has joined #ocaml
Vital303 has quit [Remote closed the connection]
seanmcl has quit []
duryodhan has quit []
ccasin has quit ["Leaving"]
th5 has quit []
dfjoerg has joined #ocaml
<dfjoerg>
I have some strange issues with ocamlfind
<dfjoerg>
on NetBSD/amd64, it seems like stripping the debug data from the binary breaks it
<dfjoerg>
does that ring *any* bell
<Camarade_Tux>
stripping debug data or just stripping? if you strip some bytecode ocaml binaries, you can break them
<dfjoerg>
strip -g
<Camarade_Tux>
it's the binaries which "embed" the interpreter
<dfjoerg>
on the ELF binary
<dfjoerg>
I can't think of a good reason why it would depend on the debug symbols to be present
<Camarade_Tux>
afaict, EFD_NONBLOCK was added on Date: Wed Jul 23 21:29:38 2008 -0700
<flux>
mrvn, ok, linux-header-2.6.27-7-generic ha sit
<mrvn>
Camarade_Tux: wow, that was specific.
<flux>
I wonder what would be the most decent course of approach
<flux>
maybe I'll upgrade to next ubuntu.. 9.04 :-)
<mrvn>
flux: that surely doesn't hurt. :)
<Camarade_Tux>
flux: 2.6.27-rc1 is from Mon Jul 28
<Camarade_Tux>
but this doesn't take branches into account
<mrvn>
flux: I'm trying to write a new Buffer module that uses the Bigarray code to access the buffer (compiler builtins) but allows reading any datatype if the alignment fits.
<thelema>
sounds like fun
<flux>
camarade_tux, yeah, I have an actual relase of that installed, but my libc6-dev is older
<flux>
I suppose I could just use kernel headers
<flux>
but apparently that's not how things should be done
<mrvn>
flux: I would just add the define to the stubs file.
<Camarade_Tux>
you better keep kernel-headers and glibc in sync :)
<Camarade_Tux>
you *really* better :P
<hcarty>
mrvn: I have a "Bigarray.Genarray.cast" function if you're interested.
<flux>
no, my distribution should do that :)
<hcarty>
mrvn: IIRC it makes a copy of the bigarray though, so it's likely not what you have in mind.
<mrvn>
hcarty: that changes a int array to int64 array and the like?
<hcarty>
mrvn: Yes
<Camarade_Tux>
flux:
<Camarade_Tux>
here, I have said nothing against ubuntu :)
<hcarty>
mrvn: It should be easy enough to share the data and avoid the copy
<mrvn>
Not what I need at all. I want A.get_int8 a 0; a.get_uint8 a 1; a.get_uint16 a 2; a.get_int a 4; a.get_int64 a 8
* Camarade_Tux
doesn't use distributions with dependencies but has been hit by bad dependencies several times
<hcarty>
Ah, I see
<mrvn>
get_int is tricky though. Should that read 32bit or 64bit?
<hcarty>
mrvn: Native int?
<mrvn>
hcarty: that is boxed.
<mrvn>
Whole lot of more problems.
<hcarty>
mrvn: Then 31 vs 63 bit OCaml int?
<mrvn>
hcarty: yep.
<mrvn>
I can provide a get_int31. But how do I provide a get_int63?
<hcarty>
mrvn: Native int :-) As in, whatever is native to the system's arch (31 or 63).
<mrvn>
and a get_int has to check the buffer size and alignment against whatever the size of int is currently.
dfjoerg has left #ocaml []
<mrvn>
Does ocaml have a log(Pervasives.max_int)?
<mrvn>
a sizeof(int)
<hcarty>
mrvn: Sys.word_size or something like that I think.
<mrvn>
Or does anyone have an idea how I get external get: ('a, 'b, 'c) t -> int -> 'a = "%caml_ba_ref_1" to emit code for a specific 'b without the first argument having that type?
jonafan has joined #ocaml
* mrvn
misses Array1.to_string : (int, int8_unsigned_elt, c_layout) Array1.t -> int -> int -> string but you can't write that in ocaml.
<mrvn>
I'm stuck at get_int31. Bigarray has no access function for 31bit integers.
<thelema>
mrvn: I thought you weren't going to deal with bits, but stay at the byte level?
<thelema>
just read 32-bits and drop one bit
<mrvn>
thelema: I want to read 4 bytes but use an unboxed int and it needs to run on 32bit and 64bit cpu.
<thelema>
does it need to run the same on either?
<mrvn>
It needs to use 4 bytes on both.
<thelema>
Int32.to_int
<mrvn>
On 32bit cpus I can use a (int, int, c_layout) Array1.t. But on 64bit I need (int32, int32, c_layout) Array1.t and Int32.to_int it seems.
BigJ2 has quit [Read error: 110 (Connection timed out)]
<mrvn>
It sees that /2 is a sar but then it conditionally adds 1 for the tag.
<thelema>
I didn't realize it would do that kind of optimization
<mrvn>
And for that it also needs to free up %rax first.
<thelema>
and that's a horrible way to conditionally add the tag
<flux>
mrvn, by sar, id you mean lsr?
<flux>
in any case, with negative numbers it's very different..
<thelema>
flux: no, asr
<mrvn>
that would ignore the sign
<flux>
ah, ok
<flux>
it's still different, though
<flux>
not just very different :)
<flux>
s/not just/just not/
<thelema>
flux: difference?
<mrvn>
hmm, -1 >> 1 == -1 but -1 / 2 == 0. right?
<flux>
(-5) asr 1 vs (-5) / 2
<flux>
so, rounding
<thelema>
okay, it's not the same.
<mrvn>
I want an unsigned type in ocaml.
<thelema>
let compare_uint n1 n2 = let sgn1 = (n1 lsr 24) - (n2 lsr 24) in if sgn1 = 0 then (n1 land 0xffffff) - (n2 land 0xffffff) else sgn1
<flux>
I wanto sleep. good night :)
<flux>
thelema, that's beautiful
<flux>
I shall see dreams about it! ->
<thelema>
thank the author of camomile
<mrvn>
thelema: and mul and div?
<thelema>
mrvn: patch the compiler
<thelema>
while you're at it, add overflow checks
<mrvn>
thelema: That would only work with different operators.
<mrvn>
or actualy better with phantom types.
<mrvn>
['signed 'unsigned] int
<thelema>
the compiler isn't bound by the type system
<thelema>
and if I were you, I'd do uint
<mrvn>
thelema: but then I need to use a different operator for int and uint adition.
<thelema>
phantom types seem like a bad choice to me
<thelema>
the compiler could work it out.
sramsay has joined #ocaml
ttamttam has quit ["Leaving."]
<hcarty>
Phantom types seem like a very interesting approach to unsigned int values in OCaml. Either method (phantom types or a new uint type) could be masked with pa-do.
Yoric[DT] has joined #ocaml
<hcarty>
thelema: Why do phantom types seem like a bad choice to you?
<thelema>
ugly error messages
<thelema>
the longer the types are, the harder it is to read
<mrvn>
let m x y = x * y would need to be polymorphic and there is no bit to decide if it is signed or unsigned at runtime.
<mrvn>
Might mean you have to specify types in such cases.
<thelema>
you'd need to specify for *
<thelema>
you'd have (*) : [`signed] int -> [`signed] int -> [`signed] int
<mrvn>
Would ruin the "compiler picks the right one" benefit.
<thelema>
and (*') : [`unsigned] int -> [`unsigned] int -> [`unsigned] int
<thelema>
I see what you're saying - non-phantom types don't union.
<thelema>
M would have to be monomorphic of unknown type ('_a)
<hcarty>
Wouldn't ( * ) be (I'm not sure of the syntax) ([`unsigned | `signed] as 'a) int -> 'a int -
<hcarty>
> 'a int ?
<thelema>
hcarty: that's what it'd be for the phantom type case
<thelema>
hcarty: but without phantom types, it'd need a monomorphic type for code generation, but it wouldn't know which one until it was used
<hcarty>
thelema: Ok, thanks for the clarification. I think I misread/misunderstood an earlier comment.
<thelema>
which means it wouldn't be exportable from a module as is
Yoric[DT] has quit ["Ex-Chat"]
<kaustuv>
maybe I am old fashioned, but I remember a time when "unsigned int" was called "nat"
<mrvn>
hcarty: The problem is that mul is different for signed and unsigned.
ygrek_ has quit [Remote closed the connection]
<mrvn>
For it to be exportable in modules the compiler would need to generate the signed and unsigned case in the module and let the using code call the right one. And then you get an exponential explosion of different functions with more and more arguments.
<hcarty>
mrvn: Ah, I did not know that. I should read up on various integer representations and the underlying math.
<hcarty>
Well, I suppose I did learn that at some point. But it's not something I've thought about in a very long time.
<mrvn>
hcarty: It is only through the clever encoding that add/sub is the same. anything else differs.
<mrvn>
There is actualy verry little you can do with phantom typed ints that won't fix it to one or the other. So maybe int and uint types with seperate operators isn't a bad idea.
<mrvn>
can't even do if x < 10 then
<mrvn>
n8
schme has quit [Read error: 54 (Connection reset by peer)]
schme has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]