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/
terrorjack has quit [Quit: Ping timeout (120 seconds)]
terrorjack has joined #ocaml
rgrinberg has joined #ocaml
hackinghaunt has joined #ocaml
notnotdan has quit [Ping timeout: 244 seconds]
notnotdan has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
jonasbits has quit [Ping timeout: 252 seconds]
jonasbits has joined #ocaml
gravicappa has joined #ocaml
<sim642> Are there any examples of containerizing an opam package installation in a lightweight manner? That is, the final image shouldn't contain any opam/ocaml stuff (like the repository, compiler, etc) that aren't necessary for executing a binary installed by the package
d_bot has quit [Remote host closed the connection]
d_bot has joined #ocaml
cbarrett has quit [Ping timeout: 264 seconds]
cbarrett has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gravicappa has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
zebrag has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 258 seconds]
sagax has joined #ocaml
rgrinberg has joined #ocaml
mro has joined #ocaml
rgrinberg has quit [Ping timeout: 265 seconds]
Serpent7776 has joined #ocaml
<d_bot> <Jektrix> You mean like in Docker?
mro has quit [Remote host closed the connection]
mro has joined #ocaml
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #ocaml
olle has joined #ocaml
<d_bot> <Splingush> The keyword is "multistage docker container". You have one stage where you install your build tools and compile, then a next stage where you only copy the compiled binary over (and copy/install libraries that are dynamically linked). Alpine linux worked for me for the final stage.
<d_bot> <Splingush> I checked via ldd to see what libraries are needed for the final container, to be able to run the binary.
hendursa1 has joined #ocaml
hendursaga has quit [Ping timeout: 276 seconds]
Haudegen has joined #ocaml
bartholin has joined #ocaml
<d_bot> <undu> @companion_cube you're not the only one, it's just that I need to update the compiler first on the product :(
rond_ has joined #ocaml
jlrnick has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
wonko has joined #ocaml
jlrnick has quit [Remote host closed the connection]
jlrnick has joined #ocaml
waleee has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
<d_bot> <Jektrix> I was going to say pretty much exactly what Splingush said 😅
spip has joined #ocaml
bobo has quit [Ping timeout: 264 seconds]
waleee has quit [Ping timeout: 264 seconds]
xd1le has joined #ocaml
rgrinberg has joined #ocaml
Anarchos has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
mro has joined #ocaml
mro has quit [Ping timeout: 260 seconds]
rond_ has quit [Quit: Client closed]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
hendursa1 has quit [Ping timeout: 276 seconds]
hendursa1 has joined #ocaml
wonko has quit [Ping timeout: 246 seconds]
jlrnick has quit [Read error: Connection reset by peer]
jlrnick has joined #ocaml
jlrnick has quit [Ping timeout: 258 seconds]
gravicappa has joined #ocaml
<d_bot> <Mukal> Hi, I want to write an interpreter with OCaml. I'm still a beginner, still at the semantics and syntax part, so maybe still a long way to go. But would appreciate it if there are readings that I can already access or even better a guide that specific for OCaml which I haven't found. The other guide I found was mainly for other languages, or it does not matter actually? The motivation of writing an interpreter is mainly to understan
<companion_cube> maybe look at "crafting interpreters"? it uses java in the first half, but OCaml would be suited too
rgrinberg has joined #ocaml
<d_bot> <Mukal> I've just looked it, looks good. But, what do you mean by "would be suited too"?
<companion_cube> well, it'd work at least as well as java for the first half
<d_bot> <Mukal> All right, thank you very much 🙂
<dmbaturin> The concepts remain the same, mostly. ASTs, environments etc. It's easier to express with algebraic types for sure.
<d_bot> <Mukal> I see, that's nice then.
Franciman has quit [Remote host closed the connection]
Franciman has joined #ocaml
rgrinberg has quit [Ping timeout: 268 seconds]
Serpent7776 has quit [Quit: leaving]
xd1le has quit [Quit: xd1le]
bartholin has quit [Quit: Leaving]
Yehowshua has joined #ocaml
<Yehowshua> I was kind of hoping that `dune utop` would drop me into a seesion where the names in my main are already accessible
<Yehowshua> but this doesn't seem to be the case?
<Yehowshua> I have a directory with the two following files:
<Yehowshua> I should mention I'm a bit new to dune and ocaml in general
<Yehowshua> Any suggestions on how I might be able to load my main.mlin a repl along with the dependencies of that file?
JSharp has quit [Ping timeout: 244 seconds]
JSharp has joined #ocaml
olle has quit [Ping timeout: 264 seconds]
<sim642> @Splingush That's what I ended up doing but it feels extremely dirty to have to pick the right things out of the build into the final container. Was hoping dune could do that because it knows all the dependencies and non-dependencies
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #ocaml
Ekho- has joined #ocaml
cross_ has joined #ocaml
motherfs1 has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
motherfsck has quit [*.net *.split]
Ekho has quit [*.net *.split]
cross has quit [*.net *.split]
olle has joined #ocaml
Ekho- is now known as Ekho
<d_bot> <Splingush> sim642: I do not know a better approach than that, but my use-case differs a bit from your apparently as well. I've only ever used it for binaries built myself.
<d_bot> <Splingush> But I'm confused there for a bit: I thought the dune-stanza-files were specifying on a ocaml-level what dependencies there are, but not on an OS-level. If you built your binary, the used ocaml-libraries for it won't be necessary afterwards, but on an OS-level it will need some dynamically linked libraries at runtime.
<d_bot> <Splingush> I might be misunderstanding it, my knowledge there is just sufficient to get things going.
<d_bot> <Splingush> Is your example public? I might not be able to help you further, but providing more concrete information will let others suggest other approaches as well.
Anarchos has joined #ocaml
mbuf has quit [Quit: Leaving]
mro has joined #ocaml
gravicappa has quit [Ping timeout: 246 seconds]
<d_bot> <RegularSpatula> I have an example of a multistage Docker image with a static ocaml binary if you’re interested in a concrete example…it’s a bit messy but it may be useful to see
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
rgrinberg has joined #ocaml
mro has quit [Remote host closed the connection]
motherfs1 has quit [Quit: quit]
olle has quit [Ping timeout: 268 seconds]
<sim642> Here's what I hacked together today (needs cleanup and comments): https://github.com/goblint/analyzer/blob/docker/Dockerfile
Yehowshua has quit [Ping timeout: 256 seconds]
<sim642> One big annoyance in my case is the apron dependency which has C shared libraries. And for some reason --relocatable build still has their RUNPATH as absolute in the binary, so I have to manipulate the binary to make it relative
<d_bot> <RegularSpatula> Will a static build work in your case?
vicfred has joined #ocaml
motherfsck has joined #ocaml
<sim642> I haven't tried, but if it's possible then it might even be better for ease of use
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot> <RegularSpatula> Yeah it was convenient, but my app was pure ocaml so it was no big deal to build it static…not sure with yours how it’ll go with those C reps tho
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has joined #ocaml
mro has joined #ocaml
waleee has joined #ocaml
olle has joined #ocaml
mro has quit [Ping timeout: 268 seconds]
mro has joined #ocaml
olle has quit [Ping timeout: 264 seconds]
mro has quit [Quit: Leaving...]
Tuplanolla has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 268 seconds]
Yehowshua has joined #ocaml
<Yehowshua> I want to drop into the ocaml REPL and play around with a few libraries I've installed with Opam, but calling `open somelib` in $ocaml doesn't work directly...
<Yehowshua> everytime, I have to use topfind and then require...
<Yehowshua> is this the standard pattern for pulling libs into the REPL
<Yehowshua> if so, it feels a little kludgy
<rgrinberg> Yehowshua yes that's how it works. It may seem kludgy if you don't notice the distinction between open and require in this case.
<rgrinberg> You don't need to open a library's main module to use it
<Yehowshua> that is also true
<rgrinberg> it's perfectly fine to refer to it with a qualified name
<d_bot> <NULL> The `#use "topfind"` is usually automatically run as part if `.ocamlinit`
<d_bot> <NULL> of*
<Yehowshua> say I have an ocaml file that uses multiple opam installed libraries... is there any way to load this file into the ocaml repl with all of its dependencies too
<Yehowshua> Is there a way to have opam uninstall a list of ackages from a file?
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]