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/
Tuplanolla has quit [Quit: Leaving.]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<remexre> is there a good way to get at auxv (ie the getauxval function) from ocaml
agentcasey has quit [Ping timeout: 252 seconds]
agentcasey has joined #ocaml
alfiee has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
tri has joined #ocaml
humasect has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
tri has quit [Ping timeout: 260 seconds]
<discocaml> <lewiscampbell> is there any library that provides a mutable prioriy queue?
<humasect> stm or lwt?
<discocaml> <lewiscampbell> just a regular single threaded synchronous one
<humasect> https://ocaml.org/manual/4.12/moduleexamples.html ? came up as priority queue
Inline has quit [Read error: Connection reset by peer]
humasect has quit [Remote host closed the connection]
<discocaml> <lewiscampbell> thanks, I'll just copy pasta that
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
tri has joined #ocaml
tri has quit [Ping timeout: 252 seconds]
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
wickedshell has quit [Ping timeout: 248 seconds]
humasect has joined #ocaml
humasect has quit [Ping timeout: 252 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
burley has joined #ocaml
m5zs7k has quit [Ping timeout: 268 seconds]
tri has joined #ocaml
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
<discocaml> <purringhutao> When passing -custom to ocamlmklib, the `libfoo.dylib` file shouldn't be generated, right?
<discocaml> <raiinyzen> Alr, I have 4 years before I apply to Jane Street, time to learn OCaml
burley has quit [Remote host closed the connection]
tri has quit [Remote host closed the connection]
alfiee has joined #ocaml
m5zs7k has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
tri has joined #ocaml
<discocaml> <purringhutao> Does the order of the -cclib options matter? When I inspect the `cma` and `cmxa` files, the "Extra C object files" are given in a different order, and this seems to be the only difference that causes the compilation to succeed or fail.
<discocaml> <purringhutao> `Extra C object files: -lllvm -L/usr/lib/llvm-18/lib -lLLVMSupport -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle -lstdc++ -lrt -ldl -lm -lz -lzstd -ltinfo`
<discocaml> <purringhutao>
<discocaml> <purringhutao> works, while
<discocaml> <purringhutao>
<discocaml> <purringhutao> `Extra C object files: -lllvm -L/usr/lib/llvm-18/lib -lstdc++ -lLLVMSupport -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMSupport -lLLVMDemangle -lrt -ldl -lm -lz -lzstd -ltinfo` does not work
<discocaml> <purringhutao> Ok, seems that order does matter, and this is what gets passed to the C linker
<dh`> link order matters, and should be lib2 after lib1 if lib1 uses lib2
<dh`> (which is the reverse order from ocaml package linking)
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
wickedshell has joined #ocaml
infinity0 has quit [Ping timeout: 252 seconds]
m5zs7k has quit [Ping timeout: 248 seconds]
infinity0 has joined #ocaml
<discocaml> <raiinyzen> How to start learning OCaml?
m5zs7k has joined #ocaml
alfiee has joined #ocaml
<discocaml> <raiinyzen> ```bash
<discocaml> <raiinyzen> #=== ERROR while compiling core_unix.v0.17.0 ==================================#
<discocaml> <raiinyzen> # context 2.3.0 | linux/x86_64 | ocaml.5.3.0 | https://opam.ocaml.org#e41dcf1317027b68f2
<discocaml> <raiinyzen> 446cba5fefed79d9087146
<discocaml> <raiinyzen> # path ~/.opam/default/.opam-switch/build/core_unix.v0.17.0
<discocaml> <raiinyzen> # command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p core_unix -j 23
<discocaml> <raiinyzen> # exit-code 1
<discocaml> <raiinyzen> # env-file ~/.opam/log/core_unix-293884-06db21.env
<discocaml> <raiinyzen> # output-file ~/.opam/log/core_unix-293884-06db21.out
<discocaml> <raiinyzen> ### output ###
<discocaml> <raiinyzen> # /home/wyattgill/.opam/default/lib/ocaml/caml/platform.h:222:10: error: implicit declaratio
<discocaml> <raiinyzen> n of function ‘atomic_load_acquire’ [-Wimplicit-function-declaration]
<discocaml> <raiinyzen> # [...]
<discocaml> <raiinyzen> # | ^~~~~~~~~~~~~~~~~~~
<discocaml> <raiinyzen> # /home/wyattgill/.opam/default/lib/ocaml/caml/platform.h: In function ‘caml_plat_latch_set’
<discocaml> <raiinyzen> :
<discocaml> <raiinyzen> # /home/wyattgill/.opam/default/lib/ocaml/caml/platform.h:230:3: error: implicit declaration
<discocaml> <raiinyzen> of function ‘atomic_store_release’; did you mean ‘atomic_store_explicit’? [-Wimplicit-funct
<discocaml> <raiinyzen> ion-declaration]
<discocaml> <raiinyzen> # 230 | atomic_store_release(&latch->value, Latch_unreleased);
<discocaml> <raiinyzen> # | ^~~~~~~~~~~~~~~~~~~~
<discocaml> <raiinyzen> # | atomic_store_explicit
<discocaml> <raiinyzen> # (cd _build/default && /home/wyattgill/.opam/default/bin/ocamlopt.opt -w -40 -g -I time_flo
<discocaml> <raiinyzen> at_unix/time_unix/.time_unix.objs/byte -I time_float_unix/time_unix/.time_unix.objs/native -
<discocaml> <raiinyzen> I /home/wyattgill/.opam/default/lib/base -I /home/wyattgill/.opam/default/lib/base/base_inte
<discocaml> <raiinyzen> rnalhash_types -I /home/wyattgill/.opam/default/lib/base/md5 -I /home/wyattgill/.opam/defaul
<discocaml> <raiinyzen> t/lib/base/shadow_stdlib -I /[...]
<discocaml> <raiinyzen> # File "time_float_unix/time_unix/time_unix.ml", line 1, characters 4-14:
<discocaml> <raiinyzen> # 1 | [@@@deprecated "[since 2022-04] Use [Time_float_unix] instead"]
<discocaml> <raiinyzen> # ^^^^^^^^^^
<discocaml> <raiinyzen> # Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context
<discocaml> <raiinyzen> HELP!
<discocaml> <raiinyzen> I am unable to download the Async Lib
alfiee has quit [Ping timeout: 260 seconds]
<discocaml> <regularspatula> are you using macOS with arm chip?
<discocaml> <raiinyzen> no Arch Linux on 86_64
<discocaml> <raiinyzen> x86
<discocaml> <regularspatula> yes it doesn't work on others as well
<discocaml> <regularspatula> but it is fixed on a prerelease
<discocaml> <raiinyzen> how to use that then?
<discocaml> <regularspatula> jane street stuff is a bit tricky to use their bleeding edge stff
<discocaml> <regularspatula> stuff*
tri has quit [Remote host closed the connection]
<discocaml> <raiinyzen> so what do I do?
tri has joined #ocaml
<discocaml> <regularspatula> they have their own opam repo: https://github.com/janestreet/opam-repository
<discocaml> <raiinyzen> now what
<discocaml> <regularspatula> i don't recall--it has been years since I needed their repo. There are instructions out there somewhere though
<discocaml> <raiinyzen> Oh, I gixed it
<discocaml> <raiinyzen> Oh, I fixed it
<discocaml> <regularspatula> by editing camlatomic.h ?
<discocaml> <raiinyzen> ye it didnt fix
<discocaml> <raiinyzen> now I have a new package error
<discocaml> <raiinyzen> do you have any other recomendations then?
<discocaml> <regularspatula> you could try this: https://github.com/janestreet/core_unix/issues/14#issuecomment-2610014858, or don't use ocaml 5.3
<discocaml> <regularspatula> do you absolutely need async_unix?
<discocaml> <raiinyzen> how do I switch versions? Im realy new.
tri has quit [Ping timeout: 248 seconds]
<discocaml> <raiinyzen> no but I dont know what else to use for it tho
<discocaml> <regularspatula> ah yeah, i'm not sure I would try to mess about with the caml header files maybe in that case
<discocaml> <regularspatula> are you followind a guide or just interested in jane street libs?
<discocaml> <regularspatula> lwt is the more commonly used async/promise lib
<discocaml> <raiinyzen> I will be working at Jane Street in 4 years
<discocaml> <raiinyzen> when I am eligable to apply
<discocaml> <raiinyzen> and im already profiecient in Rust, Python, Go and Haskell
<discocaml> <raiinyzen> and im already profiecient in Rust, Python, Go and learning Haskell
<discocaml> <raiinyzen> so i thought it would be cool to start with OCaml now
agentcasey has quit [Remote host closed the connection]
<discocaml> <regularspatula> well, you don't need the jane street libraries to learn ocaml -- you can just use the more common alternatives if you want
<discocaml> <regularspatula> unless you're following along with Real World OCaml book
<discocaml> <raiinyzen> good idea, also is there a command to clean all your pkgs?
agentcasey has joined #ocaml
<discocaml> <regularspatula> you can remove your switch if you want
<discocaml> <raiinyzen> how
<discocaml> <regularspatula> `opam help`
<discocaml> <raiinyzen> I need to remove all opam pkgs
<discocaml> <regularspatula> for what reason?
<discocaml> <raiinyzen> i broke it i dont know
<discocaml> <raiinyzen> now I have some new error with "core"
<discocaml> <regularspatula> well if ever you get into a really bad state with an opam switch then you can use `opam switch remove ...` to remove the switch and create a new one
<discocaml> <regularspatula> i have never tried to remove all packages from a switch while keeping the switch however
<discocaml> <raiinyzen> what is a swithc
<discocaml> <raiinyzen> is it just a compiler version?
<discocaml> <regularspatula> have you gone through the introductory material here? https://ocaml.org/docs
<discocaml> <regularspatula> it seems that you may need some basics first
<discocaml> <raiinyzen> nope
<discocaml> <raiinyzen> yep
<discocaml> <regularspatula> sorry for dumping too many terms at you that you weren't familiar with -- I would take a look through that stuff to get a feel for stuff first
tri has joined #ocaml
<discocaml> <raiinyzen> no like I know the language
<discocaml> <raiinyzen> like i made a simple todo REPL
<discocaml> <regularspatula> right but you don't know the ecosystem or tooling it seems
<discocaml> <raiinyzen> ```
<discocaml> <raiinyzen> let tasks = ref [] (* Mutable list of tasks *)
<discocaml> <raiinyzen>
<discocaml> <raiinyzen> let add_task task =
<discocaml> <raiinyzen> tasks := task :: !tasks;
<discocaml> <raiinyzen> print_endline ("Added: " ^ task)
<discocaml> <raiinyzen> ;;
<discocaml> <raiinyzen>
<discocaml> <raiinyzen> let list_tasks () =
<discocaml> <raiinyzen> print_endline "Tasks:";
<discocaml> <raiinyzen> List.iteri (fun i task -> Printf.printf "%d. %s\n" (i + 1) task) (List.rev !tasks)
<discocaml> <raiinyzen> ;;
<discocaml> <raiinyzen>
<discocaml> <raiinyzen> let remove_task n =
<discocaml> <raiinyzen> if n <= 0 || n > List.length !tasks then
<discocaml> <raiinyzen> print_endline "Invalid task number!"
<discocaml> <raiinyzen> else
<discocaml> <raiinyzen> let index = n - 1 in
<discocaml> <raiinyzen> tasks := List.mapi (fun i task -> if i = index then "" else task) !tasks
<discocaml> <raiinyzen> |> List.filter (fun x -> x <> "");
<discocaml> <raiinyzen> print_endline "Task removed!"
<discocaml> <raiinyzen> ;;
<discocaml> <raiinyzen>
<discocaml> <raiinyzen> let rec main () =
<discocaml> <raiinyzen> print_endline "\nCommands: add <task>, list, remove <n>, exit";
<discocaml> <raiinyzen> print_string "> ";
<discocaml> <raiinyzen> flush stdout;
<discocaml> <raiinyzen> match read_line () with
<discocaml> <raiinyzen> | "exit" -> print_endline "Goodbye!"
<discocaml> <raiinyzen> | "list" -> list_tasks (); main ()
<discocaml> <raiinyzen> | cmd when String.length cmd > 4 && String.sub cmd 0 4 = "add " ->
<discocaml> <raiinyzen> yes
<discocaml> <regularspatula> eg "what is a switch" indicates you need to do some reading first
<discocaml> <regularspatula> also, mind the channel description. it says "please don't post walls of text" -- I think it messes up the IRC bridge
<discocaml> <raiinyzen> mn
<discocaml> <raiinyzen> mb
<discocaml> <raiinyzen> do u know Haskell?
<discocaml> <regularspatula> not much other than using it 10+ years ago
<discocaml> <raiinyzen> wow you must be good at FP, so long in the field?
<discocaml> <regularspatula> or just old lol
<discocaml> <raiinyzen> Do you do FP for work?
<discocaml> <regularspatula> i use ocaml often for work, but i'm not a computer scientist
fmira has joined #ocaml
<discocaml> <raiinyzen> what do you do then?
<discocaml> <regularspatula> bioinformatics
<discocaml> <raiinyzen> im doing Bio rn in HS, not my thing but I know people that enjoy it!
<discocaml> <regularspatula> nice! computers are more fun anyway
<discocaml> <regularspatula> I think you will enjoy OCaml though
<discocaml> <regularspatula> it's very nice and the tooling really isn't too bad once you get used to it
agentcasey has quit [Quit: ZNC 1.10.x-git-27-bfd731cf - https://znc.in]
<discocaml> <raiinyzen> we will see, Rust friends of mine say its great!
<discocaml> <regularspatula> i enjoy it more than rust...sometimes we need to use rust but only if necessary. I like the garbage collector
<discocaml> <regularspatula> of ocaml, rather than having to thinkabout that if I don't need to
agentcasey has joined #ocaml
<discocaml> <raiinyzen> well, rust doesnt need one do to the barrow checker
<discocaml> <raiinyzen> but I still understand
tri has quit [Remote host closed the connection]
<discocaml> <regularspatula> yes, but the borrow checker is not fun 🙂
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 244 seconds]
mange has quit [Quit: Quittin' time!]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
polykernel_ has joined #ocaml
polykernel has quit [Ping timeout: 265 seconds]
polykernel_ is now known as polykernel
polykernel has quit [Ping timeout: 252 seconds]
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
alfiee has joined #ocaml
Serpent7776 has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
tri has joined #ocaml
tri has quit [Ping timeout: 245 seconds]
alfiee has joined #ocaml
bartholin has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
Exa has quit [Ping timeout: 268 seconds]
humasect has joined #ocaml
humasect has quit [Ping timeout: 260 seconds]
alfiee has joined #ocaml
Haudegen has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
bartholin has quit [Quit: Leaving]
divya has quit [Remote host closed the connection]
divya has joined #ocaml
alfiee has joined #ocaml
tri has joined #ocaml
patrick_ is now known as patrick
alfiee has quit [Ping timeout: 252 seconds]
tri has quit [Ping timeout: 252 seconds]
patrick has quit [Changing host]
patrick_ has joined #ocaml
rustyne has quit [Remote host closed the connection]
pluviaq has quit [Remote host closed the connection]
richardhuxton has quit [Remote host closed the connection]
xvilka has quit [Remote host closed the connection]
whereiseveryone has quit [Remote host closed the connection]
_alix has quit [Remote host closed the connection]
beo has quit [Remote host closed the connection]
b0o has quit [Remote host closed the connection]
immutable has quit [Remote host closed the connection]
Ankhers has quit [Remote host closed the connection]
arya_elfren has quit [Remote host closed the connection]
slondr has quit [Remote host closed the connection]
seeg has quit [Remote host closed the connection]
philipwhite has quit [Remote host closed the connection]
pmk has quit [Remote host closed the connection]
ymherklotz has quit [Remote host closed the connection]
lane has quit [Remote host closed the connection]
soni_ has quit [Remote host closed the connection]
ggb has quit [Write error: Broken pipe]
tranzystorekk has quit [Remote host closed the connection]
ursa-major has quit [Remote host closed the connection]
sleepydog has quit [Remote host closed the connection]
patrick_ has quit [Read error: Connection reset by peer]
henrytill has quit [Read error: Connection reset by peer]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
olle has joined #ocaml
alfiee has joined #ocaml
ggb has joined #ocaml
beo has joined #ocaml
pmk has joined #ocaml
philipwhite has joined #ocaml
immutable has joined #ocaml
pluviaq has joined #ocaml
rustyne has joined #ocaml
lane has joined #ocaml
ymherklotz has joined #ocaml
tranzystorekk has joined #ocaml
patrick_ has joined #ocaml
seeg has joined #ocaml
soni_ has joined #ocaml
henrytill has joined #ocaml
xvilka has joined #ocaml
richardhuxton has joined #ocaml
b0o has joined #ocaml
whereiseveryone has joined #ocaml
slondr has joined #ocaml
ursa-major has joined #ocaml
_alix has joined #ocaml
arya_elfren has joined #ocaml
sleepydog has joined #ocaml
Ankhers has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
CalimeroTeknik has quit [Ping timeout: 260 seconds]
Haudegen has quit [Quit: Bin weg.]
CalimeroTeknik has joined #ocaml
Inline has joined #ocaml
alfiee has joined #ocaml
pi3ce has quit [Ping timeout: 252 seconds]
pi3ce has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 248 seconds]
myrkraverk__ is now known as myrkraverk
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
myrkraverk_ has joined #ocaml
patrick_ is now known as patrick
myrkraverk has quit [Ping timeout: 272 seconds]
patrick has quit [Changing host]
patrick_ has joined #ocaml
DerTeufel has joined #ocaml
Inline has quit [Ping timeout: 244 seconds]
patrick_ is now known as patrick
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
JuanDaugherty has joined #ocaml
patrick has quit [Changing host]
patrick_ has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 252 seconds]
Inline has joined #ocaml
polykernel has joined #ocaml
myrkraverk has joined #ocaml
patrick_ is now known as patrick
myrkraverk_ has quit [Ping timeout: 248 seconds]
bibi_ has quit [Quit: Konversation terminated!]
JuanDaugherty has quit [Quit: praxis.meansofproduction.biz (juan@acm.org)]
ds-ac1 has quit [Ping timeout: 276 seconds]
bibi_ has joined #ocaml
patrick has quit [Changing host]
patrick_ has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
casastorta has quit [Remote host closed the connection]
casastorta has joined #ocaml
<discocaml> <gooby_diatonic> What's the workflow for changing OCaml switch from within Emacs 🤔
<discocaml> <gooby_diatonic> It pulls the default switch on startup I believe, but sometimes I don't want to restart Emacs just to use a different version temporarily
<discocaml> <gooby_diatonic> Using `opam env` from eshell also isn't really working
alfiee has joined #ocaml
tri has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
tri has quit [Ping timeout: 248 seconds]
Inline has quit [Ping timeout: 252 seconds]
olle has quit [Ping timeout: 265 seconds]
CalimeroTeknik has quit [Changing host]
CalimeroTeknik has joined #ocaml
<discocaml> <gooby_diatonic> Oooo I'll check that out, thanks ^^
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 276 seconds]
dawids has joined #ocaml
euphores has quit [Quit: Leaving.]
Haudegen has quit [Quit: Bin weg.]
tri has joined #ocaml
tri has quit [Ping timeout: 252 seconds]
euphores has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
dawids has quit [Quit: Leaving]
bartholin has joined #ocaml
polykernel has quit [Ping timeout: 252 seconds]
polykernel has joined #ocaml
Inline has joined #ocaml
Haudegen has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
Serpent7776 has quit [Ping timeout: 244 seconds]
euphores has quit [Quit: Leaving.]
alfiee has joined #ocaml
euphores has joined #ocaml
alfiee has quit [Ping timeout: 265 seconds]
alfiee has joined #ocaml
sixfourtwelve has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
YuGiOhJCJ has joined #ocaml
JuanDaugherty has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
sixfourtwelve has quit [Quit: leaving]
gentauro has quit [Ping timeout: 260 seconds]
gentauro has joined #ocaml
Anarchos has joined #ocaml
JuanDaugherty is now known as ColinRobinson
rgrinberg has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
Inline has quit [Remote host closed the connection]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Inline has joined #ocaml
alfiee has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
alfiee has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
fmira has quit [Ping timeout: 264 seconds]
bartholin has quit [Quit: Leaving]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 248 seconds]
<dh`> irc doesn't like large volumes of text at once, because of a long history of bozos doing it on purpose to DoS the system
mange has joined #ocaml
Tuplanolla has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]