mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
<reynir>
companion_cube: Ah, yea, a framework would be nice. I've toyed with the idea of abusing cmdliner, but I think that requires some rewriting. For example, single line help messages.
tane` has quit [Quit: Leaving]
<reynir>
companion_cube: It calls the wolfram alpha api and can lookup addresses and do geoiplookups
<reynir>
It also runs a TLS server I can connect to with a client certificate so I can tell it which channels to join :P
<infinity0>
companion_cube: heh ok thanks!
defgeneric has quit [Ping timeout: 240 seconds]
<larhat>
is it possible to define variables in _tags? so i can define some common deps, and then do <src/one.byte>: $common, package(special_one); <src/two.byte>: $common, package(special_two)?
<larhat>
or i should just use `true: common_packages`?
<zozozo>
doesn't doing: <src/*.byte>: package(common) <src/one.byte>: packae(specific), works ?
<zozozo>
as far as I understand it tags are cummulative
defgeneric has joined #ocaml
silver_ has joined #ocaml
dhil has joined #ocaml
silver has quit [Ping timeout: 264 seconds]
silver_ is now known as silver
<larhat>
zozozo: yes, it would also work similar to `true: …`, just wanted to know, whether it possible to define variables. It seems more clear to me, for some reason %) Thanks!
mfp has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
ltadeu has joined #ocaml
fluter_ is now known as fluter
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
govg has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
dhil has quit [Read error: Connection reset by peer]
<companion_cube>
reynir: ah, funny
<companion_cube>
maybe we can merge our efforts then, my bot doesn't have any kind of authentication
al-damiri has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
dhil has joined #ocaml
fre has joined #ocaml
Donald__ has quit [Ping timeout: 260 seconds]
<infinity0>
so, if we start with ('a, 's) state then we want to write some utility that involves using "decorated" states that are semi-fixed, would it be more conventional to do
<companion_cube>
that could be one plugin among others in the common IRC bot framework :p
<reynir>
Getting client certs working required patching tls and x509 IIRC
<companion_cube>
along with my youtube query one, etc.
<Armael>
hey, I wrote the youtube query command :O
<infinity0>
yeah i guess i should think about that a bit more. the decoration would also be user-chosen but it's unclear which one would be more or less "fixed" at this stage
mengu has joined #ocaml
<infinity0>
i suppose at least part of it is fixed (outside of the 't)
<reynir>
eurgh
<reynir>
something's broken because I've upgraded from python 3.5 to 3.6
<reynir>
and it affects opam somehow
nomicflux has joined #ocaml
AlexDenisov has joined #ocaml
Jean-Baptiste has joined #ocaml
uberTaco has joined #ocaml
<uberTaco>
Question for the smart people here: is there a good way to cross-compile from a linux host to build an OSX executable?
bbc_ is now known as bbc
<cheater>
without knowing any ocaml specific things you can always run osx in a vm..
<cheater>
so that's one way
nomicflux has quit [Quit: nomicflux]
<cheater>
but it's not really "cross compiling"
<infinity0>
uberTaco: if you build "for freebsd" there's a good chance it will work
<infinity0>
i also don't know how to do that though, but it might easier to google for
mengu has quit [Remote host closed the connection]
slash^ has joined #ocaml
Flerex has joined #ocaml
Flerex has quit [Client Quit]
th5 has joined #ocaml
Jean-Baptiste has left #ocaml ["ERC (IRC client for Emacs 25.1.1)"]
agarwal1975 has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
Michael_- has joined #ocaml
dhil has joined #ocaml
<uberTaco>
gotcha
<uberTaco>
thanks
annoymouse has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uberTaco has quit [Quit: And away!]
mengu has joined #ocaml
vicfred has quit [Ping timeout: 240 seconds]
infinity0 has quit [Ping timeout: 260 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
mengu has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
vicfred has joined #ocaml
vicfred has quit [Client Quit]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
mengu has quit [Ping timeout: 248 seconds]
infinity0 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 255 seconds]
copy` has joined #ocaml
fre has quit [Read error: Connection reset by peer]
fre has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yomimono has joined #ocaml
AlexDenisov has joined #ocaml
mfp has quit [Ping timeout: 258 seconds]
wtetzner has joined #ocaml
fre has quit [Read error: Connection reset by peer]
Michael_- has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
fre has joined #ocaml
wtetzner has quit [Remote host closed the connection]
Michael__ has joined #ocaml
Michael__ is now known as Guest54280
orbifx-m has joined #ocaml
<orbifx-m>
in oasis, findlibname and findlibdirectory, don't affect how the modules are opened, their identifiers, correct?
alfredo has quit [Read error: Connection reset by peer]
handlex has joined #ocaml
<companion_cube>
it's only relevant to ocamlfind (and projects relying on the lib)
<companion_cube>
no indeed
jeffmo has joined #ocaml
MercurialAlchemi has joined #ocaml
<jeffmo>
Hey all! I'm trying to build a plugin system for Flow and I'm getting a "undefined symbol: camlPervasives__print_endline_1300" error when calling Dynlink.loadfile on a cmxs file whose code is simply: `let () = print_endline "plugin works"`
<orbifx-m>
companion_cube: what about findlibcontainer?
<jeffmo>
When I inspect the cmxs file with readelf, I see there's a NOTYPE/Undefined symbol for "camlPervasives__print_endline_1300" -- and when I inspect the loader binary, I see there's a FUNC symbol present as well
<jeffmo>
I've also discovered that if I *dont* compile with -noautolinks in a simple test case, everything seems to work
<jeffmo>
but if I do include the flag, I can repro the error
<jeffmo>
(and unfortunately I need -noautolink in my real binary in order to compile with some C plugins it has)
<jeffmo>
anyone have any ideas or hit this before?
handlex has quit [Quit: handlex]
<companion_cube>
orbifx-m: what about it?
<Guest54280>
Lwt.wait creates a waiter thread in sleeping mode. What does this thread do after it wakes up?
<orbifx-m>
does that affect how the module appears nested from the code's perspectives? will I have to open X.Y if I specify findlibContainers: X?
<thizanne>
Guest54280: it returns unit
<thizanne>
(wait no not necessarily unit)
<thizanne>
it returns the value with which you woke it up
vicfred has joined #ocaml
<thizanne>
see : let (t, u) = Lwt.wait ();; Lwt.state t;; Lwt.wakeup u 42;; Lwt.state t
<Guest54280>
So, is it simply fun x -> Lwt.return x?
<thizanne>
no, Lwt.return returns immediately, it does not wait
<thizanne>
Lwt.wait makes the thread... wait :)
<Guest54280>
Yes, except that thing
<orbifx-m>
companion_cube: it appears not
<companion_cube>
I don't understand what you mean
<orbifx-m>
findlibcontainers doesn't affect the scope in ocaml code
yomimono has quit [Ping timeout: 240 seconds]
octachron has joined #ocaml
<companion_cube>
no, they don't
<companion_cube>
OCaml code only sees modules
<octachron>
orbifx-m: nothing that you can write in an oasis file will affect module organization
<orbifx-m>
thanks
dhil has quit [Ping timeout: 260 seconds]
<companion_cube>
octachron: actually, it can, if you add `Pack: true`
<companion_cube>
(often useful for sub-libraries, imho)
yomimono has joined #ocaml
dhil has joined #ocaml
govg has joined #ocaml
<octachron>
companion_cube: ah yes, I had forgotten that the pack option is properly supported by tools
<octachron>
(at least compared to module aliases)
<orbifx-m>
what's pack true companion_cube ?
<companion_cube>
it's an option for libraries in oasis
<companion_cube>
it packs the library's modules
<orbifx-m>
so that they appear nested in ocaml as submodules?
<companion_cube>
yeah, you don't known -pack? :-)
MercurialAlchemi has quit [Ping timeout: 252 seconds]
philtor has joined #ocaml
fre has quit [Read error: Connection reset by peer]
fre has joined #ocaml
<octachron>
With pack, modules *are* nested together as submodules, it is more than appearance
MercurialAlchemi has joined #ocaml
fre has quit [Read error: Connection reset by peer]
fre has joined #ocaml
zirman has joined #ocaml
<companion_cube>
yes
zirman has quit [Changing host]
zirman has joined #ocaml
zirman has quit [Read error: Connection reset by peer]
zirman has joined #ocaml
annoymouse has quit [Quit: Connection closed for inactivity]
ygrek has joined #ocaml
jnavila has quit [Quit: It was time]
larhat has quit [Quit: Leaving.]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wtetzner has joined #ocaml
ltadeu is now known as snowcrshd
zirman has quit [Read error: Connection reset by peer]
zirman has joined #ocaml
<snowcrshd>
just out of curiosity, does anybody know if there are any ocaml-related slack channels?
napping has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
<dmbaturin>
snowcrshd: Because we absolutely have to trade an open standard for a proprietary walled garden. ;)
<Guest54280>
This is called an unsafe peice of code: let next = let i = ref 0 in fun () -> incr i; foo () >|= fun () -> (* Another thread might call [next] here *) !i
<Guest54280>
What is the best explanation for it being unsafe?
<companion_cube>
there is a slack channel for ocamllabs
<companion_cube>
but well, it's closed
zpe has quit [Remote host closed the connection]
<reynir>
I think reasonml had a slack channel, but they're now using the Next Fancy Thing (forgot what)
zpe has joined #ocaml
<Guest54280>
Even if another thread calls next, I guess i is still a local variable that would be different in independent calls
<Guest54280>
(point to different locations)
<companion_cube>
reynir: discord?
<reynir>
yea
<companion_cube>
or discourse, or matrix…?
<dmbaturin>
From bad to worse? :)
<reynir>
discord or discourse I think
<orbifx-m>
booo to using slack
<dmbaturin>
Slack can handle history at least...
slash^ has quit [Read error: Connection reset by peer]
<companion_cube>
free platforms are fragmented, sadly :?
<companion_cube>
:/
<dmbaturin>
Guest54280: i is shared between instances of next.
emias has quit [Quit: Bye]
fre has quit [Read error: Connection reset by peer]
zpe has quit [Ping timeout: 240 seconds]
<reynir>
Someone mentioned that they were using irccloud and that their browser tab had crashed
<dmbaturin>
next evaluates to a closure that contains the i ref, and the unit -> ('a -> unit) function.
<Guest54280>
What is the rule? Are refs (and olny refs) that are defined in a function point to the same location when function is called by other functions/threads?
<companion_cube>
I use screen, works like wonder
<dmbaturin>
If I inferred the type of the inner function correctly, which I can't guarantee because I'm no OCaml compiler.
<dmbaturin>
companion_cube: All cool kids use tmux these days.
<companion_cube>
Guest54280: every time `ref x` is evaluated, a new reference is created
<reynir>
I use tmux, 140 day uptime \o/
<companion_cube>
dmbaturin: bah. I don't see the point
<companion_cube>
139 here :D
<companion_cube>
damn
<reynir>
It's actually 141 :P
<companion_cube>
anyway, never had any issue with screen
<dmbaturin>
companion_cube: Me neither.
<companion_cube>
anyway, got to go
<dmbaturin>
Save for tmux users on my lawn. ;)
<companion_cube>
I moved from irssi to weechat, a move to tmux is still possible :D
<dmbaturin>
Sometimes I seriously consider adding the missing bits to irssi because I don't like weechat's approach to UI.
<dmbaturin>
I get around it with perl scripts. Don't tell anyone I know perl though.
<companion_cube>
I like the sidebar; of course i removed the alignment very quickly
<companion_cube>
(in weechat)
<companion_cube>
overall the move was not that hard
<reynir>
I hear there's a 1.0 release for irssi around the corner
<companion_cube>
it's released
<reynir>
Ah
<Guest54280>
companion_cube: but that makes the code safe
<snowcrshd>
dmbaturin: ahn, ok dude, thanks
<dmbaturin>
Guest54280: Yeah, it _may_ be safe, depending on what's inside.
<dmbaturin>
Nothing defined outside that scope will know what next is to begin with.
<snowcrshd>
companion_cube: reynir: hmm, thanks. The place I work has recently moved to slack so I was curious if there were some ocaml channels there
<reynir>
wait, they also used gitter
<reynir>
I might be mixing up the chat clients/networks
<snowcrshd>
but that doesn't seem to be popular around here hahah
<snowcrshd>
thanks anyway
<napping>
Is there any reasonable way to move an opam root directory?
orbifx-m has quit [Ping timeout: 264 seconds]
<dmbaturin>
Then again, code that can be changed to become unsafe is not inherently unsafe. All code would be considered inherently unsafe then. :)
orbifx-m has joined #ocaml
<snowcrshd>
hmm, apparently the reson guys have both an IRC channel and a Discord channel. Funny, I thought discord was mainly used for games
<Guest54280>
dmbaturin: maybe I am missing something here. you mentioned that is 'i' is shared between instances, but also invoking 'next' creates closures with different environments (different references that point to different integers).
Denommus has joined #ocaml
<dmbaturin>
napping: Well, if you don't want to hunt all bits where path is specified, you can always opam switch export, re-init, and import it.
<dmbaturin>
But I think opam-init/init.* and shell profile are the only places where it's specified.
<napping>
What about paths baked into compilers and bytecode?
<dmbaturin>
Guest54280: You can refer to next inside that code where there comment about safety is, and it will refer to that same binding. Unless I misread it.
<napping>
Guest54280: next is bound to the restult of let i = ref 0 in fun () -> ...
<napping>
that only makes one reference, then returns a function sharing that reference
<reynir>
snowcrshd: the irc channel is dead though :-)
<Guest54280>
dmbaturin: interesting! that means a reference defined inside a function continues to live even when the function exits.
<dmbaturin>
If there is a possibility that something happens between incr and ! and that something has access to the next binding, then race condition is very real.
<napping>
Guest54280: that reference isn't defined inside the function
<dmbaturin>
Bind creates that possibility since context switches occur between binds.
<napping>
Is there no concurrent semantics?
<dmbaturin>
Guest54280: Well, in "let next = let i = ref 0 in let aux () = incr i; !i in aux" i and aux are in the same closure, and as long as next binding itself lives, the i lives too.
<dmbaturin>
Concurrency libraries define atomic functions, and ways to make things atomic. Things that do not contain binds are atomic on their own.
<napping>
Is there any way to specify several repositories for opam init?
<dmbaturin>
Hhm, good question.
<napping>
I don't have a system compiler installed yet, and I was hoping to use the --comp option to just go straight to building from a local compiler description. But, it seems to need the default repository set up for the base packages.
orbifx-m has quit [Ping timeout: 260 seconds]
Guest54280 has quit [Ping timeout: 260 seconds]
orbifx-m has joined #ocaml
<dmbaturin>
I don't even bother with system compiler these days. Bootstrapping ocaml is absurdly fast.
<napping>
Really?
<napping>
seems to take 5-10 minutes here
<dmbaturin>
Well, compared to bootstrapping say gcc. Five minutes even once a day wouldn't be a big loss.
<dmbaturin>
And I don't setup opam daily even.
<napping>
Fast for a compiler, I suppose
<napping>
My case is unusal - I'd like to package a program along with an O'Caml compiler, but I'd prefer to avoid requiring a fixed installation directory
kakadu has quit [Quit: Konversation terminated!]
<dmbaturin>
napping: Depending on the use case, you may get around the issue entirely by making a custom top level with your libs.
<napping>
I'm pretty sure that at least supporting just ocamlfind would be enough, without needing a full opam
ygrek has joined #ocaml
<dmbaturin>
napping: I suppose your program is not an IDE?
pierpa has joined #ocaml
AlexDenisov has joined #ocaml
boojinks has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
zpe has joined #ocaml
fedruantine has quit [Ping timeout: 240 seconds]
handlex has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<napping>
no, not an IDE
jnavila has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
fedruantine has joined #ocaml
<companion_cube>
reynir: ok, I'm going to do the IRC thing
<dmbaturin>
companion_cube: Wait, how are you going to have plugins update the JSON files? Have every plugin load the whole file for updating?
<companion_cube>
it's the opposite: the core API will control all state
<companion_cube>
manage the one json file
<companion_cube>
and give plugins' only their part of the JSON
<companion_cube>
-'
<companion_cube>
right now it's very ad-hoc
<dmbaturin>
Ah, I see.
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<reynir>
whoa, github projects
larsrh has joined #ocaml
<dmbaturin>
Also, why not sqlite?
<companion_cube>
heh, maybe later :-)
<companion_cube>
I wanted sth simple
<larsrh>
I was wondering about heap size management in OCaml (on Linux). If I run a compiled binary, how much memory will it allocate? When will it feel the need to run GC?
<companion_cube>
and json is also vey easy to backup
<companion_cube>
larsrh: it runs the GC when the percentage of "wasted" memory reaches a limit
<larsrh>
companion_cube: What does "wasted" memory mean?
<companion_cube>
the memory occupied by dead objects, I think
<companion_cube>
I don't remember exactly
handlex_ has joined #ocaml
<larsrh>
How do you know that size if you don't run GC in the first place?
<companion_cube>
`man Gc` will be more accurate
<companion_cube>
ah, this is about compaction actually
<companion_cube>
the major GC is run incrementally every time the minor GC runs
<dmbaturin>
companion_cube: I guess this calls for a functor that can take different storage backends. :)
<larsrh>
I'm inquiring because of the behaviour of the Linux kernel that tends not to return NULL on malloc
<companion_cube>
dmbaturin: meh :D
<companion_cube>
we'll see
<larsrh>
so my basic question is "how do managed runtimes cope with that"
<companion_cube>
or maybe sqlite will store the json, who knows
<dmbaturin>
I'll take it up for the sake of it. ;)
<companion_cube>
larsrh: OCaml doesn't use malloc anyway
<companion_cube>
it relies on sbrk or sth like that
tane has joined #ocaml
<larsrh>
companion_cube: it looks like I'm opening a can of worms there ...
<companion_cube>
heh :D
<larsrh>
"Memory allocation: it's hard"
<companion_cube>
yep
<larsrh>
man Gc doesn't really tell me much
handlex_ has quit [Client Quit]
handlex has quit [Ping timeout: 264 seconds]
<dmbaturin>
I use non-strict evaluation for such things and don't think much about it unless I run into problems with it. :)
<dmbaturin>
Sometimes this approach runs me into the bottom, but well...
<reynir>
I have a book written by the professor of a course, and among other bad writing it had "XXX is like opening a can of worms of problems"
<dmbaturin>
"Worms of problems" sounds like a good name for a rock band.
<reynir>
heh
<reynir>
companion_cube: Config.t only allows for one channel - I think it's sometimes useful to reuse a bot across multiple channels
<larsrh>
companion_cube: I resorted to tweeting; let's see if the hivemind has some resources to offer :-)
<reynir>
Is there a reason for this?
<companion_cube>
reynir: not particularly
<companion_cube>
it's just a feature I never implemented
<companion_cube>
as the bot was intended to be used on one channel
<companion_cube>
but of course you will contribute your code for multi channel AND administration ;-)
<reynir>
Oh, the tls "administration" bit is ridiculously simple
<companion_cube>
sure
<companion_cube>
are you @reynir on gh ?
<reynir>
when you connect and send "commands" it checks if it's "quit" and quits, otherwise it tries to join whatever string you passed as if it was a channel :D
<reynir>
Yes
fedruantine has quit [Ping timeout: 255 seconds]
<companion_cube>
here we go
fedruantine has joined #ocaml
<reynir>
How backwards compatible do you want it? I'm thinking replacing Plugin.stateful with inline records
<reynir>
(I still haven't used that yet)
<companion_cube>
erf
<companion_cube>
I'm not that in favor ^^
<companion_cube>
inline records are 4.04, aren't they?
<reynir>
I think 4.03
<reynir>
OK
<companion_cube>
4.01 would be nice :-)
<companion_cube>
(some debians still are on 4.01)
<reynir>
Good point
octachron has joined #ocaml
fedruantine has quit [Ping timeout: 240 seconds]
<companion_cube>
ok, I don't have time anymore tonight
<companion_cube>
PRs warmly welcome
<companion_cube>
or just discussion :-)
<companion_cube>
I'm moving ocabot to this lib btw
<companion_cube>
it doesn't have anything the lib doesn't have yet
Xadnem has joined #ocaml
Xadnem has quit [Quit: leaving]
Xadnem has joined #ocaml
fedruantine has joined #ocaml
larhat has joined #ocaml
Xadnem has quit [Quit: leaving]
<reynir>
!hello
<ocabot_>
hello reynir
<reynir>
test !hello
<reynir>
(sorry)
Xadnem has joined #ocaml
<boojinks>
!hello
<ocabot_>
hello boojinks
<boojinks>
what a friendly chap ocabot_ is.
larsrh has left #ocaml [#ocaml]
armish has joined #ocaml
th5 has quit []
napping has left #ocaml [#ocaml]
wtetzner has quit [Remote host closed the connection]
orbifx has joined #ocaml
wtetzner has joined #ocaml
armish has quit [Read error: Connection reset by peer]
isd has joined #ocaml
orbifx has quit [Ping timeout: 248 seconds]
jackx has joined #ocaml
<jackx>
hi there i have one questin can some of u? help me?
<octachron>
jackx, it may depend on the question, so ask first :-)
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has quit [Remote host closed the connection]
wtetzner has quit [Remote host closed the connection]
copy` has quit [Quit: Connection closed for inactivity]
Xadnem has quit [Quit: leaving]
fds has quit [Ping timeout: 248 seconds]
fds has joined #ocaml
<jackx>
i have code from forum which are writen to ocaml
<jackx>
and im download ocml from web for windows and now i rly dont know how to execute it
AltGr has left #ocaml [#ocaml]
<jackx>
at folder oCaml/bin/are some *.exe but no one work i think i must it execute through cmd? Im a wrong? Thanks for any answers ..
al-damiri has quit [Quit: Connection closed for inactivity]
<octachron>
jackx, probably yes, either from cmd or from cygwin
<octachron>
however, if you want just to play/execute some ocaml code, there are easier options
<jackx>
i need only play/execute
<jackx>
can u tell me more about the easier options? thanks u much