companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
GuerrillaMonkey has quit [Quit: Leaving]
Yagotzirck has quit [Quit: Leaving]
mfp has quit [Ping timeout: 264 seconds]
sleepydog has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
flux38 has joined #ocaml
<flux38> i'm trying to get all elements in `xs` but not in `ys` and am doing: `List.filter (fun x -> not (List.mem x xs)) ys` but I think this runs in O(|xs||ys|)? how do I do it more efficiently?
<flux38> `ys` but not in `xs`, apologies
<Armael> sort xs and ys, then walk through them in parallel
<Armael> (somewhat like the merge operation of a mergesort)
<flux38> ah i see
<Armael> or just use sets for that kind of stuff
<flux38> is there some documentation with the big-O complexity of the functions in set?
<Armael> doesn't look like it; I'd expect most operations to be logarithmic
<flux38> set difference could be linear right?
<Armael> good question, I don't really know
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
mxns has joined #ocaml
<companion_cube> A lot of functions are, I think, worst case linear, but better in general
mxns has quit [Ping timeout: 272 seconds]
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
olle has quit [Ping timeout: 265 seconds]
sleepydog has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
olle has joined #ocaml
zebrag has quit [Client Quit]
zebrag has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
Asmadeus has left #ocaml ["moo"]
jmiven has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
zebrag has joined #ocaml
mbuf has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
Jeanne-Kamikaze has quit [Remote host closed the connection]
<flux38> what's the %compare.equal syntax mean?
<d_bot> <glennsl> without more context it could mean pretty much anything
mxns has joined #ocaml
<d_bot> <glennsl> it's usually attached to some other piece of syntax though, and then it's an annotation on that syntax node to be picked up by a PPX that will transform the AST
<flux38> i'm looking at a code sample like: ```List.mem invalid_locations x ~equal:[%compare.equal: Position.t])```
<flux38> `Position.t` looks like `type t = { col : int ; row : int }[@@deriving compare, sexp]`
<flux38> i can see they're connected but i can't tell how
<d_bot> <glennsl> the how depends on the PPX
<d_bot> <glennsl> But most likely the `[@@deriving compare]` will generate a compare function based on the type, and `[%compare.equal: Position.t]`will return that function.
<d_bot> <glennsl> Not sure why `[%compare.equal: Position.t]` is used instead of just `Position.equal`
<d_bot> <glennsl> I'm guessing it's this one: https://github.com/janestreet/ppx_compare
<flux38> yeah i'm using janestreet's ppx i believe
<flux38> how can i play aroudn with this in utop?
<flux38> i tried `let a = [%compare.equal:t];;` and it told me Error: Uninterpreted extension 'compare.equal'.
<d_bot> <glennsl> utop apparently has a `-ppx` command line switch and `#ppx` directive. Never used it myself though.
<flux38> hum, okay
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
Jesin has quit [Read error: Connection reset by peer]
Jesin has joined #ocaml
steenuil has quit [Read error: Connection reset by peer]
mxns has joined #ocaml
emias has quit [Ping timeout: 272 seconds]
emias has joined #ocaml
mbuf has quit [Ping timeout: 260 seconds]
mxns has quit [Ping timeout: 268 seconds]
flux38 has quit [Remote host closed the connection]
djellemah has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
dborisog has joined #ocaml
zolk3ri has quit [Ping timeout: 240 seconds]
andreas303 has quit [Ping timeout: 240 seconds]
andreas303 has joined #ocaml
zolk3ri has joined #ocaml
andreas303 has quit [Ping timeout: 240 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
andreas303 has joined #ocaml
Jesin has quit [Read error: Connection reset by peer]
narimiran has joined #ocaml
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
shawnw has joined #ocaml
jlr has joined #ocaml
jlr has quit [Remote host closed the connection]
mbuf has quit [Ping timeout: 240 seconds]
zolk3ri has quit [Ping timeout: 240 seconds]
zolk3ri has joined #ocaml
jayesh-bhoot has quit [Quit: Idle for 30+ days]
olle_ has joined #ocaml
rwmjones|hols is now known as rwmjones
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
mbuf has joined #ocaml
tryte has quit [Remote host closed the connection]
tryte has joined #ocaml
mfp has joined #ocaml
bartholin has joined #ocaml
Haudegen has joined #ocaml
dhil has joined #ocaml
jlr has joined #ocaml
Tuplanolla has joined #ocaml
<mbuf> If I have a custom .opam file, how can I ask opam to install the package and build steps used in the .opam file?
<Fardale> you can pin the package with opan pin
<mbuf> Fardale, I get a wrap: execvp ./configure No such file or directory error
<mbuf> Fardale, where does opam download the sources for a pinned package for the current switch?
<Fardale> You just have a opam file or did you modified the opam file in the src of the package?
<Fardale> The idea is to have a local version of a package and pin it to test some modification
<Fardale> pinning a package is given a new source for the package to opam, either a git, http or file, but you need to have the full package at this location not only the opam file
<mbuf> Fardale, just the opam file with the updated url source field
<mbuf> Fardale, I was under the assumption that opam will fetch the sources specified in the URL, download it and then build it
<Fardale> OK, no it will try to find the package where the opam file is
<Fardale> Then I don't know if it is possible
tryte has quit [Remote host closed the connection]
tryte has joined #ocaml
tryte has quit [Client Quit]
tryte has joined #ocaml
ArthurStrong has joined #ocaml
aiowej has joined #ocaml
<aiowej> I'm starting to use dune, in a project where I previously just built with Make. In Emacs, I'd like to get a toplevel with utop, and integrate it with emacs. To do so without dune, I hit C-c C-b and type `utop -emacs`, and then I can send expressions from my source buffer to utop. How can you run `dune utop` but with the `-emacs` flag, or is there some other way to integrate dune, utop, and emacs? Humble thanks
steenuil has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
<aiowej> Found the answer: you can add `-- <utop options>`, so in the end I run `dune utop . -- -emacs`. It still does not load functions in other files though - I have a file `./util.ml` and `./main.ml` where there are references to the fn `Util.str`, but when running `dune utop .` and in there `Util.str;;`, it gives `Error: Unbound module Util`.
<aiowej> When doing `dune exec main.exe` it will successfully use the fn `Util.str` defined in `util.ml` though
Anarchos has joined #ocaml
dborisog has quit [Remote host closed the connection]
mbuf has quit [Ping timeout: 264 seconds]
Serpent7776 has quit [Ping timeout: 272 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
_whitelogger has joined #ocaml
djellemah has joined #ocaml
_whitelogger has quit [Ping timeout: 260 seconds]
_whitelogger_ has joined #ocaml
waleee-cl has joined #ocaml
shawnw has quit [Ping timeout: 264 seconds]
sleepydog has quit [Remote host closed the connection]
sleepydog has joined #ocaml
aiowej has quit [Ping timeout: 264 seconds]
hnOsmium0001 has joined #ocaml
raver has quit [Quit: Gateway shutdown]
raver has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
mro_name has joined #ocaml
Serpent7776 has joined #ocaml
aiowej has joined #ocaml
neiluj has quit [Ping timeout: 240 seconds]
aiowej has left #ocaml [#ocaml]
aquijoule_ has quit [Remote host closed the connection]
richbridger has joined #ocaml
<daimrod> if aiowej comes back, there has been discussions about limitations on dune utop: https://discuss.ocaml.org/t/dune-utop-limitations/6881
ArthurStrong has quit [Quit: leaving]
mbuf has joined #ocaml
<mbuf> If I add a custom foo.1.2 to ~/.opam/repo/default/packages/foo, and I run "opam update", the custom foo.1.2 gets removed. How do I just add a custom .opam file to the default ~/.opam repo?
tane has joined #ocaml
nullcone has joined #ocaml
<avsm[m]> mbuf: use `opam pin add` for one package. for more, `opam repo add` to add a new directory that contains the custom foo.1.2
<mbuf> avsm[m], thanks!
mro_name has quit [Quit: Leaving...]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
mbuf has quit [Quit: Leaving]
Anarchos has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
neiluj has joined #ocaml
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
hoel has joined #ocaml
Anarchos has quit [Excess Flood]
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 246 seconds]
narimiran has quit [Ping timeout: 260 seconds]
Anarchos has joined #ocaml
mxns has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
Anarchos has quit [Excess Flood]
Bahman has joined #ocaml
<olle> which subset of C would be most suitable for escape analysis, you think?
olle_ has quit [Ping timeout: 265 seconds]
Anarchos has joined #ocaml
jlr has quit [Ping timeout: 268 seconds]
neiluj has joined #ocaml
neiluj has quit [Changing host]
mro_name has joined #ocaml
Serpent7776 has quit [Quit: leaving]
<companion_cube> rust
<Anarchos> eze , as in the Cars movie ?
<companion_cube> olle: why would you need that?
mro_name has quit [Quit: Leaving...]
<neiluj> hi! trying to choose between some ocaml database libraries, did you have experience with any?
<neiluj> hmm all things considered i'll go with ocaml-caqti
decentpenguin has quit [Ping timeout: 246 seconds]
mxns has quit [Ping timeout: 264 seconds]
hoel has quit [Remote host closed the connection]
decentpenguin has joined #ocaml
<olle> companion_cube: again the stack allocation thingy
<olle> but yeah
<olle> since rust stack allocates by default...
<olle> hard to imagine how many people have tried to "fix C" during the ages :/
<Armael> but why do you want stack allocation?
<olle> should be a menhir example out there for C-like lang, right?
<olle> Armael: speed
tane has quit [Quit: Leaving]
<Armael> why not use rust if you want speed
<olle> not convinced rust is not needlessly complex
<olle> usually you don't *always* want speed
<Armael> ocaml then ? :-)
<olle> C# can be tuned a lot, it seems.
<olle> but i'm interested in the programming experience where the escape analysis is part of the compilation errors.
<olle> should check the gc prototypes available for rust, i guess
dhil has quit [Ping timeout: 256 seconds]
bartholin has quit [Quit: Leaving]
<companion_cube> There are none really serious afaik
<companion_cube> Are you not using php currently?
<companion_cube> Ocaml as it currently is, not a fantasy version, might already be pretty fast for your needs
<olle> companion_cube: I am using PHP, and they do have a file called escape_analysis.c in their src
<olle> just have to find the correct people to ask about it
<olle> This is also related to writing PHP code in C instead, and using the PHP standard lib.
<olle> Which could be useful for our SaaS.
<olle> OR do a PHP-like language that compiles to C code that integrates with PHP libs. Idk.
<olle> Russian Facebook VK or whatever open-sourced their own PHP compiler last year
<olle> Obviously I'd love to use OCaml in-house, but good luck convincing CTO about that.
<olle> "fixable by seniors" is a common constraint :)