<ketty>
dbueno_: i think you first have to bind the records to types..
<ketty>
type varid = {name: string; qual: string}
<ketty>
type pkgid = {name: string; ver: string}
<ketty>
type id' = VarId of varid | PkgId of pkgid
<avlondono>
but can't share the name field
<ketty>
they can't ?
<avlondono>
no they can't
<ketty>
ahh... i see
<dbueno_>
ketty: crap. You're right.
<dbueno_>
The field names of records are in one global namespace?
<avlondono>
conside let a = { s with name = "bleh" }, what is the type of a and s?
<dbueno_>
Couldn't it just force a type decl?
<dbueno_>
let a: <something> = ...
<avlondono>
I think the problem is that the type infered will be the last type declaring the field name, which is shared.
<avlondono>
there was some complete explanation of the reason in a thread in the caml-list.
<ketty>
well, the good side of this is that it forces me to modulize things :)
* avlondono
can't find the thread
<avlondono>
anyway I'm off. g'night.
<ketty>
nigth.. ^^
<ketty>
eh night :)
mikeX_ is now known as mikeX
dylan has joined #ocaml
dbueno_ has quit ["This computer has gone to sleep"]
mikeX has quit ["zzz"]
finelemon has joined #ocaml
<finelemon>
hello
finelemon has quit [Client Quit]
finelemon has joined #ocaml
revision17_ is now known as Revision17
jcreigh has joined #ocaml
Smerdyakov has quit ["Leaving"]
jcreigh has quit ["leaving"]
shawn has quit ["This computer has gone to sleep"]
ayrnieu has quit [Nick collision from services.]
ayrnieu_ has joined #ocaml
ayrnieu_ is now known as ayrnieu
shawn has joined #ocaml
pango is now known as pangoafk
andreas_ has joined #ocaml
pangoafk is now known as pango
love-pingoo has joined #ocaml
revision17_ has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
Skal has joined #ocaml
_JusSx_ has joined #ocaml
<andreas_>
hi
<ketty>
hello
Skal has quit [Remote closed the connection]
Tachyon76 has joined #ocaml
Skal has joined #ocaml
andreas_ has quit []
Pupeno has joined #ocaml
<Pupeno>
Hello.
<ketty>
hi
<Pupeno>
There's one ocaml compiler called ocaml right ?
<ketty>
mmm...
<ketty>
the command is named ocamlc
<Pupeno>
I meant the package, the software as a whole; is there any other ocaml compiler than ocaml on (this one: http://caml.inria.fr/ocaml/) ?
<ketty>
i vaguely remember hearing of another...
<ketty>
but i have never used any other
<sieni>
ocamlopt is the native code compiler
<sieni>
ocamlc generates byte code
<Pupeno>
ok.
<Pupeno>
And it is released under QPL... was there any good reasons to use QPL instead of GPL or some other more popular/known/"nicer" license ?
<sieni>
I don't think there's any other reason to use QPL besides "all your code are belong to us"
<sieni>
if you patch the compiler, you are supposed to give Inria the rights to use your patches in their commercial versions of Ocaml without any compensation.
<Pupeno>
I see :/
<zmdkrbou>
Pupeno: there's no "really" free compiler for ocaml
<sieni>
and of course there's always standard ml :-)
Schmurtz has joined #ocaml
<Pupeno>
Thank you.
Pupeno has left #ocaml []
andreas_ has joined #ocaml
_JusSx__ has joined #ocaml
_JusSx_ has quit [Read error: 110 (Connection timed out)]
Schmurtz has quit [Read error: 113 (No route to host)]
<ppsmimou>
sieni: I think you're wrong
<ppsmimou>
<sieni> if you patch the compiler, you are supposed to give Inria the rights to use your patches in their commercial versions of Ocaml without any compensation. << could you quote the relevant part of the license?
<ppsmimou>
ah I see
<love-pingoo>
ppsmimou: is that really the case ?
Tachyon76 has quit ["Leaving"]
ktne has joined #ocaml
<ktne>
hello everyone
<ktne>
i'm trying to follow an ocaml tutorial
<ktne>
and there is this line:
<ktne>
repeated "hello" 3
<ktne>
i enter this then i press enter
<ktne>
and then nothing happens
<ktne>
(the command doesn't appear to be parsed as there is no # cursor anymore)
<ktne>
maybe it needs something like ';' or '.'?
<ketty>
you need to write: repeated "hello" 3;;
<ktne>
why are those ";;" nowhere specified in any tutorial?
<ketty>
i don't know.. stupid tutorial? :)
<ktne>
not just this tutorial
<ktne>
most of them seem to
<ketty>
hmmm
<ktne>
ok this doesn't work either :)
<ktne>
let me paste..
<ketty>
ok
<ktne>
hmm, do you happen to know a paste service with ocaml highlight?
<ketty>
pastbin.be
<pango>
that example is not supposed to work out of the box
<pango>
it's just an example of syntax
<ktne>
oh
<ktne>
but it said that it was "hello world"-equivalent :)
<pango>
(maybe it should, you're not the first to try c&pasting it)
<pango>
repeated is not a standard function, it's just a valid name
<ktne>
why there are two ";;" at the end?, a single one is reserved for something else?
<pango>
yes, ; is sequence separator, as usual
<ketty>
";;" is almost only needed in the interactive top-level
<flux__>
almost?
<ketty>
well it is only strictly needed there..
<ktne>
why?
<ketty>
but some people seem to use it in files too
<ktne>
does it close the REPL loop too or something?
<pango>
ktne: yes, it triggers interpretation/evaluation/printing phases
<ktne>
ok
<ketty>
mm.. it is to allow you writing multiline stuff :)
<ktne>
hmm
<ktne>
:)
<pango>
or even to enter several declarations at once
<pango>
# let a = 3
<pango>
let f x = x + 2 ;;
<pango>
val a : int = 3
<pango>
val f : int -> int = <fun>
<ktne>
int_of_float, char_of_int, int_of_char
<ktne>
hmm
<ktne>
locutus_of_borg
_JusSx__ has quit ["leaving"]
<dylan>
type borg = Locutus of borg
<ktne>
is there any reason for ** instead of *.?
<flux__>
well
<flux__>
you might want to multiply numbers and not raise them to their nth power
<flux__>
:)
<ktne>
oh
<ktne>
:))
<ktne>
i don't understand one thing, what's the meaning of references if the language is pure functional?
<ketty>
it means the the language isn't pure functional :)
<ktne>
oh :)
<ski>
(in one sense, one can have references in pure functional style, too)
<ktne>
hmm
<ktne>
maybe.
<ski>
e.g. if i have a "current" list, and have indices that refer to elements in it, and pass around the current version of the list
<ski>
then those integer indices are a kind of references
<ktne>
ah
<ketty>
but are they mutable?
<ktne>
they probably wouldn't
<ski>
in that case, no
<ktne>
or at least not outside the current scope
<ski>
also, one can exchange the "current list" with the "current memory state/array" (or "current world state" for that matter :), and exchange "integer indices" that refer into the current list by "memory addresses/pointers" that refer into the current memory state/array
<ktne>
well that's just a vm implemented in a pure functional fashion :)
<ski>
of course, to get decent performance, one needs the "update-in-place optimisation", (which can safely be used purely if one in some way ensures the memory/world states are passed in a single-threaded fashion)
<ski>
:)
<ktne>
:)
<ketty>
but if they aren't mutable there is no difference from normal variables...
<flux__>
ski, such optimizations may be left for the compiler? when they advance enough in ten to twnty years or so.. ;)
<ski>
if single-threadedness is ensured, then the internal mutation isn't detectable, right
<ski>
flux__ : well, Clean does this today
<flux__>
ski, hm, with linear types?
<ski>
yes
<ski>
(Mercury does a similar thing)
<flux__>
I meant like you could map stuff and if the original list would never be used again, it could optimize that to a destructive operation
<flux__>
or does clean does exactly that?
<flux__>
s/does/do/2
<ski>
and Haskell ensures single-threadedness by hiding the states behind an abstract data type (the state/io monad)
<ski>
flux__ : it does :)
<flux__>
nice
<ktne>
ok, thanks for the help. cya :)
ktne has left #ocaml []
<flux__>
linear types would be nice in haskell, too
<ski>
i agree
<ski>
(or why not an ML variant ..)
<flux__>
ski, but you still need to tell the compiler which types are linear and which not?
<ski>
yes, .. one advantage of this is that one doesn't have to hope that compiler optimises it the way one wants, instead one either is sure or get a compile-time error
<ski>
though, many functions can be defined in a parametric way, so they work for both linear and non-linear arguments
<ski>
(e.g. append)
<ski>
(and of course the type inference works for linearity information, too)
<flux__>
it would be nice, though, that as an optimization all (remaining non-linear) values could be considered being of linear type, unless it wouldn't compile :)
<flux__>
dunno if it would really be a worthwhile optimization though
<flux__>
I think linearity in itself is more of a constraint tool than an optimizatino tool
<ski>
hm, could you clarify what you meant by that optimisation ?
<flux__>
replacing copying with destructive updates where possible
<ski>
you mean when run-time knows there's just one reference left ? (as opposed to compile-time knowledge of single reference)
<ski>
(some kind of thing for reference counting GC ?)
<flux__>
well let's say you've just created that list within your scope
<flux__>
that way you can be sure there are no references to it
<ski>
ah, yes
<flux__>
and similarly by other whole program optimization methods you could possibly identify unique instances of objects
<ski>
i know at least Mercury has this kind of analysis and optimisation (not sure how mature it is, though)
<ski>
one can of course approximate, when doing separate-compilation
<ski>
e.g. when you have local functions (that aren't returned as closures) that constructs a list or tree, and consumes it again
<flux__>
I actually might have code that could benefit from this kind of optimization greatly..
<flux__>
it generates a convex hull for a set of coordinates and then a set of squares that fill the area
<flux__>
and I needed to tune the vm parameters to make it real-time enough
<ski>
i guess this would be good for code with more than one pass (though deforestation would be even better, if applicable here)
<flux__>
region inference (I'm guessing that's the link?) is interesting also
<flux__>
is mlkit the only language that implements those?
<ski>
not sure
<flux__>
oh, mlton says they're not going to do it
<ski>
mhm
<ski>
one optimisation i'd love to be able to rely more on is tail-recursion(/call)-modulo-cons
descender has joined #ocaml
Tachyon76 has joined #ocaml
joshcryer has quit [Client Quit]
mikeX has joined #ocaml
Snark has joined #ocaml
descender has quit [herbert.freenode.net irc.freenode.net]
andreas_ has quit [herbert.freenode.net irc.freenode.net]
julbouln has quit [herbert.freenode.net irc.freenode.net]
pango has quit [herbert.freenode.net irc.freenode.net]
Bigb[a]ng has quit [herbert.freenode.net irc.freenode.net]
det has quit [herbert.freenode.net irc.freenode.net]
descender has joined #ocaml
andreas_ has joined #ocaml
julbouln has joined #ocaml
pango has joined #ocaml
Bigb[a]ng has joined #ocaml
det has joined #ocaml
Skal has quit [Remote closed the connection]
andreas_ has quit []
chimikal has quit [Read error: 110 (Connection timed out)]
<flux__>
it would be nice if one could say, when defining functions, that it is inteded to be tail recursive, or perhaps that a function application is supposed to be tail recursive
<flux__>
and receive compiler diagnostics if it isn't so
<mikeX>
constraint programming-like?
<ski>
i'd like language (or at least implementation) guarrantees on when one surely gets tail-recursion(/calls) better
<ski>
mikeX : huh ?
<mikeX>
nothing really, just wanted to say something
* mikeX
hides
<ski>
:)
Smerdyakov has joined #ocaml
<ski>
(flux__ : i.e. more or less like scheme (but maybe not required proper tail calls, just guarranteed local tail-recursion would be good, too))
piggybox has quit [Connection timed out]
Tachyon76 has quit [Read error: 113 (No route to host)]
det has quit [herbert.freenode.net irc.freenode.net]
julbouln has quit [herbert.freenode.net irc.freenode.net]
pango has quit [herbert.freenode.net irc.freenode.net]
descender has quit [herbert.freenode.net irc.freenode.net]
Bigb[a]ng has quit [herbert.freenode.net irc.freenode.net]
descender has joined #ocaml
julbouln has joined #ocaml
pango has joined #ocaml
Bigb[a]ng has joined #ocaml
det has joined #ocaml
mikeX_ has joined #ocaml
mikeX has quit [Nick collision from services.]
mikeX_ is now known as mikeX
mikeX_ has joined #ocaml
mikeX_ has quit [Client Quit]
mikeX has quit [Client Quit]
mikeX has joined #ocaml
piggybox has joined #ocaml
chimikal has joined #ocaml
love-pingoo has quit ["Leaving"]
smimou has joined #ocaml
love-pingoo has joined #ocaml
Tachyon76 has joined #ocaml
Tachyon76 has quit [Client Quit]
love-pingoo has quit ["Leaving"]
piggybox has quit [Connection timed out]
Schmurtz has joined #ocaml
pango is now known as pangoafk
love-pingoo has joined #ocaml
pangoafk is now known as pango
profmakx has joined #ocaml
permanente has quit [Read error: 110 (Connection timed out)]
finelemo1 has joined #ocaml
chad has joined #ocaml
_JusSx_ has quit ["leaving"]
finelemon has quit [Read error: 110 (Connection timed out)]
_JusSx_ has joined #ocaml
Snark has quit ["Leaving"]
<pango>
I wonder how costly are lazy values in ocaml
exa has joined #ocaml
exa has quit [Remote closed the connection]
profmakx has quit ["Lost terminal"]
profmakx has joined #ocaml
chad has quit [Read error: 104 (Connection reset by peer)]
piggybox has joined #ocaml
joshcryer has joined #ocaml
rillig has joined #ocaml
love-pingoo has quit ["Connection reset by by pear"]