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
urek has quit [Quit: Leaving]
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
_whitelogger has joined #ocaml
rock64 has quit [Ping timeout: 256 seconds]
rock64 has joined #ocaml
mfp has quit [Ping timeout: 246 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
dborisog has joined #ocaml
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
mbuf has joined #ocaml
narimiran has joined #ocaml
benschza has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chripell has joined #ocaml
_whitelogger has joined #ocaml
Haudegen has joined #ocaml
snowpanda has quit [Quit: Leaving...]
<rosalogia> Hey everyone, super beginner question I apologise, but I'm wondering about the double semicolon and when it becomes necessary in .ml files? I'm generally struggling to find extensive documentation on how to work with .ml files and what the conventions are
<rosalogia> I've seen a lot of "the double-semicolon isnt actually part of the language and is completely unnecessary outside of utop" but I'm having trouble getting my programs to compile if I don't use a double-semicolon at least once before invoking the main function (which, again, please let me know if I'm wrong to be using one)
<def> rosalogia: you can use a let-binding in place of semicolon
<def> <expr>;; is useful in the top-level
<def> but `let my_name = <expr>` is preferred in an ml file
<def> `let () = main ()` for side-effectful functions
<def> or `let _ = <expr>` to just ignore the result of an expression though is generally not recommended
<rosalogia> ohh
<rosalogia> let me try that
drdee has joined #ocaml
<rosalogia> that works perfectly :) thanks for clarifying, appreciate it a lot
ArthurStrong has joined #ocaml
olle has joined #ocaml
<olle> how come ownership inference never made it to a language? I wonder why Rust went with explicit ownership :d
<olle> maybe it's easier to reason about?
<olle> or easier to read the code
ArthurStrong has left #ocaml [#ocaml]
seliopou has quit [Ping timeout: 260 seconds]
sagax has joined #ocaml
<Leonidas> rosalogia: it shouldn't ever be required. if it does then there might be something subtly wrong with your code, with it doing a different thing than you might expect it to do.
<rosalogia> thank you! :)
<Leonidas> olle: explicit ownership is tracking the somewhat implicit concept of ownership from languages like C into a formal system that the compiler can enforce
<olle> Leonidas: sure, but you can also infer it with escape analysis, e.g.
<olle> meaning, ownership is transfered iff the variable cannot escape
<olle> there are some papers on it online
<olle> rust went another way, tho
<flux1> it seems like actually deploying it to a useful language with mutation, lambda functions, threading, objects can be quite a task while at the same time having small syntax. I wonder if this really was a solved problem at the time when OCaml was devised?
<flux1> and I do wonder if tracing garbage collector is at all compatible. ie. Rust doesn't do it.
<olle> sure
<olle> Clean has uniqueness types, slightly related
<flux1> too bad Clean is proprietary, its ideas might have more impact otherwise
<olle> it is? didn't know
<flux1> hmm, it seems Clean 3.0 is available under "Simplified BSD license"
<flux1> and even before it appears to have been under LGPL or proprietary, so I guess it's been fine
<olle> kk
<olle> also something called Universe Types
rosalogia has quit [Quit: rosalogia]
rosalogia_ has joined #ocaml
<Drup> Clean is open source, and there are several papers on its type system
<olle> oooh
<olle> ok
<Drup> flux1: a GC is mostly compatible. Rust doesn't have GC because the memory representation is highly non-uniform. It has RC, but it requires explicit boxing and various use of traits, it's very clunky to use
<olle> but it doesn't need it, right?
<olle> because of the ownership control
<Drup> You don't want maximal control all the time
<Drup> sometimes, you just want the damn thing not to make segfaults
malc_ has joined #ocaml
<olle> I've heard that's highly immoral ;)
<Drup> said the php programmer
<olle> haha
<olle> it's a joke they run at /r/programmingcirclejerk
<olle> that rust is the moral choice
<olle> btw, if i get my next patch accepted to psalm (php static analyzer), i might start to work on some escape analysis for it. they already have flow analysis for null values.
<olle> then it would actually have some kind of working typestate system
<Drup> how do you compose accross functions ?
<olle> i don't even know what that means, lol
<olle> but i'll get there. i hope :)
<Drup> how do you make sure the composition is still safe according to your analysis ? :)
<Drup> (it's the question to throw a wrench in many static analysis plans ... :p)
<olle> Drup: well, my thought was simply that if the variable doesn't escape, it's automatically transfered ownership
<olle> if and if does escape, it does not transfer
<olle> and changing typestate is only allowed if you own the variable
<olle> and, system only tracks ownership of classes you tag, like `@track-ownership`.
rosalogia_ has quit [Quit: rosalogia_]
<olle> 12:05 < olle> and changing typestate is only allowed if you own the variable
<olle> But this can bite you
<olle> like, "why don't I own it???"
<olle> and you have to look in other places in the code to see what you did wrong.
<olle> (not sure if that answers your question)
tane has joined #ocaml
mfp has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
kleisli has quit [Ping timeout: 256 seconds]
peterbb has joined #ocaml
rock64 has quit [Ping timeout: 256 seconds]
rock64 has joined #ocaml
drdee has quit [Remote host closed the connection]
drdee has joined #ocaml
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
narimiran has quit [Remote host closed the connection]
dborisog has quit [Ping timeout: 264 seconds]
oturtle_ has quit [Quit: WeeChat 2.7.1]
oturtle has joined #ocaml
dr-dd has joined #ocaml
drdee has quit [Quit: Leaving]
dr-dd has quit [Client Quit]
drdee has joined #ocaml
nullcone has joined #ocaml
Haudegen has joined #ocaml
<olle> hm, I thought there would be more connections between ownership and escape analysis? maybe not
waleee-cl has joined #ocaml
drdee has quit [Remote host closed the connection]
malc_ has quit [Ping timeout: 240 seconds]
nullcone has quit [Quit: Connection closed for inactivity]
olle has quit [Ping timeout: 256 seconds]
vicfred has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
Jesin has quit [Quit: Leaving]
muskan has joined #ocaml
Jesin has joined #ocaml
malc_ has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
kleisli has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
chripell has quit [Ping timeout: 240 seconds]
muskan has quit [Ping timeout: 245 seconds]
narimiran has joined #ocaml
waleee-cl has joined #ocaml
nullcone has joined #ocaml
oriba has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
Anarchos has joined #ocaml
mbuf has quit [Quit: Leaving]
zebrag has joined #ocaml
zmt01 has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
zmt00 has quit [Ping timeout: 260 seconds]
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
Jesin has quit [Quit: Leaving]
amiloradovsky has joined #ocaml
zebrag has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
pippijn_ has joined #ocaml
rosalogia has joined #ocaml
rosalogia has quit [Quit: rosalogia]
rosalogia has joined #ocaml
narimiran has quit [Ping timeout: 265 seconds]
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
tane has quit [Quit: Leaving]
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
companion_square has joined #ocaml
companion_square is now known as ginny
ginny has quit [Client Quit]
malc_ has quit [Ping timeout: 260 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 246 seconds]
drdee has joined #ocaml
rock64 has quit [Ping timeout: 260 seconds]
drdee has quit [Quit: Leaving]
Haudegen has quit [Ping timeout: 258 seconds]
rock64 has joined #ocaml
nullcone has joined #ocaml