tmtwd has quit [Remote host closed the connection]
MrScout has joined #ocaml
samrat has joined #ocaml
MrScout has quit [Ping timeout: 248 seconds]
manud has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
tmtwd has joined #ocaml
accidus_benartiu has quit [Ping timeout: 246 seconds]
accidus has quit [Ping timeout: 240 seconds]
hay207 has quit [Ping timeout: 246 seconds]
mcclurmc has quit [Remote host closed the connection]
accidus has joined #ocaml
accidus_benartiu has joined #ocaml
mcclurmc has joined #ocaml
wagle has quit [Read error: Connection reset by peer]
hay207 has joined #ocaml
contempt has quit [Ping timeout: 256 seconds]
wagle has joined #ocaml
darkf has joined #ocaml
contempt has joined #ocaml
MercurialAlchemi has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 240 seconds]
dsheets has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
samrat has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
samrat has quit [Ping timeout: 240 seconds]
tmtwd has quit [Remote host closed the connection]
swgillespie has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
manud has quit [Quit: manud]
manud has joined #ocaml
manud has quit [Client Quit]
ggole has joined #ocaml
dsheets has quit [Ping timeout: 256 seconds]
dsheets has joined #ocaml
hsuh has quit [Ping timeout: 256 seconds]
hsuh has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
dsheets has quit [Ping timeout: 256 seconds]
kushal has joined #ocaml
Submarine has joined #ocaml
Submarine has joined #ocaml
sailorswift has joined #ocaml
psy_ has quit [Ping timeout: 256 seconds]
Simn has joined #ocaml
siddharthv_away is now known as siddharthv
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
hay207 has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
Bhavya has joined #ocaml
crocket has joined #ocaml
<crocket>
hello
<crocket>
Is it possible for a simple DDNS client daemon written in ocaml to run under 10MB?
keen__________18 has quit [Read error: Connection reset by peer]
manizzle has joined #ocaml
keen__________18 has joined #ocaml
sp0on has joined #ocaml
sp0on has quit [Client Quit]
sp0on has joined #ocaml
sp0on has quit [Client Quit]
sp0on has joined #ocaml
yomimono has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
<dmbaturin>
crocket: Sure. I'm not sure if there's a need for _simple_ DDNS clients though. :)
<dmbaturin>
There's sure need for a comprehensive but cleanly written one. ddclient is a mess.
<dmbaturin>
Either way, a "complex" one would hardly be 10MB large either, unless you link a lot of huge libraries.
<crocket>
dmbaturin, ddclient was written in perl.
<crocket>
perl encourages mess.
<dmbaturin>
crocket: Well, it's a mess even by perl standards.
ollehar has joined #ocaml
<crocket>
I don't try to write the next version of ddclient.
samrat has joined #ocaml
ollehar has quit [Quit: ollehar]
<dmbaturin>
crocket: Why don't you?
<dmbaturin>
I'd join it if you did. ;)
ollehar has joined #ocaml
<crocket>
dmbaturin, That is not my need.
<crocket>
I solve problems minimally.
yomimono has quit [Ping timeout: 250 seconds]
ollehar has quit [Remote host closed the connection]
ollehar has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
crocket has left #ocaml ["Leaving"]
samrat is now known as smingh
<smingh>
is there any way I can get utop in emacs to indent lines properly?
accidus has quit [Remote host closed the connection]
accidus_benartiu has quit [Remote host closed the connection]
mort___ has joined #ocaml
mort___ has quit [Client Quit]
manud has joined #ocaml
iorivur has joined #ocaml
iorivur has quit [Ping timeout: 256 seconds]
mort___ has joined #ocaml
smingh has quit [Quit: Computer has gone to sleep.]
smingh has joined #ocaml
lewis1711 has joined #ocaml
yomimono has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
KDr2 has quit [Ping timeout: 256 seconds]
sailorswift has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
KDr2 has joined #ocaml
Haudegen has joined #ocaml
nullcat has joined #ocaml
jonludlam has joined #ocaml
_andre has joined #ocaml
manud has quit [Quit: manud]
manud has joined #ocaml
<lewis1711>
is there a good dynamic array module floating around on opam?
<ggole>
There's one in batteries, and one in containers
<ggole>
Dunno about standalone
manud has quit [Quit: manud]
rand000 has joined #ocaml
vanila has joined #ocaml
<flux>
so I have this code that reads data with Cohttp from a SSL socket
<flux>
it uses Lwt_stream.fold_s on the stream to handle the received data
<flux>
then I use an external tool to kill the transwer in the meanwhile, and I get an Ssl.Read_error exception
<flux>
what would be the best way to just have this stream getting cut instead of the mysterious exception popping up? I of course colled some (very marginally) useful information during the fold, so I would rather just have it finish early than an exception killing the result altogether.
<flux>
I guess I could make a new stream out of the old one that intercepts the exception and swallows it, cutting the stream short..
<apache2>
lwt_try ?
<flux>
but if I put it outside the Lwt_stream.fold_s, the folded value within the it will be lost on the exception
<flux>
of course I could just put it to a variable, but that's ugly ;)
siddharthv is now known as siddharthv_away
<apache2>
:( I still don't understand lwt, so can't help you, but good luck!
jonludlam has quit [Ping timeout: 240 seconds]
<flux>
this brought me a bit further: let filter_stream_exceptions stream = Lwt_stream.from @@ fun () -> Lwt.catch (fun () -> Lwt_stream.get stream) (function | exn -> return None)
<flux>
maybe it should get an argument for handling the exceptions :)
Haudegen has quit [Ping timeout: 248 seconds]
<def`>
smondet: hmm, I tried arecent version of merlin, jsoo is ok
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rwmjones>
'course I'm using that documentation to implement the parser, so any undocumented stuff that goes on in the real parser won't work for me
cthuluh has quit [Ping timeout: 264 seconds]
<Drup>
rwmjones: that's a very good ocasion to improve the doc
<Drup>
but tbh, the only valid documentation is going to be the .mly, I'm affraid
<flux>
documentation should be generated from it.. :-)
samrat has joined #ocaml
samrat has quit [Ping timeout: 255 seconds]
iorivur has joined #ocaml
rand000 has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
ollehar1 has joined #ocaml
yomimono has quit [Ping timeout: 246 seconds]
yomimono has joined #ocaml
samrat has quit [Ping timeout: 246 seconds]
samrat has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
<NingaLeaf>
Is recursion dangerous? I was having an office debate about this given that my work is in OCaml and my colleagues are working in Java.
<NingaLeaf>
I've always used recursive functions and never thought twice about it. I've never had a side-effect or bug when using recursion.
<NingaLeaf>
Is there a situation where recursion could impact my work? (I've been using OCaml for just under a year)
<flux>
ningaleaf, well, if you are processing big data structures and your function isn't tail-recursive
<flux>
ningaleaf, particular example: List.reverse a big list
<Drup>
flux: that's no more dangerous than using a stack
samrat has joined #ocaml
<flux>
well, typical linux systems only come with 8 megabytes of it permitted by default
<flux>
it is possible to crash the program with recursion; it's not possible to crash it with a for loop :P
<flux>
well I suppose it is if your program is CPU-time limited :)
<flux>
drup, so it's not more dangerous, it can be exactly as dangerous
<NingaLeaf>
Oh I had no idea you could crash the program with recursion!
<Drup>
NingaLeaf: well, it's simply a stack overflow
<flux>
these days you do get a nice exception
<flux>
unless you happen to exceed the stack within a C function
<Drup>
flux: not always
<flux>
I find it particularly stupid that the standard library functions are implemented in a way that manipulating big lists in a simple fashion isn't always possible :/
<flux>
maybe a 8-megabyte list isn't the best thing to have. but maybe you usually have just 10k lists, and that one time your data is bigger, and your program fails :(
<flux>
of course, all alternative/augmented standard libraries fix this
samrat has quit [Ping timeout: 256 seconds]
<Drup>
does the JVM garantees tail call nowadays ?
<flux>
I very much doubt that
<flux>
but maybe it has tail calls for some situations?
<Drup>
this would explain the opinion of Java people on recursion
<theblatte>
usually it's better to start by reimplementing tail-recursive versions of List.* functions that are not tail-recursive :/
<Drup>
theblatte: map is not obvious to implement in a tailrec manner
<flux>
the problem is that a tail-rec List.map/List.reverse would either be unsafer or possibly slower
<Drup>
theblatte: that's, like, typical ML anti-pattern
<ggole>
In fact, somebody was working on a TRMC patch that should help
<theblatte>
Drup: it doesn't have t[D[D[D[D[Dhe same interface
<Drup>
and ?
<flux>
well, they could be in some Lst module
<theblatte>
also, wouldn't ocaml complain about List being defined twice?
<flux>
just to give the reader an idea that they are different
<Drup>
theblatte: no
MercurialAlchemi has joined #ocaml
slash^ has joined #ocaml
samrat has joined #ocaml
<Drup>
theblatte: I mean, you redefine List ..
<flux>
it wouldn't, because that's exactly what you're doing now
<ggole>
Oh, that was def`
<theblatte>
ah, I meant if we were to put it in a list.ml, but we don't have to
<Drup>
yeah
<Drup>
I mean, you redefine List by the empty module and put a lot of list_* functions, that's just silly ^^'
<flux>
let safe_map f xs = try List.map f xs with Stack_overflow -> List.rev_map f (List.reverse xs)
elfring has joined #ocaml
<flux>
what do I win?!
<Drup>
flux: the exception handler is not free, by far
<flux>
thought the case of not entering is pretty fast?
<Drup>
trmc is a better solution anyway
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<flux>
such a cheat. instead of using dirty hacks in the standard library ocaml just adds new language features.. ;-)
<ggole>
Properly done trmc is faster than Obj.magic hacks anyway
<ggole>
You can elide the write barrier.
Submarine has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
<flux>
it's nice, but it's sort of an invisible optimization, isn't it? if you rewrite such a function so that recursion happens via its argument, the optimization breaks?
<flux>
at least merlin is able to tell which places are tail calls and which not
<Drup>
flux: [@tailcall] ? :)
<ggole>
It's not really much more complicated than tail calls
<ggole>
It's a well-known optimisation in prolog circles
<ggole>
Been around for decades
tane has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
Hannibal_Smith has joined #ocaml
samrat has joined #ocaml
<jrslepak>
Some trouble with ocamlbuild... I have a .c file I'm using to define some extern functions for use by some generated LLVM code (like in http://llvm.org/docs/tutorial/OCamlLangImpl4.html). If I write a function that depends on libgc, I can compile it directly with gcc, but I can't get ocamlbuild to do the same when building the REPL. I included `A"-cclib"; A"-lgc"' in the `flag' list, but I still get a linking error (the same as I get if I invoke gcc w
samrat has quit [Ping timeout: 252 seconds]
samrat has joined #ocaml
dsheets has joined #ocaml
samrat has quit [Ping timeout: 240 seconds]
contempt has quit [Ping timeout: 265 seconds]
samrat has joined #ocaml
contempt has joined #ocaml
nullcat__ has joined #ocaml
samrat has quit [Ping timeout: 252 seconds]
spaceships has left #ocaml [#ocaml]
samrat has joined #ocaml
ygrek has joined #ocaml
jtfmumm has joined #ocaml
systmkor has quit [Quit: Leaving]
systmkor has joined #ocaml
darkf has quit [Quit: Leaving]
samrat has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
manizzle has quit [Ping timeout: 240 seconds]
jwatzman|work has joined #ocaml
creichert has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
nullcat has joined #ocaml
nullcat__ has quit [Ping timeout: 256 seconds]
shinnya has joined #ocaml
Denommus has joined #ocaml
nullcat has quit [Read error: Connection reset by peer]
nullcat has joined #ocaml
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 256 seconds]
sailorswift has joined #ocaml
jtfmumm has joined #ocaml
wraithm has joined #ocaml
MrScout has joined #ocaml
samrat has quit [Ping timeout: 256 seconds]
jao has joined #ocaml
cthuluh_ has joined #ocaml
Haudegen has joined #ocaml
samrat has joined #ocaml
mort___ has quit [Ping timeout: 246 seconds]
wraithm has joined #ocaml
nullcat_ has joined #ocaml
cthuluh_ is now known as cthuluh
samrat has quit [Ping timeout: 252 seconds]
nullcat has quit [Ping timeout: 244 seconds]
ygrek has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
samrat has quit [Ping timeout: 256 seconds]
jao has quit [Ping timeout: 252 seconds]
samrat has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
paddymahoney has joined #ocaml
sailorswift has joined #ocaml
hsuh has quit [Quit: leaving]
ggole has quit []
xificurC_ has joined #ocaml
ygrek has joined #ocaml
nullca___ has joined #ocaml
xificurC has quit [Ping timeout: 246 seconds]
nullcat_ has quit [Ping timeout: 278 seconds]
nha_ has joined #ocaml
MrScout has quit [Remote host closed the connection]
<Maelan>
Hi, I am working on a syntax tree. In the first place (input) it is untyped, then I run a typechecking on it. I would like to keep data, such as types inferred, attached to each node of the tree.
MrScout has joined #ocaml
<Maelan>
Currently I define twice the datastructure, once with no information attached and once with the type of each sub-expression.
<Maelan>
Something like:
<Maelan>
type expr = Var of string | Op_call of operator * expr list | And of expr list | …
<Maelan>
module Typed = struct type expr_ = Var of string | Op_call of operator * expr list | And of expr list | … and expr = typ = expr_ end
<Maelan>
(I have a type ‘typ’ defined somewhere.)
<Maelan>
oops, it is: … and expr = typ * expr
<Maelan>
But maintaining concurrently these two types is tedious and ugly.
<Maelan>
So I would like a means of doing something like:
<Maelan>
type expr_ = Var of string | Op_call of operator * expr list | And of expr list | …
wagle_ has joined #ocaml
<Maelan>
where I could then define the type ‘expr’ by either ‘type expr = typ * expr_’ or ‘type expr = expr_’
companion_square has joined #ocaml
Asmadeus_ has joined #ocaml
fds_ has joined #ocaml
rand000_ has joined #ocaml
maurer_ has joined #ocaml
_2can_ has joined #ocaml
wraithm_ has joined #ocaml
igitoor_ has joined #ocaml
orbitz_ has joined #ocaml
lyxia_ has joined #ocaml
<Maelan>
So the solution would be to replace ‘expr’ in the definition of type ‘expr_’ by a type parameter, but then it seems impossible to define properly type ‘expr’…
MrScout has quit [Remote host closed the connection]
mort___ has joined #ocaml
<Maelan>
in terms of type ‘expr_’, since the latter expects a parameter
<thizanne>
you could put your ast uin a functor
<nha_>
how usable is the scheme syntax for camlp5?
<thizanne>
something like module Make (Info : sig type 'a t end) = struct type expr = Var of string | Add of expr Info.t * expr Info.t end
dwoos_ has joined #ocaml
jefus_ has joined #ocaml
manizzle has joined #ocaml
bitbckt_ has joined #ocaml
<thizanne>
and then, module Untyped = Make (struct type 'a t = 'a)
MrScout has joined #ocaml
felipealmeida_ has joined #ocaml
<thizanne>
module Typed = Make (struct type 'a t * typ * 'a end)
lpaste_ has joined #ocaml
mcclurmc has joined #ocaml
wraithm has quit [*.net *.split]
tane has quit [*.net *.split]
rand000 has quit [*.net *.split]
jonludlam has quit [*.net *.split]
yomimono has quit [*.net *.split]
ollehar has quit [*.net *.split]
wagle has quit [*.net *.split]
ggherdov has quit [*.net *.split]
l1x has quit [*.net *.split]
companion_cube has quit [*.net *.split]
fds has quit [*.net *.split]
dwoos has quit [*.net *.split]
orbitz has quit [*.net *.split]
igitoor has quit [*.net *.split]
cdidd_ has quit [*.net *.split]
nicoo has quit [*.net *.split]
lupine has quit [*.net *.split]
Sorella has quit [*.net *.split]
seako has quit [*.net *.split]
cojy has quit [*.net *.split]
_2can has quit [*.net *.split]
boegel has quit [*.net *.split]
lpaste has quit [*.net *.split]
Jefus has quit [*.net *.split]
zozozo has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
lyxia has quit [*.net *.split]
maurer has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
srax has quit [*.net *.split]
mariusae has quit [*.net *.split]
felipealmeida has quit [*.net *.split]
bitbckt has quit [*.net *.split]
dwoos_ is now known as dwoos
felipealmeida_ is now known as felipealmeida
<Maelan>
Oh, right thizanne, I did not event thought of a functor.
<tizoc>
did anything change in merlin lately that may affect ppx_deriving?
ollehar has joined #ocaml
<Maelan>
The solution I thought of is by parameterizing the type of the data attached instead of parameterizing the type of nodes. That would avoid duplicating constructors, but I see no real benefit on it. This is less powerful, for untyped exprs I would be forced to attach some dumb data that I would have to ignore.
<flux>
hmm, if the type it parametrized, then doesn't it really mean that you don't need dummy data? I think many wouldn't call () dummy data, but rather no data :)
manizzle has quit [Ping timeout: 244 seconds]
* jrslepak
has a ()-annotated AST at some point
<flux>
bonus: you get to write functions that work on both kinds of AST, if it dosen't care about the attached data
<Maelan>
true
<Drup>
Maelan: the parametrized approach is probably better, imho
paddymahoney has quit [Remote host closed the connection]
wagle_ is now known as wagle
<Maelan>
By the way, a typed AST seems like a case study for GADT to me, but then duplicating the AST (an untyped tree and a GADT tree) is unavoidable, isn’t it?
<Drup>
yeah
<Drup>
also, gadt for a typed ast is not *always* such a great idea, in particular if you want to do code transformation at some point
<Maelan>
Why?
mcclurmc has quit [Remote host closed the connection]
<Drup>
because then you have to prove whatever property you have in your gadt is preserved by the transformation
manizzle has joined #ocaml
<Drup>
and by "prove", I mean "convince the typechecker"
mcclurmc has joined #ocaml
<Maelan>
(thanks for your link jrslepak, I just finished reading it)
<MercurialAlchemi>
Drup: do threats work?
iorivur has quit [Ping timeout: 240 seconds]
<Drup>
MercurialAlchemi: yes, "Obj.magic" will make the typechecker accept pretty much anything :D
<Drup>
but it is not without consequences :D
<MercurialAlchemi>
that's more like brainwashing
<jrslepak>
. o O ( by "threats," do you mean "coercion"? )
<Drup>
flux: didn't you had a bunch of stuff in the biocaml library too ?
<Drup>
s/flux/smondet/
<flux>
l/c
<flux>
smondet, that seems interesting
<flux>
seems to have lots of code as well, with documented interfaces
<flux>
seems to be based on mostly standard ocaml arrays, though, so I wonder how is its performance? it does depend on lacaml, so maybe some conversions are occurring..
<companion_cube>
bigarrays are compatible with lacaml, I think?
<flux>
I would imagine yes
<companion_cube>
if all you have is arrays of floats
paddymahoney has joined #ocaml
<flux>
oml seems to use 'float array' and 'float array list' though
<companion_cube>
erf
<smondet>
flux: do not hesitate to add issues to `oml`
<smondet>
Drup: indeed there was stuff I think in Biocaml (haven't touched it in a year)
<companion_cube>
is oml supposed to be only a math library, or also having machine learning stuff?
<flux>
I've been using Vg and Gg with some success, but they aren't lapack-based
<smondet>
companion_cube: well the people writing it are doing machine learning so they add sutff when they need it
<flux>
but as my existing code uses them, I'm pretty much bound to it.. maybe if I do something completely new I can try oml :)
<flux>
a machine learning library might even be more interesting than just a general math library. I noticed it has ~recently gained logistic regression, which is useful
<flux>
smondet, so should I make an issue about not being available via opam.. :)
igitoor has quit [Ping timeout: 240 seconds]
<smondet>
flux: yes, please (i'm not an author)
<smondet>
struktured / struk|desk knows more than me
<nullca___>
like, when I can make sure I can safely use it
<flux>
it's really quite simple: don't use it! :)
<nullca___>
.......
<nullca___>
well, then our OCaml-TLS is not safe!
<companion_cube>
sad
<nullca___>
that.. i mean, looks horrible to me
<nullca___>
then use this library to parse tls related protocol, i believe
<nullca___>
s/then/they
igitoor has joined #ocaml
<flux>
nullca___, I think this would be a better way to ask this. "Hey guys, I have this interface puzzle for you. How do I implement this signature safely? https://github.com/mirleft/ocaml-asn1-combinators/blob/master/src/asn_cache.ml - or must I resort to potentially kitten-eating unsafe code making use of Obj.magic? or just give up and switch the codebase to python? thanks!"
<nullca___>
....
<nullca___>
or
<flux>
or, to php
<nullca___>
could someone explain his comment at line 4
<nullca___>
partial fold?
<flux>
higher..order.. abstract..stuff
<companion_cube>
syntax
<companion_cube>
HOAS = higher order abstract syntax
<companion_cube>
it's when you have a grammar with binders, and represent the binders using the functions of OCaml
<companion_cube>
so that scoping is enforced by OCaml
igitoor has quit [Changing host]
igitoor has joined #ocaml
<nullca___>
ocaml's not being lazy really troubles me a lot these days. David Kaloper here uses such hack, together fix ``Fix`` to express recursive grammar, to deal with the problem
<companion_cube>
I like it not being lazy
<nullca___>
yeah
<nullca___>
i mean
<flux>
what's wrong with the 'lazy' mechanism?
<nullca___>
on this specific example, it's really inconvenient
<companion_cube>
otoh, yeah, lazy is sometimes too strict
<nullca___>
you have to do such trick
<companion_cube>
it's hard to tie the knot
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]