adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
The_Mad_Pirate has joined #ocaml
smazga has quit [Ping timeout: 265 seconds]
vicfred has quit [Quit: Leaving]
smazga has joined #ocaml
Manis[m] has quit [Ping timeout: 246 seconds]
tmhoang has quit [Ping timeout: 272 seconds]
Manis[m] has joined #ocaml
tmhoang has joined #ocaml
solarliner has quit [Ping timeout: 272 seconds]
smazga has quit [Ping timeout: 264 seconds]
olle has quit [Ping timeout: 256 seconds]
olle has joined #ocaml
The_Mad_Pirate has quit [Quit: Konversation terminated!]
smazga has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
wingsorc has joined #ocaml
mfp has quit [Ping timeout: 264 seconds]
hlisp has joined #ocaml
hlisp_ has joined #ocaml
hlisp has quit [Read error: Connection reset by peer]
wingsorc has quit [Quit: Leaving]
objmagic has joined #ocaml
dborisog has joined #ocaml
smazga has quit [Ping timeout: 246 seconds]
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee-cl has quit [Quit: Connection closed for inactivity]
Guest86932 has quit [Ping timeout: 260 seconds]
vicfred has joined #ocaml
hlisp_ has quit [Remote host closed the connection]
mbuf has joined #ocaml
andreas303 has quit [Remote host closed the connection]
olle_ has joined #ocaml
ollehar_ has joined #ocaml
andreas303 has joined #ocaml
inkbottle has quit [Quit: Konversation terminated!]
CcxWrk has quit [Ping timeout: 256 seconds]
chripell has joined #ocaml
<zozozo> kind of a generic question but apart from potentially legacy reasons, what is there to gain in transforming a program to be completely tail-rec vs augmenting the stack limit ? In this case it is not reaosnably easy to do and would basically require passing everything to CPS, which in effect basically trades stack space for heap space. So if in all cases the programm will take a lot of place to run,
<zozozo> why shouldn't it be the program's decision which ratio between stack space and heap space it uses/needs ?
<zozozo> (s/place/space)
<def> bonus point if you also answer what happens in multicore runtime, where you can use fiber to store stack fragments in heap.
solarliner has joined #ocaml
<zozozo> yeah, that's basically what brought me to the question: I thought hey what if when i approach the stack limit I just store that fiber and start a new one, thus doing what CPS does but kind of in chunks
<zozozo> and then, what if that was not necessary ?
<def> I don't think you have to store the fiber. The new runtime takes care of that.
<def> (a stack is automatically resized, with an amortized scheme).
<zozozo> yeah, you'd just need a way to check the stack and switch to a new fiber if it's too close to the limit I guess ?
<def> there is already the machinery to check stack limits built in.
<zozozo> (I don't think the new runtime will automatically prevetn stack overflows ?)
<def> on native stacks no, but on fiber yes.
<zozozo> so a computation in a fiber will not stack overflow ? and instead do an oom ?
<def> As far as I understand yes. Maybe that can be customized
<zozozo> oh that would be nice
<Armael> that was my understanding as well (but that was some time ago)
<zozozo> and in terms of performance does computing in a fiber rather than on the native stack changes a lot ?
<def> (it seems reasonable to do some sanity check, including running custom user functions, in stack resizing code)
<def> only when using externals.
<def> using allocating externals require switching back to the system stack.
<def> (at least that was the execution model around ~1 year ago, I haven't closely followed changes since)
<zozozo> ok, so I'm now in the category of people for whom multicore would solve some of my problems, never though that would be my case, XD
<def> :). Yep, multicore is a bit more than what the name suggest.
<zozozo> that certainly reduces my motivation to switch my whole project to CPS, :p
<def> CPS adds a lot of overhead
<zozozo> yeah beside the obvisou time cost of doing the rewrite, that is one of my concerns
<def> In your case it seems that you really want a stack, just a big one, right?
<zozozo> yes
<zozozo> basically its to do type-checking of astronomically big terms
<zozozo> in fact, exactly SMT-sized terms
<def> SMT can deal with astronomically big terms :o ?
<zozozo> so a disjunction over a million of elements in expected (and all the yada-yada concerning big lists, etc)
<zozozo> so I have terms with unbounded depth and width
<zozozo> and these should not make everything crash
olle__ has joined #ocaml
<zozozo> but writing substituion, printing, etc.. functions that do not crash on huge terms is a pain because not only does List.maps and such have to be tail-rec but you cannot really allow non tail-rec functions written in a navie way (e.g. for printing)
<zozozo> so even printing would need to be tail-rec, using a tail-rec version of List.map which itsefl takes as argument a function taking continuations, etc... basically writing everything in the continuation monad
<zozozo> and besides the headache that it would be in terms of writing the code, it would likely degrade perfs a lots
<def> Yep, I did that once, not because of the stack, but because I was simulating non-determinism.
<zozozo> hence the: "why does stack sapce gets limited so much when heap space is not, and why should we be forced to trade in onyl one direction ?"
<def> I confirm the part about headaches :P
<zozozo> since CPs will eat a lof of heap space to track the recursion, why not do it in the stack space, which ahs the additional benefit of being more hierarchised, and more efficient
<zozozo> so ulimit -s unlimited will become my friend I think, *but* since my program implements an internzl way to limit the memory used (by using gc alarms), it would need to find a way to estimate the memory used by the stack
<def> you can try to multicore trunk :)
<zozozo> haha
Haudegen has joined #ocaml
<olle__> ocaml has gc alarms?
<olle__> das cool
<zozozo> olle__: yes, you read a bit about one of the potentiel use of gc alarms there : https://discuss.ocaml.org/t/todays-trick-memory-limits-with-gc-alarms/4431
<theblatte> zozozo: what about switching to a stdlib that has tail-rec List.map et al.? They basically do List.rev |> List.rev_map so there'll be overhead
<zozozo> theblatte: that only solves a part of the problem, because since terms can also be arbitrarily deep, then even 1 frame for the tail-rec map at each level will blow up the stack
<zozozo> (I'm not saying it's not a good idea, just not enough on itw own)
<theblatte> ah :)
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
Anarchos has joined #ocaml
<Anarchos> i want to pin a package to a local directory, but opam complains about missing «install-bsd-compatible.patch»
jao has joined #ocaml
smazga has joined #ocaml
solarliner has quit [Ping timeout: 246 seconds]
mfp has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
pigeonv has joined #ocaml
kvda has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CcxWrk has joined #ocaml
kvda has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
<olle__> solution: stop wanting things
<Armael> 🤔
jaar has joined #ocaml
mbuf has quit [Read error: Connection reset by peer]
mbuf has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
smazga has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
smazga has quit [Ping timeout: 246 seconds]
Haudegen has quit [Quit: Bin weg.]
waleee-cl has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Haudegen has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Leonidas> so zen
<Leonidas> zen2 even
<olle__> zen 2.0
<olle__> POWER-ZEN
<olle__> American style
<Leonidas> oh no, no-naked-pointers will probably destroy all the C extensions :(
<gahr> is there a way to parse arbitrary run-time text into a Vdom.Node.t?
Anarchos has joined #ocaml
X-Scale` has joined #ocaml
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
X-Scale has quit [Client Quit]
emias has quit [Quit: WeeChat 2.3]
smazga has joined #ocaml
smazga has quit [Ping timeout: 246 seconds]
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #ocaml
<Anarchos> how to tell opam to compile a package with debug symbols ?
<companion_cube> it always does, afaik
<companion_cube> (well, dune does, opam doesn't know anything about debug symbols)
<Anarchos> companion_cube ocamldebug doesn't find the debug symbols for my local dypgen package
<companion_cube> do you compile dypgen with -g?
<companion_cube> 🤷
olle__ has quit [Ping timeout: 256 seconds]
zebrag has joined #ocaml
<Anarchos> companion_cube i use opam pin and opam install
<companion_cube> I mean, does dypgen opam file cause it to compile with `-g`
<companion_cube> dypgen's opam file is the one responsible for that stuf
<companion_cube> f
<Anarchos> let me see
<Anarchos> companion_cube i do'nt see anything, but i do'nt know the syntax of opam files
<companion_cube> look for the `build` step
<Anarchos> companion_cube in flags, i have only 'light-uninstall'
<Anarchos> build --> make
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
<Anarchos> companion_cube what should i put there, 'OCAMLPARAM="_,g" make ' ?
<companion_cube> does `make` not use debug? :/
<Anarchos> no idea
* Anarchos is idle: passe le balai
<companion_cube> but you're the one maintaining dypgen, aren't you?
<Anarchos> companion_cube no i am not. i am just doing PR to let it work
<Anarchos> cause i need it
<companion_cube> ah, I see
<companion_cube> although if you're the sole user, you're going to be the maintainer de facto
FreeBirdLjj has joined #ocaml
<Anarchos> companion_cube i wonder why no more projects use dypgen
<Anarchos> companion_cube it is the only parser framework i know to be able to deal with ambiguities and to add dynamically rules to the grammar
* Anarchos has returned
smazga has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
Haudegen has quit [Quit: Bin weg.]
<companion_cube> becaues most people try to avoid that, I think
<Anarchos> companion_cube yes but you know that for my app, i really need this tool (parsing math formulas and adding notations abuse)
<companion_cube> I know, but I think no one else tries to do that
<companion_cube> which is why you'r ethe only user
<zozozo> well coq does something like that but I think they use camlp4 (or 5 ?) for that iirc
<companion_cube> they don't try to parse arbitrarily ambiguous stuff
<companion_cube> they just have an extensible grammar
<zozozo> right
<zozozo> but that's enough of a complicated thing I think
<companion_cube> it's quite a different thing still
waleee-cl has quit [Quit: Connection closed for inactivity]
Haudegen has joined #ocaml
chripell has quit [Quit: Leaving]
mbuf has quit [Quit: Leaving]
dborisog has quit [Ping timeout: 246 seconds]
<flux1> so I've updated my old system to use opam 2.x but opam switch doesn't show an ocaml compiler more recent than 4.06.1+multicore after doing opam update. what do I need to do to make 4.10 show?
<Anarchos> opam list-available-switch ?
<flux1> hmm :) I guess I was confused, the list was 16 already entries long. thanks!
<flux1> hmm, so if I use ocaml multicore, does it give me an easy way to work with a synchronous C libary, like postgresql?
<flux1> ..in a parallel manner
<flux1> actually probably regular OCaml threads give me that already, except for the limited event support in the Event module
waleee-cl has joined #ocaml
tane has joined #ocaml
cyberbanjo has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
jnavila has joined #ocaml
Anarchos has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
<olle> was russel really the inventor of type theory? claimed here: https://plato.stanford.edu/entries/type-theory/
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
cyberbanjo has quit [Read error: Connection reset by peer]
jnavila has quit [Quit: Konversation terminated!]
tane has quit [Quit: Leaving]
kvda has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
solarliner has joined #ocaml
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 256 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 258 seconds]
<dash> Who would you credit it to?
<companion_cube> I'd have thought of Church
solarliner has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 264 seconds]
jaar has quit [Quit: Leaving]
kvda has joined #ocaml