adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org and http://caml.inria.fr | http://ocaml.org/releases/4.02.0.html | Public channel logs at http://irclog.whitequark.org/ocaml
darkf has joined #ocaml
tac_ has joined #ocaml
teknozulu has quit [Ping timeout: 255 seconds]
bradytrix has joined #ocaml
araujo has joined #ocaml
bradytrix has quit [Remote host closed the connection]
teknozulu has joined #ocaml
ygrek has joined #ocaml
tac_ has quit [Quit: Leaving]
aletheap_ has joined #ocaml
aletheap has quit [Ping timeout: 240 seconds]
aletheap_ is now known as aletheap
ygrek has quit [Ping timeout: 258 seconds]
koderok has joined #ocaml
manud has joined #ocaml
yotam has joined #ocaml
aletheap has quit [Ping timeout: 245 seconds]
Lasher` has joined #ocaml
manud has quit [Client Quit]
samrat has joined #ocaml
samrat has quit [Ping timeout: 260 seconds]
samrat has joined #ocaml
samrat has quit [Ping timeout: 258 seconds]
samrat has joined #ocaml
tnguyen has joined #ocaml
boogie has joined #ocaml
bytbox has quit [Remote host closed the connection]
bytbox has joined #ocaml
samrat has quit [Ping timeout: 255 seconds]
<teknozulu> So I'm trying to construct a bst, but there is a problem. I've defined the left/right of a node as node option, but I don't know how to define the record itself as an option: http://pastebin.com/vnvSS3zf . I believe this is the cause of "This expression has type treenode option
<teknozulu> but an expression was expected of type treenode" for lines 18 and 25?
<teknozulu> ahh, fixed it (Some root)
samrat has joined #ocaml
koderok has quit [Quit: koderok]
samrat has quit [Ping timeout: 272 seconds]
samrat has joined #ocaml
samrat has quit [Ping timeout: 246 seconds]
q66[lap] has quit [Read error: Connection reset by peer]
samrat has joined #ocaml
q66[lap] has joined #ocaml
boogie has quit [Quit: Leaving...]
huza has joined #ocaml
sheijk_ has joined #ocaml
sheijk has quit [Ping timeout: 240 seconds]
nicoo has quit [Ping timeout: 264 seconds]
teknozulu has quit [Ping timeout: 272 seconds]
waneck has quit [Ping timeout: 258 seconds]
tac_ has joined #ocaml
taion809 has quit [Ping timeout: 272 seconds]
sheijk_ has quit [Ping timeout: 260 seconds]
waneck has joined #ocaml
slash^ has joined #ocaml
sheijk has joined #ocaml
sheijk has quit [Ping timeout: 260 seconds]
hhugo has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
oscar_toro has joined #ocaml
sheijk has joined #ocaml
tnguyen has quit [Ping timeout: 272 seconds]
sheijk has quit [Ping timeout: 246 seconds]
q66[lap] has quit [Quit: Textual IRC Client: www.textualapp.com]
samrat has quit [Ping timeout: 244 seconds]
q66[lap] has joined #ocaml
MercurialAlchemi has joined #ocaml
lordkryss has joined #ocaml
tnguyen has joined #ocaml
samrat has joined #ocaml
tnguyen has quit [Ping timeout: 244 seconds]
tnguyen has joined #ocaml
tnguyen has quit [Ping timeout: 245 seconds]
q66[lap] has quit [Quit: Textual IRC Client: www.textualapp.com]
q66[lap] has joined #ocaml
manud has joined #ocaml
samrat has quit [Ping timeout: 255 seconds]
Simn has joined #ocaml
samrat has joined #ocaml
ysz has joined #ocaml
tac_ has quit [Ping timeout: 272 seconds]
samrat has quit [Ping timeout: 255 seconds]
malc_ has joined #ocaml
manud has quit [Quit: manud]
samrat has joined #ocaml
sheijk has joined #ocaml
sheijk has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
kakadu has joined #ocaml
ollehar has joined #ocaml
manud has joined #ocaml
tane has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 272 seconds]
ygrek has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has joined #ocaml
ysz has quit [Quit: This computer has gone to sleep]
<adrien> that might sound really stupid but really
<adrien> how can I write an int as an int on a file_descr?
hhugo has quit [Quit: Leaving.]
jonludlam has quit [Ping timeout: 260 seconds]
sheijk has joined #ocaml
ygrek has joined #ocaml
tani has joined #ocaml
jonludlam has joined #ocaml
tane has quit [Ping timeout: 246 seconds]
sheijk has quit [Ping timeout: 260 seconds]
hhugo has joined #ocaml
manud has quit [Quit: manud]
ygrek_ has joined #ocaml
ygrek has quit [Remote host closed the connection]
tani is now known as tane
q66[lap] has quit [Quit: Textual IRC Client: www.textualapp.com]
samrat has quit [Ping timeout: 255 seconds]
morphles has joined #ocaml
hhugo has quit [Quit: Leaving.]
<malc_> adrien: "on file_descr"?
morphles has quit [Ping timeout: 272 seconds]
<adrien> to a Unix.file_descr
<adrien> only way I see right now is to split the int into chars in a string
<adrien> but nothing from the stdlib
<malc_> adrien: i'm confused a bit, so you have an int and want to get file_descr out of it?
<adrien> no: I have an int and I want to write it on the file descriptor
tnguyen has joined #ocaml
<adrien> to* the file descriptor
<malc_> # Unix.single_write (Obj.magic 1) "hi" 0 2;;
<malc_> hi- : int = 2
<malc_>
samrat has joined #ocaml
<adrien> no, write the value of the int to the file descriptor
<malc_> ah
<malc_> there's a way to marshall stuff, but i guess that again is not what you want
<adrien> no, I need something fixed-size
<malc_> it will be fixed size
rand000 has joined #ocaml
<adrien> and marshall compresses its output
<adrien> (I _hate_ that feature)
tnguyen has quit [Ping timeout: 244 seconds]
huza has quit [Quit: WeeChat 0.3.8]
<malc_> there's output_binary_int, but it there are issues with that too
<adrien> it works on channels, not file descriptors and mixing the two is really inconvenient and error-prone
morphles has joined #ocaml
hhugo has joined #ocaml
<malc_> hence but part of my remark
q66[lap] has joined #ocaml
<Drup> adrien: bind the relevant C syscall ?
<flux> adrien, ocaml doesn't cam with the functions doing int->string in binary, but perhaps Batteries or Core does?
<flux> s/cam/come/ :-o
<adrien> I need to avoid deps and I don't really want to make bindings either
<adrien> this should do it
<adrien> buf.[i] <- Char.chr (to_int (logand 255l (shift_right_logical x (8 * (i + 1)))))
<adrien> x being the int32
<Drup> :blurp:
<adrien> well
<adrien> not much choice
<adrien> also, I think lwt has what it takes
morphles has quit [Ping timeout: 272 seconds]
<adrien> but I don't want to add deps at all
ygrek_ has quit [Ping timeout: 255 seconds]
ggole has joined #ocaml
pminten has joined #ocaml
zpe has joined #ocaml
sheijk has joined #ocaml
samrat has quit [Ping timeout: 255 seconds]
zpe has quit [Remote host closed the connection]
<adrien> btw, in case someone wants to reuse that, there's a +1 which shouldn't be there
samrat has joined #ocaml
sheijk has quit [Ping timeout: 255 seconds]
hhugo has quit [Quit: Leaving.]
tnguyen has joined #ocaml
malc_ has quit [Remote host closed the connection]
tnguyen has quit [Ping timeout: 260 seconds]
samrat has quit [Ping timeout: 255 seconds]
marvin-hh has joined #ocaml
samrat has joined #ocaml
zpe has joined #ocaml
rand000 has quit [Quit: leaving]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<gasche> adrien: Batteries or https://github.com/OCamlPro/ocplib-endian
samrat has quit [Ping timeout: 255 seconds]
<adrien> right, but I'm going for 0 deps in this
<adrien> and as far as I can tell the approach is similar to the code I pasted above
<gasche> Printf.printf "%08lX"
<adrien> yeah, thought about that too
<adrien> but it feels too dirty :P
<gasche> I would feel worse about shift_right_logical, but pick your poison
<adrien> :)
<adrien> well, my main annoyance was to have nothing like that in the stdlib
<adrien> very frustrating
<adrien> but now the code is here...
<adrien> and even works
<adrien> need to play a bit with libarchive now and it should be good
<gasche> finally, recent OCaml versions (4.00 or 4.01, I don't remember) come with specific primtives
<gasche> %caml_string_{get,set}32{,u}
sheijk has joined #ocaml
<gasche> if performance matter you may want to optionally use them
samrat has joined #ocaml
Thooms has joined #ocaml
sheijk has quit [Ping timeout: 260 seconds]
q66[lap] has quit [Quit: Textual IRC Client: www.textualapp.com]
samrat has quit [Ping timeout: 255 seconds]
sheijk has joined #ocaml
samrat has joined #ocaml
Unhammer has joined #ocaml
ygrek has joined #ocaml
sheijk has quit [Ping timeout: 255 seconds]
morphles has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
morphles has quit [Ping timeout: 250 seconds]
tnguyen has joined #ocaml
tnguyen has quit [Ping timeout: 272 seconds]
huza has joined #ocaml
samrat has joined #ocaml
morphles has joined #ocaml
sheijk has joined #ocaml
huza has quit [Ping timeout: 260 seconds]
sheijk has quit [Ping timeout: 250 seconds]
ocp has quit [Quit: Leaving.]
<adrien> GRRRRR!
q66[lap] has joined #ocaml
<adrien> I need to afk but if I remember correctly, Bigarray's map_file needs a file descriptor opened as read-write
<adrien> always
<adrien> unconditionally
<adrien> except I cannot
<adrien> justification being that if it the file isn't writable then you get undefined behaviour when writing to the bigarray
<adrien> and that's not acceptable behaviour
<adrien> so what do we get currently?
<adrien> 13:33:25.293156 mmap(NULL, 1380, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0x65000) = 0x7f837fddb000
<adrien> 13:33:25.293453 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x10} ---
<adrien> _great_
samrat has quit [Quit: Computer has gone to sleep.]
<adrien> as for why I cannot open in write mode: it's the executable I'm currently executing
<adrien> at that point I might as well rewrite in C
<adrien> gasche: hmmm, I hadn't thought of these primitives; performance isn't a concern (only one to read), however I think I'm staying with compatibility to 3.12 for now
divyanshu has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
bezirg has joined #ocaml
cago has joined #ocaml
sheijk has joined #ocaml
jgjl has joined #ocaml
larhat has joined #ocaml
sheijk has quit [Ping timeout: 260 seconds]
tnguyen has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
<adrien> and why is there nothing between "minor" and "major" severities in mantis?
<mrvn> like "normal"?
<adrien> yeah
shinnya has joined #ocaml
jgjl has quit [Quit: Textual IRC Client: www.textualapp.com]
jgjl has joined #ocaml
cago has quit [Quit: cago]
cago has joined #ocaml
darkf has quit [Quit: Leaving]
samrat has joined #ocaml
morphles has quit [Ping timeout: 245 seconds]
Submarine has quit [Remote host closed the connection]
samrat has quit [Ping timeout: 250 seconds]
ontologiae has joined #ocaml
sheijk has joined #ocaml
sheijk has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
samrat has joined #ocaml
taion809 has joined #ocaml
<adrien> anyone remember what is the "proxy" field inside "struct caml_ba_array"?
<adrien> and when it is NULL?
<whitequark> def`: sublime-text-merlin is broken :/
<whitequark> AttributeError: 'MerlinProcess' object has no attribute 'acquire'
<whitequark> hm, this is very odd
<whitequark> def`: nevermind, sublime barfed while reloading plugin
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Anarchos has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
jgjl has joined #ocaml
isBEKaml has joined #ocaml
Simn has joined #ocaml
isBEKaml has quit [Quit: leaving]
<adrien> hmpf, my complaint above was not baseless but wasn't the cause of my troubles
<adrien> PROT_WRITE is fine as long as MAP_PRIVATE is also provided
<adrien> my additional bindings in ocaml-archive to read from bigarrays were not good and were dereferencing a NULL
<adrien> (twice, just-in-case)
isBEKaml has joined #ocaml
divyanshu has quit [Quit: Connection closed for inactivity]
samrat has quit [Ping timeout: 245 seconds]
sheijk has joined #ocaml
samrat has joined #ocaml
pminten has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
ysz has joined #ocaml
ysz has quit [Client Quit]
samrat has joined #ocaml
zpe has joined #ocaml
sheijk has quit [Ping timeout: 258 seconds]
xavierm02 has joined #ocaml
nicoo has joined #ocaml
<xavierm02> Is it possible to define lazy operators like && without expanding them? I get that it's just an if-then-else but if I try to recreate it with a function, it evaluates both arguments before calling it so it can't be lazy...
<xavierm02> I'd have exapected something like that to avoid evaluating the second argument (but it doesn't): let f x = if x then (fun y -> y) else (fun _ -> false);;
<xavierm02> My use case for this is that I have a Yes/No/Maybe type and want to have binary operators on it. Thank you in advance for your answers.
<whitequark> xavierm02: no, it's special-cased in the compiler
<whitequark> external ( && ) : bool -> bool -> bool = "%seqand"
<whitequark> unless it's defined exactly like this, the evaluation order is the usual one
<nicoo> xavierm02: Short answer: you can't because OCaml is eagerly-evaluated
<nicoo> (boolean short-circuits are hardwired in the compiler)
<nicoo> xavierm02: You might be able to do what you want using closures, or lazy, but it will introduce a small amount of boilerplate
isBEKaml has quit [Quit: leaving]
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<xavierm02> whitequark, nicoo: Okay :( Thank you :)
<xavierm02> nicoo: I get how it would work with lazy but I don't understand how closures would help. Could you please give some more detail?
sheijk has joined #ocaml
<nicoo> xavierm02: Basically, instead of doing something like 'my_operator (expr1) (expr2) (expr3)', do 'my_operator (expr1) (fun () -> expr2) (fun () -> expr3)'
<nicoo> (And if you pass actual arguments, you get ever-so-closer to monadic style)
sheijk has quit [Ping timeout: 250 seconds]
oriba has joined #ocaml
rand000 has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
nicoo has quit [Quit: WeeChat 0.4.3]
nicoo has joined #ocaml
sheijk has joined #ocaml
ollehar1 has joined #ocaml
ollehar1 has quit [Client Quit]
zpe has quit [Ping timeout: 272 seconds]
sheijk has quit [Ping timeout: 245 seconds]
Thooms has quit [Quit: WeeChat 0.4.3]
q66[lap] has quit [Quit: Textual IRC Client: www.textualapp.com]
oriba has quit [Remote host closed the connection]
morphles has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
pminten has joined #ocaml
<adrien> so, now that I have my small executable that I can append a tarball to
sheijk has joined #ocaml
<xavierm02> nicoo: Ok, thank you :)
<adrien> which then extracts then tarballs, runs something from it, waitpid() and then cleans the files
<adrien> do I release it separately or not?
<nicoo> adrien: Do you want to be flagged by antivirii ?
<nicoo> Drup: Prolegomena <3
<adrien> well, without ocaml for marshaling the instruction data, it'll be a bit annoying
<nicoo> adrien: To be honest, though, tar doesn't hide from signature-based antivirii, so it would be strange for someone to use it for that purpose
<adrien> plus my binaries will only handle .tar.xz and would have to be edited properly to remove the current payload
<adrien> and the current way to generate the wrapped binary is not so windows-friendly
<adrien> (cat x.native; cat $(PAYLOAD); ./x.native $$(stat --printf=%s $(PAYLOAD)))
sheijk has quit [Ping timeout: 250 seconds]
<adrien> nicoo: UPX stuff often gets flagged
<nicoo> adrien: Ah, ok, you xz. Then yes, you might run in the same issues as UPX
<nicoo> I would say, though, that it is useful enough to be released on its own
<adrien> it's a program + payload
tac_ has joined #ocaml
<jgjl> Hi, is there an up-to-date HTTP proxy implementation for ocaml?
cody__ has joined #ocaml
<whitequark> I don't think so
<whitequark> nicoo: I don't think a regular self-extracting archive will get automatically flagged
<whitequark> I mean, that's basically every installer ever
<nicoo> whitequark: There have been cases of self-extracting installers that got flag because they were uncommon enough, and used by some “bad software”
<nicoo> The antivirii compagnies usually don't care much about collateral damage
marynate has joined #ocaml
<whitequark> no matter what you do ...
<Drup> nicoo: ?
<Drup> "antivirii"
* Drup cringes
<nicoo> :D
<nicoo> I think you got it :)
<adrien> well, it's still an issue for upx
<adrien> antivirus are all crap
shinnya has quit [Ping timeout: 250 seconds]
<nicoo> adrien: Of course they are
jgjl has quit [Quit: Textual IRC Client: www.textualapp.com]
hhugo has joined #ocaml
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
jc1 has joined #ocaml
jc1 has left #ocaml [#ocaml]
MercurialAlchemi has joined #ocaml
sheijk has joined #ocaml
divyanshu has joined #ocaml
sheijk has quit [Ping timeout: 260 seconds]
axiles has joined #ocaml
morphles has quit [Ping timeout: 258 seconds]
Submarine has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
elfring has joined #ocaml
Arsenik has joined #ocaml
cesar has joined #ocaml
ysz has joined #ocaml
marynate has quit [Quit: Leaving]
<whitequark> I don't get it, why does jst's pa_pipebang exist?
ygrek has quit [Ping timeout: 260 seconds]
<nicoo> whitequark: What is it ?
samrat has quit [Ping timeout: 240 seconds]
<whitequark> it's a syntax extension that adds support for 4.01's |>
cody__ has quit [Remote host closed the connection]
<whitequark> the question is, why the hell is it a syntax extension?
tane has quit [Quit: Verlassend]
hhugo has quit [Quit: Leaving.]
divyanshu has quit [Quit: Computer has gone to sleep.]
hhugo has joined #ocaml
divyanshu has joined #ocaml
<ggole> Precedence is wrong otherwise?
<ggole> (Is it, though?)
<ggole> Or maybe it's that |> is in Pervasives and doesn't need an open :/
samrat has joined #ocaml
<adrien> performance?
<whitequark> ggole: it's not
<whitequark> and |> is in Pervasives anyway
<dmbaturin> Is it any different from let (|>) f g = g f ?
<whitequark> well, the stdlib |> is defined as external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply"
<dmbaturin> Yeah, I mean the extension.
<whitequark> the extension literally reverses the arguments and that's it.
<adrien> revapply wasn't available before
morphles has joined #ocaml
samrat has quit [Ping timeout: 245 seconds]
samrat has joined #ocaml
<ggole> whitequark: I mean, a library would need the open
<ggole> Seems like a really dumb reason to make a syntax extension though.
<ggole> Maybe ask the author.
<whitequark> oh
sheijk has joined #ocaml
* dmbaturin wants to make a syntax extension for perl-style =~ operator that would return None | Some of string list
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
Thooms has joined #ocaml
<rfk> that sounds nice
<whitequark> why does that require an extension?
sheijk has quit [Ping timeout: 260 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
* rfk doesn't know ocaml
<dmbaturin> The regex part doesn't fit in standard syntax, unless it's passed as a string of course.
<flux> so actually what you want is regexp quotation syntax
<flux> you could do a function like let ( =~ ) str regexp = ...
hhugo has quit [Quit: Leaving.]
Thooms has quit [Client Quit]
<flux> regexp quotation could be a nice feature.
<flux> but was there some syntax for making strings without "?
<whitequark> {regexp| |regexp}
<whitequark> I wish it was {regexp| |}, like in every other language ever
<flux> a bit more syntax-heavy than // :-)
jj_ has joined #ocaml
<whitequark> imo it is so heavy as to be unusable
<flux> indeed
<flux> there are some benefits to that syntax, but I don't really think they outweigh the downsides
q66[lap] has joined #ocaml
samrat has quit [Ping timeout: 244 seconds]
Thooms has joined #ocaml
bezirg has quit [Ping timeout: 244 seconds]
q66[lap] has quit [Ping timeout: 250 seconds]
divyanshu has joined #ocaml
mlilenium_ has joined #ocaml
mlilenium_ has left #ocaml [#ocaml]
slash^ has quit [Read error: Connection reset by peer]
Thooms has quit [Ping timeout: 260 seconds]
sheijk has joined #ocaml
jj_ has quit [Ping timeout: 246 seconds]
elfring has quit [Quit: Konversation terminated!]
divyanshu has quit [Quit: Computer has gone to sleep.]
<flux> well, someone can write a [%re "foo"] extension, which would be a lot more bearable (though still not optimal..)
<whitequark> true
<adrien> and make it use Str
<whitequark> no.
<adrien> :D
* whitequark slaps adrien around a bit with a large trout
<flux> actually it could be [%re ^just.*a regexp$], right? but perhaps not [%re [a-z]*]
<adrien> whitequark: that's not very nice
<whitequark> adrien: do you know what else isn't nice? Str!
Thooms has joined #ocaml
<whitequark> flux: such syntax hacks are fraught with peril...
<adrien> but but but !
<adrien> actually I just remembered I really need to start a washing machine o/
<flux> whitequark, but if you're putting it inside strings, do you get to use \s etc directly?
<whitequark> flux: nope, that has to be escaped
<flux> so no benefit whatsoever over plain function
<whitequark> there is, you could pre-parse it at compile time
<whitequark> and verify the syntax
<flux> well, yes, there is that. you could even statically determine the number of groups in it and return the appropriate tuple.
<whitequark> or do it with GADTs
hhugo has joined #ocaml
eikke has joined #ocaml
cesar is now known as Guest77857
testcocoon has quit [Ping timeout: 260 seconds]
<dmbaturin> Speaking of that, are there any practical examples of using GADTs?
<whitequark> ctypes?
<dmbaturin> Hhm.
<ggole> printf?
<dmbaturin> Well, true.
<adrien> ggole: "practical"
<adrien> ;p
<ggole> I've found them pretty hard to apply.
<companion_cube> http://cedeela.fr/batch-operations-on-collections.html if you're interested in a simpler example ;)
jc1 has joined #ocaml
jc1 has quit [Client Quit]
eikke has quit [Ping timeout: 260 seconds]
testcocoon has joined #ocaml
hhugo has quit [Quit: Leaving.]
<whitequark> companion_cube: so, when are you going to write a ppx_deriving plugin for your universal serializers/deserializers?
<companion_cube> hmpf.
<adrien> he's doing C now!
Hannibal_Smith has joined #ocaml
<adrien> traitor!
<companion_cube> when I write code again? I've not even started using ppx so far...
<whitequark> C, not even once
<companion_cube> no, I'm writing LaTeX those days
<adrien> you could be doing patoline!
<companion_cube> but there's a shiny Sexp library you can try to ppx_derive ;)
<companion_cube> lol.
<dmbaturin> companion_cube: Writing latex macros?
<whitequark> companion_cube: I'm not sure what is the value of a sexp library that's incompatible with sexplib
<companion_cube> nah, writing formulas in LaTeX ^^
<companion_cube> whitequark: you mean in its input or output?
<whitequark> API
<companion_cube> oh
<companion_cube> it's impossible to provide the same API, they Sexp type isn't structural anyway...
<whitequark> I could just use Sexplib?..
<companion_cube> sure
* whitequark recently modified deriving so that [%sexp_of: (int * int) list] can work
<companion_cube> someone cough adrien cough made it sound like Sexplib isn't that fast, though ;)
<whitequark> (it already works for yojson)
<adrien> and is in core and depends on camlp4 indirectly
<whitequark> adrien: it's not in core and it does directly depend on camlp4
<whitequark> that can be made conditional though
<companion_cube> doesn't it use a lot of those pa_foobar extensions?
<adrien> last time I looked it wasn't conditional
<whitequark> it's not conditional right now
<adrien> and now it's in core, at least in the tarball
<whitequark> hm, actually: Build$: flag(syntax)
<adrien> yeah, so I have a copy which is modified to avoid type_conv and which lives inside yypkg but that's not exactly a perfect situation
<whitequark> what I mean is that it doesn't depend on Core.
<whitequark> and apparently you can build it with --disable-syntax
<whitequark> opam package does not make use of that though
<companion_cube> depends: ocamlfind & camlp4 & type_conv on opam, though
<whitequark> exactly. I bet it's because old code expects sexplib to always have the pa thing
Anarchos has joined #ocaml
<adrien> it's also not particularly fast and it's big and uses packs
<adrien> and since it has built-ins for all types in the stdlib/otherlibs
<adrien> and it's packed
<yotam> whitequark: you can do regex with just {|regex|} I believe.
<adrien> you're pulling everything
<companion_cube> it can't be used in a streaming fashion ;)
<whitequark> yotam: it's a valid syntax, but claiming it only for regexps is somewhat wasteful
<whitequark> companion_cube: writing derivers for streaming readers/writers is a pain.
<whitequark> monads, monads everywhere
<yotam> ok you wanted a syntax just for regex that automatically does regex processing?
<whitequark> oh, you mean using {| |} as syntax for raw strings? that makes sense
<yotam> yeah
<yotam> it makes regex so much cleaner
<companion_cube> {re| foobar |re} does the trick too
<whitequark> ugly
<yotam> why is there mirroring in the syntax? does anybody know?
<yotam> wouldn't it have been cleaner to have {re| blah |} ?
<flux> somethingsomething about putting them inside each other, not sure what was the point.. :)
<companion_cube> if blah contains a |}, at least, you can change your bloc like {re.42| blah |re.42|}
<companion_cube> -|
<whitequark> you can still put them inside each other
<companion_cube> I think it's an escaping issue
<yotam> oh it's just to have a flexible escape sequence
<yotam> in that case, I'd expect most sequences to be 1 characters, if at that {r|...|r}
<yotam> ok so for regex, since { is never used with |, plain {|...|} should be fine
ralphtheninja has joined #ocaml
ontologiae has quit [*.net *.split]
larhat has quit [*.net *.split]
kaustuv has quit [*.net *.split]
_2can has quit [*.net *.split]
evert has quit [*.net *.split]
sh1ken has quit [*.net *.split]
deavid has quit [*.net *.split]
osnr has quit [*.net *.split]
mrvn has quit [*.net *.split]
tianon has quit [*.net *.split]
dmbaturin has quit [*.net *.split]
companion_cube has quit [*.net *.split]
nicoo has quit [*.net *.split]
NoNNaN has quit [*.net *.split]
evert has joined #ocaml
tianon has joined #ocaml
dmbaturin has joined #ocaml
_2can has joined #ocaml
companion_cube has joined #ocaml
larhat has joined #ocaml
ontologiae has joined #ocaml
kaustuv has joined #ocaml
mrvn has joined #ocaml
sh1ken has joined #ocaml
larhat has quit [Client Quit]
deavid has joined #ocaml
osnr has joined #ocaml
NoNNaN has joined #ocaml
morphles has quit [Ping timeout: 260 seconds]
nicoo has joined #ocaml
nicoo has joined #ocaml
nicoo has quit [Changing host]
ggole has quit [Ping timeout: 272 seconds]
rand000 has quit [Ping timeout: 244 seconds]
nop0x07bc has quit [Quit: WeeChat 0.4.3]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
WraithM has joined #ocaml
bezirg has joined #ocaml
hhugo has joined #ocaml
tac_ has quit [Ping timeout: 272 seconds]
ysz has quit [Quit: This computer has gone to sleep]
axiles has quit [Remote host closed the connection]
WraithM has quit [Ping timeout: 245 seconds]
<whitequark> File "parsing/pprintast.ml", line 228, characters 14-20: Assertion failed
<whitequark> sigh.
tac_ has joined #ocaml
eikke has joined #ocaml
WraithM has joined #ocaml
rand000 has joined #ocaml
bezirg has quit [Ping timeout: 240 seconds]
<jpdeplaix> whitequark: what's the difference between « expr [@@something] » and « expr [@something] » ?
<jpdeplaix> I tested and both works
q66[lap] has joined #ocaml
<Drup> yotam: of course not, other people will want to use this string thing.
<Drup> jpdeplaix: @@ attach to the struct, @ to the expression
<Drup> you probably tried in the top level, where bare <expr> is interpreted as "let _ = <expr>"
<jpdeplaix> oh I see.
<jpdeplaix> thanks
cago has quit [Quit: cago]
cago has joined #ocaml
sivoais has quit [Read error: Connection reset by peer]
Hannibal_Smith has quit [Quit: Sto andando via]
ollehar1 has joined #ocaml
teknozulu has joined #ocaml
hhugo has quit [Quit: Leaving.]
tane has joined #ocaml
Simn has quit [Quit: Leaving]
Thooms has quit [Quit: WeeChat 1.0.1]
<Drup> omg xD
ralphtheninja has left #ocaml [#ocaml]
bezirg has joined #ocaml
<whitequark> I certainly have not expected that.
teknozulu has quit [Ping timeout: 255 seconds]
fraggle_ has quit [Read error: Connection reset by peer]
oscar_toro has quit [Ping timeout: 260 seconds]
cago has left #ocaml [#ocaml]
AlexRussia has joined #ocaml
<AlexRussia> hello folks.I'm start to learn ocaml, but i see, interactive ocaml have one problem: i can't move to the left or to the right by current string.does ocalm have any alternative?
<AlexRussia> ocaml*
MercurialAlchemi has quit [Ping timeout: 272 seconds]
<dmbaturin> AlexRussia: Install utop.
teknozulu has joined #ocaml
<dmbaturin> Opam is the easiest way to do it.
Arsenik has quit [Remote host closed the connection]
<AlexRussia> dmbaturin: thanks
<AlexRussia> dmbaturin: i will try when i install ocaml 4, i've 3 now and some things not work right by this manual http://ocaml.org/learn/tutorials/basics.html i guess
<AlexRussia> dmbaturin: lol
<dmbaturin> AlexRussia: Note that you can install the compiler with opam too.
<AlexRussia> dmbaturin: i just read it bad :D
<AlexRussia> dmbaturin: compiler with opam?
teknozulu has quit [Ping timeout: 255 seconds]
<AlexRussia> dmbaturin: sorry, crazy question, does ocaml have something oriented to web develop?
manud has joined #ocaml
<AlexRussia> dmbaturin: like servers, frameworks....
<dmbaturin> What is your OS, by the way?
<dmbaturin> There's ocsigen, but I'm not a web guy so I never used it.
<AlexRussia> dmbaturin: gentoo :D
<dmbaturin> HHm, ocaml3? On gentoo? Sounds weird. ;)
<dmbaturin> I'd imagine they have 4.0.2 in ports already.
<AlexRussia> dmbaturin: gentoo count here as stable version, i've not see version enough when install it :/
sivoais has joined #ocaml
<AlexRussia> dmbaturin: 4 is masked, i've unmask it and that already in process to install ;)
<AlexRussia> dmbaturin: no more imagine, use web interface to portages and overlays http://gpo.zugaina.org/ ;)
<AlexRussia> dmbaturin: hm, okay
<AlexRussia> dmbaturin: tbh, ocaml enough fast to compile!
<dmbaturin> Yeah, the compiler is damn fast.
<companion_cube> whitequark: do you know how to link statically with C libraries?
<companion_cube> I'm struggling with my bindings...
<AlexRussia> dmbaturin: i mean, compile ocaml from source code enough fast
<AlexRussia> dmbaturin: than....even rust :/
<whitequark> companion_cube: for bytecode, you can't. and for native code, I think you can just pass it on the ocamlopt invocation
<companion_cube> oh.
<whitequark> AlexRussia: Rust compiler is very, very, very slow.
<dmbaturin> AlexRussia: Ocaml is written in ocaml.
<companion_cube> so, for bytecode, can I still load the library in the toplevel?
<whitequark> yes, you need so-called "stubs" for that
<whitequark> take a look at ocamlmklib
<AlexRussia> whitequark: no, i've yesterday compile rust from fun(test language on owm computer is fun!), so, it was over 3 hours to compile it use llvm-rust :/
<AlexRussia> dmbaturin: ...
<companion_cube> thanks
<AlexRussia> dmbaturin: how to i then compile first ocalm(3) withou ocaml insystem?
<AlexRussia> ocaml*
<AlexRussia> dammit
<AlexRussia> so, it installed
<whitequark> AlexRussia: well, your computer is also slow. but even on a modern i7, a single rust stage takes ~10 minutes, and complete bootstrap takes ~30 minutes
<whitequark> it shouldn't be like that.
<AlexRussia> whitequark: i don't think i3 is slow, i've hear its fast to compile things
<dmbaturin> AlexRussia: I've never read the gentoo build script, but it likely pulls precompiled binaries first.
<whitequark> AlexRussia: i3 is terrible for compiling things, the cache size is too small
<AlexRussia> dmbaturin: you can read ebuild, its not too much hard to read than any shell script ;)
<companion_cube> is there a way for oasis to call ocamlmklib for me?
<AlexRussia> whitequark: lol
<whitequark> companion_cube: CSources:
<companion_cube> but... I did add CSources -_-
<whitequark> show your _oasis
<whitequark> companion_cube: that ... should work
<whitequark> also, you shouldn't pass -O2 and certainly not -fPIC in CCOpt:
<companion_cube> I get a foobar.cma file, but it complains that some stub function isn't available
<companion_cube> I need -fPIC, otherwise it won't link :/
<whitequark> hrm
<AlexRussia> dmbaturin: heh, it seems like ocaml sources use make....i've no more to understand in this way
<whitequark> companion_cube: odd. anyway. what error exactly do you get
<companion_cube> thanksError: The external function `quantor_stub_add' is not available
<companion_cube> when I #load "foo.cma";;
<whitequark> show the output of ocamlobjinfo on foo.cma
<companion_cube> hmm, there's a "Extra C object files" field, and it's empty...
<AlexRussia> hm
<AlexRussia> for example: (a +. b) /. 2.0;;
<AlexRussia> why after operators + and / are dot(.) ?
<whitequark> companion_cube: yep, it should say: Extra C object files: -linotify_stubs
tane has quit [Quit: Verlassend]
<whitequark> and Extra dynamically-loaded libraries: -linotify_stubs
<ollehar1> AlexRussia: float point addition
<dmbaturin> AlexRussia: Because integers and floats are incompatible and those operators are not overloaded.
<AlexRussia> dmbaturin: complete incompatible? @_@
<whitequark> companion_cube: it might be that either CCLib or CCOpt break OASIS
<whitequark> Drup: wow, your simple deriver suggestion cost me 2 hours more than I thought and uncovered two compiler bugs
<Drup> Totally not intended :>
<whitequark> it's not a problem. I just haven't expected it at all
Guest77857 has quit [Remote host closed the connection]
kakadu has quit [Quit: Konversation terminated!]
<AlexRussia> dmbaturin: lol, i see gentoo haven't nice way to install opam from portages/overlays :/
<dmbaturin> AlexRussia: Precompiled binary doesn't work?
<AlexRussia> dmbaturin: it may work, i mean, here no usually way - via emerge
teknozulu has joined #ocaml
<whitequark> Drup: /me . o O ( should I write ppx_nonrec? )
<Drup> ?
<whitequark> type nonrec t = t
<whitequark> well, that's how it looks in camlp4. we could have type%nonrec t = t
<whitequark> but ocaml does not recognize type%... right now, so it would be [%nonrec type t = t] for the time being
<mrvn> instead of: type z = t type t = z?
<whitequark> that leaks type z
<AlexRussia> dmbaturin: what is utop itself?
<mrvn> the module signature hides it
<whitequark> you need to do the include-and-destructively-substitute trick
<companion_cube> almost looks like oasis ignores CCLib and CCOpt...
<companion_cube> and of course oasis' documentation webpage is down
manud has quit [Ping timeout: 240 seconds]
manud has joined #ocaml
teknozulu has quit [Ping timeout: 250 seconds]
<companion_cube> is there a way to give -cflags through oasis ?
<companion_cube> (sorry, but I can't access the documentation :s)
<whitequark> Drup: I looked at type_conv's nonrec implementation and I don't want to write it anymore
<whitequark> companion_cube: _tags
<companion_cube> awwww
<companion_cube> well, worth trying
<companion_cube> I guess it's cflags(foo)?
<whitequark> yes
<companion_cube> I'm so annoyed by the shitty documentation of oasis and ocamlbuild
<companion_cube> there isn't a proper list of _tags anywhere I search
<companion_cube> or even of what I can put in the tag itself
<whitequark> ocamlbuild -documentation
<companion_cube> like, ccopt("-I foo/bar")
<whitequark> it's just cflags(-I foo/bar)
<companion_cube> well, ocamlbuild -documentation is cryptic, I never understood its meaning
<companion_cube> Warning: tag "cflags" does not expect a parameter, but is used with parameter "-ccopt '-I ../../libs/quantor-3.0/'" <--- wtf seriously?
<whitequark> oh, right, -cflag is only a command-line argument
<companion_cube> ;_;
teknozulu has joined #ocaml
<whitequark> well, just write a myocamlbuild.ml file
<whitequark> you need some dispatch_combine incantation
cesar_ has joined #ocaml
<companion_cube> I want to die.
cesar_ is now known as Guest40816
<whitequark> that's perfectly normal
<whitequark> so, in the After_rules-> section, do something like flag ["ocaml"; "link"; "use_quantor"] & S[A"-ccopt"; A"-I ../../libs/whatever"]
<whitequark> (yes, I remember it from the top of my head)
WraithM has quit [Ping timeout: 244 seconds]
Guest40816 has quit [Ping timeout: 244 seconds]
<companion_cube> so anyway, that doesn't change that I can compile the .cma, it still doesn't declare its dependence on the stubs
<whitequark> show me the line that produces the .cma
<companion_cube> that will be quicker this way
AlexRussia has quit [Remote host closed the connection]
<companion_cube> I'm pissed off that it's been two hours I've been trying to make it compile properly, only to bind 5 functions
Submarine has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
eikke has quit [Remote host closed the connection]
<whitequark> you should probably say "libs": ignore in _tags
<whitequark> not not_hygienic
<whitequark> though not sure
<companion_cube> oh
<companion_cube> maybe, yes
<companion_cube> nah, it complains
<AlexRussia> function in ocaml may return diffrent type of arguments(or i need define few funtions for few arguments)?
<whitequark> companion_cube: duuuuuh
<whitequark> sigh
<companion_cube> ?
<whitequark> OASIS even told this to you:
<whitequark> W: No replace section found in file _tags
<whitequark> it works properly with this patch
<companion_cube> oh god.
<companion_cube> thanks.
<companion_cube> thanks a lot whitequark .
<dmbaturin> AlexRussia: What languages are you already familiar with?
<companion_cube> ♥
<AlexRussia> dmbaturin: ruby :D
<AlexRussia> dmbaturin: yes yes yes, there dynamic types, but it works :D
<whitequark> companion_cube: I'm not sure I should feel happy about knowing this
<AlexRussia> dmbaturin: ou,lol
<companion_cube> well without your help I'm not sure I could sleep this night, out of frustration
<AlexRussia> dmbaturin: i thought you mean which language are already implement multiple returned types from single function
<AlexRussia> dmbaturin: i am know C, C++ and Ruby(C# in progress)
<whitequark> companion_cube: you do take this seriously
<companion_cube> well for some reason, it makes me quite angry, unlike bugs or programming issues
<dmbaturin> AlexRussia: I don't know ruby, lol. Functions have exactly one return type, but you implement ad-hoc polymorphism with variant types. There's also parametric polymorphism with parametrized types.
<dmbaturin> * you can
<whitequark> in ruby functions return exactly one value as well
jonludlam has quit [Quit: Coyote finally caught me]
<AlexRussia> dmbaturin: in ruby it may works like that: def foo(x) {if x > 0 Float.new(x) else String.new(x)} for example, i am not sure it executable cause i am not much good with ';' :/
<AlexRussia> dmbaturin: what is ad-hoc polymorphism?
<dmbaturin> For ad-hoc polymorphism you can something like "type foo = Foo of float | Bar of string" and "let baz x = match x with Foo x -> <float stuff> | Bar x -> <string stuff>".
<dmbaturin> * can do
badon_ has joined #ocaml
<dmbaturin> I need some sleep I think, my typo rate scares me.
badon has quit [Ping timeout: 245 seconds]
manud has quit [Quit: manud]
<AlexRussia> dmbaturin: haha
<AlexRussia> dmbaturin: you want to get some sleep right now?
<dmbaturin> I can't do it right now, that's the problem.
struktured has joined #ocaml
<dmbaturin> Anyway, by ad-hoc polymorphism I mean implementing a function that can take or return values of some predetermined types.
ollehar1 has quit [Ping timeout: 260 seconds]
badon_ is now known as badon
<whitequark> ad-hoc polymorphism is essentially the same thing as operator overloading... OCaml doesn't have it
<whitequark> if implicits ever get merged, they would be an example of it
<dmbaturin> AlexRussia: The important thing is that baz works with the new foo type, not with float and string directly, so it's still one type.
demonimin has quit [Ping timeout: 260 seconds]
<dmbaturin> You cannot return either float or string from it, but you can return a value of type foo again.
demonimin has joined #ocaml
<AlexRussia> whitequark: its one value, its not one type ;)
<AlexRussia> dmbaturin: hm, then type foo =.... its define new type with properties of string and float same time?
<dmbaturin> Not quite, it can be either Foo of float, or Bar of string, but no both. It just provides you with a way to distinguish the float kind of foo from the string kind of foo.
<dmbaturin> Also, if you define two functions with the same name but different type signatures, it will not give you C++ style ad-hoc polymorphism, the second one will just shadow the first one.
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
tnguyen1 has joined #ocaml
tnguyen has quit [Ping timeout: 272 seconds]
badon_ has joined #ocaml
rand000 has quit [Quit: Lost terminal]
NoNNaN has quit [Remote host closed the connection]
<AlexRussia> dmbaturin: >A list has a head (the first element) and a tail (the rest of the elements)....
<AlexRussia> dmbaturin: sounds so lisp-like :D
NoNNaN has joined #ocaml
badon has quit [Disconnected by services]
<AlexRussia> dmbaturin: lol, i thought its a functions
<dmbaturin> whitequark: Where do I find more information about those implicits?
badon_ is now known as badon
omqal has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
<whitequark> dmbaturin: ask def`
<dmbaturin> AlexRussia: Well, in lisps a cons cell is essentially a primitive type, while in ML there's nothing special about 2-tuples.
xavierm02 has quit [Quit: Page closed]
AltGr has joined #ocaml