twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
<tomprince>
pippijn: The description the the C interface documents it, I think. I wouldn't be suprised if it is 256-10. It probably uses a single byte, with some reserved values.
ulfdoz has quit [Ping timeout: 252 seconds]
MaskRay has quit [Ping timeout: 260 seconds]
Tobu has quit [Ping timeout: 272 seconds]
ankit9 has joined #ocaml
caligula_ has quit [Quit: Konversation terminated!]
<Ptival>
monomorphic parameterized variants are represented with an 8-bytes tag (256 values), the 10 missing ones being reserved as tomprince mentioned
<Ptival>
here you can see what the reserved tags are for
cago has joined #ocaml
djcoin has joined #ocaml
<flux>
typerex.org seems interesting
<flux>
wonder if it actually works.
ontologiae has joined #ocaml
Tobu has quit [Read error: Operation timed out]
* adrien
might try it but will also need vim support :P
<Ptival>
"It is designed to integrate easily in your favorite editor"
<Ptival>
lies!
<flux>
well, apparently it uses a separate process that would then interact with your editor
<flux>
if your editor doesn't support doing that, then I doubt it will easily integrate :)
<flux>
hmm, I wonder if it works with ocamlbuild
<flux>
or ocamlfind
<flux>
it mentions how to modify your Makefile to work with it..
<Ptival>
anyway, I've given up on vim for OCaml
<Ptival>
went emacs+evil
edwin has joined #ocaml
<flux>
ah, it has ocamlbuild instructions in the manual
<djcoin>
adrien: ahah vim FTW :) +1
<flux>
but no mention of ocamlbuild+ocamlfind
edwin has quit [Client Quit]
<djcoin>
Ptival: is evil good ? I used emacs + vimpulse a feqw years ago
<djcoin>
It was quite good
<Ptival>
djcoin: it's good enough, I wouldn't say perfect as I can feel some things are different
<Ptival>
the problem is sometimes it doesn't go well with other emacs stuff (for instance I have some issues with agda-mode)
<djcoin>
There are many things differents when you use advanced vim features as I can recall - of course I would say
<Ptival>
sure
eikke has joined #ocaml
mort___ has joined #ocaml
Ptival has quit [Read error: Connection reset by peer]
cyphase has joined #ocaml
Ptival has joined #ocaml
hnrgrgr has quit [Quit: leaving]
MaskRay has quit [Ping timeout: 260 seconds]
_andre has joined #ocaml
hnrgrgr has joined #ocaml
Ptival has quit [Read error: Connection reset by peer]
Ptival has joined #ocaml
emmanuelux has joined #ocaml
eikke has quit [Ping timeout: 244 seconds]
rby_ has quit [Remote host closed the connection]
Tobu has joined #ocaml
bacam_ is now known as bacam
foocraft_ is now known as foocraft
braibant has left #ocaml []
cdidd has joined #ocaml
rby has joined #ocaml
mort___ has quit [Quit: Leaving.]
ikaros has joined #ocaml
mfp has quit [Quit: Leaving]
edwin has joined #ocaml
thomasga has joined #ocaml
Drup has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
ulfdoz has joined #ocaml
Tobu has joined #ocaml
oriba has joined #ocaml
avsm has joined #ocaml
Tobu has quit [Read error: Operation timed out]
mort___ has joined #ocaml
Tobu has joined #ocaml
beckerb has joined #ocaml
letrec has joined #ocaml
eikke has joined #ocaml
<pippijn>
do people in ocaml use the $ operator like in haskell?
<pippijn>
let ($) a b = a b
<pippijn>
apparently, it's not in scope by default (if it's even defined anywhere)
<flux>
no, because it doesn't have the correct precedency and $ is used by camlp4 for something
<flux>
batteries defines **> (ugh), I've used @@ often
<pippijn>
ah
<pippijn>
flux: so @@ is the right precedence?
<flux>
I think so yes
<djcoin>
What is this operator supposed to mean ?
<flux>
it's the "avoid parenthesis" operator
<flux>
used like: fun1 arg1 arg2 @@ fun callback_argument -> "hello world"
<flux>
actually fun1 @@ fun _ -> fun2 @@ fun _ -> fun3 @@ fun _ -> "hello", indent it properly and you start to see why it can be preferable to using actual parenthesis :)
<flux>
also known as the apply-operator
<djcoin>
all right, thanks!
* adrien
hates paren-avoidance
<flux>
adrien, well, I take it you haven't written a lot of code in continuation-passing-style..
<flux>
actually I cannot see why this wouldn't be legal already: f arg1 arg2 fun argname -> .. - but perhaps it'd be a bit unclear, even though syntactically unambigious
<adrien>
indeed but to be more complete: I hate paren-or-newline-or-whatever-else avoidance
<adrien>
I was reading camllexer's code two days ago and I've really hated some things caused by what I'd call operator-abuse; that would have been fine with newlines or some indentation however
<adrien>
(this wifi connection loses packets all the time; "great" for IRC shells)
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<iZsh>
pippijn: you have <| in Batteries
<Drakken>
<| makes more sense given |>
<flux>
ah, <| is perhaps nicer, but it's an alias for **>. how about the precedency?
<flux>
I really should learn the ocaml precedency table by heart ;)
<iZsh>
unfortunately it's left afaik
<iZsh>
I use it when I only need one
<iZsh>
otherwise you have another one which acts like a pipe
<Drakken>
If I implement two similar functions with a function that takes several customizing functions as args, with the functions always be slowed down by all those extra function calls, or does the compiler inline them wherever possible?
<Drakken>
I mean _will_ the functions be slowed
mort___ has quit [Remote host closed the connection]
ankit9 has quit [Quit: Leaving]
<Drup>
about operator, is there a tricky way to define a binary operator with a greater priority than function application ? It doesn't seem possible "naturally"
<hcarty>
pippijn: It will work. I don't know if it will do what you want it to do. But it will work :-)
<pippijn>
it compiles..
<hcarty>
pippijn: Given that definition of compare, you could probably just use Pervasives.compare
<pippijn>
I want a deep compare
<hcarty>
Pervasives.compare will go as deep as it needs to
Cyanure has joined #ocaml
explodus has quit [Ping timeout: 265 seconds]
silver has quit [Remote host closed the connection]
mort___ has joined #ocaml
<thelema>
pippijn: if you need a deep compare of something not comparable by Pervasives.compare, you'll have to write it yourself. batteries 2.0 has a nice set of comparison combinators that make this easier.
explodus has joined #ocaml
<thelema>
pippijn: that said, strings, pairs, and lists are all properly supported by Pervasives.compare
<pippijn>
thelema: will I get a compiler error if something is not comparable?
antegallya has quit [Ping timeout: 248 seconds]
<pippijn>
I just hope it won't resort to comparing pointer values or something
<thelema>
pippijn: no, you won't.
<pippijn>
hm, ok
<thelema>
you'll either get incorrect runtime behavior (if you're comparing sets, for example)
<thelema>
or an exception at runtime, if you're comparing functions
<pippijn>
ok
<thelema>
the comparison functions don't compare pointers, afaik, there's no builtin way to get a pointer compare. You can get a pointer equality test, but no compare
oriba has quit [Quit: oriba]
eikke has quit [Read error: Operation timed out]
antegallya has joined #ocaml
ocp has quit [Read error: Operation timed out]
cago has quit [Quit: Leaving.]
ftrvxmtrx has quit [Quit: Leaving]
letrec has quit [Ping timeout: 252 seconds]
ulfdoz has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Ex-Chat]
ulfdoz has joined #ocaml
ikaros has joined #ocaml
Tobu has quit [Read error: Operation timed out]
Tobu has joined #ocaml
mort___ has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
iago has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
twittard has quit [Quit: twittard]
thomasga has quit [Quit: Leaving.]
pangoafk is now known as pango
<flux>
and afaik that's because xompacting gc can move pointers
<flux>
so it would be disastrouous to build, say, a set based on that :)
twittard has joined #ocaml
zuymanto has joined #ocaml
csmrfx has joined #ocaml
<csmrfx>
Is there a ocaml guide that is short, and perhaps suitable for a rubyist?
<bitbckt>
there's ocamlbrowser for local docs and ^^ on the web.
Xizor has joined #ocaml
<rwmjones>
csmrfx: ocamlbrowser is pretty terrible TBH; I use less /usr/lib/ocaml/*.mli
<csmrfx>
lol I couldnt even tell what ocamlbrowser is and what it is used for
<companion_cube>
on my distro I have man pages for the ocaml modules
<companion_cube>
man List, for instance
<csmrfx>
yes, seems I do too
mort___ has joined #ocaml
<bitbckt>
I just use the web for docs and open the source only when necessary.
<csmrfx>
ok, thanks, good deal! 8) plenty of reading to do here
<csmrfx>
Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile
Cyanure has quit [Quit: Quitte]
Cyanure has joined #ocaml
<csmrfx>
So is there a standard for OCaML?
<thelema>
csmrfx: only implied by the one implementation of it. And it's "OCaml".
fraggle_ has quit [Read error: Connection reset by peer]
<csmrfx>
So theres no standard? Is Ocaml the reference implementation?
<companion_cube>
exactly
<thelema>
csmrfx: OCaml is the only implementation. Even if there were a standard, OCaml adds new features pretty regularly, so...
<adrien>
there are some variants but these are mostly research stuff
<thelema>
yup, like jocaml and gcaml
<adrien>
(there are also branches on the ocaml svn)
<csmrfx>
Suppose I was writing an article on this. What could I use as an authoritative reference that tells about OCaml being the reference implementation?
<csmrfx>
Well I need a reference to the statement "OCaml is the reference implementation". Main !== reference
<Ptival>
reference implementation of what?
<csmrfx>
OCaml, as far as I understood correctly
<Ptival>
@__@
<thelema>
reference implementation of this simpler thing called "caml", which is not standardized, but which exists in the creators minds as a single thing implemented by many people
<Ptival>
well read the history page
<Ptival>
I wouldn't say that it's _the_ reference implementation of Caml though :\
<csmrfx>
Ok, so I must write: "OCaml has not been standardized."
<thelema>
yes
<thelema>
the only definition of what OCaml is supposed to do is what ocamlc accepts and does
<Ptival>
yes, it evolves as needs arise and according to some external feedback/contributions
fraggle_ has joined #ocaml
<csmrfx>
So, is ocaml just a subset of caml or a language of it's own?
<csmrfx>
Yes, I'm reading that, just wanted to get that cleared up.
<csmrfx>
Which statement is truest? OCaml is an extension of Caml -vs- OCaml is a new language based on Caml
<thelema>
I think extension
<thelema>
there are some minor functionalities that were lost in the conversion, but I don't think their loss is significant enough to say it's a new language.
<csmrfx>
Is a OCaml 'let definition of an identifier' same as variable?
<pippijn>
it doesn't vary
<pippijn>
so it's hardly variable
<thelema>
csmrfx: it's comparable, but fundamentally different.
<csmrfx>
Ok, not variable. Identifier.
<csmrfx>
Or?
<thelema>
variables are associated with a memory location, the value stored in which can be changed
<pippijn>
let definition of an identifier defines an identifier
<pippijn>
sounds sensible :)
<thelema>
let does "binding" of a value to a name, meaning that the value on the right can be referred to as the name on the left.
<thelema>
values are immutable, memory locations change
<csmrfx>
just checking - I wouldnt know if the manual uses those words in descriptive sense, or because in OCaml you call these 'identifier'.
<thelema>
"identifier" is just a name, such as a variable name or a field name or a module name.
<Ptival>
it is a "mathematical" variable, and not a computer's "assignable"
<pippijn>
is there an order defined for initialisation of global values?
<thelema>
pippijn: yes, the order they're declared
<Ptival>
pippijn: top to bottom of the file?
<pippijn>
and across modules?
<thelema>
pippijn: depends on link order
<pippijn>
ah
<thelema>
linking is done in a linear order, this defines the initialization order of the modules linked
<pippijn>
ok
<pippijn>
ocamlbuild does some topological ordering, so it's essentially random except for the topological order
<thelema>
pippijn: yes, ocamlbuild usually determines link order by topo-sorting, but the compiler takes a list of modules and links them in the order given
<csmrfx>
Do you call these expressions Caml frases, or just frases?
<thelema>
phrases
ocp has joined #ocaml
ocp has left #ocaml []
<csmrfx>
Which part needs the distinction between * and *. - compiler or parser? And why can't it infer that from the values of the terms of the phrase?
<thelema>
csmrfx: it infers the types of the values from the operator
<Ptival>
so it would be a type error to use one in place of the other
<csmrfx>
I guess instinctually I figured you could just infer op type from values 8=)
<Ptival>
you could in other settings
<thelema>
csmrfx: that's the idea of function overloading. type inference is the reverse
<csmrfx>
Hey howcome #ocaml doesn't have a ocaml bot?
<thelema>
csmrfx: it has had them at various times in the past, but noone is running one now.
<pippijn>
I seem to remember it did
<pippijn>
ok
<csmrfx>
ok
<Ptival>
rwmjones had this xavierbot
<Ptival>
I read about today
<adrien>
perl
<adrien>
iirc
<Ptival>
?
<csmrfx>
So data structures are composed of data types?
<thelema>
data structures are composed of values
<thelema>
data types define which values can combine to make a data structure
<csmrfx>
;)
<adrien>
Ptival: iirc, xavierbot is perl
<thelema>
type vs. value is an important distinction that is so simple it's easily forgotten
<csmrfx>
Ok, so value *has* a type?
<Ptival>
yes
<csmrfx>
only one, right?
<Ptival>
hum
<Ptival>
a polymorphic value can wear different types
<csmrfx>
but only one at once
<thelema>
values can be part of many types
<thelema>
types are just sets of values.
<csmrfx>
ok, so I cannot write for myself: the type system has basic types, thus a value has some type: bool|int|float|chat|string
<thelema>
Ptival: I don't think you can have a "polymorphic value"
<_habnabit>
thelema, the result of Marshal.from_string ?
<Ptival>
thelema: (I'm thinking of functions as values here...)
Submarine__ has quit [Remote host closed the connection]
<Ptival>
_habnabit: well, can you write let x = Marshal.from_string "...";; ?
<_habnabit>
yes?
<Ptival>
without any type annotation?
<thelema>
Ptival: functions have types as well, but the types for them are generally more complex.
<csmrfx>
I'll be damned if I can tell any difference between the definition between a tuple (ordered set), array (an ordered set) and a list (wait, its an ordered set, right?)
<thelema>
I guess [] is another example with a wierd type.
<thelema>
so there are values that are in many types...
<csmrfx>
perhaps a value has one type at any given moment in time?
<thelema>
csmrfx: tuples are fixed length and can have different types at different positions
<Ptival>
csmrfx: a tuple can have heterogenous values
<thelema>
csmrfx: the compiler can treat some values as having undeterminate type.
<_habnabit>
# let x = Marshal.from_string (Marshal.to_string None []) 0;;
<_habnabit>
val x : 'a = <poly>
<_habnabit>
Ptival, ^
<Ptival>
_habnabit: ok :)
<csmrfx>
ah well, I'll just write that the type system has these types
<Ptival>
what are you writing?
<thelema>
csmrfx: arrays and lists are mostly different in the efficiency of various operations on them.
<thelema>
csmrfx: because of their underlying representation. But they are similar at that level.
<csmrfx>
Ptival: writing because it helps to *really* learn, also as future reference for myself and others, in an article on fi wikipedia: https://fi.wikipedia.org/wiki/Objective_Caml
<Ptival>
thelema: well arrays are fixed-length and lists aren't?
<csmrfx>
(the article was 3 lines when I started)
<thelema>
Ptival: both are fixed length
<Ptival>
thelema: ok I see what you mean
ikaros has quit [Quit: Ex-Chat]
<csmrfx>
Hm, are functions data types?
<thelema>
csmrfx: functions are values
<thelema>
they have types
<csmrfx>
ok, just checking 8)
oriba has joined #ocaml
<csmrfx>
Kind of weird btw that the ocaml manual chapter 3 keeps talking about Caml this and Caml is and so on
<thelema>
csmrfx: the objects chapter?
<csmrfx>
Should that be called Caml system? or can one call it OCaml