Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Soni has quit [Ping timeout: 256 seconds]
<d_bot_> <sparsest> Can I get a bit of tech support? I'm using OCaml Platform with VS Code, and I've installed ocaml-lsp-server in my switch, but OCaml Platform says it's not installed. When I go to "select sandbox" in VSCode, it only shows "Global" and "Custom" switches, while "opam switch" shows a lot of them, so maybe OCaml Platform isn't seeing my switches for some reason? Anyone have this issue before?
<d_bot_> <NULL> What OS ? Notice anything weird in the "OCaml commands" tab of outputs ?
<d_bot_> <rgrinberg> which version of opam do you have?
<d_bot_> <sparsest> 2.0.5
<d_bot_> <rgrinberg> okay, upgrade to 2.1.x and it should work
<d_bot_> <rgrinberg> we need to fix this bug
<d_bot_> <NULL> What's the bug exactly ?
<d_bot_> <rgrinberg> the plugin uses a command line flag that only exists since 2.1.x to run opam
<d_bot_> <sparsest> Got it, thanks!
<d_bot_> <sparsest> I just sorta nuked my config by trying different things, so I'll try to restore it and try upgrading opam
bobo has quit [Ping timeout: 240 seconds]
spip has joined #ocaml
<d_bot_> <NULL> If you really nuked everything and if installing a compiler is not prohibitively long, you can delete ~/.opam, install the latest version and (re)do opam init
<d_bot_> <NULL> You'd also want to remember the packages you installed if you do that
<d_bot_> <sparsest> Thanks! It does seem to be working now. For the record, I did delete ~/.opam just to keep things simple
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Soni has joined #ocaml
rgrinberg has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
<companion_cube> what's this new warning:
<companion_cube> Warning 70 [missing-mli]: Cannot find interface file.
<companion_cube> are we supposed to always write .mli now?!
<companion_cube> (cc octachron, I'm sure he knows)
<sleepydog> might be a dune bug. that warning has been around for 2 years
<d_bot_> <NULL> 1 year old, around since 4.13.0 (https://github.com/ocaml/ocaml/issues/7493) and the PR that goes with it
<d_bot_> <NULL> About the question "are we supposed to always write .mli now ?" the proposed answer is "we don't know [hence why] the warning is off by default"
<companion_cube> yeah well, the trigger happy dune people make that a mostly false statement
<companion_cube> if "we don't know" then why is there a warning? :)
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<companion_cube> well, opened an issue on dune.
random-jellyfish has quit [Ping timeout: 256 seconds]
gopiandcode has quit [Quit: WeeChat 3.0]
azimut_ has quit [Remote host closed the connection]
azimut has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
toastloop has joined #ocaml
gopiandcode has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
Haudegen has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gravicappa has joined #ocaml
<d_bot_> <Bluddy> link for the lazy?
mro has joined #ocaml
Anarchos has joined #ocaml
olle has joined #ocaml
wingsorc has quit [Quit: Leaving]
hsw has quit [Quit: Leaving]
<octachron> companion_cube, writing mli is still supposed to be the default. Note that this warning is disabled by default for the compiler, and will be for at least as long as that there is no simple way to disable it on a file-by-file basis.
<octachron> I don't know why dune enabled it by default too.
micro has quit [Ping timeout: 256 seconds]
micro has joined #ocaml
mbuf has joined #ocaml
<Anarchos> sleepydog hi
olle has quit [Quit: Lost terminal]
<d_bot_> <Bluddy> wait but dune makes warnings=errors by default for release profile. So not having an mli will cause a build error?
<d_bot_> <octachron> No, dune transform warnings in errors in the dev profile? Otherwise, the deprecation alert would have be rendered totally pointless.
<d_bot_> <octachron> And having deprecation warning promoted to error in the dev profile is already painful enough that from time to time I hear people half-jokingly suggesting to introduce a pre-deprecation alert.
<d_bot_> <NULL> `mkdir dune_test; cd dune_test; echo "let main () = print_endline \"Hello World\"\n let () = main ()" > test.ml; dune init executable test; dune build; dune build --profile=release` I don't see warning 70 with this, what did I do wrong to reproduce ?
<d_bot_> <NULL> `ocamlc test.ml -w A` does raise warning 70
toastloop has quit [Quit: Leaving]
toastloop has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
sleepydog has quit [Ping timeout: 250 seconds]
sleepydog has joined #ocaml
jakzale_ has joined #ocaml
b0o has quit [Ping timeout: 245 seconds]
olle has joined #ocaml
jakzale has quit [Ping timeout: 240 seconds]
jakzale_ is now known as jakzale
b0o has joined #ocaml
salkin has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
bartholin has joined #ocaml
hsw has joined #ocaml
toastloop has left #ocaml [Leaving]
kakadu has joined #ocaml
Anarchos has quit [Ping timeout: 272 seconds]
jlrnick has joined #ocaml
mro has quit [Quit: Leaving...]
hackinghorn has quit [Ping timeout: 240 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
hackinghorn has joined #ocaml
jlrnick has quit [Ping timeout: 240 seconds]
cedric has joined #ocaml
hegz has quit [Remote host closed the connection]
hegz has joined #ocaml
hegz has quit [Ping timeout: 256 seconds]
hegz has joined #ocaml
spip has quit [Ping timeout: 256 seconds]
bobo has joined #ocaml
mro has quit [Remote host closed the connection]
hegz has quit [Quit: Quit]
mg has quit [Ping timeout: 256 seconds]
mg has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<olle> Why is tagless-final called tagless-final?
<olle> What tagless? And what's final about it?
<Corbin> I could summarize what Oleg says in e.g. https://okmij.org/ftp/tagless-final/course/lecture.pdf if you like. But I don't know what you've been reading.
<olle> Hmmm
<d_bot_> <glennsl>
<d_bot_> <glennsl> "In sum, using ordinary functions rather than data constructors to represent well-typed
<d_bot_> <glennsl> terms, we achieve a tagless evaluator for a typed object language in a metalanguage with a
<d_bot_> <glennsl> simple type system (Hindley 1969; Milner 1978). We call this approach final (in contrast
<d_bot_> <glennsl> to initial), because we represent each object term not by its abstract syntax but by its denotation in a semantic algebra."
<d_bot_> <glennsl> Don't ask me to explain what that acutally means though. I understand the "tagless" part, but still not so much the "final" part.
<Corbin> Okay, sure. So, let's do "final" first. We have multiple options for representing abstract syntax. One option is to use a GADT; we can hold any sort of typed abstract syntax by representing it as a tree.
<Corbin> We could say that a GADT is the "initial" way to represent abstract syntax. That's not (just) because it's an easy way to get started, but because we can use a fold to turn a tree into basically anything, right? We can start with the initial encoding, and then turn it into any other encoding we like.
<Corbin> The tagless-final approach is "final" (or sometimes "terminal") in a similar sense: we should be able to turn any encoding into a final encoding. This is what gives final encodings their low-level interpreter-ish sensation.
<Corbin> (And we can check that every initial encoding can be sent to a final encoding; the final encodings basically look like folds or visitors on the initial encodings!)
<olle> Hmm
Haudegen has quit [Quit: Bin weg.]
<Corbin> Or, maybe more confusingly, imagine API calls. An initial encoding is like sending somebody a tree so that they can do something with it or maybe just store it for later; a final encoding is like receiving the pieces of a tree and doing something with it, but not necessarily putting the tree together.
<olle> But how's it different from a normal AST encoding...?
<Corbin> There's no tree in memory. As Oleg says, we are not representing DSL values ("object terms") with the trees themselves, but "its denotation in a semantic algebra", or IOW the *meaning* of the DSL value *in the interpreter*.
<companion_cube> There's a tree of closures, at least
Anarchos has joined #ocaml
<olle> Aren't all recursive ADTs tree-like?
mro has quit [Remote host closed the connection]
<d_bot_> <Drup> olle: imagine that your DSL describes shapes. In an initial encoding, you make an ADT for the shapes and their operation. Each combinator then build membres of that ADT. A picture is just a value of that ADT. In a final encoding, each combinator is a drawing function on a context, and your "picture" is a closure that apply all these drawing functions directly.
<olle> What's a combinator?
<d_bot_> <Drup> a function to combine stuff 😄
<d_bot_> <Drup> for instance, in the shape examples, we will have `square : int -> int -> shape`, or `rotate : degree -> shape -> shape`, etc
<olle> Ok :)
<olle> What's a "value of an ADT"?
<olle> An evaluation?
<d_bot_> <Drup> the tradeoffs are very different (and Oleg explains that well)
<d_bot_> <Drup> no, just a term: `Rotate (10, Rect (1,2))`
<olle> Hm
<olle> Drup, and how would you do shapes ADT with "final encoding"?
<d_bot_> <Drup> the operation will have the same type as before
<d_bot_> <Drup> but their implementation will not use an AST
<d_bot_> <Drup> we will have something like `type shape = drawing_context -> unit`
<olle> Hmmm, maybe I'll ask on the forum for an EL5 ^^
<olle> Then others can read it too
<d_bot_> <Drup> not a bad idea 🙂
gravicappa has quit [Ping timeout: 272 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Haudegen has joined #ocaml
mro has joined #ocaml
waleee has joined #ocaml
gwizon has joined #ocaml
gwizon has quit [Client Quit]
dextaa_ has joined #ocaml
jlrnick has joined #ocaml
<d_bot_> <VPhantom> Maybe I'll understand what comes out of _that_.
<d_bot_> <VPhantom> We have _very_ smart 5-year-olds these days I guess. 😛
Anarchos has joined #ocaml
<olle> :D
wyrd has quit [Remote host closed the connection]
wyrd has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<sleepydog> oh, what a coincidence, I was just re-reading the tagless final lecture & related papers in the hope I'd understand it this time with a little more OCaml experience. I can follow the most basic examples, at least :)
mbuf has quit [Quit: Leaving]
b0o has quit [Remote host closed the connection]
jakzale has quit [Remote host closed the connection]
seeg has quit [Remote host closed the connection]
sleepydog has quit [Remote host closed the connection]
sleepydog has joined #ocaml
jakzale has joined #ocaml
b0o has joined #ocaml
seeg has joined #ocaml
rgrinberg has joined #ocaml
olle has quit [Remote host closed the connection]
gravicappa has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
zebrag has joined #ocaml
sagax has joined #ocaml
jlrnick has quit [Ping timeout: 240 seconds]
xgqt has quit [Ping timeout: 256 seconds]
xgqt has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mro has quit [Remote host closed the connection]
jakzale has quit [Remote host closed the connection]
b0o has quit [Remote host closed the connection]
sleepydog has quit [Remote host closed the connection]
seeg has quit [Remote host closed the connection]
gwizon has joined #ocaml
mro has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
sleepydog has joined #ocaml
seeg has joined #ocaml
jakzale has joined #ocaml
wyrd has quit [Ping timeout: 240 seconds]
b0o has joined #ocaml
wyrd has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
bartholin has quit [Quit: Leaving]
kakadu has quit [Quit: Konversation terminated!]
dalek_caan has joined #ocaml
Haudegen has joined #ocaml
Nahra has quit [Remote host closed the connection]
mro has joined #ocaml
<d_bot_> <mseri> There should be a long and detailed post on discuss by @ivg (I think) on tagless final that was very clarificatory to me, I will try to look it up
Soni is now known as GD-IRC
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has quit [Remote host closed the connection]
salkin has quit [Quit: salkin]
perrierjouet has quit [Quit: WeeChat 3.4]
<d_bot_> <Bluddy> I really need to post every @ivg post to OCamlverse. He writes so well it's practically out of a textbook.
mro has joined #ocaml
gravicappa has quit [Ping timeout: 245 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
jonasbits has quit [Ping timeout: 252 seconds]
dalek_caan has quit [Quit: dalek_caan]
dextaa_ has joined #ocaml
<d_bot_> <Butanium (@me on answer)> if I have local switch for my project, should I be able to select it in sandbox ?
<d_bot_> <rgrinberg> Yes
<d_bot_> <Butanium (@me on answer)> ok thanks
mro has quit [Quit: Leaving...]
rgrinberg has joined #ocaml
<d_bot_> <mseri> I think it may have been this post that I had in mind: https://discuss.ocaml.org/t/narrowing-variant-types-alternatives/3806/5 but it could well be a mix of a few of them that melted in memory 😛
<d_bot_> <Butanium (@me on answer)> I have an OCaml experiment that runs for days on a linux cloud computer
<d_bot_> <Butanium (@me on answer)> in background
<d_bot_> <Butanium (@me on answer)> is there a way for me to send it information whenever I want, for instance to get first results
<d_bot_> <orbitz> Sure
<d_bot_> <Butanium (@me on answer)> how can I do that
<d_bot_> <Butanium (@me on answer)> and like I don't want it to stop on this signal, just updating a file
<d_bot_> <orbitz> I don't know but it's a computer, they can do pretty much anything
<d_bot_> <Butanium (@me on answer)> I guess xD
<d_bot_> <Butanium (@me on answer)> for foreground process I'd use sigint catch (I know it's dirty but it works xD)
<d_bot_> <orbitz> But really, it depends on specifically what you're trying to do. You might have to define your problem a bit more to get a concrete answer
<d_bot_> <Butanium (@me on answer)> I'm running bunch of tests
<d_bot_> <Butanium (@me on answer)> to test the efficency of a TSP solver over a lot of city configuration
<d_bot_> <Butanium (@me on answer)> so it runs for days
<d_bot_> <Butanium (@me on answer)> and I'd like it to update a .CSV file when I want
<d_bot_> <Butanium (@me on answer)> before it finishs all the tests
<d_bot_> <Butanium (@me on answer)> here is a snippet of the CSV :
<d_bot_> <Butanium (@me on answer)> ```sql
<d_bot_> <Butanium (@me on answer)> solver-name,average-deviation,average-length,average-opted-deviation,average-opted-length
<d_bot_> <Butanium (@me on answer)> Iterated2Opt-Roulette,0.00296736,1050,0.00296736,1050
<d_bot_> <Butanium (@me on answer)> MCTS-SemiLength2Opt-Random-hidden_Full2opt-1s,0.0058032,1053,0.0058032,1053
<d_bot_> <Butanium (@me on answer)> MCTS-SemiLength2Opt-Roulette-hidden_Full2opt-1s,0.00764992,1055,0.00764992,1055
<d_bot_> <Butanium (@me on answer)> ```
<d_bot_> <orbitz> Any reason you can't just use a signal handler?
<d_bot_> <Butanium (@me on answer)> I totally can
<d_bot_> <Butanium (@me on answer)> for sigint I did ```ocaml
<d_bot_> <Butanium (@me on answer)> if catch_SIGINT then
<d_bot_> <Butanium (@me on answer)> Sys.set_signal Sys.sigint
<d_bot_> <Butanium (@me on answer)> (Sys.Signal_handle (fun _ -> user_interrupt := true));
<d_bot_> <Butanium (@me on answer)> (* allow user exit with Ctrl+C sigint*)
<d_bot_> <Butanium (@me on answer)> ```
<d_bot_> <NULL> Watch out for code here
<d_bot_> <Butanium (@me on answer)> you mean the channel ? It's just 4 lines I thought it'd not spam too much
<d_bot_> <NULL> Each newline becomes a new message if I understood correctly, including the formatting \`\`\` so pretty annoying
<d_bot_> <Butanium (@me on answer)> uh sorry
perrierjouet has joined #ocaml
<d_bot_> <orbitz> @Butanium is a signal handler sufficient for your needs?
<d_bot_> <Butanium (@me on answer)> yes
Butanium has joined #ocaml
<d_bot_> <Butanium (@me on answer)> like instead of `Sys.singint` I could just use a custom integer ?
<d_bot_> <orbitz> You can see the list of signals there
<d_bot_> <orbitz> Maybe you want one of the sigusr ones
<d_bot_> <Butanium (@me on answer)> how do I raise them from my linux shell ?
<d_bot_> <orbitz> The kill program
dy has quit [Remote host closed the connection]
<d_bot_> <Butanium (@me on answer)> so thing like ```bash
<d_bot_> <Butanium (@me on answer)> kill -SIGUSR2 <pid>
<d_bot_> <Butanium (@me on answer)> ```
<d_bot_> <Butanium (@me on answer)> ?
<d_bot_> <Butanium (@me on answer)> Oh yes you're right @NULL
<d_bot_> <NULL> I'd say use \` but no \`\`\`
<d_bot_> <orbitz> Check the man page
jonasbits has joined #ocaml
<d_bot_> <anmonteiro> @octachron anything changed between alpha 2 and beta1 wrt treating C compilation warnings as errors?
<d_bot_> <anmonteiro> getting
<d_bot_> <anmonteiro> ```
<d_bot_> <anmonteiro> clang-11: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument]
<d_bot_> <anmonteiro> ```
<d_bot_> <anmonteiro> didn't happen on alpha2
<d_bot_> <NULL> ^
<d_bot_> <anmonteiro> this happens on `make -C runtime sak`
<d_bot_> <anmonteiro> oh. please disregard me. I need to apply the same fix I started applying for 5.00, `hardeningDisable = [ "strictoverflow"];`
olle has joined #ocaml
Butanium has quit [Quit: Client closed]
cedric has quit [Quit: Konversation terminated!]
Tuplanolla has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<olle> I didn't yet get an answer to the pro of tagless vs ast
<olle> On the forum
<olle> Any takers? :)
Haudegen has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml