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
olle has quit [Ping timeout: 265 seconds]
olle has joined #ocaml
Hrundi_V_Bakshi has quit [Quit: No Ping reply in 180 seconds.]
Hrundi_V_Bakshi has joined #ocaml
vicfred has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
pigeonv has quit [Ping timeout: 246 seconds]
TakinOver has joined #ocaml
amiloradovsky has quit [Ping timeout: 244 seconds]
Hrundi_V_Bakshi has quit [Remote host closed the connection]
sleepydog has quit [Ping timeout: 260 seconds]
inkbottle has joined #ocaml
<inkbottle> I'm using a local switch which I created with `opam switch create ./ ocaml-base-compiler.4.10.0` while in a directory named "Owl".
<inkbottle> If I do `opam switch` or `opam show ocaml`, output is consistent with what expected from the previous command.
<inkbottle> Now, when I do: `opam install archimedes` I get an error: "no solution found".
<inkbottle> That is worrying. But somethings worries me even more. With option `-vv` the output suggests that installation is trying to use the "global switch":
Haudegen has quit [Ping timeout: 258 seconds]
<inkbottle> `~/.opam/4.09.0/bin/ocamlc "-vnum"`
<companion_cube> make sure to "eval`opam env`"? but might not be enough :s
<inkbottle> trying that
<inkbottle> Unfortunately, it makes no difference
<inkbottle> I'm opened to suggestions; and if possible I'd like to understand why, is opam not using the local switch compiler
mfp has quit [Ping timeout: 264 seconds]
<companion_cube> it should, really
<companion_cube> if you have a `_opam` and `opam sw` tells you the current switch is the one in your directory
<inkbottle> Yes, I do have a `_opam`, and yes, `opam switch` says "./Owl" and `opam show ocaml` says "4.10.0" and not "4.09.0"
<inkbottle> `opam repo` returns the path to the local switch as expected
<inkbottle> `which ocaml` returns the *local* path: everything fine there
<companion_cube> I assume you have opam2
<inkbottle> opam --version => 2.0.5
<companion_cube> that's quite mysterious
<companion_cube> wait, I see that archimedes requires camp4
<companion_cube> which has… < "4.10"
<companion_cube> that's why
<inkbottle> hummm
<inkbottle> Thanks for that insight
<companion_cube> I didn't know archimedes depended on camlp4, boo
<inkbottle> yes, and the migration is quite tough I understand
<companion_cube> question is, what does it even use camlp4 for
<inkbottle> I wanted to try Owl, which is a library for scientific/matrix calculus; they were hinting to using "jupyter notbooks"; which in turn was suggesting to use "archimedes" together with a "jupyter-archimedes".
<inkbottle> okay, trying to look in the code then
<companion_cube> if you just want to plot things, there are other libs, I think
<inkbottle> Yes, but as I said above, it was included in the tutorial about "Owl" (https://github.com/owlbarn/owl)
<companion_cube> that's unfortunate :/
<inkbottle> The library might still be working, but I might have to ditch the tutorial, and "jupyter-ocaml"; never mind
sleepydog has joined #ocaml
dborisog has joined #ocaml
cgenie[m] has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
<inkbottle> It is possible that some parts of the tutorial are not up to date; and that `archimedes` would have been deprecated in favor of `plplot` in the up to date parts of the tutorial
<inkbottle> Thanks a lot for your help; I would have been stuck otherwise.
<companion_cube> it's very possible
<companion_cube> you can file an issue I think :)
<companion_cube> plplot seems nice
<inkbottle> I could file an issue; or they already have a lot on their plate
<companion_cube> doesn't hurt to add anyway!
jao has quit [Ping timeout: 256 seconds]
inkbottle has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
narimiran has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
mbuf has joined #ocaml
<olle> Drup: you just released a new PDF about Affe?
<olle> that's just weird that you didn't mention it before when I was ranting about linear types ><
<dborisog> Is there a way of printing to console (shell, not a browser console) from Ocsigen Eliom code? Regardless of server/client/shared blocks?
<olle> dborisog: you want to print to bash from a browser?
<olle> dborisog: maybe you want a logger?
sugarwren has joined #ocaml
sleepydog has quit [Ping timeout: 260 seconds]
ferd has quit [Ping timeout: 246 seconds]
<dborisog> olle: I created a new project based using basic.ppx template, and extended it with with the minimum code from os.pgocaml/ocsigen-start for main_service and about_service, excluding ppx-extensions and the user model. It worked. My next step was to extend the code with server/client/shared ppx-extensions, however, I faced the problems with js file generation. I want to check values of the respective variables. While working with Python frameworks (Django,
<dborisog> Flask) I usually used output to bash, though I do not understand how to do it from *.eliom files. Console should work as well.
<olle> dborisog: sorry didn't use ocsigen yet
<olle> dborisog: maybe something like this? https://opam.ocaml.org/packages/logs/
<olle> dborisog: or just print_endline str; exit 0;
<dborisog> olle: thank you for tips
<olle> dborisog: you can also wait until a "real" ocaml coder is online ^^
<olle> but really, I'd expect all server-like software to have a "write to error log" functionality
narimiran has quit [Ping timeout: 256 seconds]
ferd has joined #ocaml
<labor[m]> I dont know about server side but with js_of_ocaml you can easily log stuff client side
<dborisog> It seems logging is the way to go
<labor[m]> If you hqve trouble with JS file gen, then jour problem is at compile time and I dont get why you want to log anything.
<dborisog> labor[m]: because after ppx-related transition I go the following problem: "GET http://localhost:8080/.js.js net::ERR_ABORTED 404 (Not Found)". I have not changed file generation makefile script, thus it seems I have a problem with variable values because of the server/client/shared changes.
<labor[m]> Or the scripts are broken. ;)
<dborisog> labor[m]: such a delightful though ))
<dborisog> *thought
nullcone has quit [Quit: Connection closed for inactivity]
raver has quit [Remote host closed the connection]
mfp has joined #ocaml
_xvilka_ is now known as xvilka
xvilka has quit [Changing host]
xvilka has joined #ocaml
raver has joined #ocaml
waleee-cl has joined #ocaml
Haudegen has joined #ocaml
pigeonv has joined #ocaml
zolk3ri has joined #ocaml
mengu has quit []
jao has joined #ocaml
jao is now known as Guest6704
Guest6704 has quit [Remote host closed the connection]
jao- has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
elfring has joined #ocaml
Haudegen has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
waleee-cl has joined #ocaml
amiloradovsky has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
narimiran has joined #ocaml
pigeonv has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
sleepydog has joined #ocaml
ferd has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #ocaml
ferd has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Anarchos has joined #ocaml
HyperMonkey has joined #ocaml
<HyperMonkey> hello folks. can someone take a look at this and tell me why it's not working: https://paste.ee/p/Rq3YT there is some lingering confusion over record syntax after reading Real World Ocaml
<Anarchos> HyperMonkey let me look
<HyperMonkey> oh nvm I figured it out ... it should not have .t in there, just A.b
<Anarchos> yes
<HyperMonkey> a little too much Java programming knowledge ...
<Anarchos> HyperMonkey java compared so bad to ocaml in syntax and semantics...
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
<HyperMonkey> I'm stuck again ... folks help me understand why this doesn't work: https://paste.ee/p/a2PC9 it's to do with option types
dborisog has quit [Ping timeout: 272 seconds]
<lyxia> HyperMonkey: Option.value (Some "") ~default:""
<lyxia> This is the relevant documentation: https://caml.inria.fr/pub/docs/manual-ocaml/lablexamples.html
<waleee-cl> HyperMonkey: as a side note to lyxia's solution and manual link; the Core library is using labels extensively compared to the stdlib
zolk3ri has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<Anarchos> waleee-cl at first i was not convinced by labels, but now i find them very useful to remind the meaning of parameters
<waleee-cl> Anarchos: I have nothing against labels, it was just a general observation of the patterns in Core v. stdlib for stuff like List.map &c
FreeBirdLjj has quit [Ping timeout: 260 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
<Anarchos> is there a commonly used framework to do logging ?
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<zozozo> there's the Logs library (cf https://github.com/dbuenzli/logs )
mbuf has quit [Quit: Leaving]
Anarchos has joined #ocaml
narimiran has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<olle> Is Gabriel Radanne on this channel?
Hrundi_V_Bakshi has joined #ocaml
<Drup> Yes :D
Haudegen has joined #ocaml
<olle> Drup: OK, so I asked some days ago about typestates etc, and you didn't mention you just published Kindly bent to free us?
<olle> 60 pages paper about that exact thing, lol
<Drup> well, you were going to ask me next about when you can expect me to implement it in ocaml, and it's an annoying question :)
<olle> hehe
elfring has quit [Quit: Konversation terminated!]
ferd has quit [Ping timeout: 258 seconds]
<olle> Drup: well, it looks great, so, i hope you and the team can contiue with it
<olle> Drup: mind if i link it on reddit? unless you already did
<HyperMonkey> how do I group statements in ocaml? I know they are supposed to be separated by ; but it's ambiguous without being able to specify a group of statements like { a ; b ; c } but i'm not sure that's the syntax
<Fardale> (a; b; c)
<olle> HyperMonkey: () or begin-end
<HyperMonkey> hm ok will try parenthesis
<olle> HyperMonkey: especially do this when nesting if-statements
<olle> or it will get messy
<HyperMonkey> ha yeah that's exactly the situation I'm in
<olle> HyperMonkey: a more suitable pattern might be pattern matching instead
ferd has joined #ocaml
<HyperMonkey> fortunately the type checker complaints when you get it wrong, unlike C
<olle> instead of `if bla then if blabla` you do `match bla, bla bla with ...`
ferd has quit [Ping timeout: 256 seconds]
<Anarchos> HyperMonkey begin a;b;c end
<Anarchos> i prefer begin/end to () cause they are easier to spot while fast-reading code
<olle> () are already used for tuples
<HyperMonkey> File "B.ml", line 75, characters 8-10: Warning 40: ok was selected from type Response.t. It is not visible in the current scope, and will not be selected if the type becomes unknown.
<HyperMonkey> so I created a record type in a submodule. do I have to do anything special to allow it to be read from the toplevel module?
<olle> HyperMonkey: don't infer the args in your funcs, write them out instead.
<HyperMonkey> the warning is emanating from within: `let elaborate_response (r : Response.t) : string =`
<olle> HyperMonkey: you can abstract the type, or include it fully in your module signature
<olle> ah
<olle> yeah, someone else will have to elaborate on that error :)
<olle> warning*
<olle> or google it
<olle> what's "ok"?
<Fardale> HyperMonkey: try with r.Response.ok
<Drup> olle: I would prefer you waited the last revision of the paper. It's not published yet
<HyperMonkey> Fardale: that fixed it, thanks
pigeonv has joined #ocaml
<olle> Fardale: local open would work too?
<olle> Drup: kk
<Fardale> olle: I think so
ferd has joined #ocaml
FreeBirdLjj has joined #ocaml
<olle> shouldn't you guys use a proper CSS framework for this? http://ocsigen-1.inria.fr/ocsigen-start/demo/
<olle> bootstrap or whatever
FreeBirdLjj has quit [Ping timeout: 264 seconds]
<olle> I could possibly do a PR, but it's missing a git link too :|
<Fardale> olle: it is use to build a android app. I don't know if it is a good idea to use a CSS framework. The git repo is here: https://github.com/ocsigen/ocsigen-start
<olle> Fardale: ok
<olle> hm hm
<olle> Fardale: from the docs, I get the impression app and web site were both use-cases?
<Fardale> Yes, you can build a website and an app
<olle> apps don't use css?
sugarwren has quit [Quit: Leaving]
waleee-cl has quit [Quit: Connection closed for inactivity]
<Fardale> I don't know, I never used the possibility to build a app with it. It just that as it is not only for web it may not be a good idea to use bootstrap on it
<Fardale> I personnaly don't understand why you want to use a CSS framework this simple app
<olle> unless you have a professional designer ready, always use a framework
<olle> also missing validation at some place
<HyperMonkey> is there a way to trace a function in the debugger (not toplevel)?
<olle> i never managed to get debugging working properly
<olle> but compile with -g and bla bla bla
<HyperMonkey> well I managed to find a bug without the whole debugging apparatus, and now my HTTP server has served it's first request !
<olle> huzzah!
<olle> go write a blog about it and post it on /r/ocaml ;)
<HyperMonkey> don't have time for that haha
<Fardale> olle: it is a demo project, my rule is as few dependencies as possible
<companion_cube> a css lib like bootstrap makes things simpler, I think
<Fardale> but I am not responsible for this
<olle> it could be a separate branch
<Fardale> I found bootstrap to big and heavy
<olle> how heave?
<olle> y
<Fardale> If I have to choose I would go with the w3school one
<olle> didn't see
<Fardale> But I am not into web at all
Hrundi_V_Bakshi has quit [Quit: No Ping reply in 180 seconds.]
Hrundi_V_Bakshi has joined #ocaml
<Anarchos> what is the common logging framework for servers written in ocaml ?
delysin has quit [Read error: Connection reset by peer]
delysin has joined #ocaml
<olle> implying writing servers in ocaml is "common"? :)
raver has quit [Read error: Connection reset by peer]
<pigeonv> it's pretty comfortable, though
<Anarchos> olle i had to wrote mine to handle my proof requests
Anarchos has quit [Ping timeout: 246 seconds]
Anarchos has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
<sleepydog> is the evaluation order for records defined anywhere? from my tests it seems to evaluate last to first
<Anarchos> sleepydog no idea, but it is a good advice not to rely on execution order...
<sleepydog> shoot :)
<sleepydog> unspecified
<Anarchos> how to deal with all those Module__ that dune add as prefix ??
<sleepydog> Anarchos, what do you mean? From the same library you don't need the prefix
<Anarchos> i mean that when i compile with ocamlc to do some tests, the module__ prefix is unknown
<sleepydog> can't you compile with dune?
jbrown has quit [Ping timeout: 240 seconds]
<Anarchos> i build them with dune build lib/lib.cma
<Anarchos> then added all the 'dune top' stuff to my .ocamlinit
<sleepydog> i'm still new, but what I do if I want to expose a submodule, I add `module Submodule = Submodule` to my main `.ml` file. Then I can access MyLibrary.Submodule from the ocaml toplevel
<rgrinberg> Anarchos do you use $ dune utop?
<Anarchos> rgrinberg i can't : utop doesnt' compile on my platform cause lwt doesn tnot compile
<HyperMonkey> I'm trying to figure out whether camlzip can be used to unpack an archive initially stored in memory to some strings/bytes that would also be stored in memory, but, and this is the catch, I need to be able to place a bound on the decompressed size. e.g., if it's larger than 100M decompressed simply give up rather than consuming more memory
<rgrinberg> Anarchos what platform is that?
<Anarchos> rgrinberg Haiku, which will be supported natively only in 4.11
<sleepydog> Anarchos, I don't use utop either. I do `ocaml -init <(dune top .)` from the library directory
<rgrinberg> sleepydog that's a cool trick
<rgrinberg> Anarchos you can do that, or the toplevel stanza for creating your own custom toplevel
<HyperMonkey> guess I have to learn about channels ...
<rgrinberg> HyperMonkey, Yeah, I believe you will need to go through Unix.pipe to make this work with camlzip
<sleepydog> camlzip seems to let you iterate through entries and decompress them one at a time, at least for .zip files. that should give you the tools you need to implement what you want
<sleepydog> eh, i suppose a single entry could be >100M, so you'd have to go with rgrinberg's suggestion
<rgrinberg> From what I remember, camlzip only works with in_channel's, so to deflate anything in memory you need to use a pipe
<rgrinberg> (or a temp file)
sz0 has quit [Quit: Connection closed for inactivity]