adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
nicoo has quit [Ping timeout: 240 seconds]
ollehar has quit [Ping timeout: 272 seconds]
ollehar has joined #ocaml
nicoo has joined #ocaml
mfp has quit [Ping timeout: 258 seconds]
Guest86335 has quit [Ping timeout: 260 seconds]
Guest86335 has joined #ocaml
vicfred has quit [Quit: Leaving]
smazga has quit [Ping timeout: 265 seconds]
mangoicedtea has quit [Quit: Leaving]
smazga has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
grdgz has quit [Ping timeout: 265 seconds]
grdgz has joined #ocaml
caasih has quit [Ping timeout: 246 seconds]
higherorder has quit [Ping timeout: 240 seconds]
wildsebastian has quit [Read error: Connection reset by peer]
caasih has joined #ocaml
wildsebastian has joined #ocaml
vicfred has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
jeroud has quit [Read error: Connection reset by peer]
bytesighs has quit [Ping timeout: 240 seconds]
jeroud has joined #ocaml
rgrinberg has joined #ocaml
bytesighs has joined #ocaml
wildsebastian has quit [Ping timeout: 260 seconds]
caasih has quit [Ping timeout: 240 seconds]
metadave has quit [Ping timeout: 260 seconds]
wildsebastian has joined #ocaml
bytesighs has quit [Read error: Connection reset by peer]
angerman has quit [Ping timeout: 246 seconds]
jeroud has quit [Ping timeout: 272 seconds]
bitonic has quit [Ping timeout: 260 seconds]
angerman has joined #ocaml
jeroud has joined #ocaml
bytesighs has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
bitonic has joined #ocaml
metadave has joined #ocaml
rgrinberg has joined #ocaml
higherorder has joined #ocaml
caasih has joined #ocaml
grdgz has quit [Ping timeout: 258 seconds]
adrianbrink has quit [Ping timeout: 260 seconds]
adrianbrink has joined #ocaml
banjiewen has quit [Ping timeout: 244 seconds]
SrPx has quit [Ping timeout: 260 seconds]
SrPx has joined #ocaml
banjiewen has joined #ocaml
FreeBirdLjj has joined #ocaml
grdgz has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
grdgz has quit [Ping timeout: 240 seconds]
grdgz has joined #ocaml
grdgz has quit [Client Quit]
smazga has quit [Ping timeout: 265 seconds]
Jesin has quit [Quit: Leaving]
smazga has joined #ocaml
Jesin has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
ollehar has quit [Ping timeout: 265 seconds]
ollehar has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 265 seconds]
Jesin has quit [Read error: Connection reset by peer]
Jesin has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 258 seconds]
Henman has joined #ocaml
Henman has left #ocaml [#ocaml]
osa1 has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 258 seconds]
ggole has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 258 seconds]
_whitelogger has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 265 seconds]
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
mirrorbird has joined #ocaml
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
smazga has joined #ocaml
Tuplanolla has joined #ocaml
smazga has quit [Ping timeout: 258 seconds]
osa1 has quit [Quit: osa1]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
sonologico has joined #ocaml
dckc has quit [Ping timeout: 265 seconds]
dckc has joined #ocaml
craigfe has joined #ocaml
mbuf has joined #ocaml
smazga has joined #ocaml
Guest86335 has quit [Ping timeout: 272 seconds]
smazga has quit [Ping timeout: 265 seconds]
Guest86335 has joined #ocaml
<rwmjones> how can I run dune from its build directory w/o installing it?
aaaaaa has quit [Quit: leaving]
Guest86335 has quit [Ping timeout: 240 seconds]
mirrorbird has quit [Ping timeout: 258 seconds]
vicfred has quit [Quit: Leaving]
Guest86335 has joined #ocaml
vicfred has joined #ocaml
smazga has joined #ocaml
osa1 has joined #ocaml
Haudegen has joined #ocaml
<d_bot> <Et7f3> How do you call dune ? With `-p` ?
smazga has quit [Ping timeout: 265 seconds]
mfp has joined #ocaml
mirrorbird has joined #ocaml
smazga has joined #ocaml
reynir has quit [Ping timeout: 264 seconds]
reynir has joined #ocaml
mbuf has quit [Quit: Leaving]
smazga has quit [Ping timeout: 240 seconds]
octachron has quit [Quit: ZNC 1.7.5 - https://znc.in]
octachron has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
SquidDev has quit [Read error: Connection reset by peer]
averell has quit [Quit: .]
jbrown has quit [Ping timeout: 272 seconds]
SquidDev has joined #ocaml
SquidDev has quit [Read error: Connection reset by peer]
SquidDev has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
<haesbaert> I have a module that needs runtime initialization, it initializes sdl, opens windows, surfaces and so on, I want these to be "globals" inside the module. What's the common approach to it ?
<haesbaert> so far I have a: let sdl_resources = ref None
<haesbaert> and a init : unit -> unit function that sets sdl_resources to Some (stuff), but it feels so freaking ugly
smazga has quit [Ping timeout: 265 seconds]
<haesbaert> I thought about using a functor, so the module takes a another module as initialization
malc_ has joined #ocaml
waleee-cl has joined #ocaml
mangoicedtea has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
osa1 has quit [Ping timeout: 246 seconds]
craigfe has quit [Ping timeout: 258 seconds]
smazga has joined #ocaml
sonologico has quit [Read error: Connection reset by peer]
smazga has quit [Ping timeout: 246 seconds]
sonologico has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
reynir is now known as |
| is now known as reynir
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
mangoicedtea has quit [Quit: Leaving]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
ansiwen[m] has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 265 seconds]
smazga has joined #ocaml
osa1 has joined #ocaml
<d_bot> <Et7f3> what about: `let sql_resources = init ()` ?
<companion_cube> also wrap that stuff in a lazy for idempotence, or check it's not been initialized yet
malc_ has left #ocaml ["ERC (IRC client for Emacs 28.0.50)"]
jbrown has joined #ocaml
jbrown has quit [Ping timeout: 244 seconds]
jbrown has joined #ocaml
smazga has quit [Ping timeout: 258 seconds]
smazga has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
averell has joined #ocaml
sonologico has quit [Remote host closed the connection]
smazga has quit [Ping timeout: 240 seconds]
<inkbottle> `dune build ./bin/hello.exe` fails for errors in source files which are not referenced to in the `dune` file
<companion_cube> all .ml files in the bin/ dir are fair game to dune, I think
<inkbottle> okay
<inkbottle> Is there a way I can ask nicely to leave them alone?
<companion_cube> I think if your dune stanzas have `(modules a b c)` it'll only touch files for these modules
<companion_cube> but otherwise, move them to a subdirectory maybe?
<inkbottle> Thanks, I'll try that
<inkbottle> (meaning the modules thing)
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
smazga has quit [Ping timeout: 264 seconds]
<motherfsck> have an sml question. I know this is an ocaml room but I also asked this over in #sml, but that room is awfully quiet in general. If there is a better place for me to ask this. I'd greatly appreciate it.
<motherfsck> I've got a copy of Purly Functional Data Structures By Chris Okasaki. The first few implementations seem straight forward enough to follow conceptually, but actually using them in sml has me stumped. Coming from an imperative background, this all is pretty foreign to me.
<motherfsck> http://codepad.org/pXrrVu4K Judging by the error I feel as if I need to define an additional struct and pass that in in lieu of 1. Anyway, thanks in advance for any help.
<Armael> insert seems to take a pair
<Armael> so try ISet.insert (1, ISet.empty)
<motherfsck> Yep that was it. Thanks a bunch. I 've been beating my head against a wall for a couple days on that
smazga has joined #ocaml
<motherfsck> Can I ask, what about the syntax told you that?
<Armael> in signature SET, you have "val insert : Elem * Set -> Set"
<Armael> "foo * bar" is the type of a pair
* motherfsck noted
<Armael> what you wrote would've worked if the type of insert was instead Elem -> Set -> Set
<Armael> also, in the implementation of insert (l31) you can see that it takes a pair
<motherfsck> ok. sounds like i have some basic syntax that I need to nail down still
<Armael> note that in SML it is customary to encode a multiple arguments for a function by having the function take a tuple (so, the function is uncurried)
<Armael> instead, in ocaml, the convention is instead to have a curried function
<motherfsck> Is there any reason behind that besides convention?
<Armael> (these are just conventions, both styles work in SML and ocaml)
* motherfsck nods
<Armael> I'm not sure
<Armael> they are not strictly equivalent, since if you have a function of type a -> b -> c, the function may perform side effects after being provided the first argument only
smazga has quit [Ping timeout: 240 seconds]
<Armael> whereas with a function of type a*b -> c, you can see that it can only do something after you provided both arguments
<Armael> so in that sense the SML convention is a bit more explicit (the type gives you a bit more information), but it is less convenient if you want to partially apply the function
<Armael> but I don't know what is the historical reason for chosing one style over the other in SML/ocaml
<companion_cube> in SML things were not curried because compilers were not good at making currying efficient
<companion_cube> part of why Caml/OCaml became its own thing is because of abstract machines that were good at avoiding the overhead of currying
<Armael> is that the reason ? or is it that compilers were not optimizing currying because it was not the convention?
<companion_cube> I think it's really because currying is harder
smazga has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
mirrorbird has quit [Quit: Leaving]
<rwmjones> rgrinberg (or anyone) ... I'm trying to make modifications to dune to fix https://github.com/ocaml/dune/issues/3736 but to do that I want to modify my local copy of dune and test the changes on a build of ocaml-ssl
<rwmjones> however I cannot work out how to run dune from the local copy in another directory
<rwmjones> obvs I don't want to install dune
jbrown has joined #ocaml
<rwmjones> ../dune/dune.exe build does not work with errors similar to:
jbrown has quit [Remote host closed the connection]
Hrundi_V_Bakshi has joined #ocaml
vicfred has quit [Quit: Leaving]
smazga has joined #ocaml
<rgrinberg> rwmjones try using --root to set the directory where you want dune to run.
<rwmjones> rgrinberg: so I have to run dune from the dune directory with --root pointing to the directory I want to test build?
<rgrinberg> I don't think you need to run dune from the dune directory.
<rgrinberg> If you're using --root, you should be able to run dune from any directory
<rwmjones> $ ./dune.exe --root ~/d/ocaml-ssl build
<rwmjones> dune: too many arguments, don't know what to do with `build'
<rwmjones> Try `dune --help' for more information.
<rwmjones> Usage: dune COMMAND ...
<rwmjones> (same with --root=...)
<rgrinberg> ah, you're using the bootstrap binary. That's not what you're looking for. You need to use _build/install/default/bin/dune
<rwmjones> ok let's see ..
smazga has quit [Ping timeout: 240 seconds]
<rwmjones> $ ./_build/install/default/bin/dune --root=$HOME/d/ocaml-ssl build
<rwmjones> dune: too many arguments, don't know what to do with `build'
<rwmjones> Usage: dune COMMAND ...
<rwmjones> Try `dune --help' for more information.
<rgrinberg> Oh, you must pass --root=.. after build.
<rgrinberg> It's a quirk of cmdliner
<rwmjones> $ ./_build/install/default/bin/dune build --root=$HOME/d/ocaml-ssl
<rwmjones> File "src/config/dune", line 3, characters 12-29:
<rwmjones> 3 | (libraries dune-configurator))
<rwmjones> Entering directory '/home/rjones/d/ocaml-ssl'
<rwmjones> ^^^^^^^^^^^^^^^^^
<rwmjones> Error: Library "dune-configurator" not found.
<rwmjones> Hint: try:
<rwmjones> dune external-lib-deps --missing --root /home/rjones/d/ocaml-ssl @@default
<rwmjones> Done: 0/0 (jobs: 0)
<rgrinberg> That project requires configurator, doesn't it?
andreas303 has quit [Remote host closed the connection]
<rwmjones> rgrinberg: maybe? I've no idea what configurator is
<rgrinberg> It's just a library we created. It's what we use to create these executables that probe the C compiler for example.
<rgrinberg> in ocaml-ssl, this library is being used to probe the C compiler the way you mentioned in your issue I'm assuming
<rwmjones> ok, that's seems to be part of dune itself afaict, at least there's an otherlibs/configurator dir in dune
<rgrinberg> Yes, it's part of the same project, but it's just a regular ocaml library.
andreas303 has joined #ocaml
<rwmjones> ok .. so how do I run dune from the build directory and have it use configurator from the same dir?
<rgrinberg> You have two options:
<rgrinberg> * symlink the configurator directory (and any dependencies) to your project
<rgrinberg> * make configurator visible through findlib
<rwmjones> so how exactly?
<rwmjones> I guess something with OCAMLFIND_* environment variables?
<rwmjones> commands such as
<rwmjones> $ OCAMLFIND=~/d/dune/otherlibs/configurator ../dune/_build/default/bin/dune.exe build
<rwmjones> don't seem to work
<rgrinberg> Pretty much. Although dune makes it a bit easier with exec. If you've built dune and configurator, they should appear in _build/install/default/lib
<rgrinberg> Then you can just do ./dune.exe exec -- sh
<rgrinberg> and you'll be in an environment where the locally built public libraries are visible through findlib
bartholin has quit [Remote host closed the connection]
<rgrinberg> E.g. ./dune.exe exec -- ocamlfind query dune-configurator should point to the right path
<rwmjones> $ _build/default/bin/dune.exe exec -- ocamlfind query dune-configurator
<rwmjones> Done: 0/0 (jobs: 0)ocamlfind: Package `dune-configurator' not found
<rwmjones> (I've done 'make clean && make release' and it succeeded)
<rgrinberg> Run $ make dev
<rwmjones> make dev wanted a whole bunch of packages that I don't have
<rgrinberg> Ok run ./dune.exe build @install
smazga has joined #ocaml
<rwmjones> File "otherlibs/configurator/src/dune", line 7, characters 17-22:
<rwmjones> Error: Library "csexp" not found.
<rwmjones> 7 | (libraries unix csexp result) ^^^^^
<rgrinberg> you need csexp to build configurator. We used to vendor it, but some upstream distro maintainers got mad ;)
<rwmjones> why can't I just run it without installing anything? it al seems very complicated
bartholin has joined #ocaml
<rgrinberg> You can absolutely run dune without installing anything.
<rgrinberg> The problem is that you need an additional library for the project you're building
<rwmjones> so I don't really understand why I need this configurator thing since we're perfectly able to build ocaml-ssl in fedora except for the bug
<rgrinberg> No idea how you're able to do that. ocaml-ssl needs configurator to probe for some #define's https://github.com/savonet/ocaml-ssl/blob/master/src/config/discover.ml
smazga has quit [Ping timeout: 246 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
ggole has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 265 seconds]
smazga has quit [Ping timeout: 258 seconds]
smazga has joined #ocaml
reynir has quit [Ping timeout: 258 seconds]
reynir has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 246 seconds]
Tuplanolla has quit [Quit: Leaving.]
amiloradovsky has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
Jesin has quit [Quit: Leaving]
mangoicedtea has joined #ocaml
benschza_ has joined #ocaml
benschza has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
zebrag has joined #ocaml
webshinra_ has quit [Remote host closed the connection]
smazga has quit [Ping timeout: 265 seconds]
inkbottle has quit [Ping timeout: 258 seconds]
_whitelogger has joined #ocaml
Guest86335 has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 265 seconds]
vicfred has joined #ocaml
Hrundi_V_Bakshi has quit [Ping timeout: 265 seconds]
mangoicedtea has quit [Quit: Leaving]
smazga has joined #ocaml