<discocaml>
<iamjcchan> I'm using cohttp-eio to make api request with tls-eio for https, but I don't actually want to validate certificate and I couldn't find the document to disable tls validation for either cohttp-eio nor tls-tio
<discocaml>
<iamjcchan> I'm using cohttp-eio to make api request with tls-eio for https, but I don't actually want to validate certificate and I couldn't find the documentation to disable tls validation for either cohttp-eio nor tls-tio
<discocaml>
<iamjcchan> i was trying to install piaf and it gave me some error so I went with cohttp😂
<discocaml>
<yawaramin> hehe
<discocaml>
<iamjcchan> also I couldn't fine the doc that tells you how to specify build profile for an executable
<discocaml>
<iamjcchan> on my macbook m2, when I try to install piaf, the build error says openssl/rand.h file not found. so am I missing any system dependencies
<discocaml>
<yawaramin> yeah i guess you're missing the openssl dev package?
<discocaml>
<yawaramin> oh you said Mac, so i guess `brew info openssl`
<discocaml>
<iamjcchan> it says openssl@3: stable 3.4.0 (bottled) is installed
ygrek has joined #ocaml
<discocaml>
<yawaramin> i have that file in the path `/opt/homebrew/Cellar/openssl@3/3.4.0/include/openssl/rand.h`. not sure why it's not finding it for you. maybe your switch is outdated? you could try `eval $(opam env) && opam update && opam upgrade` and then try installing piaf
<discocaml>
<iamjcchan> thanks let me try that
zenmov has quit [Remote host closed the connection]
zenmov has joined #ocaml
<discocaml>
<iamjcchan> for piaf, is there a method for adding basic auth header?
pi3ce has quit [Read error: Connection reset by peer]
ygrek has quit [Remote host closed the connection]
infinity0 has quit [Ping timeout: 252 seconds]
pi3ce_ has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
bartholin has joined #ocaml
myrkraverk has joined #ocaml
infinity0 has joined #ocaml
zenmov has quit [Ping timeout: 276 seconds]
bartholin has quit [Quit: Leaving]
<ski>
mbacarella : Irssi, here
<discocaml>
<ape_logic> why doesn't ocaml use type inference for mathematical operators and refuse to compile float and int operations? it a historical reason?
<discocaml>
<ape_logic> why doesn't ocaml use type inference for mathematical operators and refuse to compile float and int operations? is it a historical reason?
<discocaml>
<ape_logic> hmm on reflection I guess it's because they're not special functions and just declared like everything else
<discocaml>
<ape_logic> ..so what we really need is for them to be polymorphic, right? `Int 5 + `Int 10 looking pretty to me
<discocaml>
<ape_logic> *pretty ergonomic
<discocaml>
<ape_logic> ..so what we really need is for them to be polymorphic, right? \`Int 5 + \`Int 10 looking pretty ergonomic to me
agentcasey has quit [Ping timeout: 252 seconds]
zenmov has joined #ocaml
<dh`>
haskell uses typeclasses for this
<dh`>
but it's not actually that simple, float operations don't satisfy the same axioms as integer operations
<dh`>
e.g. (x +. y) +. z is not the same as x +. (y +. z)
<dh`>
so if you abstract it you either pass up a lot of integer optimization opportunities or generate wrong float code
mbuf has joined #ocaml
Serpent7776 has joined #ocaml
zenes has joined #ocaml
zenes has quit [Changing host]
zenes has joined #ocaml
Haudegen has joined #ocaml
zenes has quit [Ping timeout: 248 seconds]
YuGiOhJCJ has joined #ocaml
olle has joined #ocaml
Anarchos has joined #ocaml
troydm has quit [Ping timeout: 252 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<discocaml>
<deepspacejohn> If + worked on both int and float types, what would be the type of `fun a b -> a + b` ?
<olle>
(Number, Number) -> Number ?
<olle>
Then you have to unpack Number to figure out if it's int or float.
Haudegen has quit [Quit: Bin weg.]
divya has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
Haudegen has joined #ocaml
toastal has quit [Ping timeout: 255 seconds]
ygrek has joined #ocaml
qrpnxz has quit [Quit: WeeChat 3.8]
qrpnxz has joined #ocaml
toastal has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
bartholin has joined #ocaml
<discocaml>
<xavierm02_> olle: then you get the usual disadvantages of dynamically typed things, e.g. what do you do when the two operands are of different types?
<discocaml>
<xavierm02_> dh`: this drawback applies if you try to generate polymorphic code, but you could also add duplicated monomorphised code for each instance
gahr has quit [Read error: Connection reset by peer]
steenuil has quit [Read error: Connection reset by peer]
ansiwen has joined #ocaml
remexre has quit [Read error: Connection reset by peer]
steenuil has joined #ocaml
remexre has joined #ocaml
casastorta has quit [Remote host closed the connection]
end has quit [Quit: end]
Ekho has quit [Quit: CORE ERROR, SYSTEM HALTED.]
pie_ has quit [Remote host closed the connection]
casastorta has joined #ocaml
pie_ has joined #ocaml
end has joined #ocaml
Ekho has joined #ocaml
zenmov has quit [Remote host closed the connection]
<olle>
xavier, type-cast?
<olle>
Or disallow
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 245 seconds]
<olle>
Is this a type-class discussion?
<discocaml>
<xavierm02_> olle:disallowing weakens the static guarantees given by typing, and type casting can induce weird behavior (e.g. casting from int to float before or after an operation can change the result)
Haudegen has quit [Quit: Bin weg.]
Serpent7776 has quit [Ping timeout: 245 seconds]
<olle>
disallow statically? isn't that what haskell does?
<olle>
I believe there are multiple articles on how to do this in ocaml with modules and gadt, no?
<octachron>
Haskell type is not `(Number, Number) -> Number` but `Number x => (x,x) -> x` which doesn't allow the problematic case where the left and right operand are different instances of the Number type class.
<olle>
octachron: meaning you get a type error?
<octachron>
Indeed
<olle>
Manually casting always seemed best option to me. Intention is clearer.
<olle>
octachron: +1
<discocaml>
<Kali> it is simple to do this with gadts but since you have to write it out manually at that point why even bother just use separate functions in the first place
<discocaml>
<deepspacejohn> you can always wrap int, float, int32, int64, etc. into a "number" type but you'll ultimately have to unwrap it to do anything useful with it. it's easier to just pick the target type that you need in the end and convert other values to that.
<discocaml>
<Kali> yeah ^
<discocaml>
<octachron> Or wrapping your algorithm in a functor when you reallly want it to work on all noetherian rings.
olle has quit [Ping timeout: 252 seconds]
ygrek has quit [Remote host closed the connection]
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
mbuf has quit [Quit: Leaving]
Haudegen has joined #ocaml
toastal has left #ocaml [Disconnected: Received SIGTERM]
toastal has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce_ has joined #ocaml
Tuplanolla has joined #ocaml
ygrek has joined #ocaml
Serpent7776 has joined #ocaml
ygrek has quit [Remote host closed the connection]
<discocaml>
<diligentclerk> I have been writing some numerical code in Futhark for a while and I've gotten used to just functorizing everything and working with an arbitrary number type t. It's not bad
Anarchos has joined #ocaml
<discocaml>
<astreamingcomesacrossthesky> I'm having a heck of a time getting zarith installed on my new computer. I'm using nix and I have `gmp` available, but the installation errors out with this error from `ocamlfind`:
<discocaml>
<astreamingcomesacrossthesky>
<discocaml>
<astreamingcomesacrossthesky> ```
<discocaml>
<astreamingcomesacrossthesky> ocamlfind: Bad configuration: Cannot mkdir ... Path component does not exist or is not a directory```
<discocaml>
<astreamingcomesacrossthesky>
<discocaml>
<astreamingcomesacrossthesky> Which is in some measure true bc several parents of the intended output dir do not exist, except it's trying to build the lib in the parent directory of my local switch?
<discocaml>
<._null._> What OS and what did you do to install it ?
<discocaml>
<astreamingcomesacrossthesky> It's NixOS and it's being brought in as a dependency of another library by OPAM
<discocaml>
<astreamingcomesacrossthesky> I just tried installing it directly and same result
<discocaml>
<._null._> Did you install it through Nix or opam ?
<discocaml>
<astreamingcomesacrossthesky> OPAM
<discocaml>
<._null._> When you try `opam install zarith --verbose`, can you find the problematic command ? Can you understand what happens ?
<discocaml>
<astreamingcomesacrossthesky> It compiles successfully with `make` but yeah one of the C options is an installation path that does not exist which is why it blows up on `make install`
<discocaml>
<astreamingcomesacrossthesky> I guess I could try building this from source
<discocaml>
<._null._> I get this line, is it the path that's wrong ?:
<discocaml>
<._null._> (I set up a local switch in /tmp)
chiselfuse has quit [Ping timeout: 260 seconds]
<discocaml>
<astreamingcomesacrossthesky> No that looks similar to mine and the path to zarith in the .opam dir also looks similar, where it seems to go wrong is the invocation of `ocamlfind install -destdir`, the path being passed to that is nonsense
<discocaml>
<astreamingcomesacrossthesky> The part that exists is /home/me/my-code/ocaml-stuff but then it produces this subdirectory /outputs/out/lib/ocaml/5.1.1/site-lib no part of which is existing
<discocaml>
<._null._> But `destdir` is completely wrong ? And it comes from nowhere ?
<discocaml>
<astreamingcomesacrossthesky> Yeah exactly that
pie_ has quit [Quit: No Ping reply in 180 seconds.]
<discocaml>
<astreamingcomesacrossthesky> Sorry I'm on my phone otherwise I'd copy these commands directly
mal`` has quit [Quit: Leaving]
<discocaml>
<._null._> This directory first appeared in the initial configure script, can you confirm ?
<discocaml>
<astreamingcomesacrossthesky> Correct
pie_ has joined #ocaml
mal`` has joined #ocaml
<discocaml>
<._null._> What does `ocamlfind printconf destdir` print ?
<discocaml>
<astreamingcomesacrossthesky> The bogus dir that appears in the configure script
chiselfuse has joined #ocaml
<discocaml>
<._null._> So the issue comes from ocamlfind, not from zarith
<discocaml>
<._null._> I'm not sure I can help further, but I imagine you're not the first to encounter this issue
<discocaml>
<astreamingcomesacrossthesky> No worries, you've been plenty of help already. I'll see what I can do about it. Thanks a lot!
<discocaml>
<._null._> Oh wait, do `ocamlfind printconf conf` and read this file ?
Everything has joined #ocaml
<discocaml>
<astreamingcomesacrossthesky> Destdir is set to something in `/nix/store` here
<discocaml>
<._null._> Any related environment variables ?
<discocaml>
<astreamingcomesacrossthesky> Path is set to nix derivation for OCaml and a derivation for findlib
<discocaml>
<astreamingcomesacrossthesky> And then some variables for ocamlc and ocamlopt but they don't look relevant here
<discocaml>
<._null._> Then I don't know, but it sure is related to a problematic interaction between nix and ocamlfind
<discocaml>
<astreamingcomesacrossthesky> Cool, well that narrows it down at least. I'll get it figured out eventually. Or maybe I won't 🤷🏼♂️
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bartholin has quit [Quit: Leaving]
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
Everything has quit [Quit: leaving]
<discocaml>
<ape_logic> out of curiosity, why use a switch in Nix at all?
<discocaml>
<ape_logic> unless this isn't in a devshell.. are you doing systemwide imperative opam ?
<discocaml>
<astreamingcomesacrossthesky> I'm brand new to nix and I'm still kinda figuring out when and where I should be using nix for things and when I should be using PL-specific tooling but to answer your question I do have a dev shell yes
<discocaml>
<astreamingcomesacrossthesky> Surely there can't be Nix packages for every OCaml library that people need so I imagine there has to be some mixed usage, no?
Anarchos has quit [Quit: Vision[]: i've been blurred!]