wtetzner has quit [Remote host closed the connection]
wtetzner has joined #ocaml
wtetzner has quit [Ping timeout: 244 seconds]
sepp2k has quit [Quit: Leaving.]
sh0t has quit [Quit: Leaving]
darkf has joined #ocaml
roger_ has joined #ocaml
<roger_>
howdy - quick question anyone can tell me what is the correct syntax to format a staged string "/some/path/%s" that is loaded from a text file and I want my code to do something similar to Printf.sprintf "this string %s" "example"
<mrvn>
"/some/path/%s"?
<mrvn>
Loading format strings from text files can't be type checked. You have to make your own runtime type checks.
thizanne has quit [Ping timeout: 244 seconds]
<roger_>
does the Scanf module provide that functionality?
<mrvn>
magically deduce what the user supplied file will in the future contain and generate the right type for it? No.
roger_ has quit [Quit: Page closed]
wtetzner has joined #ocaml
wtetzner has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
fluter has quit [Ping timeout: 264 seconds]
govg has quit [Ping timeout: 258 seconds]
zpe has quit [Ping timeout: 260 seconds]
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 260 seconds]
averell has quit [Ping timeout: 258 seconds]
fluter has joined #ocaml
wtetzner has joined #ocaml
wtetzner has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 258 seconds]
phao has joined #ocaml
MercurialAlchemi has joined #ocaml
tmtwd has joined #ocaml
ygrek has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
ygrek has quit [Ping timeout: 250 seconds]
seangrove has quit [Ping timeout: 260 seconds]
tmtwd has quit [Ping timeout: 264 seconds]
govg has joined #ocaml
rgrinberg has quit [Ping timeout: 276 seconds]
travula has joined #ocaml
seangrove has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
Mercuria1Alchemi has joined #ocaml
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
Simn has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
manizzle has joined #ocaml
shinnya has quit [Ping timeout: 258 seconds]
tane has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
<M-jimt>
Is there an OCaml library for interacting with RethinkDB? My Google-fu is failing me.
phao has quit [Ping timeout: 258 seconds]
dexterph has joined #ocaml
<flux>
probably not then, I don't think it would be hard to find :)
tmtwd has joined #ocaml
freusque has joined #ocaml
bobry has joined #ocaml
orbifx has joined #ocaml
<bobry>
Is it possible to "inherit" object types? E.g. if I have type foo = <x: int> and then type bar = <foo; y: int>?
johnelse has joined #ocaml
AltGr has joined #ocaml
johnelse has quit [Ping timeout: 276 seconds]
<flux>
no
<bobry>
I see, thanks.
kushal has quit [Read error: Connection reset by peer]
dave24 has joined #ocaml
Algebr` has joined #ocaml
kushal has joined #ocaml
larhat has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
ggole has joined #ocaml
johnelse has joined #ocaml
jwatzman|work has joined #ocaml
larhat1 has quit [Ping timeout: 265 seconds]
govg has joined #ocaml
fluter has quit [Ping timeout: 258 seconds]
larhat has joined #ocaml
dhil has joined #ocaml
fluter has joined #ocaml
nicholasf has joined #ocaml
brub has quit [Remote host closed the connection]
rand__ has joined #ocaml
<dave24>
can I caml_c_thread_unregister the thread which called caml_startup ?
yomimono has joined #ocaml
govg has quit [Ping timeout: 260 seconds]
<dave24>
nvm, i can just not do that by checking if caml_c_thread_register returned 1. -.-
bobry has quit [Quit: Connection closed for inactivity]
travula has quit [Ping timeout: 260 seconds]
<Algebr`>
in 4.03, are exceptions able to get inlined records too
<Algebr`>
oh apparently yes, compiled
zpe has joined #ocaml
tane has quit [Ping timeout: 244 seconds]
sdothum has joined #ocaml
Orion3k has quit [Ping timeout: 244 seconds]
Orion3k has joined #ocaml
SpiceGuid has joined #ocaml
reser has joined #ocaml
<Algebr`>
for a class, is there a way to create a locally abstract type for it?
<reser>
Hey, I'm new to ocaml and having some trouble. I have a function that takes two arguments x,y and returns None or Some. For each possible x there is only one possible y that returns Some (and vice versa). Now given a specific y, I want to call the function without having to guess x - is this possible?
<Algebr`>
for example, say you don't want the type of an instance variable exposed in an mli
<reser>
Now that i wrote it out it feels like a obvious no
nicholasf has quit [Remote host closed the connection]
<flux>
try prolog :)
<flux>
algebr`, hmm, do you need to expose the variable it in the mli at all?
<Algebr`>
oh great, was able to hide it since nothing else used that type at all
nicholasf has joined #ocaml
<Algebr`>
ended up exactly what I wanted
wtetzner has joined #ocaml
silver has joined #ocaml
_andre has joined #ocaml
Orion3k has quit [Ping timeout: 276 seconds]
<reser>
Types with * in between are tuples, but if there is only a space between, what are those?
<ggole>
Applied type constructors
tane has joined #ocaml
Orion3k has joined #ocaml
<reser>
Ah, i get it. Thanks ggole
fluter has quit [Ping timeout: 250 seconds]
fluter has joined #ocaml
axiles has quit [Ping timeout: 240 seconds]
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
axiles has joined #ocaml
axiles has quit [Ping timeout: 244 seconds]
axiles has joined #ocaml
averell has joined #ocaml
freusque has quit [Ping timeout: 250 seconds]
<Algebr`>
can opam depext handle custom ppas?
kushal has quit [Ping timeout: 258 seconds]
kushal has joined #ocaml
johnelse has quit [Ping timeout: 265 seconds]
thizanne has joined #ocaml
rgrinberg has joined #ocaml
johnelse has joined #ocaml
tmtwd has joined #ocaml
tane has quit [Read error: Connection reset by peer]
tani has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
tani is now known as tane
dhil has quit [Ping timeout: 250 seconds]
agarwal1975 has joined #ocaml
nicholasf has quit []
SpiceGuid has joined #ocaml
tmtwd has quit [Ping timeout: 264 seconds]
phao has joined #ocaml
reser has quit [Ping timeout: 250 seconds]
fraggle-boate has quit [Remote host closed the connection]
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
fraggle-boate has joined #ocaml
clockish has quit [Quit: bye]
clockish has joined #ocaml
fraggle-boate has quit [Remote host closed the connection]
fraggle-boate has joined #ocaml
wtetzner has quit [Remote host closed the connection]
dhil has joined #ocaml
tane has quit [Ping timeout: 244 seconds]
tane has joined #ocaml
chattered has joined #ocaml
slash^ has joined #ocaml
tani has joined #ocaml
tane has quit [Read error: Connection reset by peer]
tani has quit [Client Quit]
pierpa has joined #ocaml
copy` has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
sdothum has quit [Client Quit]
Algebr` has joined #ocaml
sdothum has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
tane has joined #ocaml
govg has joined #ocaml
ygrek has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
SpiceGuid has joined #ocaml
SpiceGuid has quit [Read error: Connection reset by peer]
sdothum has quit [Client Quit]
unbalancedparen has joined #ocaml
sdothum has joined #ocaml
SpiceGuid has joined #ocaml
grandy____ has joined #ocaml
<seangrove>
What is jsnew in jsoo, and how do I reference it?
<seangrove>
Or better yet, how do I new `(new Date()).getTime().toString()` in jsoo?
rgrinberg has quit [Ping timeout: 250 seconds]
Algebr` has joined #ocaml
<seangrove>
Algebr`: Or better yet, how do I new `(new Date()).getTime().toString()` in jsoo?
<larhat>
seangrove: with ppx you can do `new%js constr arg1 arg2`
<larhat>
let now = new%js Js.date_now in now##toString
zpe has quit [Remote host closed the connection]
yomimono has quit [Quit: Leaving]
larhat has quit [Quit: Leaving.]
pierpa has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
octachron has joined #ocaml
shinnya has joined #ocaml
<grandy____>
hello, I'm fairly new to ocaml and just wanted to ask some advice -- I'd like to port some code that is currently javascript (used in a react-native IOS app) to ocaml, and use it natively on IOS and Android... it appears that there are projects that allow both of these as targets for ocaml code ... wondering if anyone has any suggestions.
<chattered>
grandy____: If that can be done easily, it's awesome!
<chattered>
Sadly, I only muck around on Linux.
<grandy____>
chattered: rewriting the code in ocaml should be easy, not sure about accessing native APIs though, there are a few that I need to use
<grandy____>
currently some code is objc and used in the js code via the react native bridge... but I'd like to just implement it directly in ocaml and use the one native API it cares about (storage) ...
<grandy____>
trying to figure out the best way to do a small test / proof of concept
<grandy____>
Drup: might be, I think bucklescript is an option for using ocaml and targeting js as well, However I was thinking that ideally my ocaml code would be able to target obj, java, and js.
<adrien>
I think there's also the ocaml-ios stuff to access native APIs but from my point of view, cordova is a safer bet
<Drup>
I'm going to be very blunt: don't use bucklescript.
johnelse has quit [Ping timeout: 258 seconds]
sepp2k has joined #ocaml
<Drup>
(I can go into details if you really want, but I shouldn't: bucklescript is not even out of alpha, js_of_ocaml has been around for more than 5 years)
<grandy____>
ahh yes i'd like to hear any thoughts you have, bluntness perfectly welcome
<chattered>
Drup: I messed around with ocaml_to_js a while back, and was impressed with the idea of having a single set of sources that get auto split between server side and client side, but was sceptical that I wouldn't hit edge cases where it's not as automatic as I'd liked. Is it reasonably battle tested these days?
<grandy____>
not using ocaml for the whole app, but i am thinking it might make sense to write the most accuracy-critical code in it, since it's far more elegant than the same thing written in js with static type checking and Immutable.js
<Drup>
grandy____: I don't know much about having code that would work natively on the various plateforms. I heard the cordova stuff works quite well. Algebr` might be able to tell you things about iOS specially
<Drup>
chattered: do you mean ocamljs or js_of_ocaml ?
dave24 has quit [Quit: leaving]
<chattered>
js_of_ocaml
<Drup>
(afaik, none of them do code spliting though, that's eliom)
<chattered>
I didn't realise there were two now!
<chattered>
Ah, yes, eliom.
<Drup>
there isn't, ocamljs died quite some time ago
<chattered>
I thought js_of_ocaml was just a subproject within the latter.
<chattered>
Within ocsigen.
<Drup>
yeah
<grandy____>
Drup: Integrating with native libraries is not all that important, and react-native is fantastic in many ways, but at some point my data storage stuff needs to be faster and should be written for the native platform ... hence thinking about a language that can target c/objc and java ...
<Drup>
js_of_ocaml is very reliable, a lot of people use it
<chattered>
Drup: And ocsigen?
<Algebr`>
what ios stuff
<Drup>
Your fear about automatic code spliting seems a bit weird, since it's completely user directed with annotations :)
<Algebr`>
seangrove: oh its in the example, basic
<Algebr`>
there's gettime used
<chattered>
Well the automatic part I was thinking of was the server-client communication via JSON.
<Drup>
grandy____: I know ocaml can compiles to IOS and Android (you don't need to compile to c/objc or java to do that ...). I don't know more
<Algebr`>
grandy____: not sure what the question was?
<grandy____>
Drup: ahh ok
<Algebr`>
yes you can write logic in OCaml and then expose it to the objc side
thizanne has quit [Quit: WeeChat 1.5]
<Drup>
chattered: Yeah, I don't know how long ago you tried. There are no problems with that
<grandy____>
Algebr`: yeah sorry I was vague, I guess looking more closely the mobile platform opam ports appear to be the best approach for integrating with native code on either one .
<Algebr`>
Drup: a little bit harsh on BS, its certainly moving a lot faster than jsoo
<grandy____>
Algebr`: cool, I also want to interact with a few of the objc libraries from within ocaml, not sure if that is possible, but I imagine it may be
<Drup>
(As I said, all of it is user directed with annotations, it's difficult to imagine a situation where the compiler would get confused :p
<Algebr`>
grandy____: yes possible and done
<Drup>
Algebr`: frankly, no.
<grandy____>
Algebr`: ahh excellent
<Algebr`>
Drup: momentum is clearly on BS side.
<Drup>
hype is, and he's quite better at marketing
<chattered>
Drup: Cool. I was trying it out back in 2012, and it looked pretty awesome.
<Algebr`>
one man is better at marketing than an entire project that has been alive for at least 5 years?
<Algebr`>
I will say at least one thing, it seems to me that its easier to get BS to accept desires from actual users than jsoo
zpe has joined #ocaml
<grandy____>
I'm excited to be considering this, as I've wanted a chance to use ocaml for something for a while, and this may be an elegant and minimal (at first) way to do it for work :)
<Algebr`>
grandy____: you should be! its very possible
<Drup>
Algebr`: I really don't want to enter a sparing contest with you. If you think there is now momentum for jsoo, look at the changelog for the last release.
<grandy____>
Algebr`: excellent, as I get started porting some of the code, do you recommend any sort of unit testing approach ...
<Algebr`>
Drup: that's exactly the kind of off putting attitude that will doom jsoo
<Algebr`>
grandy____: unit testing UI is kind of hard in any way right
<Drup>
Algebr`: No, that's just the fact that you don't want to argue with you specifically :]
<Algebr`>
I'm not arguing, I'm reevaluating whether its worth it to keep putting energy into a project that doesn't take nicely to end users desires
<grandy____>
Algebr`: in this case just porting data storage stuff so no need to worry about ui
<Algebr`>
grandy____: yea, then plan alcotests I guess
<grandy____>
ahh ok
<Algebr`>
What should I do about this: I want to release an opam package that wants a PPA
<Algebr`>
but avsm said that opam depext doesn't know about ppa
<Algebr`>
so release anyway and it fails on each build for PR
<Drup>
Algebr`: that's *your* experience. In the meantime, there is a long list of feature wishes from the Coq people that were integrated into jsoo and now a allows coq to run in a browser. Various things from lexify have been fixed or integrated. jsoo now supports stuff for janestreet's libraries, etc
<Algebr`>
or could opam take a dockerfile?
zpe has quit [Ping timeout: 244 seconds]
<Algebr`>
I think that if anyone is having a bad experience with a project then project maintainers should try to help out rather than say oh well, that's their problem
<Algebr`>
perhaps that has become controversial somehow
axiles has quit [Ping timeout: 250 seconds]
<Algebr`>
I'll drop the issue
<Drup>
chattered: 2012 was a long time ago, it got a lot of new stuff since then :p
<Algebr`>
has anything docker related become integrated in opam??
AltGr has left #ocaml [#ocaml]
<SpiceGuid>
Anyone knows who has invented the modified preorder tree traversal :?
<SpiceGuid>
I can't find a reference :(
dhil has quit [Ping timeout: 244 seconds]
seangrove has quit [Ping timeout: 240 seconds]
pierpa has joined #ocaml
<SpiceGuid>
modified preorder tree traversal is often abbreviated as MPTT
axiles has joined #ocaml
SilverKey has joined #ocaml
<SpiceGuid>
alas, MPPT also means Maximum Power Point Tracking
Algebr` has quit [Remote host closed the connection]
seangrove has joined #ocaml
yegods has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
dexterph has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
ontologiae_ has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
picolino has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
rand__ has quit [Ping timeout: 258 seconds]
SilverKey has quit [Quit: Halted.]
SIGILL has quit [Ping timeout: 250 seconds]
richi235 has quit [Ping timeout: 240 seconds]
richi235 has joined #ocaml
rand__ has joined #ocaml
zpe has joined #ocaml
ggole has quit []
zpe has quit [Ping timeout: 276 seconds]
Mercuria1Alchemi has quit [Ping timeout: 265 seconds]
ollehar has joined #ocaml
toolslive has quit [Ping timeout: 264 seconds]
slash^ has quit [Read error: Connection reset by peer]
<engil>
I do like how BS is very hype but yet everybody still use the good ol' jsoo
<engil>
momentum is useless if it doesn't pull people in
darkf has quit [Quit: Leaving]
rgrinberg has joined #ocaml
orbifx has joined #ocaml
toolslive has joined #ocaml
octachron has quit [Quit: Leaving]
<ollehar>
what tag number would I give to a block which is a reference variable?
<mrvn>
same as a not reference I think
<mrvn>
# type 'a ref = { mutable contents: 'a };;
<ollehar>
ah, wait, I had a bug, started counting from 1 like some kind of n00b.
<ollehar>
thanks mrvn
<mrvn>
does let x = ref 1.0 use Double_tag?
SilverKey has joined #ocaml
yegods has quit [Remote host closed the connection]
<ollehar>
not clear from the manual
<ollehar>
but
<ollehar>
1.0 is double tagged
<ollehar>
so ref 1.0, block pointing to Double_tag block?
<mrvn>
try it.
<ollehar>
yes, just have to do
<ollehar>
a := 10
<ollehar>
first
<ollehar>
a := 5
<ollehar>
(in malfunction syntax)
yegods has joined #ocaml
<mrvn>
type 'a r = { x : 'a; } let make x = { x } let t = make 1.0. What is t then? Tag 0 or Double_tag? Potentially both depending wether 'a is known at that point? Does every code accessing a double check the gat to see if it was Double_taged?
<ollehar>
and if it's an int it's not tagged?
<mrvn>
it's a record. It's always tagged
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
nicholasf has joined #ocaml
<ollehar>
uh, is Double_tag subject for change? not sure I can access that constant via malfunction.
<mrvn>
ollehar: who cares? Use the definition from the header file. If it changes your code gets the changed value.
<mrvn>
and (BLK/0 :TAG double <bits for a float>) is printed as simple 1.0
<ollehar>
will write a bug
<Drup>
inspect is a cool library, of which I pretty much use only 1 function. It does a lot of other nice things, it would make a great companion for any malfunction hacking
<ollehar>
yeah
<ollehar>
thanks for the tip!
Simn has quit [Quit: Leaving]
SpiceGuid has quit [Ping timeout: 258 seconds]
<ollehar>
but seriously, why not have a utop bot?
<ollehar>
with beer, and hookers...!
<ollehar>
in fact, screw the bot
<Drup>
(the truth is that I find everything that uses graphviz cool because :pretty dot: )
<Drup>
(the dot output from inspect is particularly marvelous)