* adrien_oww
grabs companion_cube, ties his hands, gags his mouth, blindfold him and sends him to mongolia so noone can hear his crazy ideas again
<adrien_oww>
toordog: you're able to recompile ocaml?
<companion_cube>
adrien_oww: heyyyyyyy
<companion_cube>
there's a compilation backend for JS, so any other target can't be that crazy
<companion_cube>
(php, maybe)
<jbrown>
companion_cube: isn't the erlang runtime basically a bytecode interpreter?
<Drup>
companion_cube: evm_of_ocaml ? :D
<companion_cube>
jbrown: I think so
<jbrown>
the ghc runtime on the other hand...
<companion_cube>
it has tail call
<companion_cube>
it may even have weak tables...
<companion_cube>
also, hot swapping of code
<toordog>
adrien_oww not really
<adrien_oww>
ok
<toordog>
i believe it's coming from the code we created which is a module for liquidsoap
<adrien_oww>
there isn't a lot of info there
<toordog>
but i don't have a clue to where these call come from
WraithM_ has joined #ocaml
<toordog>
ok
<adrien_oww>
I suspect a stack overflow because of the depth of the callstack but it's not _that_ deep either
<adrien_oww>
otoh the fact that it crashes in some code that catches an exception is quite surprising
<toordog>
yesterday, we raised the stack size limit on the OS to allow ocaml to run without segfaulting
<toordog>
we raised it to 8M
<thomasga>
if someone wants to make me a nice gift for christmas, I would happily accept a build system which just works
<adrien_oww>
well, it's an upper limit
* toordog
snap his finger and once the smoke disapeared, a build system that actually works appear in front of thomasga
<thomasga>
toordog: if only
<toordog>
you have to believe for it to works thomasga ;)
<adrien_oww>
thomasga: every time I've thought long about that, I ended up with the conclusion that we all ask quite a lot of different things that start very simple then grow _a_ _lot_
<adrien_oww>
I'm not sure it's that doable
<adrien_oww>
that said, ocamlbuild with less dynamic discovery is something I'd like to see
watermind has quit [Read error: Connection reset by peer]
watermind has joined #ocaml
<thomasga>
adrien_oww: indeed
<thomasga>
not sure such a thing exists, but that would be cool to have anyway
<toordog>
adrien_oww so you think the issue could be the same as before with a not well managed memory allocation?
<thomasga>
would be happy to have something which solves only 99% of my problems
<adrien_oww>
I recently ended up having to add C code right inside yypkg; that's not something I ever expected to do
rom1504 has joined #ocaml
<adrien_oww>
(at least it found a bug in cross-compilation patches)
<adrien_oww>
toordog: dunno; I'd probably start finding what the exception is about
<adrien_oww>
"caml_raise_exn"
jonludlam has quit [Ping timeout: 248 seconds]
<toordog>
ok, i'll send it to the dev
<toordog>
we might end up hiring a consultant in the end
dant3 has quit [Remote host closed the connection]
<adrien_oww>
I'd look at the (C) code of caml_raise_exn() while doing "frame 2" in gdb and checking the parameters to the function to know which excepted has been triggered
<adrien_oww>
you need to build with debug symbols too ;-)
<adrien_oww>
and not strip
kyrylo has joined #ocaml
<adrien_oww>
or strip to a separate file that gdb will be able to find when you load the core
jonludlam has joined #ocaml
shinnya has joined #ocaml
* companion_cube
thinks the cloud of smoke will not disappear before years
<adrien_oww>
companion_cube: err, ok
groovy2shoes has joined #ocaml
dsheets has quit [Quit: Leaving]
Xenasis has joined #ocaml
dsheets has joined #ocaml
travisbrady has joined #ocaml
dsheets has quit [Client Quit]
dsheets has joined #ocaml
chingfantsou has joined #ocaml
yezariaely has quit [Quit: Leaving.]
chingfantsou has left #ocaml []
Yoric has quit [Ping timeout: 260 seconds]
Kakadu has quit [Quit: Page closed]
Xenasis has quit [Remote host closed the connection]
skchrko has quit [Ping timeout: 260 seconds]
agnoctone has quit [Quit: Page closed]
oriba has joined #ocaml
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 252 seconds]
Axord has quit [Quit: I'm sure it's perfectly safe]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
dant3 has joined #ocaml
jwatzman|work has joined #ocaml
rwmjones has quit [Ping timeout: 245 seconds]
<whitequark>
gasche_: hello
<whitequark>
are GADTs powerful enough to represent the universal quantifier? say val concat : 'a stream -> 'a stream -> 'a stream
<companion_cube>
this is already possible without GADT
<companion_cube>
what becomes possible is the existential quantifier
<companion_cube>
type exists_stream = | Foo : 'a stream -> exists_stream
<whitequark>
companion_cube: sorry, you've missed the context of the question
<ggole>
Is this the thing where you want to say "this type variable conveys no information about this variant", ie, it can be any leg?
<Drup>
whitequark: don't use Stream :/
<whitequark>
ggole: no, this is an entirely different problem
<whitequark>
Drup: hm? why?
<ggole>
Righto
<Drup>
whitequark: because it's full of so many issues it's not even funny anymore
* ggole
wishes there was a way to do that without a silly wrapper
<whitequark>
Drup: I'm using Lwt_stream in my actual code
<Drup>
I'm talking about the stream from the standard library
<whitequark>
yeah, in the example it's just for demonstration purposes
<Drup>
ok
introom has quit [Ping timeout: 272 seconds]
<Drup>
whitequark: a reason why you don't want to describe this stuff in caml with some sort of dsl ?
<toordog>
adrien_oww is there anything in the runtime of ocaml that could fill a buffer unlessly leading to a stack overflow or segfault ?
<whitequark>
Drup: I want to be able to load a plan at runtime without recompilation
<Drup>
whitequark: and compilation + runtime dynlink doesn't suit you, I suppose
<whitequark>
Drup: yes, I would like to avoid that
<Drup>
make sense
demonimin has quit [Ping timeout: 245 seconds]
<whitequark>
for a variety of reasons, starting with the fact you cannot unload a dynlinked library
<adrien_oww>
toordog: there shouldn't be; if you can, you should really try to reproduce the issue on a separate machine and put a newer ocaml there
<adrien_oww>
there have been quite a lot of changes which could help you a lot when trying to find such issues
<adrien_oww>
(especially stack overflow since you should get an earlier warning)
<toordog>
i don't have any idea how to reproduce it actually. on 52 process running, only 2 segfault like that in 20h lenght of time.
<toordog>
i think that the segfault happen when an error is raised but not handled correctly
<Drup>
whitequark: what issues do you have with concat ?
milosn has quit [Ping timeout: 272 seconds]
<toordog>
i have 2 server running with ocaml 4.x
<whitequark>
Drup: say, `square' has an OCaml signature int stream -> int stream and is defined like this: let square : _ typed = (Fun (Stream Int, Stream Int), square)
<whitequark>
`concat' has an OCaml signature 'a stream -> 'a stream -> 'a stream and would be defined like this: let concat : _ typed = (Fun (Stream ?, Fun (Stream ?, Stream ?)), concat)
<whitequark>
in the place of ? should be the GADT representation of the type variable
<whitequark>
but I don't know how to define it
jonludlam has quit [Read error: Operation timed out]
<companion_cube>
isn't more a "compose" function?
<whitequark>
companion_cube: well, I think it's called "append" in Lwt_stream
<companion_cube>
oh, all the type variables are the same?
<whitequark>
but that doesn't really matter
<companion_cube>
the three "?"
<whitequark>
companion_cube: yes
ocp has quit [Ping timeout: 246 seconds]
<companion_cube>
ah
<whitequark>
I can add a branch, say, | Typevar : int -> 'a typ
<companion_cube>
you can write "forall", conceptually, with a record containing a function
<whitequark>
but I don't know how to actually check for equivalence with such definition
<Drup>
whitequark: I don't think it's a good idea
<companion_cube>
type 'a foo = {'b. ('a -> 'b) -> 'b; }
<companion_cube>
type 'a foo = {call:'b. ('a -> 'b) -> 'b; }
<companion_cube>
(that's to do CPS)
<whitequark>
companion_cube: I'm not sure I see how is this relevant
<companion_cube>
well, you asked for a universal quantifier ;)
<companion_cube>
(but I'm not sure either)
<whitequark>
Drup: I just had an idea
jonludlam has joined #ocaml
<whitequark>
Drup: if I somehow know the type bound to the type variable in advance, it's possible to do this:
<whitequark>
let a = Int (* Float, String, ... *) in
<whitequark>
Dyn (Fun (Stream a, Fun (Stream a, Stream a)), fun (S x) (S y) -> S (Lwt_stream.append x y))
<whitequark>
Drup: I could make it work if I would have some kind of template to match against
<whitequark>
(isn't this how parametric types work in ML?)
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
<Simn>
I hope you don't mind if I chime in with a non-OCaml GADT question while you're on the subject. Should it be allowed to have constructors of different types in an or-pattern while matching? Here's a Haxe example of what I mean: https://github.com/HaxeFoundation/haxe/issues/2473
<ggole>
"Well, there were other factors in play there. htmlspecialchars was a very early function. Back when PHP had less than 100 functions and the function hashing mechanism was strlen()."
<ggole>
Wat
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
<malvarez>
yeah, that's php for you
zpe has joined #ocaml
Xenasis has joined #ocaml
jonludlam has quit [Remote host closed the connection]
<whitequark>
to me it looks like a NIH version of Lwt
<orbitz>
whitequark: I use Core, and Async is consistent with the rest of Core
<whitequark>
I see
<orbitz>
I've only written one thing in lwt and I found the API a bit messy and unorganized
<Drup>
if your code is already using core all over the place, not using it sounds like a difficult mission.
<orbitz>
But I was a young, inexperienced, ocaml developer at the time. It started out as a modeling contract and next thing I know they wanted meto do two things...at once
zacts_ has quit [Quit: leaving]
<whitequark>
I found Lwt rather well-designed, sans few obviously legacy parts
zacts has joined #ocaml
<whitequark>
and I've tried to pick up Core several times but gave up after looking at compile times and executable sizes
<orbitz>
yep, a serious flaw of Core
zacts is now known as Guest32833
<orbitz>
hopefully some good deadcode detection will make its way into Ocaml soon
Guest32833 has quit [Client Quit]
<orbitz>
I like teh general design of Core enough to use it, but I think it has some serious flaws
<whitequark>
... or maybe Core will become more modular. :p
<orbitz>
I think they inverted a lot of the container stuff, which is an ok idea if you control the whole library, but doesn't compose at all
zacts_ has joined #ocaml
<orbitz>
Like String.Map
<Drup>
I don't know about the design, I'm still waiting for some documentation. (yes, I like to bring this point back)
mcclurmc has quit [Remote host closed the connection]
<orbitz>
GADTs are above my paygrade :)
<whitequark>
hah
nullFxn has left #ocaml []
fds has quit [Ping timeout: 246 seconds]
fds has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
chturne has joined #ocaml
<whitequark>
hm, I think I understood it myself
<chturne>
Apparently the semantics of <expr1> ; <expr2> are that <expr1> is evaluated for side-effects, and then <expr2> is evaluated and the becomes the result of the entire expression. How come this ~ http://codepad.org/STOFo1g8 ~ only prints 10, and not 10 followed by "5 not even"?
<chturne>
Oh crap, parsing rules
<chturne>
need parens
<chturne>
Sorry for the noise
<whitequark>
ocp-indent can make these kinds of errors apparent
mreca has joined #ocaml
<chturne>
I did notice tuareg indenting the second match way over to the right, but like an idiot I assumed it was being silly and lined it up manually.
<chturne>
Always trust in tuareg :)
tane has quit [Quit: Verlassend]
dant3 has quit [Remote host closed the connection]