adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
tennix has quit [Ping timeout: 255 seconds]
palomer has joined #ocaml
<Drup> dmbaturin: how is that different with or without lwt ?
<palomer> hey guys
<dmbaturin> Maelan: I wish I could get a typed lambda calculus course myself rather than trying to build a coherent picture piece by piece. :)
<palomer> I’ve been reading through some ocaml code and I keep seeing the @@ operator
<Drup> palomer: "f @@ x" ≡ "f x"
<palomer> what’s the point?!?!?!!
<dmbaturin> palomer: val (@@) : ('a -> 'b) -> 'a -> 'b
<dmbaturin> palomer: To avoid parentheses.
<Drup> palomer: f @@ g @@ x ≡ f (g x)
<palomer> ahhhh
<palomer> looks like haskell :)
<Drup> It's $ in haskell
<palomer> so we don’t like parentheses anymore?
<dmbaturin> palomer: There's also |> : 'a -> ('a -> 'b) -> 'b
<dmbaturin> x |> f |> g
<palomer> x |> f |> g = g(f(x)) ?
<dmbaturin> Yep.
<dmbaturin> Drup: Well, I'm not sure if I can always make something use Lwt_io functions instead of uncooperative versions.
<dmbaturin> palomer: Sometimes @@ and |> can save you from excessive parentheses proliferation. :)
<Drup> by throwing you into excessive operator proliferation :D
AltGr has joined #ocaml
<dmbaturin> Parens or operators? Choose sides carefully!
empyrean has joined #ocaml
<dmbaturin> Drup: What I mean is that I don't want to invent a wire protocol, but I do need to pass JSON-encoded messages of arbitrary length. What's the best practice for this?
jwatzman|work has quit [Quit: jwatzman|work]
browncodes has quit [Ping timeout: 268 seconds]
<Drup> I don't really have an answer for you
<Drup> (mostly because I don't really understand the issue ...)
<Drup> (but, again, I'm mostly clueless about IO)
jeffmo has quit [Quit: jeffmo]
<palomer> anyone here tried the websocket module from OPAM?
<dmbaturin> The issue is that I need to know when to stop reading. :)
<dmbaturin> Or know how many bytes to read in advance.
igoroliveira has quit [Quit: Connection closed for inactivity]
nopf has quit [Ping timeout: 246 seconds]
luigy has quit [Ping timeout: 250 seconds]
nopf has joined #ocaml
luigy has joined #ocaml
gustav___ has quit [Ping timeout: 260 seconds]
gustav___ has joined #ocaml
swgillespie has joined #ocaml
rgrinberg1 has quit [Ping timeout: 255 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tmtwd has quit [Ping timeout: 240 seconds]
tmtwd has joined #ocaml
ousado_ has joined #ocaml
ousado has quit [Ping timeout: 240 seconds]
<palomer> I found this code in the websocket module source tree: (ignore @@ server uri; fst @@ Lwt.wait ());
<palomer> I don’t see the point of having the fst there
<palomer> it’s the same as ignore (server uri; fst (Lwt.wait ()), which is the same as ignore (server uri; Lwt.wait())
<palomer> unless I’m missing something
<Drup> palomer: pretty sure you got the parens wrong
<Drup> it's (ignore ...) ; (fst ...)
<palomer> ahhhh
<palomer> so @@ binds tighter than ;
echo-area has quit [Remote host closed the connection]
obadz has quit [Ping timeout: 240 seconds]
obadz has joined #ocaml
higgs has quit [Ping timeout: 240 seconds]
higgs has joined #ocaml
higgs has quit [Ping timeout: 240 seconds]
swgillespie has joined #ocaml
palomer has quit [Quit: palomer]
rgrinberg1 has joined #ocaml
palomer has joined #ocaml
Algebr has joined #ocaml
tennix has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
<bernardofpc> re containersLabels (even if I'm not a big user of CC*), I feel it makes more sense with ipython-notebook-type completion; for example, will merlin show the ~f:(a->b->a) in TypeEnclosingExpression ?
jimt has quit [Ping timeout: 240 seconds]
echo-area has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
gabemc has joined #ocaml
higgs has joined #ocaml
rgrinberg1 has joined #ocaml
<palomer> uhhh, what?
higgs has quit [Ping timeout: 240 seconds]
higgs has joined #ocaml
huza has joined #ocaml
higgs has quit [Ping timeout: 240 seconds]
darkf has joined #ocaml
higgs has joined #ocaml
higgs has quit [Client Quit]
Algebr has quit [Remote host closed the connection]
steshaw has quit [Quit: Connection closed for inactivity]
Algebr has joined #ocaml
empyrean has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tmtwd has quit [Ping timeout: 260 seconds]
Algebr has quit [Remote host closed the connection]
mac10688 has quit [Ping timeout: 268 seconds]
gabemc has quit [Ping timeout: 272 seconds]
sh0t has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
sh0t has quit [Ping timeout: 246 seconds]
gabemc has joined #ocaml
swgillespie has joined #ocaml
swgillespie has quit [Max SendQ exceeded]
swgillespie has joined #ocaml
tmtwd has joined #ocaml
contempt has quit [Remote host closed the connection]
rgrinberg1 has quit [Ping timeout: 240 seconds]
rgrinberg1 has joined #ocaml
contempt has joined #ocaml
psy_ has quit [Ping timeout: 240 seconds]
nullcatxxx_ has joined #ocaml
psy_ has joined #ocaml
MercurialAlchemi has joined #ocaml
yurug has joined #ocaml
yurug1 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
yurug has quit [Ping timeout: 240 seconds]
yurug has joined #ocaml
yurug1 has quit [Read error: Connection reset by peer]
tmtwd has quit [Ping timeout: 240 seconds]
lagrangi-wan has quit [Quit: F...ix you, Emacs.]
rgrinberg1 has quit [Ping timeout: 264 seconds]
sivoais has quit [Ping timeout: 256 seconds]
sivoais has joined #ocaml
Denommus` has joined #ocaml
blik71 has joined #ocaml
Denommus has quit [Ping timeout: 255 seconds]
<blik71> hey can someone take a look at my code really quick, I'm new to Ocaml and wanted to know why I am getting an unbound value exception during a particular function call
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
sivoais has quit [Ping timeout: 264 seconds]
obadz has quit [Ping timeout: 256 seconds]
obadz has joined #ocaml
sivoais has joined #ocaml
<dmbaturin> blik71: Sure.
sivoais has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sivoais has joined #ocaml
<blik71> thanks but i figured it out i was returning a list instead of an int lol
tennix has quit [Quit: WeeChat 1.3]
jimt has joined #ocaml
yurug has quit [Ping timeout: 240 seconds]
blik71 has quit [Ping timeout: 240 seconds]
rgrinberg1 has joined #ocaml
yurug has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Denommus` has quit [Read error: Connection reset by peer]
Denommus` has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
yurug has joined #ocaml
palomer has quit [Quit: palomer]
<companion_cube> bernardofpc: labels belong in types, so merlin should show them
yurug has quit [Ping timeout: 250 seconds]
nullcatxxx_ has joined #ocaml
yurug has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 240 seconds]
yurug has quit [Ping timeout: 250 seconds]
yurug has joined #ocaml
obadz has quit [Ping timeout: 268 seconds]
tane has joined #ocaml
obadz has joined #ocaml
Haudegen has joined #ocaml
damason has quit [Ping timeout: 255 seconds]
jeffmo has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
rgrinberg1 has joined #ocaml
yurug has quit [Ping timeout: 272 seconds]
rgrinberg1 has quit [Ping timeout: 268 seconds]
ely-se has joined #ocaml
obadz has quit [Ping timeout: 250 seconds]
obadz has joined #ocaml
tennix has joined #ocaml
willy__ has joined #ocaml
willy_ has quit [Ping timeout: 240 seconds]
keen______ has joined #ocaml
yurug has joined #ocaml
keen_____ has quit [Ping timeout: 264 seconds]
Krikey_Sanchez has joined #ocaml
<Krikey_Sanchez> I'm just learning ocaml coming from a haskell background
<Krikey_Sanchez> how do I define a type that has a variant that is a list of a type variable?
<def`> Not sure what you mean
<dmbaturin> Krikey_Sanchez: type 'a foo = Foo of 'a | Bar of 'a list
<def`> but 'type 'a t = Variant of 'a list'
<Krikey_Sanchez> does ocaml use capitalization syntactically?
<Krikey_Sanchez> like, do type names have to be lowercase?
<dmbaturin> Yes, it does.
<def`> yes
<def`> only value constructors and modules names are capitalized
<dmbaturin> Type constructors have to be lowercase, and data constructors have to be capitalized.
<flux> significant case? what's next, significant whitespace?!
<def`> :)
<flux> but actually I don't mind it at all
<flux> it is the very smallest consistent style guide for the whole of ocaml.. :)
antkong has quit [Quit: antkong]
<flux> krikey_sanchez, module names (and module type names, even as module arguments) and constructors begin with an uppercase letter, all others start with a lowercase or an underscore
<flux> re significant whitespace: f# seems to have gotten rid of some of the crud in ocaml by opting to use it..
<dmbaturin> Type variables start with apostrophe.
<flux> case in point: match inside a match
<flux> but I don't know, maybe the f# syntax has its downsides, I haven't actually tried writing it
<Krikey_Sanchez> man, mandatory-lowercase type names
<Krikey_Sanchez> that is weird to me
<def`> flux: not module types (language corner cases) >/dev/null
<dmbaturin> Krikey_Sanchez: More weird than mandatory capitalized type names? :)
<flux> def`, well that was hardly because of the whitespace syntax :)
<Krikey_Sanchez> it's just that I'm used to the haskell way of doing things :)
<def`> flux: what?
<flux> def`, I doubt F# dropped the module system because they opted to use significant whitespace
<def`> flux: I mean module types names in OCaml have no lexical restrictions
<dmbaturin> flux: The biggest problem is that neither syntax allows to recover the intended meaning in nested matches and the like.
<flux> def`, oh
<flux> def`, I hadn't noticed :-)
<Krikey_Sanchez> also, it seems like ocaml will let me write either pure functional code, or object-mutating code
<Krikey_Sanchez> and I'm not sure which I should pick
<def`> they might be the only kind of unrestricted identifier :D (polymorphic variants too)
<flux> I guess the same kind of 'oh' that polymorphic variants can start with lowercase
<def`> yes
<Krikey_Sanchez> I'm trying to write a bloom filter
<flux> I understand that's mostly an oversgiht that cannot be fixed
<def`> no better explanation than 'it was possible' (or LR was ok)
<Krikey_Sanchez> and I don't know if it's better to use the object syntax and have methods that update an internal data structure
<Krikey_Sanchez> or write haskell style functions that take a filter value and return a new filter value
<dmbaturin> Krikey_Sanchez: You can even write reference mutating code without any objects if you feel like it. Or record field mutating (foo.myfield <- value).
<flux> krikey_sanchez, I wouldn't probably use object style for algorithmic code
<def`> Krikey_Sanchez: for a bloom filter, pure data structure seems inappropriate
<def`> Just use module abstractions
<Krikey_Sanchez> so yeah I don't entirely undrestand modules yet
<Krikey_Sanchez> I have the tutorial page on them open now
<Krikey_Sanchez> it seems like it's intended as a namespacing scheme
<flux> I think you don't really need to understand much about them for writing a bloom filter
<def`> opaque type and a bunch of functions in the signature, you can use mutation and no objects in the implementation
<def`> yep
<Krikey_Sanchez> by signature you mean the stuff between struct and end in the module def?
<def`> yes, the interface if you prefer
<dmbaturin> I think F# dropped both modules and ocaml-style objects to simplify full interoperability with other .Net languages that all use object system imposed by .Net
<Krikey_Sanchez> so, I can define some function: let insert filter value = ...
<Krikey_Sanchez> and write it in such a way that I mutate the value passed to filter
<Krikey_Sanchez> and not just return a new filter?
<ely-se> you can efficiently represent an immutable bloom filters
<ely-se> yes Krikey_Sanchez you can do that, and return unit
<Krikey_Sanchez> so syntactically, I can either mutate the value, or return a new value, just like in an ordinary imperative language
<Krikey_Sanchez> is there a preferred style?
<Krikey_Sanchez> are there performance impacts for writing mutable vs immutable code?
<def`> preferred style is to isolate mutations
<def`> you can use them if they have clear
<def`> boundaries
<ely-se> because OCaml does not limit the number of references to mutable data (unlike e.g. Rust), it can easily become difficult to keep track of who sees your mutations. hence immutability is generally preferred
<Krikey_Sanchez> ok
<dmbaturin> Krikey_Sanchez: There are three ways to write a signature. It can be in an .mli file, it can be defined as "module type Foo = sig ... end", or it can be embedded ("module Foo : sig ... end = struct ... end").
<def`> (think ST monad in haskell, but not appearing in the signature)
<def`> (although OCaml style is more liberal about side effects :))
<Krikey_Sanchez> so the signature is basically a large type definition?
<Krikey_Sanchez> like, a module has a type that is the type of every value and function in it?
Kakadu has joined #ocaml
<def`> yes, thats the point of module system: a second type system to talk about type and terms from the expression language
<dmbaturin> Krikey_Sanchez: The module language is kinda separate from the core languages. Modules are its "values" and signatures are their types, kind of.
<ely-se> the signature of the module is not the type of the values in the module
<ely-se> but it does specify what the types of each of those values are
<dmbaturin> Krikey_Sanchez: Also, "functor" in ocaml refers to a module parameterized by a signature that can be instantiated with different modules that match that signature.
<def`> it is highly expressive but comes without inference, is more verbose, etc...
<ely-se> can you encode linked lists with modules and functors? :p
<Krikey_Sanchez> as an aside, how do I insert a value into a list?
<ely-se> 1 :: [2, 3, 4]
<Krikey_Sanchez> mutably, I mean
<Krikey_Sanchez> or is there no way to do that?
<ely-se> can't, lists are immutable
<dmbaturin> Lists are immutable.
<flux> you can of course wrap a list inside a reference and mutate that reference
<dmbaturin> Lists are just "type 'a list = [] | (::) of 'a * 'a list", in imaginary syntax.
<ely-se> I wish "ref 1 = ref 1" were false :[
<Krikey_Sanchez> what's the equivalent of ":l <filename>" in the repl?
obadz has quit [Ping timeout: 240 seconds]
<MasseR> Krikey_Sanchez: #use "filename"
<dmbaturin> ;;
<MasseR> But it reads the file as is, so the outer module is not recognized
<MasseR> As in, if you have foo.ml with a function foo, you won't invoke it with Foo.foo, but foo
<def`> #mod_use to preserve module
obadz has joined #ocaml
<dmbaturin> #use is equivalent to pasting the contents of the file into the REPL.
<ely-se> watched a video of a guy using a typewriter connected to a computer as a REPL yesterday
sh0t has joined #ocaml
willy__ has quit [Read error: Connection reset by peer]
BitPuffin|osx has quit [Ping timeout: 246 seconds]
willy__ has joined #ocaml
bitbckt has quit [K-Lined]
bitbckt has joined #ocaml
rgrinberg1 has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
gabemc has quit [Ping timeout: 256 seconds]
rgrinberg1 has quit [Ping timeout: 240 seconds]
<ely-se> I love how he enters ⌹ as ⎕, backspace, ÷
obadz has quit [Ping timeout: 246 seconds]
obadz has joined #ocaml
obadz has quit [Changing host]
obadz has joined #ocaml
<dmbaturin> ely-se: Well, that's what backspace was for.
<ely-se> My favourite APL program: {⎕←⍵⋄∇⌽⍵}'dog'
<mrvn> Which prints out cat?
yurug has quit [Read error: Connection reset by peer]
yurug1 has joined #ocaml
sh0t has quit [Ping timeout: 246 seconds]
<ely-se> repeatedly prints "dog" and "god"
<mrvn> I think I'm loosing something to transscription errors
<dmbaturin> "APL was a mistake carried through to perfection"
<ely-se> Not to mention Conway's Game of Life: {↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
<dmbaturin> ely-se: What does it take as input?
<ely-se> a matrix
<dmbaturin> How do you pass it the glider, for instance?
<ely-se> draw the glider in the matrix
<ely-se> glider ← (3 3⍴⍳9)∊3 4 6 8 9
<ely-se> 1 means a cell, 0 means empty
<ely-se> the function then performs one step of the game and returns the resulting matrix
zpe has joined #ocaml
tane has quit [Quit: Verlassend]
ely-se has quit [Quit: leaving]
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
ely-se has joined #ocaml
tane has joined #ocaml
jonludlam has joined #ocaml
rgrinberg1 has joined #ocaml
mea-culpa has joined #ocaml
rgrinberg1 has quit [Ping timeout: 264 seconds]
zpe has quit [Remote host closed the connection]
ineol has joined #ocaml
rand__ has joined #ocaml
yurug has joined #ocaml
yurug1 has quit [Ping timeout: 256 seconds]
ely-se has quit [Quit: lunch]
pobivan has joined #ocaml
Guest85634 is now known as johnelse
pobivan has left #ocaml [#ocaml]
AltGr has left #ocaml [#ocaml]
Haudegen has quit [Ping timeout: 244 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
Denommus` has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
ely-se has joined #ocaml
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Verlassend]
zpe has joined #ocaml
obadz has quit [Ping timeout: 252 seconds]
obadz has joined #ocaml
ollehar has joined #ocaml
yurug has quit [Ping timeout: 260 seconds]
_andre has joined #ocaml
echo-area has quit [Read error: Connection reset by peer]
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
Simn has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
xet7_ has quit [Ping timeout: 240 seconds]
xet7_ has joined #ocaml
yurug has joined #ocaml
ggole has joined #ocaml
xet7_ has quit [Ping timeout: 268 seconds]
xet7_ has joined #ocaml
tennix has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
xet7_ has quit [Read error: Connection reset by peer]
xet7_ has joined #ocaml
lmaocaml has joined #ocaml
<lmaocaml> Why is there not integer types of various sizes and singnedness not there in stdlib?
<lmaocaml> writing numerical code ocaml = SUPER painful.
<lmaocaml> And the int type is machine dependent ...
<lmaocaml> How do people deal with these issues?
rgrinberg1 has joined #ocaml
<Drup> lmaocaml: you have better control over your integers when you store them inside bigarrays, so the storage part is not an issue. integer types are mostly used for storage issues
<lmaocaml> all integer arithmetics depend on the size of integers...
<lmaocaml> how is not that an issue?
<Drup> Do you have a concrete issue where you would want smaller/unsigned integers for arithmetic purposes ?
<lmaocaml> yes, marshalling data for e.g.
<Drup> so storage.
<lmaocaml> also compression algos
<Drup> It's not for computing
<lmaocaml> It = ocaml?
<Drup> the small integers
<lmaocaml> where are small integers?
rgrinberg1 has quit [Ping timeout: 240 seconds]
xet7_ has quit [Ping timeout: 240 seconds]
xet7_ has joined #ocaml
<enjolras_> you cn use a lib for mashalling. Or write your own. Integer szefor mashalling are part of the serialize/unserialize function
<Drup> Ok, let me rephrase that into a more coherent sentence: Most usages of small integers are not computing, they are storage optimization (including the example you gave). If you want this storage optimization, you can use the Bigarray module and have precise control over the array layout. If it's really for computing, then there are external libraries.
<mrvn> lmaocaml: integers in ocaml are 31/63 bit. In algorithms you usualy need 32/64 bit and then you have the Int32/Int64 modules in stdlib and UInt32/UInt64 outside.
<lmaocaml> those are boxed..
<Drup> lmaocaml: locally unboxed inside function body when you do computation
<Drup> (there is uint package in opam, for example)
<mrvn> Are int64 boxed inside an array or are they stored liek float array?
<lmaocaml> is this some optimization?
<lmaocaml> i thought they were boxed everywhere.
<Drup> lmaocaml: yes, it's an optim
<mrvn> lmaocaml: yes, float arrays don't have boxed floats
<lmaocaml> Drup: that library is hard to use.
<ggole> int64 arrays are boxed
<lmaocaml> i wish we had operator overloading
<ggole> (Elements of them are, I mean.)
<mrvn> lmaocaml: we do.
<lmaocaml> only for floats..?
<mrvn> lmaocaml: just only one overload at a time. Not in parallel.
<ggole> That could probably be changed if it were important.
<mrvn> let ( + ) = ( * ) (* overload *)
ollehar1 has joined #ocaml
<lmaocaml> yeah not really useful.
<lmaocaml> when you are using all sizes of ints.
<ggole> int64 and double have the same representation and GC treatment but need different interpretations for polymorphic equal, comparison, etc
<Drup> lmaocaml: this library is not very well defined :/
<lmaocaml> and i have to call functions with qualifiers for some basic arithmetic.
<lmaocaml> the code is fucking ugly :(
<Drup> lmaocaml: you can use local open, it makes thing easier
<Drup> let me show you
<lmaocaml> not really
<mrvn> lmaocaml: you usualy use ints of a specific size and then you can do let ( + ) = IntXY.( + )
<Drup> mrvn: No
<mrvn> lmaocaml: or define +..
ollehar has quit [Ping timeout: 252 seconds]
ollehar1 is now known as ollehar
<lmaocaml> mrvn: that is what the problem is..
<mrvn> Drup: no what? YOu don't usualy use ints of a specific size?
<lmaocaml> no overloading = crazy infix functions
<Drup> mrvn: no, what you are saying is a bad method
<mrvn> Drup: not my call to make
<lmaocaml> Drup: how would you do this?
<Drup> please let me finish
<Drup> it will work with all the modules in ocaml-uint
<Drup> you can enrich it with all the operators
<mrvn> Drup: same idea, much better syntaxtic suggar
<Drup> mrvn: yes, but the sugar is the important part here
<lmaocaml> hmm, nice. But i have to add u16 to u8 for e.g.
<lmaocaml> so there is an upcast involved.
<Drup> lmaocaml: you will have to perform the upcasts yourself, but that's the ocaml way :)
<mrvn> Drup: In my module I made a module Infix = ... and then used IntXY.Inffix.(). But a functor is a nicer idea.
<lmaocaml> Drup: thanks for the tip to use functors over that crazy library.
<lmaocaml> it will be a little more cleaner.
<Drup> ah, actually, the functor is provided by uint already
<mrvn> lmaocaml: You could go real crazy and make objects
<lmaocaml> also what's the cost of calling ffi?
<lmaocaml> those are all ffi..
<mrvn> lmaocaml: for u8 it's high. for 1024bit integers its negible.
<lmaocaml> LOL
<Drup> (comparatively to the computation)
<mrvn> (naturally)
<mrvn> What FI do you use for u8?
<lmaocaml> Hence my original question of why these are not primitve types.
<lmaocaml> mrvn: some compression schemes and dsp algos.
<mrvn> lmaocaml: simple answere: The compiler didn't need them.
<mrvn> lmaocaml: I would think they would act on a block of data. Not single ints.
<mrvn> val compress : option list -> string -> string
<ggole> OCaml isn't really designed for numeric computation
ollehar has quit [Ping timeout: 246 seconds]
<lmaocaml> would any work on fixing the runtime would be considered upstream?
rand__ has quit [Quit: leaving]
<mrvn> but it's great when you can offload the computation to C in chunks. Then you can even release the runtime lock and make use of multiple cores.
sepp2k has joined #ocaml
<lmaocaml> mrvn: that's like saying write all critical parts in C..
<mrvn> lmaocaml: there is a uint library already. What's there to fix?
<lmaocaml> mrvn: the overhead...
ely-se has quit [Quit: leaving]
<Drup> lmaocaml: There is something I don't understand. Why do you want to compute on small ints ?
<Drup> just compute on "normal" integers and store them small in a bigarray
<mrvn> lmaocaml: is there any? Have you checked the generated code?
<mrvn> Drup: you might have to add extra "mod 256" in the code.
<lmaocaml> Drup: some of operations like 2s complement needs to be implemented by hand.
<mrvn> lmaocaml: there is -a and not a.
<lmaocaml> for small ints.
<mrvn> xor 0xff
<lmaocaml> yeah exactly
<mrvn> no C call involved
<lmaocaml> so you would have to do these things which the arch does already?
<mrvn> lmaocaml: that belongs in the UInt module
<lmaocaml> so if you add 2 instructions per simple int arith, iot amounts a lot for computations.
dhil has joined #ocaml
<mrvn> lmaocaml: what 2 instructions? So far we've added 0
<lmaocaml> you are doing xor.
<mrvn> no, I'm doing not on the large int.
<lmaocaml> yes and then the xor.
<mrvn> no.
<mrvn> For Int8 I do not, for UInt8 I do xor.
<ggole> Hmm, is writing to a Bigarray defined to truncate? It seems to in practice.
<lmaocaml> I am writing an emulator, where i have to do these things manually i find it painful.
<mrvn> or maybe I always do not. Would have to check if that works out everywhere.
<mrvn> ggole: it truncates to the storage size.
<mrvn> ggole: I've written support for int31 for BigArray and that truncates to 32bit. Which means on 64bit archs you can store 32bit and get them back and on 32bit you only get 31bit back.
ollehar has joined #ocaml
<lmaocaml> Ah, now i see my code, i am doing this 2s complement because i don't want to waste 4 bytes when all i need is a single byte.
<mrvn> lmaocaml: for a single value or a large block of them?
<mrvn> lmaocaml: Note: UInt8 is stored as 8 byte.
<lmaocaml> for a range of memory.
<mrvn> lmaocaml: then use BigArray and it will truncate u8 to bytes when storing.
<lmaocaml> mrvn: yeah so when you add, subtract diff size of integers you ahve to do this funky business.
<mrvn> lmaocaml: Nope. you just let it overflow and the lower 8 bit remain correct.
<mrvn> At least for u8, for signed int the over/underflow is undefined behaviour.
ely-se has joined #ocaml
xet7_ has quit [Ping timeout: 255 seconds]
xet7_ has joined #ocaml
libertas has joined #ocaml
<lmaocaml> Ah, it seems the problem is i need a sint library
<lmaocaml> so things like u16 + s8 works properly.
BitPuffin has joined #ocaml
<mrvn> if "type u16 = private int type s8 = private int" then "let sum = U16.of_int (u16 + s8)"
<mrvn> or not?
<lmaocaml> those are memory loc.
<lmaocaml> so i want to avoid storing 4x size data.
<lmaocaml> so the u16 is reg and and the s8 is memory
<mrvn> you would store them compact in BigArray but large in values.
<ggole> Unless you want structs rather than arrays
<ggole> OCaml doesn't really have a good story there
<ely-se> mrvn: sharks are smarter than most people.
<ggole> Indeed. I've never head of a shark dying from a selfie.
<ely-se> I should dye my hair.
<mrvn> ggole: doh, wrong precedence :)
<lmaocaml> seems like BigArray should help, i am using 'a array.
<mrvn> 'a array uses values so they will be 4/8 byte.
<ely-se> lol "lmaocaml"
tennix has joined #ocaml
tennix has quit [Client Quit]
igoroliveira has joined #ocaml
<lmaocaml> i was using U8.t array from the ocaml-uint package; so had to these conversions.
orbitz_ has quit [Quit: Reconnecting]
<lmaocaml> I will switch things :)
orbitz has joined #ocaml
<lmaocaml> Thanks.
<lmaocaml> ely-se: ?
<ely-se> funny nickname
rgrinberg1 has joined #ocaml
<lmaocaml> :/ couldn't make it palindrome
<ely-se> good good. let the disappointment flow through you
<ggole> Laughing My Ass Off Can't Appreciate ML
<lmaocaml> ggole: Exactly!
<ely-se> holy guacceggole
rgrinberg1 has quit [Ping timeout: 268 seconds]
xet7_ has quit [Ping timeout: 256 seconds]
rgrinberg1 has joined #ocaml
<mrvn> lmaocaml: Laughing My Ass Cheeks Off Can't Appreciate ML
<lmaocaml> And it's already morning.. :D
MercurialAlchemi has joined #ocaml
keen_______ has joined #ocaml
Guest17580 has joined #ocaml
keen______ has quit [Ping timeout: 246 seconds]
<lmaocaml> alright, gotta go, see you later. This channel is surprisingly active.
<lmaocaml> :D
lmaocaml has quit [Quit: Page closed]
ineol has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ollehar> "surprisingly"?
<ollehar> hmpf
ineol has joined #ocaml
ely-se has quit [Quit: leaving]
yurug has quit [Ping timeout: 240 seconds]
jonludlam has quit [Ping timeout: 268 seconds]
Guest17580 has quit [Remote host closed the connection]
Guest17580 has joined #ocaml
ely-se has joined #ocaml
Guest17580 has quit [Remote host closed the connection]
jonludlam has joined #ocaml
Guest17580 has joined #ocaml
Tekilla has joined #ocaml
ollehar has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
marsam has joined #ocaml
rgrinberg1 has quit [Ping timeout: 268 seconds]
rgrinberg1 has joined #ocaml
xet7_ has joined #ocaml
Guest17580 has quit [Read error: Connection reset by peer]
Denommus has joined #ocaml
<companion_cube> I agree that the lack of numeric types is annoying
<companion_cube> like uint8, uint32...
nullcatxxx_ has joined #ocaml
ely-se has quit [Quit: leaving]
cball has quit [Ping timeout: 240 seconds]
ely-se has joined #ocaml
ely-se has quit [Client Quit]
xet7_ has quit [Ping timeout: 240 seconds]
jonludlam has quit [Ping timeout: 244 seconds]
psy_ has quit [Ping timeout: 246 seconds]
palomer has joined #ocaml
shinnya has joined #ocaml
ely-se has joined #ocaml
cball has joined #ocaml
jonludlam has joined #ocaml
palomer has quit [Quit: palomer]
rgrinberg1 has quit [Ping timeout: 252 seconds]
ollehar has quit [Ping timeout: 250 seconds]
ely-se has quit [Quit: leaving]
rgrinberg1 has joined #ocaml
marsam has quit [Read error: Connection reset by peer]
marsam has joined #ocaml
libertas has quit [Ping timeout: 240 seconds]
darkf has quit [Quit: Leaving]
yurug has joined #ocaml
slash^ has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
zpe has quit [Remote host closed the connection]
_berke_ has joined #ocaml
palomer has joined #ocaml
palomer has quit [Client Quit]
rgrinberg1 has joined #ocaml
marsam has quit [Read error: Connection reset by peer]
marsam has joined #ocaml
tane has joined #ocaml
palomer has joined #ocaml
xet7_ has joined #ocaml
xet7_ has quit [Read error: Connection reset by peer]
ely-se has joined #ocaml
xet7_ has joined #ocaml
nicoo_ has joined #ocaml
larhat1 has joined #ocaml
palomer_ has joined #ocaml
DanielRi1hman has joined #ocaml
Lasher`_ has joined #ocaml
gperetin_ has joined #ocaml
palomer has quit [Ping timeout: 244 seconds]
IbnFirnas has quit [Ping timeout: 244 seconds]
palomer_ is now known as palomer
nicoo has quit [Ping timeout: 244 seconds]
Lasher` has quit [Ping timeout: 244 seconds]
eikke has quit [Ping timeout: 244 seconds]
DanielRichman has quit [Ping timeout: 244 seconds]
ineol has quit [Ping timeout: 244 seconds]
dhil has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
gperetin has quit [Ping timeout: 244 seconds]
larhat has quit [Ping timeout: 244 seconds]
gperetin_ is now known as gperetin
dhil has joined #ocaml
eikke has joined #ocaml
palomer has quit [Client Quit]
dalastboss has joined #ocaml
palomer has joined #ocaml
palomer has quit [Client Quit]
<dalastboss> is there a nice idiom for making a module with custom hashable key type?
<dalastboss> the best ive got is this http://pastebin.com/X7t1FnuB
ollehar has joined #ocaml
<dalastboss> but it'd be nice if I could just do "type t = ... with hashable"
<dalastboss> or something like that
<dalastboss> i should clarify this is when working with core
jeffmo has quit [Quit: jeffmo]
ely-se has quit [Quit: Leaving]
jwatzman|work has joined #ocaml
<Drup> dalastboss: that piece of code seems fine
mort___ has joined #ocaml
<Drup> ah, it's going to complain about type with the same names
<dalastboss> it compiles as is
<dalastboss> i just feel its a little verbose
<Drup> not much better to propose
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yurug1 has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
yurug has joined #ocaml
nicoo_ is now known as nicoo
yurug1 has quit [Ping timeout: 252 seconds]
dalastboss has quit [Ping timeout: 246 seconds]
oriba has joined #ocaml
jonludlam has quit [Ping timeout: 240 seconds]
yurug has quit [Ping timeout: 252 seconds]
ely-se has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
kushal has joined #ocaml
jeffmo has joined #ocaml
yurug has joined #ocaml
palomer has joined #ocaml
<oriba> on Caml-list there was mentioned a OCaml-course, and even long-time OCamlers said, they may do it. I didn't found infos to that course in my mail-folders. What course were they talking about / where to find it?
jabesed has joined #ocaml
palomer has quit [Client Quit]
mort___ has quit [Ping timeout: 246 seconds]
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
ollehar has quit [Quit: ollehar]
yurug1 has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
nullcatx_ has joined #ocaml
<oriba> companion_cube: aha, ok, thanks. Does cover basic things. I wonder why long-term OCamler's said, they want to paticipate. Hmhhh... maybe just for fun....
palomer has joined #ocaml
<sgeisenh> oriba: there was some mention of opportunities to help others with the course
<oriba> aha
nullcatxxx_ has quit [Ping timeout: 250 seconds]
yurug has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
yurug1 has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
palomer_ has joined #ocaml
Krikey_Sanchez has quit [Quit: Leaving]
palomer has quit [Ping timeout: 255 seconds]
palomer_ is now known as palomer
kushal has quit [Quit: Leaving]
yurug1 has joined #ocaml
yurug has quit [Ping timeout: 268 seconds]
palomer has quit [Quit: palomer]
marsam has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
nullcatx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marsam has joined #ocaml
<Drup> there is a forum for the course which you can access if you are registered, and then you can answer questions
<Drup> MercurialAlchemi: some of the references in accelerando/Stross' work are surprising sometime :p
mort___ has joined #ocaml
<Drup> (like, suddenly, a rather not mainstream metal band)
yurug has joined #ocaml
yurug1 has quit [Read error: Connection reset by peer]
<MercurialAlchemi> Drup: hm, I don't recall, but Accelerando packs 50 ideas per sentence :)
<MercurialAlchemi> coincidentally, I'm reading the Annihilation Score right now
<Drup> MercurialAlchemi: I find the start and middle part more interesting than the end
nullcatxxx_ has joined #ocaml
moei has quit [Quit: Leaving...]
moei has joined #ocaml
snyp has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 244 seconds]
ely-se has quit [Quit: Leaving]
BitPuffin has quit [Ping timeout: 246 seconds]
<companion_cube> yeah, it's tough to read
<MercurialAlchemi> Drup: yeah
<MercurialAlchemi> it's a bunch of short stories, that's why
<MercurialAlchemi> today on HN "JavaScript as default language and software stack"
<MercurialAlchemi> yeah, right, let's all shoot off our foot
<MercurialAlchemi> when I hear of a nodejs codebase, my first thought is "fresh legacy code, coming up"
<Drup> I didn't found it that hard to read
<Drup> (especially compared to hyperion ...)
<companion_cube> really? hyperion is less dense
<Drup> It's not the density, just the confusionness
dsturb has quit [Ping timeout: 250 seconds]
<SHODAN> hyperion?
<SHODAN> keats?
<SHODAN> oh
<SHODAN> it's been a while since i read those books
<SHODAN> might do it again soonish. i liked them :)
<SHODAN> especially the first one
marsam has quit [Remote host closed the connection]
<SHODAN> (but ilium and olympos was even better imo)
ggole has quit []
Kakadu has quit [Quit: Page closed]
ely-se has joined #ocaml
<MercurialAlchemi> I liked the structure a lot
<MercurialAlchemi> (hyperion's)
<MercurialAlchemi> but the last two, ugh
<MercurialAlchemi> in fact, it's like Herbert, that's the only Dan Simmons book I read that I like
<MercurialAlchemi> (with Fall of Hyperion)
<Drup> the novel that weird me out the most, structure wise, is "Consider Phlebas"
<MercurialAlchemi> right?
<MercurialAlchemi> compared to Use of Weapons, it's easy...
<Drup> oh no, Use of Weapons, sorry
<Drup> yes
<Drup> I think I read it 3 times before actually understanding it
<SHODAN> :)
<SHODAN> those kind of books are the best
<MercurialAlchemi> of course, compared to something like Gravity's Rainbow, they're light reading
<Drup> MercurialAlchemi: don't know that one
<MercurialAlchemi> it's, hmm
<MercurialAlchemi> postmodern?
<Drup> that's never a good sign
<ely-se> Oh Caml, oh Caml, I love you so much. Oh Caml, oh Caml, but not enough for preventing me from switching to OCaml.
<ely-se> OCaml poem^
<MercurialAlchemi> if you give up on understanding what's happening, it's quite enjoyable
<ely-se> MercurialAlchemi: sometimes I wish I were dumb so I'd have fewer worries
<Drup> MercurialAlchemi: I get this impression with a lot of niche movies
<MercurialAlchemi> ely-se: hit yourself on the head :)
<ely-se> no, only dumb people do that
<MercurialAlchemi> Drup: ah, I'm a mass market man when it comes to movies
<MercurialAlchemi> a plebeian
<Drup> Me too, precisely
<MercurialAlchemi> hehe :)
mort___ has quit [Quit: Leaving.]
sepp2k has quit [Quit: Leaving.]
palomer has joined #ocaml
Lasher`_ is now known as Lasher`
Tekilla has quit [Quit: Quitte]
Tekilla has joined #ocaml
xet7_ has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
xet7_ has joined #ocaml
cthuluh has quit [Ping timeout: 240 seconds]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
Simn has quit [Quit: Leaving]
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
marsam has joined #ocaml
<palomer> hey guys
<palomer> how do I get the documentation for a module I installed through opam?
Kakadu has joined #ocaml
mort___ has joined #ocaml
<companion_cube> there is no general rule, as for now
<companion_cube> opam info gives you the homepage of the package, in general
cthuluh has joined #ocaml
dhil has quit [Quit: Leaving]
<companion_cube> some day we will have centralized documentation...
struk|work has joined #ocaml
yurug1 has joined #ocaml
obadz has quit [Read error: Connection reset by peer]
yurug has quit [Ping timeout: 250 seconds]
slash^ has quit [Read error: Connection reset by peer]
obadz has joined #ocaml
<palomer> is it possible to find all the files installed by an opam package?
<Drup> No it's not
<Drup> it's easy to find where are the packages though, it's in .opam/<switch>/lib/<package>
wwilly has joined #ocaml
yurug1 has quit [Ping timeout: 250 seconds]
willy__ has quit [Ping timeout: 264 seconds]
snyp has quit [Quit: WeeChat 1.3]
Submarine has quit [Remote host closed the connection]
empyrean has joined #ocaml
palomer has quit [Quit: palomer]
marsam has quit [Remote host closed the connection]
palomer has joined #ocaml
marsam has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
orbifx has joined #ocaml
<orbifx> how is ocaml doing on ARM? production ready?
<vbmithr> orbifx: yeah.
jeffmo has quit [Quit: jeffmo]
<orbifx> good stuf
rgrinberg1 has quit [Ping timeout: 240 seconds]
<orbifx> I've been doing some haskell but it's support for ARM yet is lacking. I don't have the time to hack something to get this ready.
<orbifx> Is Ocaml somehow better for embedded development than Haskell?
sh0t has joined #ocaml
yurug has joined #ocaml
_andre has quit [Quit: leaving]
<Drup> orbifx: do you know about mirage ?
<orbifx> Drup: no
<orbifx> enlighten me please :)
<flux> orbifx, there's also ocapic
<Drup> for extreme situations :p
<orbifx> I like the sound of mirage, checking ocapic too
<orbifx> flux: does ocapic compromise performance just to get ocaml code running on PIC, or does it actually perform well?
<Drup> it's running ocaml's bytecode, not native, so, you could say so
<orbifx> does ocaml compile to native code at all or is it only bytecode?
wwilly has left #ocaml ["Leaving"]
<icicled> orbifx, both
<Drup> of course it compiles to native code too :D
<orbifx> :D
<orbifx> I'm starting to like the sound of that
<orbifx> Pureness drove me to Haskell, but it seems to neglect system level programming necessities
<Drup> if you are interested into system programming (not really embedded), you might be interested by this book: https://ocaml.github.io/ocamlunix/
<orbifx> any functional language better than ocaml targetting system development?
<companion_cube> not really functional, but rust?
<orbifx> Nice one Drup, looking forward to reading this
<orbifx> companion_cube: looked at rust I think... i'd prefer more functional
MercurialAlchemi has quit [Ping timeout: 255 seconds]
<companion_cube> well if you want to get really low-level, memory allocation becomes more of a concern
<dmbaturin> orbifx: The native compiler is available for x86(64), ARM, SPARC, and, if I remember correctly, PPC. Bytecode interpreter technically runs on anything.
<companion_cube> there is ATS, too, but it's really tough
<dmbaturin> Really tough, but also really tempting. :)
<orbifx> companion_cube: how established is rust? say compared to Haskell or Ocaml
<orbifx> Haskell isn't that good for system programming just now
jabesed has quit [Ping timeout: 246 seconds]
<dmbaturin> orbifx: By system programming you mean interfacing with existing OS or writing a new one?
<orbifx> dmbaturin: practically the first, posix in particular, but being able to write a new one would distinguish the language even more
tane has quit [Quit: Verlassend]
<companion_cube> well rust is still young, but has a very nice and active community
<companion_cube> but if you only wish to interface to the C api of your ARM system, OCaml (mirage) should be fine
palomer has quit [Ping timeout: 255 seconds]
<dmbaturin> Writing a multitasking OS in a language that relies on garbage collection is going to be tough.
palomer has joined #ocaml
<orbifx> dmbaturin: doesn't ocaml have any facilities to manually control memory (if necessary)?
<Drup> Not really
<Drup> the only thing you can do that is "manual" is allocate a big chunk of memory that the GC is not gonna move
higgs has joined #ocaml
<dmbaturin> Lisp machines had an OS-wide garbage collector, so it's not entirely impossible though.
<orbifx> Drup: reading the article you pasted. Is pervasives, the equivalent of prelude?
<Drup> yes
<orbifx> dmbaturin: OS-wide?
rgrinberg1 has joined #ocaml
<dmbaturin> orbifx: Yes, the OS did garbage collection for the processes AFAIR. But it was hardware-assisted, and it was a tagged architecture, so not sure if it's feasible to replicate on less specialized hardware.
<orbifx> ok
<orbifx> and now for something wilder.. does Ocaml target FPGAs at all?
<Drup> not really, but there is https://github.com/ujamjar/hardcaml
malc_ has joined #ocaml
<orbifx> thanks
<orbifx> you guys are being very helpful, very glad for this :)
obadz- has joined #ocaml
<orbifx> Is the concept of monads applicable to ocaml or not necessary since it allows side effects?
shinnya has quit [Ping timeout: 260 seconds]
<companion_cube> it's applicable, but not necessary
<orbifx> can one go hardcode on writing pure functional code with ocaml? or is the imperative always creeping in?
obadz has quit [Ping timeout: 260 seconds]
<companion_cube> you can go quite hardcore, I think
<companion_cube> of course at some point you need IO
<orbifx> can IO be done with a monadic away to encapsulate the side-effects?
<companion_cube> you could write an IO monad
<companion_cube> but it's not very useful, I think
<companion_cube> the bottom line: don't try to mimic Haskell to closely
<companion_cube> idiomatic OCaml is nice too ;)
<orbifx> just reading the article Drup pasted and I'm seing `begin` which makes me think of BASIC :P
<companion_cube> oh, well
<companion_cube> begin end is like ( )
<dmbaturin> orbifx: Technically, yes, but it's rarely, if ever, is used in practice. Monads is not the only way to hide implementation after all.
<orbifx> so looking at the first example here: https://ocaml.github.io/ocamlunix/generalities.html#sec3
<companion_cube> the Lwt monad (for non blocking IO) is usd quite a lot
<orbifx> (search for begin)
<dmbaturin> orbifx: Usually people use monads when abstraction fits it nicely. Like this: http://ocsigen.org/lwt/
<orbifx> could that be written in a more functional way in ocaml?
<orbifx> (i'm not saying it's bad, just want to know)
<companion_cube> this is very IO-oriented
<companion_cube> it could use some printer combinators, though
<orbifx> ok
<orbifx> checking lwt at the same time
<companion_cube> I would write Format.printf "%a@." (CCArray.print ~sep:" " CCString.print) Sys.argv
nullcatxxx_ has joined #ocaml
<nullcatxxx_> anyone tried papiers before? https://github.com/Armael/papiers
<dmbaturin> orbifx: http://baturin.org/code/lwt-counter-server/ Simple complete Lwt example.
<companion_cube> (just as an example)
marsam has quit [Read error: Connection reset by peer]
<orbifx> thanks companion_cube & dmbaturin
Armael has joined #ocaml
nullcatxxx_ has quit [Client Quit]
marsam has joined #ocaml
<orbifx> nice example dmbaturin
<dmbaturin> The code from the ocamlunix book has distinctive old ocaml feel (the book is from early 00's).
<dmbaturin> Doesn't make the book bad though, and it's not as noticeable as in code that was direct translation from CAML Light. :)
<orbifx> i can't distinguish dialects
<orbifx> I just want to move to functional (Because _I've seen the light_) and Haskell is not ready for ARMv7
<dmbaturin> ;;'s all over is the most obvious thing.
<companion_cube> yeah, no labels, too
<dmbaturin> You don't need them outside the REPL anymore, and in the REPL they are just end of input marks.
swgillespie has joined #ocaml
<companion_cube> oh, you needed ;; in source code back then?
<orbifx> any libs for postfix?
<Drup> companion_cube: no you didn't
<dmbaturin> companion_cube: Yes. One day I've built CAML Light from tarball. Looks like it required a ;; after virtually everything.
<companion_cube> funny
<dmbaturin> (I also made an RPM package, but I need to find where to release it :)
<companion_cube> orbifx: there is a smtp client and an imap client libs
<companion_cube> although I think the smtp one lacks encryption as of now
<dmbaturin> But the earliest OCaml versions I could find didn't have the ;; problem already.
<Drup> oh, you meant caml light, yes you do
<orbifx> companion_cube: i meant for controlling postfix -- it was a long shot :P
<companion_cube> oh
<companion_cube> I don't think so then! Check on opam
<orbifx> what is `let () = ...` ?
<orbifx> checked, didn't find anything
<orbifx> probably my first program in ocaml :P
palomer has quit [Quit: palomer]
<Drup> what's "postfix" ?
<dmbaturin> orbifx: I wrote a whole post about let () = :) http://stuff.baturin.org/post/112190416805
<orbifx> Drup: postfix is the most established SMTPd out there
<orbifx> if I may say
<Drup> I see
<Drup> I guess people would be more motivated by an ocaml implementation of smtp :p
sh0t has quit [Quit: Leaving]
<dmbaturin> Control postfix in what way? I just edit main.cf/master.cf :)
<orbifx> the programmable way is to use postconf
<orbifx> Drup: i think ocaml has an smtp implementation as mentioned above. But it isn't for administrating postfix
<Drup> yeah
<dmbaturin> Compared to sendmail, postfix config format was... very refreshing. So I never bothered to automate it.
<orbifx> dmbaturin: it is true
<companion_cube> I heard good things about openSTMPd, too
<orbifx> and I may hardly need to do any changed.. Dovecot i'm dreading a lot more :P
<companion_cube> but a pure OCaml mail server would be nice
<companion_cube> if it had smtps, imaps, sieve
<orbifx> s/changed/changes
<Drup> ( companion_cube : I would add to the required that it's miragified)
<orbifx> companion_cube: a lot to implement :P
<Drup> requirements*
<dmbaturin> malc_: I wonder if implementing lambda term reduction in sendmail is feasible. Probably it is.
<companion_cube> Drup: of course.
<malc_> dmbaturin: given turing completeness the answer is resounding - yes
<orbifx> dmbaturin: good article, thanks
<dmbaturin> malc_: Yeah, hence "feasible" instead of "possible". What I'm wondering about is how much of a turing tarpit this task would be.
<orbifx> dmbaturin: have you used some ocaml blog?
<orbifx> ah.. tumblr powered..
<dmbaturin> companion_cube: I'd rather keep SMTP and IMAP servers separate, or at least reasonably modular.
<malc_> dmbaturin: missed "feasible", my bad
<companion_cube> dmbaturin: using modules
<companion_cube> please :p
<companion_cube> but I'd be more confident in a mail toolchain if it was pure OCaml
<orbifx> break the heck out of them, postfix has it right. Unix philosophy ftw.
<dmbaturin> orbifx: No, sadly. Tumblr software is getting horrible though, so I'll have to migrate somewhere at some point. They can't handle either HTML or non-JPG images correctly anymore.
rgrinberg2 has joined #ocaml
<dmbaturin> Probably because there's not much demand for it among 13 years old kids or something.
<orbifx> dmbaturin: I've written a simple blog in bash
<companion_cube> don't!
<orbifx> companion_cube: ?
<companion_cube> sorry. Writing software in bash is my nightmare
<orbifx> companion_cube: it wasn't that bad, it's an interface really on other popular unix utilities
<dmbaturin> Well, the alternative is to use generate static HTML of course. That's what I did to baturin.org (uses the same MPP template processor that runs ocaml.org).
<orbifx> check it out
<orbifx> you can write your own back ends for anything you need it to do
IbnFirnas has quit [Ping timeout: 244 seconds]
rgrinberg1 has quit [Ping timeout: 244 seconds]
brendan has quit [Ping timeout: 244 seconds]
<orbifx> currently uses markdown for conversion and manages it's own files
eikke has quit [Remote host closed the connection]
<dmbaturin> orbifx: One company wanted to hire me to work on their photo hosting that was written in Korn shell and ran on Solaris 9 or something equally ancient.
<companion_cube> I use pelican already :)
<companion_cube> although I should move to something that supports asciidoc
eikke has joined #ocaml
<orbifx> dmbaturin: lol, from my experience, bash and other shell scripting is ok as glue and that is it.
<orbifx> You can do more, but you need a lot of determination :P
IbnFirnas has joined #ocaml
<orbifx> I wanted to try it though, wanted to write something ultra portable
<orbifx> even looked at markdown -> html with awk
brendan has joined #ocaml
<orbifx> dmbaturin: is 'a a unit too?
<companion_cube> :s
<dmbaturin> orbifx: 'a is a type variable. It can be substituted for unit of course, same as in haskell.
<dmbaturin> val foo : 'a -> b ==> foo :: a -> b
<Drup> actually
<orbifx> ok
<Drup> val foo : 'a -> b ==> foo :: a -> B
<dmbaturin> * let foo : 'a -> 'b = fun x -> ... No handy embedded type annotation syntax in ocaml.
<Drup> (type name are capitalized in Haskell)
<orbifx> exception Unix_error of error * string * string --- is * some kind of composition?
<malc_> # Obj.magic;;
<malc_> - : 'a -> 'b = <fun>
<Drup> orbifx: foo * bar is (foo, bar)
<Drup> it's a tuple
<dmbaturin> Drup: Good point. Lack of apostrophe before b was a typo though, I didn't mean it. :)
<orbifx> ok
<malc_> Drup: it is not a tuple, but that's historic wart
<orbifx> also is it acceptible to write tuples without brackets in ocaml? saw something like `let x, y = ...`
<orbifx> malc_: what is it?
<orbifx> and you suggest it should be a tuple?
<Drup> malc_: let's happily slip that point under the carpet, shall we ? :D
<malc_> orbifx: type constructor with three arguments
<malc_> Drup: sure ;)
<Drup> For most purposes, it's a tuple
<dmbaturin> orbifx: * is often rendered as the cross product symbol in non-pasteable media. :)
<malc_> orbifx: A of (a * b * c) is distinct from A a * b * c is what i'm implying
<malc_> +of
<dmbaturin> orbifx: You can also write a list of tuples as [1,2; 3,4]
<companion_cube> this is going to confuse orbifx
<orbifx> dmbaturin: that is what i pressume.. something like `.` in Haskell
<orbifx> companion_cube: I think i got it
<dmbaturin> The list of tuples? No, that's just syntax. List sugar uses ; as element separator.
<dmbaturin> And because it's distinct from the item separator fro tuples, no parens are needed there.
<orbifx> and basically tuples are ok without brackets (in certain places?)
<dmbaturin> There is no direct equivalent of haskell . :: (b -> c) -> (a -> b) -> a -> c in pervasives, even though it's trivial to implement. @@ is the equivalent of $, and there's also |> { x |> f |> g ==> g(f(x)) }
<dmbaturin> Yeah, if there's nothing to confuse the parser, naked tuples are ok.
<orbifx> ah the lingo, what would languages be without it :P
<orbifx> any ArchLinux users here?
<companion_cube> yep
ely-se has quit [Quit: sleep]
<orbifx> companion_cube: you?
<orbifx> or yep in general ?! :P
<companion_cube> me
<companion_cube> what's your question?
<orbifx> kewl, nothing, just demographing the channel :P
<orbifx> good to know there is another one here, in case i have any distro specifics, and that is is popular.
<dmbaturin> orbifx: opam is mostly OS-agnostic.
<dmbaturin> Well, as long as the OS is not windows. :)
<orbifx> screw winblows
<orbifx> who is using that anyway?
* orbifx winks
<orbifx> companion_cube: I noticed in archlinux-arm they don't have opam, but a package called ocaml-findlib
<orbifx> heard of that ?
<companion_cube> yep, opam relies upon findlib
<Drup> very crudely, findlib is ocaml's pkg-config
<Drup> opam is ... an actual package manager
<adrien> ocamlfind/findlib's semantics are different from pkg-config but they fill the same feature gap: how to properly compile and links files when libraries are involved
<dmbaturin> orbifx: adrien uses ocaml on windows. If I do need it, that's whom I annoy. :)
shinnya has joined #ocaml
<orbifx> nice, good desing idea pkg-config, I appreciate it.
<orbifx> adrien: I'm sorry to hear that
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malc_ has quit [Quit: leaving]
<orbifx> dmbaturin: I don't really own any winblows machines. I have a a work laptop I poke with the stick (cygwin) when I need to vpn.
<orbifx> companion_cube: but no opam in armv7 of archlinux-arm
<dmbaturin> Well, I still think ocaml can work very well for cross-platform GUI apps.
<companion_cube> I don't know, I don't use arch-arm, sorry
<orbifx> unless i can get it from AUR since I pressume it's written in ocaml?
<companion_cube> it is on AUR yes
<orbifx> companion_cube: yeah and PKGBUILD confirms armv7h.. that's were I will get it
<Drup> (the other way is to use mirage to target ARM)
<orbifx> So glad it's all so painless. Getting ghc alone is >700MiB. Trying to crosscompile....
<orbifx> mirage pressumes a virt-visor underneath right?
<Drup> orbifx: yes and no, usually it assumes Xen, but a bare metal version is almost working, using rumprun
<orbifx> Drup: ok, on some other ideas I have that would be nice, but for this case I'm targetting Arch
<orbifx> any articles on the flow of making a ocaml project/module/package?
<orbifx> ala `cabal init`
shinnya has quit [Ping timeout: 240 seconds]
mac10688 has joined #ocaml
nullcatxxx_ has joined #ocaml
<smondet> dmbaturin: nice to discover your blog, you could add yourself to http://planet.ocaml.org/ (?)
BitPuffin|osx has joined #ocaml
Kakadu has quit [Remote host closed the connection]
nullcatxxx_ has quit [Client Quit]
<orbifx> Drup: thanks
<orbifx> on my to-read list for tomorrow
<orbifx> Drup, dmbaturin, companion_cube, malc_, icicled, vbmithr, flux: thanks all for answering my questions and generally helping.
<orbifx> Nice channel
<orbifx> later
orbifx has quit [Quit: "laterz"]
nullcatxxx_ has joined #ocaml
jwatzman|work has joined #ocaml
<dmbaturin> smondet: I never perceived it as important or topical enough for aggregators. In any case I need to decide something about its new software. Do you happen to know what people use for statically generated blogs these days?
marsam has quit [Remote host closed the connection]
jonludlam has joined #ocaml
yurug has quit [Ping timeout: 246 seconds]
<smondet> dmbaturin: we use the thing integrated with github
<smondet> jeckyll
damason has joined #ocaml
<oriba> companion_cube: imap client libs for ocaml? do you have a link?
obadz- has quit [Ping timeout: 240 seconds]
obadz has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
<oriba> companion_cube: ah, there is one in omap...
lagrangi-wan has joined #ocaml
<oriba> s/omap/opam/ :)
Tekilla has quit [Quit: Quitte]
jonludlam has quit [Ping timeout: 272 seconds]
oriba has quit [Quit: WeeChat 1.3]
bitbckt has quit [Ping timeout: 240 seconds]
S11001001 has quit [Ping timeout: 240 seconds]
Sorella has quit [Ping timeout: 240 seconds]
lwlvlpl has quit [Ping timeout: 240 seconds]
jwatzman|work has quit [Ping timeout: 240 seconds]
fluter has quit [Ping timeout: 240 seconds]
_habnabit has quit [Ping timeout: 240 seconds]
higgs has quit [Ping timeout: 240 seconds]
cball has quit [Ping timeout: 240 seconds]
igoroliveira has quit [Ping timeout: 240 seconds]
icicled has quit [Ping timeout: 240 seconds]
rossberg has quit [Ping timeout: 240 seconds]
segmond has quit [Ping timeout: 240 seconds]
Sorella has joined #ocaml
rossberg has joined #ocaml
icicled has joined #ocaml
higgs has joined #ocaml
bitbckt has joined #ocaml
cball has joined #ocaml
systmkor has quit [Quit: Leaving]
lwlvlpl has joined #ocaml
igoroliveira has joined #ocaml
_habnabit has joined #ocaml