adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
segmond has quit [Ping timeout: 268 seconds]
tftio has joined #ocaml
alexst has joined #ocaml
tftio has quit [Quit: Textual IRC Client: www.textualapp.com]
segmond has joined #ocaml
eeks_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alexst has quit [Ping timeout: 276 seconds]
yunxing has quit [Remote host closed the connection]
alexst has joined #ocaml
struk|desk|away is now known as struk|desk
yunxing has joined #ocaml
alexst has quit [Quit: Lost terminal]
mac10688 has quit [Ping timeout: 244 seconds]
copy` has quit [Quit: Connection closed for inactivity]
<aantron> Drup: did you intentionally leave the xmlns attribute alone when eliminating arguments to attributes that have only one variand?
FreeBirdLjj has joined #ocaml
AltGr has joined #ocaml
mac10688 has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
danieli has joined #ocaml
yunxing has quit [Remote host closed the connection]
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
jeffmo has quit [Quit: jeffmo]
tennix has joined #ocaml
seangrove has joined #ocaml
<struk|desk> a signature like val install : atom list -> bool option -> bool -> unit makes me really appreciate labels
foolishmonkey has quit [Quit: Leaving]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
djellemah_ has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
Algebr` has joined #ocaml
yunxing has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
mac10688 has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 240 seconds]
<chenglou> hi, I'm using oasis and exposing a library called A, with modules B. In another project I'm including A through `ocamlfind ocamlc -package A test.ml`
<chenglou> test tries to refer to a type definition defined in B, e.g. B.myType and everything goes well
<chenglou> however when I try to call the function B.doThis it ocamlfind says
<chenglou> Error: Error while linking test.cmo: Reference to undefined global `B`
<chenglou> which confuses me because the reference to the type B.myType worked
<chenglou> there's no explicitly declare modules anywhere. I'm just testing the water by importing projects. Anyone knows what I'm doing wrong?
<def`> types have no dynamic content, so they don't need to be linked
<def`> as soon as you use values, you need to provide an implementation
<def`> assuming your project description is correct, just pass -linkpkg to ocamlfind during the linking step
darkf_ has joined #ocaml
<chenglou> ah I see, thanks
<struk|desk> chenglou: tldr; lazy evaluation linking style
<chenglou> ok this works, but there's a new problem. In B I also happened to have done `open C`, and now in that other project when I run ocamlfind etc it says Reference to undefined global 'C'
<def`> package B should express its dependency on C
<chenglou> in my oasis file for the library A it looks like:
<chenglou> Library A
<chenglou> path: blabla
<chenglou> Modules: B
darkf_ has quit [Ping timeout: 250 seconds]
<chenglou> did I need to include C too? Does it mean I have to include all the transitive dependencies of B?
<def`> if B need C, its B which should specify its dependency on C
<def`> B's META file seems wrong
<def`> if B needs C, it is B...*
<chenglou> I didn't specify anything for B in my oasis file, aside from that Modules field in Library A
<def`> B has to be specified somewhere
<def`> it is the definition of B which is wrong.
<def`> nothing to change in the current oasis file.
<def`> but wait... A, B, C... are these modules or packages ?
<chenglou> A is the library that can be found from ocamlfind list, B is a regular file b.ml, so is C
<def`> ok
<chenglou> but C isn't specified in the Modules field of that oasis file for Library A
<def`> then you have to specify the dependencies of A
<def`> C is a module of A it seems
<chenglou> only used by B internally though
<chenglou> it's a helper file
<def`> make it an internal module
<def`> InternalModules: C
<def`> in oasis
<def`> I though you were talking about packages.
<def`> thought*
<def`> You have to make explicit the list of modules of your package.
darkf has joined #ocaml
<chenglou> oh wow, even the transitive dependencies?
<chenglou> seems working, lemme include all of them
<def`> You should not think of that as transitivive dependencies, just as the list of modules to make your package a closed entity.
<def`> Transitive dependencies will be handled by ocamlfind.
<chenglou> I guess I misunderstood how `open` worked then?
<def`> But yes, if you think of each module as an independent entity, then it is the list of transitive dependencies.
<def`> There are two independent things at play here.
<def`> First there is the language. open is a statement of the language, it brings the content of a module into the scope.
<def`> Then there is the extra-linguistic issue of mapping programs in the language to object files and link them.
darkf_ has joined #ocaml
<def`> This depends more on the OS design than on the language itself.
<def`> So all these unfriendly and boring steps are just the way OCaml and the ecosystem chose to map linguistic entities to files and system linker objects.
darkf has quit [Ping timeout: 250 seconds]
<def`> (I should have said separated rather than independent, ... these are obviously dependent)
kushal has joined #ocaml
<chenglou> I see
<chenglou> though nonetheless, adding each helper file to oasis InternalModules seems a bit weird
<def`> the overspecification you have to do in the oasis just explains how to map language concept to the filesystem. This is clunky yes
<chenglou> let's say I have no explicitly declared modules, just simple ocaml files, should Modules + InternalModules always be the entire list of files in my project?
<def`> maybe it will get improved... Not much attention has been paid to that I think
<chenglou> (project that's the library A)
<def`> yes
<def`> for libraries
Mercuria1Alchemi has joined #ocaml
<chenglou> what's a package in this context then?
<def`> something you can use as a BuildDepends
darkf has joined #ocaml
<chenglou> how is that different than a library?
darkf_ has quit [Ping timeout: 250 seconds]
<aantron> chenglou: a library is one or more packages
darkf_ has joined #ocaml
<aantron> at least library in the restricted context of package management
<aantron> although i am not sure if your question is about OASIS terms
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
<aantron> OASIS seems to call a findlib package a "library"
<aantron> but i dont really use OASIS
darkf has quit [Ping timeout: 240 seconds]
<chenglou> alright I'll keep digging, thanks a lot =)
<aantron> chenglou: are you still having the original problem, or questions about the solution?
<chenglou> I've succeeded, with the small ocamlfind test. But the actual problem was this actual project is using ocamlbuild so I'm fumbling around _tags and META to find a way to integrate my oasis library A
<aantron> you should be able to get away with <**/*>: package(your_other_library) in _tags, then ocamlbuild -use-ocamlfind your_target
<aantron> the ocamlbuild project shouldnt need a META to integrate an ocamlfind package, this is only needed if you intend to install B with ocamlfind as well..
<struk|desk> OCAMLRUNPARAM=b ...wow, what a life saver
djellemah_ has quit [Ping timeout: 240 seconds]
<chenglou> aantron: `your_other_library` being `A`?
<aantron> yes
yunxing has quit [Read error: Connection reset by peer]
yunxing has joined #ocaml
darkf_ is now known as darkf
<chenglou> didn't work, don't I need to specify B somewhere?
<aantron> isn't B what you are building? what happened when it didnt work?
mac10688 has joined #ocaml
<chenglou> sorry that was a minimal repro. Lemme rephrase the new situation: I wrote A, exposed as a "library" for oasis, with `Modules` field being B, mapping to b.ml inside that project. In this new project I'm trying to integrate B through A. A is specified in the _tags file. In a file in this project, I'm referring to B
<chenglou> the error is No implementations provided for the following modules: B
<def`> chenglou: how are you building the second project?
<chenglou> which is why I've created a small new project that uses plain ocamlfind on the side to make sure that A wasn't screwing up
<def`> which command gives you this output
<aantron> and you are saying that you were able to: create a dummy project that refers to A through ocamlfind, and its source refers to B, and this compiles and links just fine, but when you try the same with ocamlbuild, you get this error?
<Algebr`> since on build topic: how do you pass threads to oasis, weirdly crapping out, perhaps can put it in _tags?
<Algebr`> -thread
<aantron> should work in _tags
<Algebr`> aantron: how again
<Algebr`> just true: thread?
<chenglou> aantron: yes
<aantron> iirc yes, after # OASIS STOP of course
<aantron> chenglou: it sounds like either you are not tagging your target with the package, or A is somehow shadowed by something older that wasnt built with the proper module list
<Algebr`> yes, that's the ticket
<aantron> what target are you building with ocamlbuidl, and what is the line that includes the package(A) tag?
ygrek has joined #ocaml
<chenglou> <src/*>: package(unix compiler-libs.common findlib etc etc etc A)
Pepe_ has quit [Remote host closed the connection]
<aantron> and the target?
mehdi_ has quit [Read error: Connection reset by peer]
mehdi_ has joined #ocaml
mac10688 has quit [Ping timeout: 276 seconds]
Pepe_ has joined #ocaml
<chenglou> aantron: aaaah sorry I've found the problem
<chenglou> the actual project uses ocamlopt
<chenglou> but in my project I've set _oasis Library A CompiledObject to byte
<chenglou> instead of best
<aantron> i dont know if best picks only one, but leaving it off definitely compiles both native and byte, and that is what you want for a library
<aantron> anyway, good to hear
<chenglou> ah good to know. You might have saved me some other trouble =) Thanks!
Simn has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
mehdi_ has quit [Ping timeout: 240 seconds]
Sim_n has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
mehdi_ has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
malc_ has joined #ocaml
simn__ has joined #ocaml
badon has quit [Ping timeout: 255 seconds]
Sim_n has quit [Ping timeout: 250 seconds]
tane has joined #ocaml
toolslive has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
ggole has joined #ocaml
ygrek has joined #ocaml
badon has joined #ocaml
struk|desk is now known as struk|desk|away
johnf_ has joined #ocaml
simn__ is now known as Simn
Sim_n has joined #ocaml
Haudegen has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
yunxing has quit [Ping timeout: 240 seconds]
FreeBird_ has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #ocaml
malc_ has quit [Remote host closed the connection]
teknozulu has quit [Ping timeout: 240 seconds]
nojb has joined #ocaml
john51_ has quit [Remote host closed the connection]
john51 has joined #ocaml
freehck has quit [Remote host closed the connection]
silver has joined #ocaml
gustav___ is now known as GUSTAV___
warp has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
freehck has joined #ocaml
julien_t has joined #ocaml
Kakadu has joined #ocaml
lokien_ has joined #ocaml
<flux> utop says "Fatal error: exception Out of memory"
<flux> my environment is a raspberry pi jessie running in a chroot-environment on an x86 host using qemu-arm..
<flux> ocaml toplevel works fine, though
pgiarrusso has quit [Ping timeout: 248 seconds]
<def`> flux: at lunch?
<flux> ..?
<flux> (also I of course intended to say "raspbian jessie")
thomasga has joined #ocaml
jwatzman|work has joined #ocaml
<Leonidas> flux: def` probably intended to say "at launch?"
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
<Leonidas> bit early for lunch, depending on your time zone :)
infinity0 has joined #ocaml
pgiarrusso has joined #ocaml
<flux> I just came from lunch :)
<flux> but yes, at launch
<Leonidas> yeah, finland already lives in the future :)
<def`> launch* :D
<def`> utop raises an exception at launch. hahah
foolishmonkey has joined #ocaml
pgiarrusso has quit [Quit: pgiarrusso]
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
pgiarrusso has joined #ocaml
pgiarrusso has quit [Client Quit]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
sepp2k has joined #ocaml
pgiarrusso has joined #ocaml
AltGr has left #ocaml [#ocaml]
<freehck> flux: doesn't it preload anything at all? I mean maybe you can remove some #use/#require from .ocamlinit.
<freehck> And this way you could fit the memory.
<mrvn> how little memory do you have?
<flux> same thing without utop
<flux> I have a lot of memory
<freehck> The other approach to solve this is to make a bigger swap.
<flux> I'm runing this on my PC that is
<flux> but the environment was chrooted qemu-arm
<flux> free -h says available 16 GB
<mrvn> what does strace say where it stops?
<flux> apparently strace doesn't work in this environment
<flux> qemu: Unsupported syscall: 26
<flux> /usr/bin/strace: test_ptrace_setoptions_for_all: PTRACE_TRACEME doesn't work: Function not implemented
<mrvn> strace qemu-system-arm utop
<flux> oops, I meant to say same thing without .ocamlinit
thomasga1 has quit [Quit: Leaving.]
<Maxdamantus> Though it's presumably the qemu that's not the "system" one.
<mrvn> strace qemu-user-arm utop?
<Maxdamantus> Something like that. I think the user emulators are usually just called things like `qemu-arm`
<mrvn> vlan=n
<mrvn> ups
<Maxdamantus> qemu-system-arm will emulate a whole computer.
<flux> can't get the chroot and strace to co-operate
<flux> and after chroot I have only access to arm strace :)
<Maxdamantus> On an unrelated note, there's a statement in https://ocaml.github.io/ocamlunix/signals.html that seems weird.
<Maxdamantus> “OCaml guarantees that a program that does not loop, does not allocate, and does not interact with the system will not have its execution interleaved with that of a signal handler.”
<flux> so I would need to copy the x86_64 strace and libs to the chroot, gaah
<Maxdamantus> Sounds like OCaml has solved the halting problem.
<flux> maxdamantus, no.. it requires you to solve it for you
<flux> "a program that does not" ie. a program identified by these properties, provided by you
<rks`> Maxdamantus: read the sentence just before?
<Maxdamantus> Hm. So is tail recursion considered a form of loop control?
<mrvn> flux: strace chroot ....?
<mrvn> Maxdamantus: what is a loop?
<Maxdamantus> `let rec f _ = f () in f ()` is interruptable for me in the ocaml top-level.
<Maxdamantus> mrvn: a computation that never finishes.
<flux> actually now that I reread the error message it's probably related to something fixable ;)
<mrvn> Maxdamantus: that won't handle any signals or switch threads. aborting it in top level is another thing.
<Maxdamantus> Interesting.
* Maxdamantus tries.
<mrvn> might also differ between top level and compiled
<flux> no time to debug now, I'll check later..
<Maxdamantus> Yeah, if the top-level is implemented as an interpreter (not sure if it is), I'd expect it to be interrupted for that reason at least.
pgiarrusso has quit [Quit: pgiarrusso]
<Maxdamantus> Indeed, it's not interrupted.
theblatte has quit [Ping timeout: 244 seconds]
<Maxdamantus> but .. neither is a while loop.
<Maxdamantus> ehh .. this is weird.
<Maxdamantus> Neither form of loop is interrupted. If I do something like a print in the middle of it, it works.
<Maxdamantus> Maybe there's an additional assumption in the statement that a "loop" is not a busy loop.
<mrvn> Maxdamantus: printf allocates, allocation gets interrupted
<Maxdamantus> Yes. printf also invokes write system calls.
<mrvn> or any form of not optimized out function call
<mrvn> Basically only useless examples don't get interrupted.
<flux> I wonder if the ocaml multicore branch has similar interruptability thing regarding the GC..
<Maxdamantus> So what loop controls have checkpoints?
<mrvn> flux: can't. Unless all cores are stuck in a loop I guess.
<mrvn> Maxdamantus: I don't think any of them do.
_snhmib is now known as snhmib
<Drup> aantron: Yes, because iirc, it could have other values, but I didn't bother add them
<Maxdamantus> (as a side note, my definition of "loop" was probably stricter than it needed to be; the point was you can't tell (generally) whether the program is stuck in an infinite loop or if it's just doing a computation that's taking a while but will finish eventually)
julien_t has quit [Ping timeout: 255 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
theblatte has joined #ocaml
thomasga has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
thomasga has quit [Client Quit]
_andre has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
malc_ has joined #ocaml
pgiarrusso has joined #ocaml
ubbersith has joined #ocaml
Haudegen has joined #ocaml
Thooms has joined #ocaml
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
Sorella has joined #ocaml
<ggole> Hmm, the flambda code style is starkly different from the rest of the codebase
<Drup> You mean, it's well writen ? :D
kushal has quit [Quit: Leaving]
<ggole> Even the file names are, uh, comprehensible
pgiarrusso has quit [Quit: pgiarrusso]
octachron has joined #ocaml
toolslive has quit [Ping timeout: 240 seconds]
<l1x> is there a chance to get the OCaml MOOC materials from somewhere?
orbifx has joined #ocaml
julien_t has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
larhat has joined #ocaml
toolslive has joined #ocaml
<sspi> is it possible to force opam to install something from a lower version?
<sspi> e.g. I want to install something from 4.02.3 in 4.03
<Drup> opam install foo.0.2
<sspi> doesn't work I still get an error for having the wrong OCaml version... (too high)
<sspi> 'doesn't comply with ocaml-version >= "4.00.0" & ocaml-version < "4.03.0".'
<sspi> or fork repo and change the opam file?
kushal has joined #ocaml
julien_t has quit [Ping timeout: 248 seconds]
ontologiae has joined #ocaml
pgiarrusso has joined #ocaml
tane has quit [Quit: Verlassend]
jeffmo has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
Thooms has quit [Remote host closed the connection]
<edwin> you can pin it, and opam pin edit
<edwin> no need to fork the entire repo
tennix has quit [Ping timeout: 255 seconds]
aantron has quit [Remote host closed the connection]
<freehck> sspi: you need something like this: opam pin add ocamlnet 3.7.3
darkf has quit [Quit: Leaving]
<sspi> nope, still doesn't work - maybe it's ctypes specific?
<freehck> what command do you type?
<sspi> opam pin add ctypes 0.4.2
<sspi> ocaml version: 4.03.0+dev8-2015-07-15 (ocaml + multicore + effects)
<freehck> sspi: I need to update opam, wait a bit please.
<sspi> ok tnx for checking it out for me :) much appreciated
<companion_cube> what, you have a 4.03 fork with multicore?
<freehck> Hm. I see that ctypes of version 0.4.2 have been recently added into opam repo. Why do you wanna pin it?
<freehck> I mean this is the last version of this package.
<freehck> btw, is 4.03 already released?
toolslive has quit [Ping timeout: 240 seconds]
<freehck> I missed it.
<freehck> There's only 4.02.3 in my opam repo.
<Enjolras> multicore is based on 4.02 iirc
th5 has joined #ocaml
<Enjolras> where did you find a branch with 4.03 ?
<sspi> but yes, experimental - you might get burned :P
<Enjolras> ha. I though +effects wasn't multicore
<companion_cube> 4.03 will have flambda, it's already great
<companion_cube> but the release with effects and multicore will be awesome :D
<Enjolras> uocaml 5.00. effects + multicore + implicits
<companion_cube> oh. yeah.
<companion_cube> do want
<Enjolras> at this point, it will need a new set of libs actually...
<companion_cube> the community would be happy to write those, I think
lokien_ has joined #ocaml
<Drup> freehck: not yet
<Drup> soon™
<sspi> yeah I'm mostly experimenting with it - trying to wrap my head around effects
<freehck> flux: I've now read your messages about arm architecture and strace. I wanna notice that you mustn't copy strace and libs there because qemu won't be able to use them. You must install specifically arm variants into your chroot environment and use an arm strace from your chroot.
<freehck> Drup: as russians speak: as soon as already. :)
<flux> freehck, I have a complete raspbian environment there and I was trying initially to use its strace, but it wouldn't work
<flux> freehck, in any case, it _seemed_ as if the host's strace would work.. doesn't qemu need to translate the system cllas for my native system anyway, in which case they should appear in strace?
<flux> but there was something off in my environment and I wasn't able to complete the testing at that time
<flux> environment as in environment variables
<flux> it didn't find some libraries. well, it could be the chroot interacting with strace as well somehow.. I didn't look really that depp.
<freehck> flux: qemu can traverse syscalls depending on the kind of emulation it does. I used only full hardware emulation, and can't answer you specifically about arm. But if "strave qemu cmd" works, it's cool.
<freehck> *s/strave/strace/"
<flux> yep, it works
<freehck> flux: I suppose that you could try a full hardware emulation. It could solve some problems but ofc it would have some worse performance.
toolslive has joined #ocaml
<flux> doesn't seem very helpful, ltrace might be more so..
<flux> freehck, full hardware emulation is even more cumbersome. here I can easily mount --bind my home directory etc
<flux> if I wanted full hardware I can use a real pi :-)
<flux> and it's much faster anyway. I thought the superior IO and memory would make this feel a bit fast, but no, it's horribly slow..
<sspi> how is it using ocaml on the pi?
<flux> what is using?
<flux> do you mean how what do I intend to do on the pi with ocaml?
<companion_cube> I hope you don't use Core
<freehck> flux: I only thought that if a native strace didn't work in such a "transparent" emulation you could test it only one time with a full hardware emulation. Btw, you should be still able to bind your chroot filesystem into your home. Don't see any problems with it.
<flux> companion_cube, :)
<sspi> I'm just curious how it is to use OCaml on the pi :) (apologies for my crappy English)
<flux> sspi, it's pretty plug'n play
<flux> sspi, just install opam from raspbian, opam switch 4.02.3, waiiiiit, then do what opam says and opam install more stuff :)
<flux> (opam init and sudo apt-get install m4 in-between)
<freehck> You need something like this. I use this script to starve my vm's.
<flux> last time I tried it it wasn't such a smooth experience
<flux> freehck, but there you have the storage as a block device, how would I bind mount anything into that? I need to use nfs/samba/sshfs/whatever?
<flux> simply starting opam install xxx takes 30 seconds on this qemu environment, so I suggest to use the real rpi :)
<freehck> flux: first of all iirc you can use not a drive but something else (like a directory). Fix me if I'm not right. Secondly you can run ssh daemon inside your vm and mount directiries via sshfs. It's quite quick when VM's runing on your machine. And the last: ofc you need to specify architecture.
<freehck> I use the sshfs variant.
Algebr` has quit [Remote host closed the connection]
<freehck> Hm. And I think that mounting the same filesystem in 2 operation systems is not a very sane thing. Sshfs seems to be a better solution.
Algebr` has joined #ocaml
<flux> I guess scratchbox(2) would be the appropriate wrapper to make this convenient
Sim_n is now known as Simn
struk|desk|away is now known as struk|desk
nicoo has quit [Ping timeout: 244 seconds]
nicootje has joined #ocaml
<pierpa> is there any work done towards flushing 8 bit chars?
<companion_cube> how do you mean?
<companion_cube> making `char` a unicode type?
<pierpa> yes
<companion_cube> no, and it won't happen, but there are unicode libraries
<pierpa> it's not the same thing
MercurialAlchemi has quit [Ping timeout: 240 seconds]
aantron has joined #ocaml
<companion_cube> but string is, and will remain, a sequence of bytes
<pierpa> just like it was customary in the past millennium :)
<companion_cube> well you can see it as a low level type and build a unicode string type on top of it
<companion_cube> 4.03 will include a common type for unicode characters, Uchar.t
<companion_cube> so that libraries can agree on it
<pierpa> that's good
<pierpa> good
<pierpa> so, there is actually some work being done :)
<pierpa> step by step...
<companion_cube> and there are good libraries (from Bünzli among others) for dealing with unicode
<flux> if you ever replaced char with a unicode char, you would still need to provide a new byte object, while deprecating basically all useful ocaml code :)
<companion_cube> maybe we could (should?) define a small library with `type ustring = private string` and the associate functions for manipulating UTF8
<pierpa> the problem with libraries not part of the ocaml distribution is that that there are many of them
<companion_cube> and `validate_utf8 : string -> ustring option`
<flux> I think I would rather have an exception-throwing version as well
<flux> it would otherwise become a chore to deal most anything that comes from outside the program :/
<flux> but I would also hate to see ocaml become one of those programming languages that are unable to deal with (ie.) file name that really ARE byte sequences, instead of valid utf8.
antkong has joined #ocaml
<pierpa> filesystems should move into this century too, btw :)
<companion_cube> I don't think USB keys will move away from FAT32 any time soon
<companion_cube> flux: yeah yeah sure
<companion_cube> but `private string` has many advantages, including no copy
<flux> companion_cube, no copy?
<flux> I mean it's immutable, why would you copy it?
<companion_cube> well you don't need to copy a `string` to obtain a `ustring`, and same in the opposite direction
<flux> (immutable nowadays I supose)
<companion_cube> yeah it's immutable
<flux> oh sorry, I read "disadvantages" :-)
<flux> pierpa, you can start by writing an unicode-aware Unix and Cmdliner :)
<companion_cube> Ahah, Uchar is probably the most well-commented module of the stdlib :D
FreeBirdLjj has joined #ocaml
<flux> it's a new module for 4.03?
<rks`> companion_cube: is it?
tennix has joined #ocaml
FreeBird_ has quit [Ping timeout: 252 seconds]
sh0t has joined #ocaml
pgiarrusso has quit [Quit: pgiarrusso]
FreeBirdLjj has quit [Ping timeout: 252 seconds]
pgiarrusso has joined #ocaml
<companion_cube> rks`: well there might be Format, too, but apart from that…
<companion_cube> maybe I've exagerated
nicootje is now known as nicoo
struk|desk is now known as struk|desk|away
<aantron> companion_cube: i have a "private" encodings library like that from a project i was working on
<companion_cube> too bad it's not stadnard :(
<rks`> companion_cube: I find the stdlib generally well documented
<aantron> it used some phantom types to also get no-op typed-checked conversions from validated utf-8 to ascii for example
<rks`> I don't see how uchar is better than any other module in that regard
<rks`> (but I'd be happy to be proven wrong, if you have some examples)
<rks`> (N.B. Obj doesn't count)
<companion_cube> yeah, you're right
<companion_cube> (oh, after the release I hope there will be discussions about the stdlib, they've been hinting at this)
<companion_cube> (this = talking about the stdlib and about improving it)
julien_t has joined #ocaml
<rks`> I wouldn't expect anything on that front.
<companion_cube> :/
<companion_cube> I still don't understand why not
<companion_cube> maintaining data structures is not a lot of work…
<companion_cube> (especially if it's additional functions to List, Option...)
<rks`> I don't know their reasons, but if you start accepting pull requests more will come
<rks`> and reviewing PR does take a lot of time
<companion_cube> maybe they can delegate this specific kind of PR to a subset of the commuity
<rks`> anyway, I think the answer nowadays is
<rks`> "you don't need a bigger stdlib, you have opam and batteries/containers/core/extlib"
<flux> we need a metastdlib
<flux> that has the data structures the alternative stdlibs make use of :)
jeffmo has quit [Read error: Connection reset by peer]
<companion_cube> erf
<companion_cube> what would be nice, at least, is a set of shared type definitions so that the alternative stdlibs are compatible
<flux> I thought I was trying to say exactly that.. :)
<companion_cube> ok, right
kolko has quit [Quit: ZNC - http://znc.in]
<companion_cube> but I wanted to specify that it should only contain type declarations, nothing else
<flux> dynamic languages have that going for it that libraries and data structures can be compatible by accident.
<flux> the only problem with the meta library concept is that the visibility cannot be shared, and pre/post-conditions may be difficult to hold
<flux> because ocaml only has visibility scoped to modules
t4nk536 has joined #ocaml
<t4nk536> Anyone else having trouble compiling, installing Eliom 5? I've tried latest stable and latest dev versions. Consistently getting error in src/ppx/ppx_eliom_client.ml line 86, unbound value AC.sequence. I have required versions of ppx_deriving, etc.
kolko has joined #ocaml
warp has quit [Quit: I'll.. be back... https://i.imgur.com/KYU8vSO.gif]
warp has joined #ocaml
jeffmo has joined #ocaml
MercurialAlchemi has joined #ocaml
kushal has quit [Quit: Leaving]
jeffmo has quit [Read error: Connection reset by peer]
kolko has quit [Quit: ZNC - http://znc.in]
kolko has joined #ocaml
struk|desk|away is now known as struk|desk
<flux> t4nk536, maybe you can put your errors to a pastebin site and ping drup
kolko has quit [Quit: ZNC - http://znc.in]
julien_t has quit [Ping timeout: 248 seconds]
kolko has joined #ocaml
hanshenrik has quit [Quit: Leaving]
slash^ has joined #ocaml
shinnya has joined #ocaml
hcarty has joined #ocaml
sepp2k has quit [Quit: Leaving.]
<Drup> t4nk536: what flux said, please provide details
<Drup> (are you using opam ?)
pgiarrusso has quit [Quit: pgiarrusso]
<t4nk536> Yes and no. Tried both ways.
julien_t has joined #ocaml
<Drup> Yeah, please use the bug tracker, do not email me directly :)
<Drup> Please try "opam install eliom --verbose" and pastebin the result
<seangrove> How can I pin a repo with opam and then edit the source of it (e.g. to add a patch?)
<Drup> pin a package ?
struk|desk is now known as struk|desk|away
kushal has joined #ocaml
<Drup> Can you try with ocaml 4.02.3 ?
<seangrove> Drup: Yeah, `opam pin mypackage https://some-git-repo#my-exp-branch`, then start hacking on `my-exp-branch` locally
<seangrove> Meh, I should probably just check it out somewhere locally, seems safer
<Drup> You have your answer :)
<seangrove> Drup: You made an excellent rubber duck, thank you
<Drup> t4nk536: actually, before that, which version of ppx_tools do you have ?
<t4nk536> 0.99.2 Worth upgrading it?
<Drup> Yes.
<t4nk536> Upgrading...stand by...
copy` has joined #ocaml
jeffmo has joined #ocaml
<companion_cube> anyone knows if OCaml (or flambda) can generate the code only one for lots of applications of the same functor?
<companion_cube> (assuming the functor is pure, no initialization code)
<t4nk536> That did it. Thanks so much.
<Drup> t4nk536: great, thanks you for testing, I'm adding the constraint on opam
antkong has quit [Quit: antkong]
ontologiae has quit [Ping timeout: 276 seconds]
des__ has joined #ocaml
<des__> good people: the topLevel seems to define a printer for any type I define, such as unions. Is there a way to access that printer in my code, so I can use it at runtime?
<companion_cube> no :D
<companion_cube> (I think everyone asks this question)
<companion_cube> you need to use explicit printers for every type, but ppx_deriving.show can derive printers for you
<des__> ah, did not know about ppx_deriving (noob here :D) ... googling frantically now
<companion_cube> welcome!
<companion_cube> https://github.com/whitequark/ppx_deriving take a look at the readme
<companion_cube> (note: only with last version of OCaml)
josh has joined #ocaml
josh is now known as j0sh
j0sh is now known as Guest22264
wolfcore has quit [Ping timeout: 252 seconds]
Guest22264 is now known as josh
josh is now known as Guest13709
<seangrove> Arr, so. damn. close.
<seangrove> I have my mirage unikernel booting on ec2 now, with Drup's patch, and console log output looks good, but it's not responding to any pings/tcp requests
struk|desk|away is now known as struk|desk
<Drup> woo
<Drup> ok, half woo
<Drup> x)
<seangrove> Yeah, big step!
<seangrove> Anything in there look obvious to you, Drup? https://gist.github.com/sgrove/c8a2eba0ed65c712db7a
Guest13709 has quit [Quit: leaving]
atsampson has joined #ocaml
wolfcore has joined #ocaml
Yithar has joined #ocaml
j0sh has joined #ocaml
<j0sh> how do i have tyxml output an unescaped html5 string? with Unsafe.data it still escapes "< ... >", making it print as regular text
<Yithar> I'm writing a unit calculator and I'm looking at the example here (http://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html), and I understand how that calculator parses negative numbers, but it doesn't differentiate between x - y, x- y and x -y as they all return the same result. In my calculator the first 2 cases are valid, but the 3rd case should be invalid. I'm not sure how to differentiate between the different cases because
<Yithar> my lexer eliminates whitespace with this line "[' ' '\t' '\r' '\n'] { token lexbuf }" so I'm guessing I have to keep the whitespace somehow.
bobry has joined #ocaml
<des__> @companion_cube: thanks a bunch!! --- I did opam install ppx_deriving, utop: #require "ppx_deriving", utop: open Ppx_deriving;; but [@@deriving...] syntax not recognized in utop.
<des__> anything obvious?
<des__> [using latest ocaml]
<aantron> j0sh: Drup:
<j0sh> aantron: yes?
<aantron> just calling Drup, he maintains tyxml
<j0sh> ah, thanks
<aantron> and is usually quite active :)
<aantron> j0sh: have you tried cdata_script? if it does what i think it does, it should be okay unless you have </script> in your text
<aantron> guess not.
<j0sh> hm let's see
<aantron> i tested it, it emits a commented CDATA section
<j0sh> yeah, i wonder if Unsafe.data should call Xml.pcdata instead of Xml.encodedpcdata
<aantron> meanwhile im concerned about val cdata (not cdata_script), because CDATA sections are not part of html
<j0sh> but looking at the print code, it seems that "encodedpcdata" means "code that is already encoded" so the encoding routine isn't actually called. i'm a bit stuck
<aantron> j0sh: Unsafe.data worked, just tried it
warp has quit [Ping timeout: 248 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
<j0sh> aantron: weird, i'm seeing the encoded data here
<aantron> i printed Unsafe.data "<foo>" and got <foo> as output
<aantron> where is your string argument to Unsafe.data coming from?
<j0sh> right now, it's just another string. i have "<span>example</span>" but its still printing the spans, i'd expect them to be parsed as part of the DOM by the browser
<aantron> i dont know how your code gets this string, but perhaps it is already escaped before passed to Unsafe.data?
<j0sh> aantron: just T.(div [Unsafe.data "<span>example</span>"])
<octachron> des__, you need #require "ppx_deriving.std";;
<aantron> j0sh: i did this in top-level: Html5.P.print_list print_string [div [Unsafe.data "<span>example</span>"]];;
<aantron> got: <div><span>example</span></div>
<j0sh> that is how it looks, but the browser doesn't parse it that way... it looks at the spans as inner text, instead of a DOM node (element?)
<aantron> i guess its hard to say whats going on without context, how are you passing this to the browser? is this in js_of_ocaml somewhere? or the browser is reading an .html file?
<j0sh> yeah, js_of_ocaml
<aantron> so what are you passing this tyxml tree to?
octachron has quit [Quit: Leaving]
<aantron> to a print function, or some dom assembly function..?
<j0sh> Dom.appendChild
<aantron> can you show that part of the code?
<Drup> j0sh: what you want to do can't work
<Drup> html is not represented as text inside Tyxml_js
<Drup> (It builds the Dom nodes directly)
<aantron> ^
<aantron> however if you serialize to string by priting and then abuse innerHTML, you might get this to work.. whether it's a good idea is another matter
<Drup> Yes, the only solution is by playing with innerHTML
jwatzman|work has quit [Quit: jwatzman|work]
<Drup> or to wait for the "string to tyxml" parser (poke poke aantron :D)
<aantron> but this parser so far is compile-time only
<j0sh> hmm, alright, i'll look at munging innerHTML, thanks
<Drup> j0sh: what are you doing exactly ?
<j0sh> Drup: taking html that's been parsed from markdown and putting it in a div
<Drup> Right
<Drup> Yeah, innerHTML is your way to go
<Drup> just create a div (potentially with Tyxml_js)
<Drup> put stuff in innerHTML
<Drup> then you can use it with tyxml normally
<j0sh> trying now
<des__> octachron: thank you! had to tweak my other #requires to avoid Fatal Error on: require "ppx_deriving.std", am all set now!
<companion_cube> des__: #require "ppx_deriving.show";;
<companion_cube> I'd say
<companion_cube> (or .std)
ygrek has joined #ocaml
Haudegen has joined #ocaml
ggole has quit []
<des__> companion_cube: thanks! looks like i'm all set for now.
des__ has quit [Quit: Page closed]
silver has quit [Quit: rakede]
lokien_ has quit [Quit: Connection closed for inactivity]
malc_ has joined #ocaml
<infinity0> suppose i've done a let open XXX in yyy where XXX is an inner module of another module that was open. how do i refer to the global XXX module?
<j0sh> hmm, using innerText with jsoo DOM isn't so nice, i lose reactivity as far as i can tell
<Drup> j0sh: the div should not be a reactive div
<Drup> the rest around can be reactive
<Drup> infinity0: you rename it
<Drup> module OldXXX=XXX
<infinity0> oh
ygrek has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
<j0sh> Drup: how to add a jsoo DOM elment to a (reactive) tyxml element? the only time i can see is right after the tyxml nodes get converted to jsoo DOM, but the two can't cohabit concurrently
kushal has quit [Quit: Leaving]
julien_t has quit [Ping timeout: 244 seconds]
yunxing has joined #ocaml
<Algebr`> Drup: followed up on that PR for tyxml example
nojb has quit [Ping timeout: 240 seconds]
<Drup> j0sh:
<Drup> Algebr`: thanks !
Snark has quit [Quit: Lost terminal]
<Algebr`> I wonder if I can use ketrew to replace my usages of cron
kakadu_ has joined #ocaml
yunxing has quit [Remote host closed the connection]
<j0sh> Drup: ahh that did the trick, thanks
<j0sh> when is one supposed to use ## versus ##. in jsoo?
<j0sh> the other innerHTML example i've seen uses ## along with <-, and that kept throwing a compiler error for me
ubbersith1 has joined #ocaml
<Drup> j0sh: camlp4 ;)
yunxing has joined #ocaml
<Drup> in ppx, ## is for methods and ##. is for attributes
ubbersith has quit [Ping timeout: 248 seconds]
<Drup> (Like in usual objects :p)
<j0sh> ah, methods and attributes, okay
Haudegen has quit [Ping timeout: 240 seconds]
hcarty1 has joined #ocaml
ollehar has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
hcarty has quit [Ping timeout: 244 seconds]
<smondet> Algebr`: depends on what you do :) (Ketrew may become a tank trying to kill a fly)
<j0sh> i take back what i said earlier, the interop between jsoo's DOM representation and tyxml is really quite seamless after doing the tyxml->dom conversion. pretty impressive, are references just being "type casted" under the hood?
<Drup> yes
<Drup> It's only typing
<j0sh> very nice
<Drup> It's a bit more tricky with reactive dom, because it's doing side effects for reactive updates
<Drup> So, you have to be careful with all the side effects
<Drup> but otherwise, yeah
<Drup> Casting between one phantom type to another :D
t4nk536 has left #ocaml [#ocaml]
<Algebr`> smondet: I have many cron jobs, like 100 and having the web interface to know their status would be nice i think
Haudegen has joined #ocaml
lokien has joined #ocaml
toolslive has quit [Ping timeout: 250 seconds]
<Algebr`> and some cron jobs depend on other to have succeed, which cron isn't good at
<companion_cube> well look at my url then :D
<foolishmonkey> Algebr`, isn't systemd the solution to all your problems?
<Algebr`> foolishmonkey: no because to actually do systemd correctly means rewriting your code in such a way that best uses systemd
<Algebr`> changes how you daemonize, etc, and i don't need continuously services, rather they are timed scripts that do things dependent on output of other scripts, or should be, like db stuff
<Algebr`> re 1: that's that how I read the systemd literature
<foolishmonkey> Maybe you should write your own task manager.
<companion_cube> heh
<companion_cube> I need to take a look at goaljobs myself
toolslive has joined #ocaml
<Algebr`> =/
<Algebr`> companion_cube: okay first time seeing this
th5 has quit [Ping timeout: 244 seconds]
<smondet> Algebr`: so yes Ketrew can do that :)
Yithar has quit [Remote host closed the connection]
Algebr` has quit [Ping timeout: 250 seconds]
toolslive has quit [Ping timeout: 250 seconds]
silver has joined #ocaml
<companion_cube> smondet: has ketrew been designed as such a cron replacement?
<companion_cube> is there a comparison with goaljobs, actually?
toolslive has joined #ocaml
<smondet> companion_cube: it's not designed "for that"; and it doesn't have the notion of cylcic jobs out-of-the-box. It is made for "big" workflow where stuff takes ages and runs on a cluster that has a scheduler. But it's pretty flexible; I would do the cron-thing with it.
lokien has quit [Ping timeout: 250 seconds]
<companion_cube> yeah ok
<companion_cube> I think there are lots of new options for complex job processing in OCaml now, I should check if some fit my needs (benchmark a prover)
mxv has joined #ocaml
lokien has joined #ocaml
ubbersith1 has quit [Ping timeout: 240 seconds]
<companion_cube> I'm writing a small containers tutorial
lokien has quit [Ping timeout: 240 seconds]
lokien has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
ubbersith has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
djellemah has quit [Quit: Leaving]
djellemah has joined #ocaml
_andre has quit [Quit: leaving]
orbifx has joined #ocaml
antkong has joined #ocaml
des__ has joined #ocaml
<des__> kind list: do I need a #require to use the constant Math.e ?
ubbersith has left #ocaml [#ocaml]
Haudegen has quit [Ping timeout: 244 seconds]
<orbifx> is there a hint or a warning if the compiler fails to detect tail recursion? Or if something is going to cause the stack to grow?
ollehar has joined #ocaml
Algebr` has joined #ocaml
<companion_cube> https://github.com/c-cube/ocaml-containers/blob/master/TUTORIAL.adoc hey containers users, if you want to take a look…
seangrove has quit [Ping timeout: 248 seconds]
mxv has quit [Ping timeout: 252 seconds]
sh0t has quit [Ping timeout: 240 seconds]
des__ has quit [Quit: Page closed]
struk|desk is now known as struk|desk|away
Haudegen has joined #ocaml
RossJH has joined #ocaml
ollehar has quit [Read error: Connection reset by peer]
ollehar1 has joined #ocaml
sh0t has joined #ocaml
nuuit has joined #ocaml
ollehar1 is now known as ollehar
hxegon has joined #ocaml
RossJH has quit [Excess Flood]
pgiarrusso has joined #ocaml
nojb has joined #ocaml
deko-pyon has quit [Quit: Loops are hard, let's GOTO shopping!]
seangrove has joined #ocaml
julien_t has joined #ocaml
<j0sh> companion_cube: nice writeup?
<j0sh> s/?/!
<companion_cube> thanks :)
nicholasf has joined #ocaml
julien_t has quit [Ping timeout: 276 seconds]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
MercurialAlchemi has quit [Ping timeout: 252 seconds]
teknozulu has joined #ocaml
larhat has quit [Quit: Leaving.]
hcarty1 has quit [Ping timeout: 244 seconds]
alexst has joined #ocaml
<hxegon> Jane street write-up on 4.03 inlining: https://blogs.janestreet.com/flambda/
copy` has joined #ocaml
<companion_cube> yeah, pretty nice
mac10688 has joined #ocaml
<edwin> so 4.03 RC soon? thats nice
<companion_cube> isn't it?
alexst has quit [Quit: Lost terminal]
<orbifx> is .adoc, and asciidoc syntax/
<orbifx> ?
<companion_cube> yes
teknozulu has quit [Ping timeout: 240 seconds]
<snhmib> does anybody have had success with the 'gtk2.0 treeview tutorial'?
<snhmib> the hello world example crashes with 300 gtk error messages and i have no idea where to start with what's wrong since i know nothing about gkt
Simn has quit [Quit: Leaving]
nojb has quit [Read error: Connection reset by peer]
<snhmib> >.< nevermind, should have read the documentation how to compile using this library a bit better
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
ollehar has quit [Quit: ollehar]
<j0sh> man, hacker news makes me mad sometimes. why are people obsessed over multicore ocaml? 99% of the time, what they really need is concurrency, not parallelism...
<aantron> because parallelism... :)
lokien_ has joined #ocaml
<orbifx> j0sh: cause they don't know. Who isn't in the process of learning?
<orbifx> Having used fork for parallelism I think it's a neat solution.
<aantron> in practice a lot of people are probably repeating criticisms they heard from others, without considering them, and few people really have enough experience with concurrency/parallelism to really care about the difference or what you can achieve either way
cartwright has quit [Quit: WeeChat 1.3]
<aantron> (with or without parallelism)
cantstanya has joined #ocaml
<aantron> (in a single process)
<orbifx> But when we go "language-shopping" we are hoping our next favourite language is going to have everything, nicely packaged, specially the features in fashion.
<Algebr> j0sh: because they need something to complain about
struk|desk|away is now known as struk|desk
<pierpa> and sometimes there's a reason if something is in fashion
<lokien_> Hey, ocaml is very fashionable
<lokien_> It came from France
kakadu_ has quit [Remote host closed the connection]
foolishmonkey has quit [Quit: Leaving]
<pierpa> :)
<lokien_> For me it's like.. Stricter Haskell.
sh0t has quit [Ping timeout: 240 seconds]
<lokien_> By the way, does anyone use -| operator?
mac10688 has quit [Remote host closed the connection]
<pierpa> where is defined this operator?
<lokien_> In batteries. It's probably % now.
<lokien_> It's for function composition
<Drup> j0sh: tbf, HN is significantly more open to OCaml than r/programming >_>
<lokien_> Drup: I wonder if anyone in /r/programming has a real job
<Algebr> that's harsh
<fds> Don't be rude about those of us without real jobs. :-P
<fds> By the way, Drup, I really liked those posts on LL/LR parsing.
<fds> On the blog you linked to.
<lokien_> fds: I don't even have an imaginary job
<Drup> fds: yep! I plan to read the rest of the blog
sh0t has joined #ocaml
bobry has quit [Quit: Connection closed for inactivity]
struk|desk is now known as struk|desk|away