keen________ has quit [Read error: Connection reset by peer]
lumikuuro has joined #ocaml
keen________ has joined #ocaml
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Nijikokun has joined #ocaml
<dmbaturin>
saml_: People often start with an abstract syntax evaluator, and if they are still convinced the idea is good, add the rest.
lordkryss has quit [Quit: Connection closed for inactivity]
nojb has quit [Quit: nojb]
manizzle has quit [Ping timeout: 245 seconds]
dubosec has joined #ocaml
moei has quit [Quit: Leaving...]
moei has joined #ocaml
hugomg has quit [Quit: Leaving]
Nijikokun has quit [Ping timeout: 264 seconds]
nonuby has joined #ocaml
ollehar has quit [Read error: Connection reset by peer]
ollehar1 has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
adc90 has joined #ocaml
ldopa has joined #ocaml
darkf has joined #ocaml
claudiuc has quit [Remote host closed the connection]
adc90 has quit [Quit: Page closed]
ldopa has quit [Ping timeout: 265 seconds]
t4nk212 has joined #ocaml
wraithm has joined #ocaml
<t4nk212>
Hello?
t4nk212 has quit [Client Quit]
MrScout has quit [Remote host closed the connection]
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
lumikuuro has quit []
s1n4 has joined #ocaml
idegen has quit [Quit: Leaving.]
saml_ has quit [Remote host closed the connection]
s1n4 has quit [Ping timeout: 245 seconds]
struktured has quit [Remote host closed the connection]
osa1 has quit [Ping timeout: 245 seconds]
wraithm has quit [Quit: leaving]
osa1 has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
mengu has joined #ocaml
osa1 has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
mengu has quit [Ping timeout: 252 seconds]
Nijikokun has joined #ocaml
Algebr` has quit [Ping timeout: 256 seconds]
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
AlexRussia has joined #ocaml
nonuby has quit [Ping timeout: 246 seconds]
ericwa has quit [Quit: Leaving...]
nonuby has joined #ocaml
A1977494 has joined #ocaml
A1977494 has quit [Client Quit]
siddharthv_away is now known as siddharthv
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
mengu has joined #ocaml
ggole has joined #ocaml
c74d has quit [Read error: Connection reset by peer]
c74d has joined #ocaml
mengu has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
manizzle has joined #ocaml
tane has joined #ocaml
ontologiae_ has joined #ocaml
ontologiae_ has quit [Ping timeout: 272 seconds]
freling has joined #ocaml
mengu has joined #ocaml
psy__ has quit [Ping timeout: 245 seconds]
martintrojer has quit [Max SendQ exceeded]
jonludlam has quit [Ping timeout: 245 seconds]
martintrojer has joined #ocaml
matason has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
thomasga has joined #ocaml
jonludlam has joined #ocaml
mengu__ has joined #ocaml
Haudegen has quit [Ping timeout: 276 seconds]
mengu has quit [Ping timeout: 252 seconds]
jonludlam has quit [Ping timeout: 252 seconds]
struktured has quit [Ping timeout: 245 seconds]
badon has joined #ocaml
Haudegen has joined #ocaml
freling has quit [Quit: Leaving.]
oscar_toro has quit [Ping timeout: 250 seconds]
<ia0>
how do persistent data structures relying on mutable states work with concurrency?
<dmbaturin>
ia0: Hhm, I always thought persistend and mutable are mutually exclusive.
<dmbaturin>
* persistent
<ousado>
that's kind of a contradiction..
<dmbaturin>
Or I misundertood your question.
<ousado>
yes
<ggole>
You need enough synchronization to prevent data races
<ousado>
as in, I have the same concept of persistent datastructure as dmbaturin
<ggole>
Persistent doesn't rule out internal mutation
<ggole>
You can stick a mutable cache in front of something, for instance
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
<ousado>
mhm, ok
<ggole>
Or a lazy_t: you always get the same answer, but there's mutation under the hood to avoid doing the work twice
<ousado>
arguably that should occur at a level that isn't exposed to the user, though
<ggole>
It's interal, right
<ggole>
The synchronization still needs to be there
<ggole>
*internal
<dmbaturin>
ia0: In any case, persistence doesn't automatically mean no locking, since it doesn't guarantee that a consumer will get exactly what it should.
<ggole>
It's the *user* that doesn't need to sync
<ia0>
ggole: ok I see, the data structures API should hide the synchronization
<ia0>
thx!
mort___ has joined #ocaml
mengu__ has quit [Ping timeout: 265 seconds]
nonuby has quit [Quit: Page closed]
Simn has joined #ocaml
<companion_cube>
ia0: it works if you use the equivalent of Haskell's MVar/TVar
<companion_cube>
unless you were talking about persistent arrays or this kind of trick?
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
oscar_toro has joined #ocaml
<ia0>
I mean persistent data structure for which under the hood something mutable is used (to save time or space) but in a way that the API remains pure
<ia0>
so it depends of the implementation
<ia0>
persistent arrays may be implemented in a pure way
<ia0>
about MVar/TVar, you meant how the user should use it? or the internals of the data structure API?
<ia0>
MVar looks to me as a way of synchronization, not where to use it
matason has quit []
matason has joined #ocaml
<companion_cube>
I thought you were refering to the opposite tradeoff: immutable structures in mutable references
<companion_cube>
but a concurrent implementation of persistent arrays "à la Filliâtre" might be slow
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
milosn has quit [Ping timeout: 276 seconds]
<ia0>
yes it might be slower if you only do sequential code
dsheets has joined #ocaml
<dmbaturin>
companion_cube: Who's Filliâtre and what that persistent array looks like?
<dmbaturin>
Interesting, never heard of that researcher before.
<tane>
"a wonderful standard library" :)
<flux>
maybe it was comparatively that at the time of writing it :)
Nijikokun has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
johnelse is now known as johnel_away
johnel_away is now known as johnelse
<xificurC_>
is batteries still actively maintained/developed? Do people use it? Would one recommend using it?
<xificurC_>
while for a seasoned user it might be nice to have a plethora of choices, for a newcomer like me it is quite hard to decide whether to not use antyhing, use core, batteries etc
<Leonidas>
xificurC_: batteries is more like OCaml Stdlib + some useful functions.
<xificurC_>
a comparison would be nice to have
<Leonidas>
xificurC_: Core OTOH makes programming OCaml feel quite a bit different
<Leonidas>
Core programs are completely different, they even change the argument orders of functions
<Leonidas>
xificurC_: I like both, in some way.
<Leonidas>
Batteries is still maintained, but less active than core.
<xificurC_>
Leonidas: you say bat is stdlib + funcs but I see many data structures as well
<Leonidas>
xificurC_: yes, the data structures that the stdlib was missing :)
<dmbaturin>
xificurC_: Yeah, the point is that batteries don't shadow anything.
<Leonidas>
I don't like the data structures that much
<Leonidas>
every time I have to deal with BatEnum :-/
<Leonidas>
Batteries can shadow the Stdlib, but in a compatible way: your code still runs
<Leonidas>
whereas opening Core.Std breaks your code.
<xificurC_>
and Core.Std is *huge*
<Leonidas>
I mean, it is also incredibly convenient.
<Leonidas>
it's "opinionated" as people in Ruby would say
<pippijn>
I like opinionated
michael_lee has joined #ocaml
<pippijn>
at least, if the opinions sortofkindof match mine
root_empire has joined #ocaml
<Leonidas>
they do match mine, so I'd tend to agree.
<flux>
apparently batteries works better in Windows environment? if that is a consideration.
<flux>
though was it so that Core folks too have some aspirations to get better at it?
<Leonidas>
flux: I heard Core_kernel works on Windows now
<Leonidas>
and I think that is 80% of what you'll probably need, I guess
<flux>
Core_kernel.. how big part of Core is that?
<flux>
these 'additional standard libraries' are still annoying when writing libraries
<Leonidas>
yes, I totally agree.
<Leonidas>
that's why extlib is still used, I'd guess
<flux>
ah, extlib & batteries & UTF8 :-)
<flux>
and linking trouble. not sure if it's been solved somehow yet.
<Leonidas>
linking trouble?
<flux>
there was some problem with the UTF8 package ExtLib provides, and then a library you use uses ExtLib and then you use directly Batteries and bang
<flux>
duplicate symbols
<Leonidas>
oh, I see
AlexRussia has quit [Quit: WeeChat 1.2-dev]
<flux>
basically I 'solved' it by recompiling ExtLib without UTF8
<Leonidas>
batteries should just become the stdlib and then people can use Core on top of that if they like :)
<quaranteigne>
.
<flux>
or ocaml 5.0 makes a clean break and switches to Core.. ;)
<xificurC_>
this exactly is a great newcomer barrier if you ask me
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
<Leonidas>
flux: that would cause a schism larger than that of Python 3.
<Leonidas>
xificurC_: why? just pick one that you like better and off you go
<flux>
in principle in ocaml it would be possible to make actually working program transformers that could deal even with big changes
<flux>
but I suppose no-one cares enough :)
<Leonidas>
flux: like 2to3? *hides*
<flux>
it's not really a great place to be to need to make a 'big' choice when you don't yet know much about OCaml
<flux>
leonidas, yes I mean in OCaml it could actually work ;)
<Leonidas>
well, OCaml 3.12 is still around
<xificurC_>
Leonidas: each lib requires an extra effort to learn. Having 3-4 standard libs is a duplication of effort
<Leonidas>
xificurC_: that's why RWO went with Core, no questions asked.
<Leonidas>
now if core get's rid of camlp4… :)
<xificurC_>
Leonidas: they are working on it
tashjash has joined #ocaml
<Leonidas>
so I heard. Which removes more and more of my initial objections
<companion_cube>
there's also containers ;)
<dmbaturin>
flux: On the other hand, while your programs are still small, the consequences of big choice are not big either. :)
<companion_cube>
if you want something really compatible with stdlib
<companion_cube>
(batteries has BatIO, which isn't compatible with stdlib channels)
shinnya has joined #ocaml
<companion_cube>
I'd have no objection to replace stdlib with Core in ocaml5 if: 1/ footprint was small 2/ no camlp4 3/ better doc
<dmbaturin>
companion_cube: Core has some C dependencies that prevent it from working on non-UNIX platforms, doesn't it?
<companion_cube>
I think so (although Core_kernel exists for this very reason)
<companion_cube>
same for batteries, which depends on Unix
thomasga has quit [Quit: Leaving.]
AltGr has left #ocaml [#ocaml]
<dmbaturin>
I think good support for unikernels and the most popular non-UNIX platform is important.
<Leonidas>
what was that again? OS/2?
<Leonidas>
:p
<companion_cube>
well, containers works on non-unix platforms ;)
<flux>
yeah I heard containers is a great library to check out!
<flux>
companion_cube, am I doin' it right?-)
<dmbaturin>
Leonidas: VMS, of course.
<flux>
companion_cube, only 67 commits away from #1000!
<companion_cube>
indeed, I didn't notice
<companion_cube>
flux: thanks for your enthousiasm :p
<dmbaturin>
Is there an easy to use library for reading INI-style configs e.g. into Map's?
<flux>
dunno exactly about that, but there is an INI-style config library
<dmbaturin>
flux: What's its name?
<flux>
I've used 'toml' the last time
<companion_cube>
there's a library for toml, which is pretty close to ini
<flux>
there is also ocaml-inifiles in opam but I haven't used it, probably
<Leonidas>
I tried =|< and =<<, but the problem is that you have to use parenthesis over the right side
<Leonidas>
because the operators are left associative
<Leonidas>
(I wanted to use pointfree style, that's why I am asking)
thomasga has quit [Quit: Leaving.]
freling has joined #ocaml
ollehar has joined #ocaml
<octachron>
Leonidas: you could redefine the operators to start with @ or an other right associative operator
mengu has joined #ocaml
asQuirreL has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
<Leonidas>
octachron: yes, I kinda wonder why they aren't, since they are meant to do exactly that, I think
* Leonidas
is unsure whether a bit additional cuteness warrants introducing more complexity. probably not.
djellemah has quit [Quit: Leaving]
Hannibal_Smith has joined #ocaml
thomasga has joined #ocaml
osa1 has joined #ocaml
djellemah has joined #ocaml
<nicoo>
Pointfree is pointless
<cmtptr>
pointliberated
jonludlam has quit [Remote host closed the connection]
jonludlam has joined #ocaml
siddharthv is now known as siddharthv_away
sdothum has joined #ocaml
matason has quit []
<haesbaert>
hmm I can't seem to find this, is there a function for jumping into the function declaration in merlin, I mean jumping to the function prototype in the .mli, not the definition in the .ml
mengu has quit [Remote host closed the connection]
<haesbaert>
that would be useful since the function documentation is usually in .mli
<quaranteigne>
haesbaert: in vim "let g:merlin_locate_preference='mli'"
<quaranteigne>
and then you just call locate as you usually would
<haesbaert>
ahhhhhh, awesomooo :D
<Leonidas>
quaranteigne: that is nice.
<haesbaert>
so I guess if I want to hold both behaviours I should make a function that sets the variable and call locate ?
<Leonidas>
I mostly would like to switch between ml and mli
<quaranteigne>
haesbaert: yes :)
<quaranteigne>
Leonidas: ?
<Leonidas>
quaranteigne: when I have a function in ml, I'd love to jump to its signature in mli and vice versa
<quaranteigne>
ok
<quaranteigne>
well, in general, it's not easy.
<haesbaert>
oh that is so awesome
<haesbaert>
quaranteigne: I love you.
badkins has joined #ocaml
<Leonidas>
merlin is the best tool since sliced bread, true :-)
oscar_toro has quit [Ping timeout: 248 seconds]
<quaranteigne>
:)
idegen has joined #ocaml
freling has quit [Quit: Leaving.]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
Haudegen has quit [Remote host closed the connection]
lordkryss has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
cow-orker has joined #ocaml
Haudegen has joined #ocaml
mengu has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
freling has joined #ocaml
mengu has quit []
osa1 has joined #ocaml
agarie has joined #ocaml
Haudegen has joined #ocaml
matason has joined #ocaml
ygrek has joined #ocaml
milosn has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
fraggle_ has quit [Read error: Connection reset by peer]
quaranteigne is now known as quaranterieur
matason has quit []
def` is now known as dora-molly
contempt has quit [Ping timeout: 255 seconds]
contempt has joined #ocaml
avsm has joined #ocaml
shinnya has joined #ocaml
ygrek has joined #ocaml
fedjo has quit [Remote host closed the connection]
matason has joined #ocaml
mearnsh has joined #ocaml
avsm has quit [Ping timeout: 250 seconds]
shinnya has quit [Ping timeout: 276 seconds]
<ollehar>
Leonidas: really? guess I should try install it again, then :P
ollehar has quit [Remote host closed the connection]
<Leonidas>
ollehar: well, I was quite blown away. Being able to infer types from random blocks of your code helps me a lot
Simn has quit [Ping timeout: 252 seconds]
thomasga has quit [Quit: Leaving.]
Denommus has quit [Ping timeout: 248 seconds]
thomasga has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<haesbaert>
quaranterieur: can you jump to for instance List.nth mli by changing the preference ?
<haesbaert>
I can go to List.mli if I issue the command on List, but if I try on the List.something it doesn't point to
uris77 has joined #ocaml
<haesbaert>
that only happens in stuff in the standard library, the packages installed through opam work fine
<quaranterieur>
hum
<quaranterieur>
you need to have .cmt[i] files for the stdlib
<quaranterieur>
if you want that to work
<quaranterieur>
It can jump to the module because it only needs the source file for that, but to jump to a precise point of the file, you need positions
<quaranterieur>
(which are in cmt files)
<haesbaert>
hmm but it's odd that the function prototype work C-a C-t (merlin-type-enclosing), which I assumed needed the cmti files as well
Algebr` has joined #ocaml
<quaranterieur>
no, just cmi :)
<haesbaert>
ohhhhhhhh, so I probably have the cmi, but not the cmti ?
<quaranterieur>
yep
<quaranterieur>
(you have the cmi for sure, the compiler needs it to compile your files)
<haesbaert>
is there any obvious way to generate the cmti files for stdlib ?
<quaranterieur>
(but cmt[i] files are just "bonus")
<quaranterieur>
(and rarely present)
<Drup>
they are installed in the next version of ocaml
<Drup>
which doesn't help you, but is already something.
<haesbaert>
I thought that was a build option, no ?
<Drup>
of the compiler, yes
<Drup>
but the build option was not enabled for the stdlib..
<haesbaert>
ah I see
thomasga has quit [Quit: Leaving.]
<haesbaert>
Drup: but the build option depends on whoever packages them no ?
agarie has quit [Remote host closed the connection]
lordkryss has quit [Quit: Connection closed for inactivity]
michael_lee has quit [Remote host closed the connection]
root_empire has quit [Remote host closed the connection]
kdef has joined #ocaml
s1n4 has quit [Quit: leaving]
avsm has joined #ocaml
slash^ has joined #ocaml
dsheets has quit [Ping timeout: 246 seconds]
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
dario_ has joined #ocaml
<dario_>
Hi everyone! Quick question: is there any lib out there offering an OCaml interface to all the "special" functions (gamma, erf, ...) from glibc?
<nojb>
I don't think so - but you could bind them easily using Ctypes
jabesed has joined #ocaml
<dario_>
nojb: Yes, I know how to create bindings, but I'm surprised they're not part of the stdlib or any of the extended stdlibs...
<dora-molly>
what about gsl?
<dora-molly>
And those functions are not standard, it makes sense not to make them available in the stdlib
<dario_>
I don't know about gsl, though it seems way overkill
<dora-molly>
(that wouldn't be portable)
<dario_>
dora-molly: you mean there's a world beyond glibc?... :-)
<dario_>
Anyway, thanks for the assistance. I guess I'll have to write those bindings after all...
lordkryss has joined #ocaml
<dora-molly>
dario_: The answer my friend, BSD 4.2, the answer BSD 4.2
<dora-molly>
I had some success with it not long ago
ygrek has quit [Ping timeout: 250 seconds]
Algebr` has quit [Remote host closed the connection]
agarie has joined #ocaml
manizzle has quit [Ping timeout: 264 seconds]
jwatzman|work has joined #ocaml
psy_ has joined #ocaml
dario_ has quit [Remote host closed the connection]
jabesed has quit [Ping timeout: 245 seconds]
meteo_ has quit [Ping timeout: 272 seconds]
freling has quit [Quit: Leaving.]
jonludlam has quit [Ping timeout: 264 seconds]
robink_ has quit [Ping timeout: 244 seconds]
nojb has quit [Quit: nojb]
robink_ has joined #ocaml
Denommus has joined #ocaml
agarie has quit [Remote host closed the connection]
<Denommus>
ok, I just configured merlin on Emacs and I'm impressed
<Denommus>
there's nothing like that for Haskell. It can even query the type for a locally scoped variable
freling has joined #ocaml
nojb has joined #ocaml
mort___ has quit [Ping timeout: 265 seconds]
agarie has joined #ocaml
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
<ousado>
it certainly deserves its name
Hannibal_Smith has quit [Quit: Leaving]
shinnya has joined #ocaml
Haudegen has quit [Ping timeout: 276 seconds]
Algebr has joined #ocaml
oscar_toro has joined #ocaml
avsm has quit [Quit: Leaving.]
<Denommus>
ousado: hm. Are you a Portuguese or Spanish speaker?
Haudegen has joined #ocaml
nojb has quit [Quit: nojb]
freling has quit [Quit: Leaving.]
agarie has quit [Remote host closed the connection]
manizzle has joined #ocaml
s1n4 has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
n3ss3s has joined #ocaml
agarie has joined #ocaml
Anarchos has joined #ocaml
Denommus has quit [Ping timeout: 244 seconds]
badkins has quit []
n3ss3s has quit [Ping timeout: 250 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
badkins has joined #ocaml
<apache2>
is it possible to have a record field named 'type'? if so, how do I define it?
<apache2>
type mypet = { type: int; name: string; }
<apache2>
doesn't work
<ggole>
No, type is a keyword. Call it ty or type_ or something like that.
<apache2>
type mypet = { pettype: int; name: string; } works
<apache2>
ggole: ok, thanks. is there any legit usecase where you'd have 'type' appear in the same spot, or is it just an artefact from the compiler?
<ggole>
It's a fairly arrangement to have keywords and identifiers be disjoint.
<ggole>
Er, a fairly standard arrangement
<apache2>
unfortunately "type" is also quite common in records
<cmtptr>
that doesn't make it any less bad, though
<cmtptr>
and it is kind of a shame for -- yeah, for the language to reserve a word that is such a commonly useful identifier
osa1 has joined #ocaml
<ggole>
Yeah, I've run into it
<ggole>
And begin/end, too.
A19774941 has joined #ocaml
A19774941 has left #ocaml [#ocaml]
agarie has quit [Remote host closed the connection]
osa1 has quit [Ping timeout: 276 seconds]
agarie has joined #ocaml
mort___ has joined #ocaml
larhat has joined #ocaml
osa1 has joined #ocaml
Algebr has quit [Ping timeout: 256 seconds]
n3ss3s has joined #ocaml
tane has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
slash^ has quit [Read error: Connection reset by peer]
fraggle-boate has joined #ocaml
fraggle-boate_ has quit [Ping timeout: 256 seconds]
rand000 has joined #ocaml
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
mengu has joined #ocaml
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ivan\ has joined #ocaml
osa1 has joined #ocaml
s1n4 has quit [Ping timeout: 255 seconds]
Denommus has joined #ocaml
AlexRussia has joined #ocaml
osa1 has quit [Ping timeout: 255 seconds]
<Denommus>
does OCaml has an equivalent idiom to Haskell's instance Monoid a => Monoid (Maybe a) where...?
<Drup>
you mean, typeclasses in general ?
<Denommus>
that is, I want some functions to exist for my external type if the internal type fulfill a condition
<Denommus>
should I use a functor?
<Drup>
yes, probably functor
<Drup>
depends what you want to parametrize
<Denommus>
Drup: I'm worried about the left size of the =>
<Drup>
bah, that's easy, it's the signature accepted by the functor
nojb has joined #ocaml
<Denommus>
Drup: hm. If I don't have a exact module for that, I just pass to the functor like module SomeFoo = Bar(struct type t = foo;; some_other_function x = ... end)?
_andre has quit [Quit: leaving]
<Denommus>
ok, thanks
osa1 has joined #ocaml
jonludlam has joined #ocaml
trptcolin has joined #ocaml
<Drup>
yes that works
<Drup>
(you don't need the ;;)
<ousado>
Denommus: no
<ousado>
Denommus: except for a few words
Hannibal_Smith has joined #ocaml
claudiuc has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
ggole has quit []
MercurialAlchemi has joined #ocaml
agarie has quit []
<n3ss3s>
is there a comprehensive list of ocaml operators somewhere
<n3ss3s>
I'm just starting out and I keep running into fairly exotic looking stuff like |> etc
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
trptcolin has quit [Quit: trptcolin]
Meths has quit [Ping timeout: 256 seconds]
ericwa has joined #ocaml
shinnya has quit [Ping timeout: 246 seconds]
tane has quit [Quit: Verlassend]
kakadu_ has joined #ocaml
asQuirreL has quit [Ping timeout: 246 seconds]
asQuirreL has joined #ocaml
mengu has quit [Ping timeout: 250 seconds]
trptcolin has joined #ocaml
Algebr has joined #ocaml
<Denommus>
Drup: netwire does some lazyness magic for (<*>)
<Drup>
not really surprising
<Drup>
do you know any haskell library with efficiency in mind that don''t do weird stuff with lazyness ?
<Denommus>
Drup: I'm thinking about our WGen being ((unit -> float) -> 'a -> 'b * ('a, 'b) wire lazy_t) -> ('a, 'b) wire instead of not being lazy
martintrojer has quit [Ping timeout: 245 seconds]
martintrojer has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
<Denommus>
no, wait, I think it isn't needed
ncthom91 has joined #ocaml
<ncthom91>
hi all. Is there any way to execute javascript via ocaml? For example, Java has an embedded JS engine called Rhino, and another called Nashorn, C++ programs can embed Node.js, etc. Is there anything in this vein for ocaml?
<Drup>
I think there are bindings to node js
<ncthom91>
Drup really?
<ncthom91>
that would be *perfect*
<jeffmo>
Drup: ncthom91: At minimum, ocaml has a c api, and node does too..
<Drup>
ncthom91: by curiosity, why ?
<ncthom91>
Drup just satisfying some curiousities of my own around frontend web asset tooling
<Drup>
flowtype might be relevant, then
<ncthom91>
Drup facebook's type checker?
<ncthom91>
jeffmo do you have experiene with Node's C API?
<jeffmo>
(ps I work on flowtype at FB — flowtype doesn’t actually execute JS from ocaml, though)
<Denommus>
ncthom91: you can full OCaml in the frontend with js_of_ocaml
<Denommus>
yay, arr and app implemented
<Denommus>
ap
<Denommus>
maybe I should call it "apply"
rand000 has quit [Quit: leaving]
<ncthom91>
jeffmo cool, yea I didn't think flow did any execution. I have a sort of different question about flow though: the flow CLI initially spins up a local server, and then subsequent commands make requests at the local server, right?
rand000 has joined #ocaml
<jeffmo>
ncthom91: for the common case, yea (though there is a ‘flow check’ command that will do everything in-band)
<ncthom91>
jeffmo how does the client communicate with the server? Unix domain sockets?
<ncthom91>
wow i didn't realize flow was such a huge project
<jeffmo>
ncthom91: everything under the “hack” dir is vendored libs that we share with hacklang (our gradual type system for php/hhvm) — most of the Flow-specific stuff is under <root>/src
<ncthom91>
got it
dav_ has joined #ocaml
dav_ has quit [Client Quit]
<jwatzman|work>
ncthom91: if you're interested in the low-level details, i gave a talk https://www.youtube.com/watch?v=aN22-V-b8RM a few weeks ago; the first half is about the Hack type system, but the second half (starting about 39:05) is about some of the tech details, many of which are shared with Flow
<jwatzman|work>
ncthom91: the second part isn't entirely relevant to Flow, but the gist of the threading and shared heap is all shared
<jeffmo>
^^ good stuff
thegameg has quit [Ping timeout: 265 seconds]
<ncthom91>
cool, will check it out
<n3ss3s>
ugh
<n3ss3s>
So I began to use core in a small piece of code, and now when I compile I get a syntax error on the last character of the file (characters 0 to 0 on an empty line)
<n3ss3s>
the compiler says syntax error on line 65, chars 0 to 0
thegameg has quit [Ping timeout: 265 seconds]
<n3ss3s>
as you can see, there isn't a line (let alone one with code) on 65
<smondet>
n3ss3s: on line 31 your toplevel definition ends with `;`
<smondet>
(you should remove it)
uris77 has quit [Remote host closed the connection]
<smondet>
(or add `()` afterwards)
<n3ss3s>
ah sorry for the confusion that's a remnant from me trying to fix the error
<n3ss3s>
if I uncomment what starts on line 32
<n3ss3s>
I still get the syntax error on 65
<n3ss3s>
oh
<n3ss3s>
sec
<j0sh>
pwd
<j0sh>
oops
bjorkintosh has quit [Quit: Leaving]
<n3ss3s>
ok got that particular error resolved, in the end the culprit was another top-level semicolon
<n3ss3s>
(line 37, after commenting out lines 40 and 41)
vpm_ is now known as vpm
Algebr has quit [Remote host closed the connection]
<ncthom91>
jwatzman|work this talk is awesome. (I skipped to the second half, this definitely got interesting fast). I'm curious about how you confined each fork to the same memory region.. is that part of the code in the open source repo?
rand000 has quit [Quit: leaving]
Hannibal_Smith has quit [Quit: Leaving]
thegameg has joined #ocaml
<jwatzman|work>
ncthom91: each fork is mostly just a normal fork -- separate memory space etc. the only magic is that, before the fork, we have one mmap'd region with MAP_ANON|MAP_SHARED to be shared b/w the forks
Simn has quit [Quit: Leaving]
<jwatzman|work>
ncthom91: so the ocaml heap is not shared -- we don't have to worry about threading and the ocaml gc. but we have one magic region that we manage via some C ffi code that is shared
<jwatzman|work>
ncthom91: this is all open source, let me find a link, hol don
<ncthom91>
"THERE IS NO BUT! DONNY YOU'RE OUT OF YOUR ELEMENT!" lol! Great comment
<n3ss3s>
Drup: Ok, so now I've properly identified the real problem. Currently, the compiler will say that writer should return unit. However, if I take out line 40 (and the semicolon on 39), then on line 50 Curl.set_writefunction will cause an error because it expects something that returns int
<jwatzman|work>
ncthom91: it's a little more generic than that comment lets on -- hack and flow both use it -- but yeah if you use it as a generic atomic hashtable you're in for a surprise
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
trptcolin has quit [Quit: trptcolin]
trptcolin has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
<ncthom91>
jwatzman|work this is very cool stuff. I was unaware that threading in ocaml was a nightmare
<jwatzman|work>
ncthom91: the GC is single-threaded, which makes the whole thing kind of a non-starter IMO :)
<jwatzman|work>
(i also don't want to deal with atomic / synchronization code in anything except C, to be honest)
<ncthom91>
why does the GC being single-threaded a deal breaker? (This is pretty new territory for me; most of my programming experience is frontend/javascript)
trptcolin has quit [Client Quit]
<jwatzman|work>
ncthom91: well, what do you do when you have two threads that both need to allocate and invoke the GC? either, you stop the entire world to GC, or you crash :)
larhat has quit [Quit: Leaving.]
<ncthom91>
oh i see. So basically your concurrency frequently gets halted so the GC can run
<jwatzman|work>
yeah... i'm actually not sure exactly how ocaml does this by default; their "threads" might actually be single-threaded (this is what SML does)
<jwatzman|work>
we just decided to roll our own and sidestep all of this
<ncthom91>
but in your case, "threads" are actually processes
<jwatzman|work>
ncthom91: yeah i guess, though that's really a technicality since there is shared memory between them :)
<ncthom91>
good point :)
<jwatzman|work>
(ie, in linux, the only difference between fork and creating a new thread is the set of things that are marked shared vs copied -- it's the same syscall IIRC)
<Drup>
in pure ocaml 1) "threads" are single-threaded 2) no shared memory
<Drup>
OCaml code can be concurent, not parallel, period
<jwatzman|work>
Drup: thanks, that's what i thought
<Drup>
(but concurrency works perfectly fine)
<jwatzman|work>
we really needed the parallelism, FB dev machines have 32 cores, so parallelism is a ~32x speedup (functions parallelize really nicely)
Denommus has quit [Quit: going home]
<Drup>
oh sure, in your case it totally made sense :p