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/
TakinOver has joined #ocaml
alexherbo2 has quit [Write error: Connection reset by peer]
alexherbo2 has joined #ocaml
neiluj has quit [Quit: WeeChat 3.7.1]
xd1le has quit [Quit: xd1le]
hrberg has quit [Quit: No Ping reply in 180 seconds.]
hrberg has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
waleee has quit [Ping timeout: 268 seconds]
waleee has joined #ocaml
alexherbo2 has quit [Ping timeout: 245 seconds]
TakinOver has quit [Ping timeout: 250 seconds]
chrisz has quit [Ping timeout: 246 seconds]
chrisz has joined #ocaml
spip has quit [Quit: Konversation terminated!]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
azimut has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
szkl has joined #ocaml
sparogy has quit [Read error: Connection reset by peer]
sparogy has joined #ocaml
ns121 has joined #ocaml
ns12 has quit [Read error: Connection reset by peer]
ns121 is now known as ns12
Haudegen has joined #ocaml
TakinOver has joined #ocaml
mbuf has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
bartholin has joined #ocaml
<discocaml> <darrenldl> @Myrl but it/they i think the C ffi boundary might be at play here
jlrnick has joined #ocaml
olle has joined #ocaml
Haudegen has quit [Ping timeout: 276 seconds]
<discocaml> <Myrl but it/they> Yeah, I think that's also the case. Another reason is that `String.concat` is much more optimized, I think.
<discocaml> <Myrl but it/they> Really interesting lol
<discocaml> <Myrl but it/they> Hmm
<discocaml> <darrenldl> @Myrl but it/they passing string from ocaml to c is copying i think, to share without copying you would need bigstring/bigarray
<discocaml> <darrenldl> oh wait im not sure what the digestif interface allows actually hm
<discocaml> <Myrl but it/they> I think digestif uses bigarray internally, but what I'm doing is basically buffering writes, and I *think* doing `String.concat sep` is faster than doing `write x; write sep; write x; ...`
<discocaml> <Myrl but it/they> Oh, and not only that, it sometimes has to call into the C function.
<discocaml> <Myrl but it/they> Oh, and not only that, it sometimes has to call into the C function every write.
<discocaml> <Myrl but it/they> Now I'm wondering about my code in languages other than OCaml lol
<discocaml> <darrenldl> try feed_bigstring would be my recommendation
<discocaml> <darrenldl> though will need to read the implementation on if that actually reduces copying
<discocaml> <Myrl but it/they> Slight aside: I want to change digestif's implementation, how do I recompile and install(?) digestif so that my code uses the new implementation?
<discocaml> <Myrl but it/they> (I want to try using Intel's SHA intrinsics)
<discocaml> <darrenldl> you may have to build from source
<discocaml> <darrenldl> alternatively just see if blake is fast enough
<vsiles> anyone familiar with ppx_hash and stdlib's Set/Map. We have a couple of `module Set = Set.Make (S)` that are then used like `type foo = { bar : Set.t }`. I'd like to `[@@deriving hash]` on foo, but I don't know how to derive it for `Set.t` in the first place
<vsiles> any pointer ?
spip has joined #ocaml
olle has left #ocaml [#ocaml]
jlrnick has quit [Ping timeout: 276 seconds]
<vsiles> I did a quick and dirty map -> Seq.t -> list and used the support for lists
mechap has quit [Quit: WeeChat 3.8]
<theblatte> vsiles: module Set = struct include Set.Make(S) let hash = ... end?
alexherbo2 has joined #ocaml
wingsorc has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
dhil has joined #ocaml
jlrnick has joined #ocaml
quernd has quit [Quit: The Lounge - https://thelounge.chat]
quernd8 has joined #ocaml
<discocaml> <leviroth> Problem is you need a `hash_fold_t` function for the set module
<vsiles> theblatte: yes, but I want the hash function for Set.t to be derived for me (I don't really care how it's done)
<discocaml> <leviroth> I’d guess you’d need to write a new Make function that also requires a hash_fold_t function in its input, includes the normal Stdlib.Set.Make, and also adds a hash_fold_t using Set.fold
xgqt has quit [Ping timeout: 240 seconds]
<adrien> looking at Unix.map_file (which documentation mentions Genarray.map_file btw), it returns a genarray but I guess a typical process is to convert that to a Bigarray.ArraySomething for performance reasons, right?
xgqt has joined #ocaml
oriba has joined #ocaml
<discocaml> <octachron> Indeed, `Genarray` is mostly the hub data type for in that case.
jlrnick has quit [Ping timeout: 268 seconds]
rwmjones is now known as rwmjones|mtg
<adrien> thanks
rwmjones|mtg is now known as rwmjones
waleee has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
czy has joined #ocaml
<adrien> do I need to do anything to cleanly free the return of Unix.map_file? I can't spot any function (besides Unix.close on the fd)
mbuf has quit [Quit: Leaving]
mbuf has joined #ocaml
<discocaml> <masterbuilder> is there no signed hexadecimal format specifier?
<companion_cube> %h ? wdym by "signed"?
<discocaml> <masterbuilder> %h might work, I mean format an integer in hexadecimal but also signed
<discocaml> <masterbuilder> i.e. format `-1` as `-0x1` rather than `0x7FF...F`
<companion_cube> Printf.sprintf "%h" (-41.5);;
<companion_cube> - : string = "-0x1.4cp+5"
<discocaml> <masterbuilder> yeah that's no good, don't want binary exponents
<companion_cube> ah I see what you mean now, for integers it doesn't keep the sign
<companion_cube> interesting
<discocaml> <masterbuilder> well usually working with hex you want unsigned, so that makes sense, I actually do want signed
<companion_cube> I don't see anything better than "-%x" (-x)
<companion_cube> (which is… not great)
<discocaml> <masterbuilder> yeah, it's not important enough to want to implement that myself, so whatever I guess
mbuf has quit [Remote host closed the connection]
bartholin has joined #ocaml
JSharp has quit [*.net *.split]
pgiarrusso has quit [*.net *.split]
vsiles has quit [*.net *.split]
pgiarrusso_ has joined #ocaml
JSharp_ has joined #ocaml
vsiles has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
dh` has joined #ocaml
dh` has quit [Changing host]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
czy has quit [Remote host closed the connection]
wingsorc has joined #ocaml
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
<discocaml> <cemerick> Looks like a big milestone for melange https://tech.ahrefs.com/ahrefs-is-now-built-with-melange-b14f5ec56df4
waleee has joined #ocaml
<discocaml> <RegularSpatula> Was ahrefs using rescript?
<discocaml> <RegularSpatula> Ah nvm, just got to that part of the article you posted
TakinOver has quit [Ping timeout: 250 seconds]
<discocaml> <RegularSpatula> So, basically, is melange supposed to be sort of rescript if rescript never rebranded from bucklescript and still cared about ocaml ecosystem?
<discocaml> <anmonteiro> Happy to answer questions
<discocaml> <anmonteiro> You got the pitch
<discocaml> <cemerick> when I read their frontend consisted of 5000+ modules, whew! 🥴
<discocaml> <RegularSpatula> I think I remember reading on the rescript forum that Hongbo considers melange a "hostile fork" of rescript. Not sure what to make of that
<companion_cube> hostile fork of the hostile fork 🤔
<discocaml> <RegularSpatula> im a bit "confused" ...rescript and melange both seem pretty similar, and both communities are already small...i guess im just wondering how it will all work out
<discocaml> <anmonteiro> Yeah, it’s great to have tested such a big codebase. We’re pretty confident it applies to other codebase now too!
<companion_cube> rescript chose to isolate itself from the OCaml community, whereas melange is "just" another tool for the OCaml community, so it's not a fork that fragments
<discocaml> <cemerick> there was a variety of drama around the time just after the slowly-divulged split/change in rescript's direction, much of it was retracted 🤷
<discocaml> <anmonteiro> Melange belongs to the OCaml community. We’re funded by the OCaml Software Foundation, for example
<discocaml> <cemerick> even if one doesn't use melange proper, it's really important if only to continue to support .re / jsx syntaxes
<discocaml> <anmonteiro> I’d rather stay objective and avoid playing zero sum games. There’s space for everyone 🙂
<discocaml> <RegularSpatula> yeah, sorry I don't mean to stir up any more drama, but it is a question on my mind
<discocaml> <RegularSpatula> thats awesome that melange is funded by ocaml SF
TakinOver has joined #ocaml
<discocaml> <RegularSpatula> c-cube: i guess i wonder if it pulls people from rescript back to melange...idk how many people that use rescript were old ocaml devs tho
<discocaml> <RegularSpatula> @anmonteiro I really prefer rescript's JS ffi to js_of_ocaml ...does melange have that same style JS ffi?
<discocaml> <cemerick> eh, it's reasonable to keep the history alive 🙂
<discocaml> <anmonteiro> Yes. Melange started as a fork of BuckleScript
<discocaml> <Firgeis> Has anybody run into an issue with Alcotest, whereas if an exception happens in a thread started during a test the test just hangs?
<discocaml> <RegularSpatula> yeah that's awesome...imo its so easy to use JS from rescript...but not as nice for js_of_ocaml
<discocaml> <RegularSpatula> which can make it hard to stick with ocaml when i need JS integration
<discocaml> <RegularSpatula> so im excited about this ahrefs switching wholesale to melange
<discocaml> <RegularSpatula> Rescript recently updated their jsx version...does melange follow that or do its own thing for jsx?
<discocaml> <RegularSpatula> I guess the more general question of that is...are any rescript additions going to be reflected in melange? (no judgement either way, just curious)
<discocaml> <anmonteiro> We can’t get “JSX4” because that depends on “optional keys in records”
<discocaml> <anmonteiro> But we’ve upgraded the reason-react ppx and codebase to work with the new JSX runtime in the JS world
dhil has quit [Ping timeout: 276 seconds]
TakinOver has quit [Ping timeout: 240 seconds]
jlrnick has joined #ocaml
jlrnick has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
Tuplanolla has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
count3rmeasure has joined #ocaml
count3rmeasur3 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 268 seconds]
alexherbo2 has joined #ocaml
TakinOver has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
count3rmeasure has quit [Quit: Leaving]
alexherbo2 has joined #ocaml
<discocaml> <geoff> (re spatula) You got me curious so I went and searched the rescript forum to see and sure enough: https://forum.rescript-lang.org/t/state-of-rescript-compiler-roadmap/3189/13