companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
masterbuilder has quit [Remote host closed the connection]
alexherbo2 has quit [Ping timeout: 246 seconds]
Hmmf has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]
chrisz has quit [Ping timeout: 245 seconds]
chrisz has joined #ocaml
xd1le has quit [Quit: xd1le]
mima has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
mima has quit [Ping timeout: 246 seconds]
spip has quit [Quit: Konversation terminated!]
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 246 seconds]
bartholin has joined #ocaml
MarvelousWololo has quit [Read error: Connection reset by peer]
azimut_ has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #ocaml
dnh has joined #ocaml
mbuf has joined #ocaml
chrisz has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml
xd1le has joined #ocaml
masterbuilder has joined #ocaml
kakadu has joined #ocaml
chrisz has quit [Ping timeout: 246 seconds]
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
bgs has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
tom1212 has joined #ocaml
spip has joined #ocaml
barewood has joined #ocaml
barewood has quit [Quit: Client closed]
azimut has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Hmmf has quit [Quit: Client closed]
barewood has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
barewood has quit [Quit: Client closed]
azimut has quit [Ping timeout: 246 seconds]
azimut has joined #ocaml
waleee has joined #ocaml
xd1le has quit [Quit: xd1le]
MarvelousWololo has joined #ocaml
Hmmf has joined #ocaml
tom1212 has quit [Remote host closed the connection]
John_Ivan_ has joined #ocaml
John_Ivan has quit [Ping timeout: 246 seconds]
waleee has quit [Quit: WeeChat 4.0.2]
mima has joined #ocaml
mbuf has quit [Quit: Leaving]
MarvelousWololo has quit [Ping timeout: 256 seconds]
chrisz has joined #ocaml
Hmmf has quit [Quit: Client closed]
bgs has quit [Remote host closed the connection]
greenbagels has quit [Ping timeout: 248 seconds]
greenbagels has joined #ocaml
hexology has joined #ocaml
waleee has joined #ocaml
tom1212 has joined #ocaml
<tom1212> hi! how could you have implicit casts for instance promote an integer to a rational number?
<tom1212> i find it a bit heavy to explicitly write down such casts
<discocaml> <Kali> there is no way to do this implicitly
<discocaml> <Kali> you can make the conversions shorter, if you need to
<discocaml> <Kali> i often do `let iof = int_of_float`
<tom1212> :'( sniff
<tom1212> that's sad
<discocaml> <Kali> the other option is to make a variant type that has all the different number types you want and run it through a function that converts them under some condition
<discocaml> <Kali> i can't imagine this would be very good for performance
<discocaml> <Kali> you really should just convert them explicitly
<tom1212> okay, thanks for the heads up!
<tom1212> or maybe with objects? that have different constructors, like in C++?
<discocaml> <Kali> that would be even worse for performance
<tom1212> because the choice of constructor happens at runtime?
<discocaml> <Kali> objects in general are slow, the way they are designed means every method call requires a hashtable lookup at minimum
<discocaml> <Kali> this is not good for numerical calculation
<discocaml> <Kali> it is suitable for GUIs and such
<discocaml> <._null._> You can also make your cast a prefix operator, they have high precedence so they can be a single character long
<discocaml> <Kali> prefix operators: operators that begin with ~ or !
<discocaml> <Kali> ! has the highest precedence and ~ has second-highest
<discocaml> <._null._> or `?`. The only 1-long operator is `(!)` and already taken though, but all 2-long operators are free
<discocaml> <Kali> is `?` a valid operator? i was under the impression it wasn't
<discocaml> <._null._> No more than `(~)`, but `(?*)` is
<discocaml> <._null._> No more than `(~)`, but `(?* )` is
<discocaml> <._null._> No more than `(~)`, but `(?+)` is
<discocaml> <Kali> oh, i see
<discocaml> <Kali> that makes more sense
<discocaml> <Kali> (remember that editing reissues the message)
<tom1212> maybe explicit casts aren't that bad after all, there's less magic happening it's easier to figure out what is actually happening
<discocaml> <Kali> yes, it is nice to know exactly when they happen
<discocaml> <Kali> it is a little annoying sometimes but you quickly realize it is nicer explicitly
* tom1212 puts some water in the wine
MarvelousWololo has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tom1212> the fact that instatiating a module with a first-class modules/functors with the same input arguments yield different modules
<tom1212> can be problematic
<tom1212> this means that one needs to initially initialize a module once and reuse it
bartholin has quit [Quit: Leaving]
tom1212 has quit [Ping timeout: 246 seconds]
Tuplanolla has joined #ocaml
Hmmf has joined #ocaml
mima has quit [Ping timeout: 256 seconds]
tjammer has quit [Ping timeout: 246 seconds]
tjammer has joined #ocaml
<discocaml> <quantumcat.> What do you guys think of Elm? I just discovered it and it seems pretty cool. I'm not sure how it plays with OCaml but I was wondering what people in the community thought of it. Also, what its relationship with OCaml is, if any,.
<discocaml> <quantumcat.> What do you guys think of Elm? I just discovered it and it seems pretty cool. I'm not sure how it plays with OCaml but I was wondering what people in the community thought of it. Also, what its relationship with OCaml is, if any.
<discocaml> <Kali> #offtopic🎲
<discocaml> <Kali> although, my short opinion: elm's model is cool, but elm is completely unmaintained and has been for the past few years, which makes me wary of using it
<discocaml> <Kali> last release was 2019...
<discocaml> <Kali> it doesn't haave any relation to OCaml other than being an ML-style functional language
<discocaml> <Kali> *have
<discocaml> <Kali> and the ability to compile to javascript
<discocaml> <Kali> although for OCaml that was a useful 3rd-party afterthought rather than the key point of Elm
waleee has quit [Quit: uppdatterar]
waleee has joined #ocaml