adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
themsay has quit [Ping timeout: 252 seconds]
emmanuel_erc has joined #ocaml
carlosdagos has joined #ocaml
emmanuel_erc has quit [Ping timeout: 252 seconds]
keep_learning has joined #ocaml
keep_learning has quit [Client Quit]
djellemah_ has joined #ocaml
djellemah has quit [Ping timeout: 260 seconds]
keep_learning has joined #ocaml
keep_learning has quit [Client Quit]
JimmyRcom has joined #ocaml
themsay has joined #ocaml
rdivyanshu has joined #ocaml
keep_learning has joined #ocaml
keep_learning has quit [Client Quit]
tormen has joined #ocaml
spruit1111 has joined #ocaml
spruit1111 has quit [Remote host closed the connection]
tormen_ has quit [Ping timeout: 252 seconds]
iggy22 has joined #ocaml
iggy22 has quit [Remote host closed the connection]
keep_learning has joined #ocaml
keep_learning has quit [Client Quit]
JimmyRcom has quit [Ping timeout: 240 seconds]
keep_learning has joined #ocaml
keep_learning has quit [Client Quit]
jao has quit [Ping timeout: 252 seconds]
aohwang has quit [Quit: HydraIRC -> http://www.hydrairc.com <- The professional IRC Client :D]
piccolo has quit [Remote host closed the connection]
keep_learning has joined #ocaml
averell has quit [Ping timeout: 252 seconds]
averell has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
kotrcka has quit [Quit: Page closed]
Rosslaew has joined #ocaml
ygrek has joined #ocaml
sagotch has joined #ocaml
orbifx1 has joined #ocaml
KombuchaKip14 has joined #ocaml
KombuchaKip14 has quit [Ping timeout: 252 seconds]
orbifx1 has quit [Ping timeout: 272 seconds]
pierpal has quit [Quit: Poof]
Guest37815 has joined #ocaml
themsay has quit [Ping timeout: 240 seconds]
keep_learning has quit [Remote host closed the connection]
carlosdagos has quit [Quit: Connection closed for inactivity]
<xvilka> after some ocaml experience programming something in python brings zero joy and very boring
<enikar> indeed !
sagotch has quit [Quit: Leaving.]
<def`> :]
<xvilka> I'm now even thinking to learn and use Elixir for scripting, where I used Python before
<enikar> the main advantage of python, against ocaml, is the big collection of libnraries to do anything.
<xvilka> this is true, not like I am using all of them though
<enikar> of course, who will be able to use all of them ?
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
slamzy has joined #ocaml
Guest37815 has quit [Remote host closed the connection]
<Leonidas> xvilka: yes, I had the same experience. And promptly proceeded to shoot myself in the foot using mutability
asymptotically has joined #ocaml
asymptotically has quit [Remote host closed the connection]
asymptotically has joined #ocaml
pierpal has joined #ocaml
djellemah_ is now known as djellemah
sagotch has joined #ocaml
kakadu has quit [Remote host closed the connection]
freyr69 has joined #ocaml
Guest49829 has joined #ocaml
Guest49829 has quit [Remote host closed the connection]
Haudegen has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
spew has joined #ocaml
waleee has joined #ocaml
r3s1stanc3 has quit [*.net *.split]
xuanrui has quit [*.net *.split]
jimt has quit [*.net *.split]
hannes has quit [*.net *.split]
zv has quit [*.net *.split]
theglass has quit [*.net *.split]
erkin has quit [*.net *.split]
troydm has quit [*.net *.split]
ski has quit [*.net *.split]
err0ne has quit [*.net *.split]
ansiwen has quit [*.net *.split]
tg has quit [*.net *.split]
so has quit [*.net *.split]
rixed has quit [*.net *.split]
hannes has joined #ocaml
err0ne has joined #ocaml
r3s1stanc3 has joined #ocaml
ansiwen_ has joined #ocaml
tg has joined #ocaml
theglass has joined #ocaml
erkin has joined #ocaml
troydm has joined #ocaml
rixed_ has joined #ocaml
zv has joined #ocaml
zv has quit [Changing host]
zv has joined #ocaml
erkin has quit [Changing host]
erkin has joined #ocaml
jimt has joined #ocaml
theglass is now known as Guest82070
Guest82070 has quit [Changing host]
Guest82070 has joined #ocaml
ansiwen_ is now known as ansiwen
xuanrui has joined #ocaml
so has joined #ocaml
rixed_ is now known as rixed
ski has joined #ocaml
Rosslaew has quit [Ping timeout: 244 seconds]
<companion_cube> also, lack of expressions ---
<companion_cube> -_-
mfp has joined #ocaml
ski has quit [Ping timeout: 260 seconds]
ski_ has joined #ocaml
JimmyRcom has joined #ocaml
ski_ has left #ocaml [#ocaml]
ski has joined #ocaml
freyr69 has quit [Remote host closed the connection]
waleee has quit [Quit: WeeChat 2.2]
jaar has joined #ocaml
slamzy has quit [Remote host closed the connection]
zv has quit [Ping timeout: 264 seconds]
zv has joined #ocaml
AltGr has joined #ocaml
Haudegen has quit [Remote host closed the connection]
bitonic has joined #ocaml
<bitonic> is the bytecode in https://github.com/ocaml/ocaml/blob/acb0e91ac67e5b905a9d615d936297c4acb1efc0/bytecomp/instruct.mli explained anywhere? a brief description of each instruction would be enough
<Armael> and the sources of the bytecode interpreter..
<bitonic> Armael: thank you!
<bitonic> Armael: that's very helpful. what about the untyped lambda representation? i'm trying to decide where one would start to implement an alternative backend
<Armael> for lambda, I don't think there is other documentation apart from the compiler sources
<bitonic> ok. some of the concepts carry over to the bytecode (like the "blocks")
<Armael> if you want to implement an alternative backend, bytecode has the advantage that it is very stable
<Armael> and it's not too hard to recover some structure from it (you can look for example at what js_of_ocaml is doing)
<bitonic> Armael: right, the thing is that (for example) the vm seems a bit too primitive compared (say) to the JVM
<bitonic> which has locals rather than just a stack, for example
<bitonic> so it'd probably be a bit wasteful
<bitonic> anyway, i just implemented a lambda calculus + arrays + strings + cons cells to jvm compiler and i wanted to see how much effort it'd be to just compile ocaml
<bitonic> http://www.ocamljava.org/ clearly somebody had the same idea a long time ago :)
<bitonic> in fact the same guy that wrote those docs!
<companion_cube> good luck for tailcalls on the jvm though
<bitonic> companion_cube: that's actually not too hard to do
<Armael> mmm well
<bitonic> unrestricted recursion a la haskell _is_ very hard to do at speed though
<Armael> if your target doesn't have TCE you can do a best effort thing
<bitonic> but plain tail calls (single function) are not too hard to turn into loops
<companion_cube> also good luck for 31/63 bit integers
<Armael> but in general you won't be able to handle code in CPS for example
<companion_cube> ^
<bitonic> Armael: does ocaml handle tail calls for cps'd code?
<companion_cube> it handle tail calls to arbitrary closures
<companion_cube> handles*
<bitonic> (i know very little about ocaml and how it compiles, it's just the first strict functional language that popped into my mind)
<Armael> it compiles all tail calls to jumps
<bitonic> ok, so ocaml compiles _all_ tail calls away. yes, that is hard on the jvm
<bitonic> tail recursion for a single function is pretty easy, but that is indeed hard
<bitonic> and tail recursion in cps / monadic code is also hard
<bitonic> which is a massive pain in scala actually
<companion_cube> you can also have a mix of tail/non-tail calls in a single function
fraxamo has joined #ocaml
<Armael> yeah I've read some insane freer-trampolining-monad things from scala people
<bitonic> Armael: the only reliable thing to do is to trampoline. so you don't overflow but you do get a lovely 50x slowdown :P
<Armael> yeah
<bitonic> that's also what stuff like ghcjs does. there just isn't a great solution to that problem
<Armael> js_of_ocaml does that as well
<companion_cube> there is, it's called ocamlopt
<Armael> :)
<bitonic> companion_cube: well yes if you compile to native code you can have whatever you like
<bitonic> you can go off and build your stack on the heap like haskell does 🙃
<bitonic> Armael: ah interesting, js_of_ocaml is trampolined? i'm pretty sure bucklescript isn't
<Armael> only in hard cases
<Armael> it compiles self-recursion into for-loops
<companion_cube> well BS doesn't try to follow OCaml's semantics too hard, I heard
<bitonic> Armael: straight, single function self recursion is actually relatively rare
<bitonic> or anyway hard to fit programs into :(
<Armael> uh
<Armael> 99% of the recursive functions I write are doing self-recursion?
<bitonic> e.g. if you do AST traversals you end up in situations where expressing everything with simple self tail recursion is a massive pita
<companion_cube> I tend to have a lot of mutually recursive funs…
<bitonic> Armael: try using scala and write in a functional style
<bitonic> i find that i run against that wall all the time
<Armael> *shrug*
<Armael> anyway, regarding js_of_ocaml I don't remember the specifics exactly; I just now that it compiles to loops, and then resorts to trampolining if it's too complicated
<Armael> but then if you write code in CPS it will just stack overflow
<bitonic> makes sense
<bitonic> wait, why would it stack overflow if it trampolines?
<Armael> it doesn't trampoline the whole program AFAIR
<bitonic> uhu
<Armael> it just does it locally on nests of mutually recursive functions
<bitonic> okay, that sounds a bit bizarre
<Armael> again don't take my word for it, I looked at it a while ago
<bitonic> Armael: btw, the classic example of running into the recursion wall in scala is just the inability of factoring out common parts of the recursive functions in helper methods, since scala is not smart enough to turn everything into a single loop
<bitonic> so you end up manually inlining code or giving up, usually
<Armael> beh
sagotch has quit [Quit: Leaving.]
bartholin has joined #ocaml
AltGr has left #ocaml [#ocaml]
steenuil has joined #ocaml
RalfJ has quit [Ping timeout: 252 seconds]
RalfJ has joined #ocaml
breitenj has quit [Ping timeout: 252 seconds]
breitenj has joined #ocaml
jao has joined #ocaml
<Drup> bitonic: if you want to compile *to* ocaml, use malfunction
<Drup> if you want to create a new backend for ocaml, aka ocaml to something else, then it's debateable
emmanuel_erc has joined #ocaml
jaar has quit [Quit: Leaving]
kotrcka has joined #ocaml
oni-on-ion has quit [Ping timeout: 244 seconds]
oni-on-ion has joined #ocaml
on_ion has joined #ocaml
oni-on-ion has quit [Ping timeout: 276 seconds]
al-damiri has joined #ocaml
<Leonidas> I think all new backends should start form a stable base like 4.02 *ducks*
fraxamo has quit [Quit: Leaving]
igitoor has quit [Quit: leaving]
igitoor has joined #ocaml
emmanuel_erc has quit [Ping timeout: 268 seconds]
igitoor has quit [Changing host]
igitoor has joined #ocaml
jnavila has joined #ocaml
orbifx1 has joined #ocaml
spew has quit [Quit: gone meditatin']
crowley95 has quit [Ping timeout: 268 seconds]
crowley95 has joined #ocaml
emmanuel_erc has joined #ocaml
igitoor has quit [Quit: leaving]
pierpa has joined #ocaml
igitoor has joined #ocaml
igitoor has quit [Changing host]
igitoor has joined #ocaml
asymptotically has quit [Quit: Leaving]
jnavila has quit [Remote host closed the connection]
bartholin has quit [Remote host closed the connection]
orbifx1 has quit [Ping timeout: 246 seconds]
emmanuel_erc has quit [Ping timeout: 272 seconds]
<on_ion> 4.08 not ? =)
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
igitoor has quit [Remote host closed the connection]
troydm has joined #ocaml
igitoor has joined #ocaml
kino` has joined #ocaml
kino` has quit [Client Quit]
igitoor has quit [Changing host]
igitoor has joined #ocaml
carlosdagos has joined #ocaml
sammie has joined #ocaml
averell has quit [Quit: .]
dmiles has quit [Ping timeout: 240 seconds]
themsay has joined #ocaml
averell has joined #ocaml
pierpal has quit [Ping timeout: 252 seconds]
igitoor has quit [Ping timeout: 252 seconds]