<gildor>
we create package ocaml-uname with version 0.0.1
<mfp>
could some of that info be place in textual format in a separate file?
<gildor>
yes, this is possible
<mfp>
the advantage would be that it could then be extracted "statically", without running the code
<mfp>
since running anything = risky
<mfp>
even parsing is somewhat risky in fact :-P
<gildor>
well we are building a software
<mfp>
I mean for the central DB to extract that info without relying on the tarball name
<gildor>
so i am not sure that we can really "not running the code"
<gildor>
this is another question
<gildor>
;-)
<mfp>
the user does build, but the centralized DB only extracts data to be showed in the site
<gildor>
I have my idea about that
<gildor>
as usual, this is a big plan for world domination, and maybe it will never exist
<gildor>
so don't take this as granted
<mfp>
is it simpler (your idea) than having name: ocaml-uname version: 0.0.1 in a file?
<gildor>
in fact i would like to use DOAP
<bluestorm>
mfp:
<gildor>
in fact, it would replace Action.configure
<bluestorm>
ensuring an ocaml code is safe is interesting and imho worth it
<gildor>
by Action.configure_from_doap "ocaml-uname.doap"
<bluestorm>
there has been some work already with the irc bot
<mfp>
bluestorm: it demands more work than putting the data in some text file
<mfp>
and it exposes you to ppl finding ways to break it :-|
<bluestorm>
probably
<bluestorm>
i'm only saying it's fun :-'
<mfp>
there has to be something in exchange to justify the risk
<mfp>
gildor: the DOAP page is down, but judging from what I see in Wikipedia it sounds like complex, complex and uh complex? :-P I see "RDF schema", "XML vobabulary", "semantic web" and...
<mfp>
just an uninformed impression, but likely to be the 1st reaction from most ppl when exposed to this
<gildor>
well, DOAP file can be useful for generating a lot of other thing
<mfp>
as I said, one of the main lessons from my prev attempt was that doing the Right thing can prevent you from doing anything at all in the end
<gildor>
mfp: if you want to provide a Action.configure_from_mfp_format, patches are welcome ;-)
<mfp>
gildor: where's the tree?
<gildor>
the darcs is not already up
<gildor>
give me 5min
<mfp>
ah OK, darcs :-))
<mfp>
pulling is funny too :-P
<lispy>
is darcs popular here?
<mfp>
took me a while to get ~1500 patches for cabal-install earlier this morning :-P
<lispy>
mfp: whoa, can you use a global cache with that? Or is it darcs version 1 repo?
<mfp>
lispy: I've been using darcs for ~3 years or so, but I'm using git for new things now
<mfp>
lispy: don't know if they have converted the cabal-install repos yet
<mfp>
I prefer git's history rewriting (amend-record is very limited compared to rebase -i), it's faster and has no problems with large repositories/files
<lispy>
Global caches help a lot when you can use them. Basically each patch gets a globally unique name, so if you work with any repo and that name comes up it can be fetched from the cache instead of redownloaded
<mfp>
I now prefer in-place branching to 1-branch-per-working-dir, too
<lispy>
mfp: it doesn't help that the future of darcs seems very uncertain :(
<gildor>
mfp: but this is a really young project
<gildor>
mfp: i am still working on it
<gildor>
mfp: and it will take time before having something good
<mfp>
k
<gildor>
good night
<mfp>
night gildor
<mfp>
it's also 02:27 for me, so zzzz
Proteus has joined #ocaml
Proteus_ has quit [Read error: 113 (No route to host)]
<bluestorm>
btw
<bluestorm>
in my new pet project (#light syntax), i make a heavy use of the pa_matches syntax extension
<bluestorm>
and i found it to be very useful and neat in some situations
<bluestorm>
(in short, it builds predicate from patterns)
seafood has joined #ocaml
seafood has quit [Read error: 54 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
jeddhaberstro has joined #ocaml
mikezackles has quit [Connection timed out]
<landonf>
Do most of you use tuareg?
<vixey>
I would like to but I don't know what to program in ocaml yet
<jeddhaberstro>
Can some one help me out here? I don't understand why the compiler says x is of type 'a list (see comments): http://pasteall.org/1779/ocaml
<bluestorm>
landonf: yes i do
<bluestorm>
jeddhaberstro: Cons(l,Nil)
<bluestorm>
is wrong
<vixey>
jeddhaberstro: what is 'a * 'a cons ?
<bluestorm>
vixey: defined above
<vixey>
and it makes no sense to lack the [] case
<bluestorm>
jeddhaberstro: you cons a list (l), so you have a ('a list) cons
<bluestorm>
yes, you should match | [] -> Nil
<jeddhaberstro>
ah, ok
<bluestorm>
moreover, it is a bad idea to name a variable "l"
<bluestorm>
use "li"
<bluestorm>
l is not readable as it tends to be confused with 1 and | and I
<jeddhaberstro>
ok, thanks for the type
<jeddhaberstro>
that fixed it to :)
netx303 has quit ["Leaving"]
landonf has quit []
jeddhaberstro has quit []
pants1 has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
Associat0r has quit []
Philonous1 has joined #ocaml
landonf has joined #ocaml
mwc has joined #ocaml
<mwc>
Anybody know about Ocaml threads? I don't see a detach operation on threads, like say, pthread_detach. Do I have to join all threads eventually, in order to reap them?
Philonous has quit [Read error: 110 (Connection timed out)]
haveo has quit [Read error: 113 (No route to host)]
Linktim has joined #ocaml
asmanur has joined #ocaml
Philonous1 is now known as Philonous
Axioplase_ is now known as Axioplase
pango_ has quit [Remote closed the connection]
guillem has quit [Remote closed the connection]
landonf has joined #ocaml
munga_ has joined #ocaml
Watza has joined #ocaml
<Watza>
ouai bon
<Watza>
dédicace à tout le monde
<Watza>
à mon cheval
<Watza>
ma soeur
<Watza>
++
Watza has left #ocaml []
pango_ has joined #ocaml
munga_ has quit ["Ex-Chat"]
mbishop_ has joined #ocaml
mbishop has quit [Nick collision from services.]
mbishop_ is now known as mbishop
tvn1981a has joined #ocaml
<tvn1981a>
I am looking at some ocaml code and see something like let listL = ref [] ;;
<tvn1981a>
why would one want to reference a list ? isn't a list variable mutable in the first place ?
<flux>
no
<flux>
so, that's why :)
<flux>
what's the use case for Gc.create_alarm. why would anyone really need that, given that Gc can produce debug output itself?
<flux>
I'm actually reading about one case using of it is an option from the caml-list, but it looks hackish
<flux>
another tidbit: JDH> For example, I cannot even jump to the definition of an identifier> reliably. DD> OCaml 3.11 has extended .annot files that will allow external toolsto do that. Also, it tells you which function calls are tail callsand which are normal calls.
<flux>
ooh, nice :)
pango_ has quit [Remote closed the connection]
filp has quit ["Bye"]
jlouis_ has quit ["Leaving"]
pango_ has joined #ocaml
mattc58 has joined #ocaml
pec1 has left #ocaml []
jlouis has joined #ocaml
mattc58 has quit [Read error: 104 (Connection reset by peer)]
<tvn1981a>
is there a function that will print the value of the variable for me ? regardless of what type of variable I am passing it in (e.g., int, float .. )
<fremo>
printf ?
<tvn1981a>
but printf requires you to know the type passing in
<tvn1981a>
like c++ has something like cout , you can pass in a string, int, float, double etc
<tvn1981a>
and it auto prints it out without you specifying the type
<RobertFischer>
tvn1981a: No.
<tvn1981a>
it would be nice if there's something as such
<RobertFischer>
tvn1981a: There's no way to do it given OCaml's type system. And, truth be told, you'll miss it less than you think you will.
<RobertFischer>
tvn1981a: A function which prints to stdout/stderr given a XXX_to_string function and an argument of type XXX is pretty simple to write. But that the run-time type querying capabilities just don't exist in OCaml. And you don't want them to -- you just don't realize that yet.
<tvn1981a>
ic, thanks
<fremo>
can't it be done with camlp4 ?
<tvn1981a>
I thought it might have something like that given its type inference capability
<RobertFischer>
fremo: Sure. I think it has been done -- doesn't Jane St's Core have something like that?
<fremo>
probably, I remember some code that automaticaly creates functions for some types...
<RobertFischer>
tvn1981a: The type inference capability is the problem with the ambiguous types.
<fremo>
but if you use that to much, you'll have to explicitly specify types...
<RobertFischer>
fremo: Yeah, that's true. I think the Core thing just creates print_XXX functions. I don't think it frees you from having to know the type passed into a print function.
dafra has joined #ocaml
<fremo>
yep
jeddhaberstro has joined #ocaml
r0bby has quit [Connection reset by peer]
Linktim_ has joined #ocaml
<rwmjones>
tvn1981a, when camlp4 runs, you don't know the types
<rwmjones>
tvn1981a, the reason that janest can do it is because they create the functions when the type is being defined, eg:
<rwmjones>
type foo = ... with sexpr
<rwmjones>
for example
<rwmjones>
camlp4 knows the details of type foo (because it is being defined there and then) and writes a sexpr_of_foo function
<rwmjones>
however you cannot write a generic 'show' function using camlp4 that could work like 'show 4', 'show "hello"'
<rwmjones>
(hmmmm, well you _could_ if you only wanted to print literals like that)
<rwmjones>
but it wouldn't work for 'let v = 1 in show v'
Linktim has quit [Read error: 113 (No route to host)]
tomh- has joined #ocaml
asmanur has quit [Remote closed the connection]
Linktim_ has quit [Read error: 113 (No route to host)]
jonas_e` has quit [Remote closed the connection]
dafra has quit [Connection timed out]
<Philonous>
Can someone please explain why ocaml has two different sets of arithmetical operations for ints and floats respectively? What's the gain? I guess this question is asked frequently - so maybe there is a site discussing this issue? (which I haven't found yet)
bluestorm has joined #ocaml
munga_ has joined #ocaml
<RobertFischer>
Philonous: They are two distinct operations, which take two different argument types.
<RobertFischer>
Ergo, they are two distinct functions.
<RobertFischer>
(Man, it's "why doesn't OCaml have argument overloading" central here today.)
GustNG has quit [Read error: 104 (Connection reset by peer)]
<hcarty>
Philonous: There is no function or operator overloading in OCaml
<hcarty>
One benefit is that (+) always does what you say, as does (+.), without any implicit casts
<Philonous>
So basicaly you are saying, that the type system doesn't consider int ant float to be some sort of subtype of an "arithmetic" type, which would then allow + to be polymorphic? (Maybe because Ocamls types are more hardware bound then e.g. Haskell?)
<bluestorm>
Philonous: yes
<bluestorm>
object-oriented OCaml could express that, and Functors are a way to achieve that too
<bluestorm>
but the basic numeric types have no subtyping relations
<Chile`>
Philonous: integers & floating point types are really, _really_ different
<Chile`>
Philonous: implicit conversions between them produce a lot of bugs in C/C++ code, so its actually kind of nice to have to explicitly say what you're doing.
<bluestorm>
Chile`: the same cannot be said for int and int32 or int64
<Philonous>
Well, but it would still be meaningfull to write polymorphic functions that work on floats and ints respectively. That's what I was trying to achieve in the first place
Snark has quit ["Ex-Chat"]
<bluestorm>
Philonous: use a functor
<bluestorm>
you write your function inside a module parametrized over a numeric type
<Philonous>
bluestorm: gratefully noted
<bluestorm>
in wich case would such a function be useful ?
<bluestorm>
i actually fail to see any, apart from let abs x = if x < 0 then x else - x maybe
<bluestorm>
(i agree that using + instead of +. for float operations would be a syntaxic advantage, but this entails no polymorphism of any kind)
<Philonous>
I was tring to write a function that would work on color codes given in rgb where the components are either ints in a range between 0 and 255 or floats between 0 and 1
<bluestorm>
polymorphism in that case seems delicate at least
<bluestorm>
you would use, say let rgb_function max_value ... =
<bluestorm>
wich rgb_function 1. or rgb_function 255 ?
<bluestorm>
if you don't consider any ad-hoc polymorphism (doing different things based on the input type), then you have to give the function a way to know wether it works in [0..1] or [0..255]
<bluestorm>
so that's equivalent to using an alebraic datatype : rgb_function (Discrete (255, 0, 150)) rgb_function (Real (1., 0., 0.4))
<Philonous>
Actually the function itself wouldn't need to know on which range it is working, since it wouldn't have to do any clipping
<bluestorm>
hm
<bluestorm>
do you have an example of such function ?
<bluestorm>
i thought of adding the components of two colors, but that won't work
<Philonous>
Now you mention it I see that prolly any non-trivial function really would have to distinguish between types anyway
<Philonous>
Some (basic) vector/matrix operations still might be worth implementing polymorphic
<hcarty>
Philonous: Those are relatively easily handled with either a syntax extension or defining new operators
<Philonous>
Ok, thanks a bunch. That really helped me a lot.
<bluestorm>
the vector/matrix operations should take the operator as parameter
<bluestorm>
so that you can use with vectors of bools, lists, and what not
<Philonous>
Ok, that even takes care of the different possible operations you could use even on the same type
tvn1981a has quit [Remote closed the connection]
<flux>
except unless you want any kind of performance, you won't be giving addition operation as a parameter to vector operations?
<flux>
or can ocamlopt do some optimizations in those cases; I think not
kelaouchi has joined #ocaml
tab_ has joined #ocaml
haveo_ is now known as haveo
haelix_ has joined #ocaml
Yoric[DT] has joined #ocaml
haelix has quit [Read error: 104 (Connection reset by peer)]
tab has quit [Read error: 104 (Connection reset by peer)]
kelaouch1 has quit [Read error: 104 (Connection reset by peer)]
<hcarty>
flux: It probably depends on how the vector or matrix is represented. If a and b have type 'a array then it may be reasonably performant to use Array.mapi (...) a b
<hcarty>
For certain definitions of "reasonably performant"
<flux>
hcarty, more efficient than for c = 0 to 42 do ar.(c) <- ar.(c) + 1 done? well, could be, but only because Array.mapi can get rid of bounds checking? (well, they also do different things..)
<flux>
but, perhaps one should benchmark before making such claims :)
<hcarty>
flux: Hence the "may be" :-)
<flux>
but it's so late so I don't bother. instead, I'll go sleep a bit. night.
<bluestorm>
the table at the end of the documentation page concerns the MinGW port
<bluestorm>
(and the VisualThing port too)
<bluestorm>
iirc. Cygwin support all of the Unix functions
rstites has quit [Remote closed the connection]
redocdam has quit [Remote closed the connection]
toxygen has joined #ocaml
<toxygen>
hello
<toxygen>
i'm looking for a hint. i have project which has embeded some ocaml code. it's in c++ and when linking i'm getting _caml_startup as undefined symbol
<toxygen>
against which library should i link?
mikezackles has quit [Read error: 110 (Connection timed out)]