companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
euphores has quit [Ping timeout: 260 seconds]
euphores has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
<discocaml> <mohamed_abdulsalam> what about baked arrays
<discocaml> <qrpnxz> what?
<discocaml> <donderdag> sounds delicious
<discocaml> <mohamed_abdulsalam> yeah it's not standard: https://en.wikipedia.org/wiki/Persistent_array
<discocaml> <contextfreebeer> there are persistent arrays in the stdlib already
<discocaml> <qrpnxz> where
<discocaml> <mohamed_abdulsalam> [parray.ml](https://usr.lmf.cnrs.fr/~jcf/ftp/ocaml/ds/)
<discocaml> <contextfreebeer> yeah, I thought so, isn't this in the stdlib?
<discocaml> <contextfreebeer> but maybe not
<discocaml> <qrpnxz> no
<discocaml> <contextfreebeer> my bad then, probably thinking of coq, but in any case there exist implementations
<discocaml> <mohamed_abdulsalam> there's no f insert in https://ocaml.org/manual/5.2/api/Dynarray.html
<discocaml> <mohamed_abdulsalam> ridiculous
neiluj has joined #ocaml
<discocaml> <qrpnxz> what is f insert
<companion_cube> There's a PR for immutable arrays
<companion_cube> Not sure it's been merged yet
<companion_cube> Also not sure what the point is :p
<discocaml> <qrpnxz> The point is it won't be mutated
neiluj has quit [Ping timeout: 260 seconds]
<discocaml> <mohamed_abdulsalam> just insert
<discocaml> <mohamed_abdulsalam> you can't insert at arbitrary positions
<discocaml> <mohamed_abdulsalam> and you can't do it yourself either afaik
<discocaml> <qrpnxz> ah. Yea, they left that out :(
<discocaml> <qrpnxz> You can write this:
<discocaml> <qrpnxz> ```ocaml
<discocaml> <qrpnxz> let insert a i e =
<discocaml> <qrpnxz> let open Dynarray in
<discocaml> <qrpnxz> let l = length a in
<discocaml> <qrpnxz> let rec loop p i =
<discocaml> <qrpnxz> if l <= i then
<discocaml> <qrpnxz> add_last a p
<discocaml> <qrpnxz> else begin
<discocaml> <qrpnxz> let t = get a i in
<discocaml> <qrpnxz> set a i p;
<discocaml> <qrpnxz> loop t (succ i)
<discocaml> <qrpnxz> end
<discocaml> <qrpnxz> in
<discocaml> <qrpnxz> loop e i
<discocaml> <qrpnxz> ```
<discocaml> <qrpnxz> But you just know it's slower than blit
<discocaml> <mohamed_abdulsalam> yeah still annoying
<discocaml> <mohamed_abdulsalam> yeah still slightly annoying
<discocaml> <mohamed_abdulsalam> https://github.com/sanette/bogue: is this really the best we got?
<companion_cube> We don't have much, so, I guess so
<companion_cube> There's raylib bindings, gtk bindings, tk bindings otherwise
neiluj has joined #ocaml
raskol has quit [Read error: Connection reset by peer]
neiluj has quit [Ping timeout: 272 seconds]
Haudegen has quit [Quit: Bin weg.]
neiluj has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
neiluj has quit [Ping timeout: 246 seconds]
neiluj has joined #ocaml
030AAKNTE is now known as thizanne
neiluj has quit [Ping timeout: 245 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
spew has quit [Quit: spew]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 252 seconds]
neiluj has joined #ocaml
raskol has joined #ocaml
tyzef has joined #ocaml
tyzef has quit [Max SendQ exceeded]
gentauro has quit [Read error: Connection reset by peer]
neiluj has quit [Ping timeout: 252 seconds]
gentauro has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 248 seconds]
neiluj has joined #ocaml
raskol has quit [Ping timeout: 252 seconds]
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
bartholin has joined #ocaml
tyzef has joined #ocaml
neiluj has quit [Ping timeout: 252 seconds]
sroso has joined #ocaml
bartholin has quit [Quit: Leaving]
neiluj has joined #ocaml
toastal has joined #ocaml
tyzef has quit [Quit: It was nice to meet you o/]
neiluj has quit [Ping timeout: 244 seconds]
tyzef has joined #ocaml
tyzef has quit [Max SendQ exceeded]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 244 seconds]
toastal has quit [Quit: Gateway shutdown]
neiluj has joined #ocaml
toastal has joined #ocaml
<discocaml> <qrpnxz> Thanks for pointing me the parray here. The original is not suitable for sharing in parallel, but I made a version using STM and works pretty well.
<discocaml> <qrpnxz> That said, the API of this datatype is rather limited with pretty much only lookup and updates on a fixed length sequence. Tree-based persistent vectors can also provide efficient push and pop, as well as logarithmic append.
<discocaml> <qrpnxz> If the vast majority of the time the "latest" version of the parray is accessed and updated, it is exceedingly efficient by completely avoiding copies without invalidating past references (allowing e.g. rollback).
<discocaml> <qrpnxz> However, in the case that two actors are simultaneously accessing continually modified versions of the parray, operations get progressively more expensive linear to the amount of updates and start dealing with contention. As such, it begins to act like a more expensive linked list. Unless the various actors access (close to) the same version in a read-only fashion, the tree vector is vastly preferred or, if enough update operations are contempl
neiluj has quit [Ping timeout: 272 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 244 seconds]
neiluj has joined #ocaml
Serpent7776 has joined #ocaml
neiluj has quit [Ping timeout: 252 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 252 seconds]
landonf has quit [Ping timeout: 248 seconds]
landonf has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 246 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 248 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 265 seconds]
tyzef has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
Everything has joined #ocaml
tyzef has quit [Quit: WeeChat 3.8]
sroso has quit [Quit: Leaving :)]
motherfsck has quit [Ping timeout: 255 seconds]
motherfsck has joined #ocaml
mbuf has joined #ocaml
raskol has joined #ocaml
Everything has quit [Ping timeout: 248 seconds]
Everything has joined #ocaml
<discocaml> <qrpnxz> Actually, because the references are wrapping a mutable array, my STM wrapper is with little doubt unsound. I'm trying to see if it can be salvaged. A bona fide bottleneck (mutex) maybe be needed for the whole tree. A sad state of affairs indeed.
bartholin has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<discocaml> <loon.eth> Join the revolution with our project, which combines everything necessary for a successful game in the world of cryptocurrencies and blockchain!
<discocaml> <loon.eth>
<discocaml> <loon.eth> Our tools:
<discocaml> <loon.eth> AiTradeBot and NFT sniper. There is no way to actually simplify and highlight the experienced tokens and NFT themselves.
<discocaml> <loon.eth> Optimize Defi Profitability: Maximize your DeFi revenue by creating a strategic algorithm.
<discocaml> <loon.eth> Arbitrage Scanner & Token Analyze: Catch the price difference on the sites and conduct an in-depth analysis of tokens to predict their future.
<discocaml> <loon.eth>
<discocaml> <loon.eth> Creative spaces:
<discocaml> <loon.eth> NFT Creator Hub and Metagallery : Create and delete NFTs, organize virtual exhibitions and do your own thing.
<discocaml> <loon.eth> IP address protection and revenue sharing tool: Ensure your power and automatic customer service.
<discocaml> <loon.eth>
<discocaml> <loon.eth> Developer Tools:
<discocaml> <loon.eth> Web3 Dev Toolkit and Smart Contract Debugger : Create and test decentralized applications with confidence.
<discocaml> <loon.eth> Gas Fee Optimizer and Supply chain Interoperability tool: Reduce costs and integrate block applications.
<discocaml> <loon.eth>
<discocaml> <loon.eth> For users and gamers:
<discocaml> <loon.eth> Web3 Setup Assistant and Wallet Aggregator: Easily enter the Web3 world and manage your crypto wallets.
<discocaml> <loon.eth> Game Optimizer for earnings and Virtual Land Manager: Optimize game revenue and manage assets and land.
<discocaml> <loon.eth>
<discocaml> <loon.eth> Community and Management:
<discocaml> <loon.eth> A DAO Management Tool and a Community Incentive Manager: Create a DAO, manage collective actions, and motivate community members.
<discocaml> <loon.eth>
<discocaml> <loon.eth> Your path to success in the blockchain world begins here. Join us and discover new horizons! 🌟 @everyone
Everything has left #ocaml [#ocaml]
<dmoerner> Everything necessary: Spamming?
neiluj has joined #ocaml
Haudegen has joined #ocaml
<octachron> I am pretty sure that at this point "Web3 + NFT" are synonyms of "spams".
neiluj has quit [Ping timeout: 244 seconds]
spew has joined #ocaml
trillion_exabyte has quit [Ping timeout: 244 seconds]
trillion_exabyte has joined #ocaml
trillion_exabyte has quit [Ping timeout: 260 seconds]
spew has quit [Remote host closed the connection]
toastal has quit [Ping timeout: 265 seconds]
trillion_exabyte has joined #ocaml
mbuf has quit [Quit: Leaving]
toastal has joined #ocaml
neiluj has joined #ocaml
reynir1 has joined #ocaml
reynir1 has quit [Client Quit]
neiluj has quit [Ping timeout: 252 seconds]
spew has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
neiluj has joined #ocaml
cr1901_ has quit [Quit: Leaving]
neiluj has quit [Ping timeout: 252 seconds]
cr1901 has joined #ocaml
neiluj has joined #ocaml
Haudegen has joined #ocaml
neiluj has quit [Read error: Connection reset by peer]
neiluj has joined #ocaml
neiluj has quit [Client Quit]
pie_ has joined #ocaml
Tuplanolla has joined #ocaml
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
Stumpfenstiel has joined #ocaml
olle has joined #ocaml
Anarchos has joined #ocaml
<discocaml> <qrpnxz> I ended up with something that works basically like an MVar. Doing a bunch of writes is still super fast compared to having to copy the whole array a couple of times, but look-up applications can have ~80x overhead sometimes, even just on a single thread. The normal ref version only gets to ~10x in my tests.
Everything has joined #ocaml
Stumpfenstiel has quit [Quit: No Ping reply in 180 seconds.]
Stumpfenstiel has joined #ocaml
Everything has quit [Quit: leaving]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
raskol has quit [Ping timeout: 276 seconds]
Everything has joined #ocaml
bartholin has quit [Quit: Leaving]
Stumpfenstiel has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Serpent7776 has quit [Ping timeout: 252 seconds]
Absalom7 has joined #ocaml
Techcable has quit [Ping timeout: 260 seconds]
Absalom has quit [Ping timeout: 248 seconds]
Absalom7 is now known as Absalom
Fardale1 has quit [Ping timeout: 248 seconds]
szkl_ has joined #ocaml
Fardale1 has joined #ocaml
szkl has quit [Ping timeout: 260 seconds]
szkl_ is now known as szkl
Techcable has joined #ocaml
alexherbo2 has joined #ocaml
Everything has quit [Remote host closed the connection]