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/
szkl has quit [Quit: Connection closed for inactivity]
waleee has quit [Ping timeout: 246 seconds]
Tuplanolla has quit [Quit: Leaving.]
John_Ivan has quit [Ping timeout: 246 seconds]
chrisz has quit [Ping timeout: 244 seconds]
chrisz has joined #ocaml
spip has quit [Quit: Konversation terminated!]
code_chimp has quit [Quit: Textual IRC Client: www.textualapp.com]
azimut has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
<discocaml> <aerbil313> Ok, guys. Why OCaml instead of Rust? I’m gonna learn Rust regardless, but I want to know whether learning OCaml will allow me to be more productive than Rust for small-scale personal projects/prototyping. (For anything that will make it into production, Rust is still my choice.) Many say using Rust also for this purpose (quick prototyping) is still productive, by cloning and uniquely referencing memory instead of fighting with the borrow
<discocaml> <aerbil313> Ok, guys. Why OCaml instead of Rust? I’m gonna learn Rust regardless, but I want to know whether learning OCaml will allow me to be more productive than Rust for small-scale personal projects/prototyping. (For anything that will make it into production, Rust is still my choice.) Many claim using Rust also for this purpose (quick prototyping) is still very productive, by cloning and uniquely referencing memory instead of fighting with the
<discocaml> <aerbil313> Ok, guys. Why OCaml instead of Rust? I’m gonna learn Rust regardless, but I want to know whether learning OCaml will allow me to be more productive than Rust for small-scale personal projects/prototyping. (For anything that will make it into production, Rust is still my choice.) Many claim using Rust also for this purpose (quick prototyping) is still very productive, by cloning and uniquely referencing memory instead of fighting with the
<discocaml> <aerbil313> (Please “reply” to this message so that I see the notification.)
<discocaml> <octachron> * the module system
<discocaml> <octachron> * a different type system
<discocaml> <octachron> * GC: rust memory design bleeds into a lot of part of the language, you cannot really avoid its influence
<discocaml> <octachron> * compilation speed with real incremental compilation
spip has joined #ocaml
xd1le has joined #ocaml
Tuplanolla has joined #ocaml
tom1212 has joined #ocaml
<tom1212> hi! I find it a bit heavy to pass the Array module as a first class module: https://bpa.st/3LIQ
<tom1212> problem is, I don't want to use ocaml's polymorphic array type because my array is a C value and I'd like to not convert it to an ocaml array
<zozozo> tom1212: if you have C arrays, you should be able to use ocaml bigarrays since they are basicaly wrappers around C arrays
<tom1212> thanks, actually these are not C arrays
<zozozo> I also see that your Array_sig seems to also include a monad part ? (i.e. the `'a m` type)
<tom1212> yes
<zozozo> it seems a bit more complicated than expected to merge these two signatures, compared to having the regular expected array sigs, and combining its functions with the traditional monad bind
berberman has joined #ocaml
gareppa has joined #ocaml
Serpent7776 has joined #ocaml
berberman has quit [Ping timeout: 260 seconds]
berberman has joined #ocaml
Bitwiser has joined #ocaml
<Bitwiser> Hi, where can I find the GC log file (all the messages logged using [caml_gc_message] and [caml_gc_log] functions)?
Bitwiser has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
bgs has joined #ocaml
bgs has quit [Remote host closed the connection]
uncomfy has joined #ocaml
tom1212 has quit [Ping timeout: 246 seconds]
waleee has quit [Ping timeout: 260 seconds]
uncomfy has quit [Quit: uncomfy]
lobo[m] has quit [Read error: Connection reset by peer]
mclovin has quit [Read error: Connection reset by peer]
reynir[m] has quit [Write error: Connection reset by peer]
quernd8 has quit [Read error: Connection reset by peer]
quernd80 has joined #ocaml
Ankhers has quit [Ping timeout: 246 seconds]
philipwhite has quit [Ping timeout: 246 seconds]
Ankhers has joined #ocaml
philipwhite has joined #ocaml
noonien has joined #ocaml
<discocaml> <regularspatula> There’s a few threads on discuss about this. Here’s one: https://discuss.ocaml.org/t/advantages-of-ocaml-over-rust/2112
<discocaml> <regularspatula> Though if you’re going to learn rust anyway, why not also use it for small personal projects too…how else will you learn it otherwise?
John_Ivan has joined #ocaml
norris76 has joined #ocaml
<discocaml> <masterbuilder> Rust is a great language, it's worth learning in any case, doesn't need to be an either or - however, in my experience it is not really a good language for quick prototyping, since it requires you to think about many details that are honestly quite irrelevant to implementing ideas in code. proficiency in the language can mitigate this friction but the point remains that solving problems in Rust occasionally requires an extremely unnatura
<discocaml> <regularspatula> Not as safe as rust in what way…preventing data races?
<discocaml> <masterbuilder> it's easy to wrap any arbitrary code in OCaml via the FFI but Rust requires `unsafe` for this, so you have to opt in to the unsafeness or devise a safe abstraction around it
<discocaml> <regularspatula> Ah the ffi
<discocaml> <masterbuilder> this is true as well though, since Rust has it encoded in the type system
<discocaml> <regularspatula> Sure, I just don’t think I’ve heard someone say that ocaml is less safe than rust is all
<discocaml> <masterbuilder> well, there is also that some more obscure OCaml functions can invoke undefined behavior iirc, that cannot happen in safe Rust
<discocaml> <masterbuilder> but UB in Ocaml is almost nonexistent so it's kinda moot
<discocaml> <regularspatula> I’m guessing your talking about Obj
<discocaml> <masterbuilder> that's an obvious one but I think it exists outside of Obj, just something I feel like I've seen but I can't recall examples
<discocaml> <regularspatula> unsafe_get for array and stuff like that I suppose
<discocaml> <regularspatula> This discussion got me reading this: https://doc.rust-lang.org/reference/behavior-considered-undefined.html#:~:text=Rust%20code%20is%20incorrect%20if,must%20never%20cause%20undefined%20behavior. …pretty interesting
<discocaml> <masterbuilder> something that is pretty unintuitive is that Rust enforces mutability NAND aliasing without exception, even in `unsafe` code, so some things are just not possible to do with the language period
<discocaml> <regularspatula> Kind of interesting to compare to ocaml
<discocaml> <masterbuilder> if you can mutate something through a pointer that pointer **must not** be aliased
<discocaml> <regularspatula> That’s mainly about preventing data race?
<discocaml> <regularspatula> I know we’re veering off from ocaml talk …maybe better in off topic idk
<discocaml> <masterbuilder> no it applies in single threaded code too, it's just how the memory model works
<discocaml> <aerbil313> Thanks guys for feedback! I decided to learn Ocaml as well.
<discocaml> <aerbil313> Thanks for feedback! I decided to learn Ocaml as well.
azimut has joined #ocaml
<discocaml> <aerbil313> Thanks for feedback! I decided to learn Ocaml as well.
<discocaml> <aerbil313> Edit: I just happened to come upon my past research into Perl 6. I reviewed my mental notes and ended up with two options: Learn Rust & Raku or Ocaml & Raku. It would take more effort than I want to invest to be proficient in all langs at once. I can’t leave Rust, so I chose Raku over Ocaml, for that it seems Ocaml seems a GC’ed functional Rust, while Raku offers far more than that.
<discocaml> <aerbil313> Thanks for feedback! I decided to learn Ocaml as well.
<discocaml> <aerbil313> I just happened to come upon my past research into Perl 6. I reviewed my mental notes and ended up with two options: Learn Rust & Raku or Ocaml & Raku. It would take more effort than I want to invest to be proficient in all langs at once. I can’t leave Rust, so I chose Raku over Ocaml, for that it seems Ocaml seems a GC’ed functional Rust, while Raku offers far more than that.
<discocaml> <aerbil313> I just happened to come upon my past research into Perl 6. I reviewed my mental notes and ended up with two options: Learn Rust & Raku or Ocaml & Raku. It would take more effort than I want to invest to be proficient in all langs at once. I can’t leave Rust, so I chose Raku over Ocaml, for that it seems Ocaml is a GC’ed functional Rust, while Raku offers far more than that.
<discocaml> <aerbil313> I just happened to come upon my past research into Perl 6. I reviewed my mental notes and ended up with two options: Learn Rust & Raku or Ocaml & Raku. It would take more effort than I want to invest to be proficient in all langs at once. I can’t leave Rust, so I chose Raku over Ocaml, for that it seems Ocaml is a GC’ed functional Rust, while Raku seem to offer more than that.
norris76 has quit [Ping timeout: 246 seconds]
<discocaml> <Kali> How so?
azimut has quit [Ping timeout: 240 seconds]
tom1212 has joined #ocaml
<discocaml> <froyo> > Rust enforces mutability NAND aliasing without exception, even in unsafe code,
<discocaml> <froyo> masterbuilder: I thought it was possible in unsafe code...?
<discocaml> <froyo> by converting refs to raw ptrs
haesbaert has left #ocaml [#ocaml]
<discocaml> <masterbuilder> it's possible but it becomes undefined behavior instead of a compiler error
<discocaml> <masterbuilder> so it really isn't possible
<discocaml> <masterbuilder> you can create the pointers just not use them in any meaningful way
<discocaml> <masterbuilder> I think ptr arithmetic is fine
<discocaml> <masterbuilder> but as soon as you dereference them all bets are off
<discocaml> <masterbuilder> the semantics for unsafe Rust aren't even fully defined atm and volatile so not only can it break it most likely will
waleee has joined #ocaml
<discocaml> <froyo> I see now why people who find themselves needing to use lots of unsafe rust prefer zig etc.
<discocaml> <froyo> seen a couple of those kinds of blogs popping up
azimut has joined #ocaml
John_Ivan_ has joined #ocaml
John_Ivan has quit [Ping timeout: 246 seconds]
Bitwiser has joined #ocaml
gareppa has quit [Quit: WeeChat 3.8]
justache is now known as reddit-boat
reddit-boat is now known as justache
Bitwiser has quit [Ping timeout: 246 seconds]
Bitwiser has joined #ocaml
mima has joined #ocaml
tom1212 has left #ocaml [#ocaml]
mima has quit [Ping timeout: 246 seconds]
mima has joined #ocaml
bartholin has quit [Quit: Leaving]
mima has quit [Ping timeout: 246 seconds]
Bitwiser has quit [Ping timeout: 246 seconds]
Serpent7776 has quit [Ping timeout: 260 seconds]
dh` has quit [Ping timeout: 246 seconds]
cedb has quit [Ping timeout: 260 seconds]
dh` has joined #ocaml
<discocaml> <Ada> I don't write a lot of rust but I don't see at what point writing that amount of unsafe code doesn't just lend itself to be done in C directly and wrapped at a higher level
dh` has quit [Changing host]
dh` has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]