<Drup>
but yes, overall familiarity is a good first step :D
<daftluck>
So... I was bored and wrote a naive order-2 Markov chain generator in OCaml for fun to learn the language. Once I publish the code, would anyone like to critique it so I get better at the language?
<rgrinberg>
daftluck: go for it
<rgrinberg>
if you use reddit then r/ocaml is a great candidate for that sort of thing
<rgrinberg>
we don't see much traffic here
<rgrinberg>
there*
<daftluck>
Cool, thanks.
<Drup>
I agree with the reddit proposition
ygrek has joined #ocaml
bytbox has joined #ocaml
mji has joined #ocaml
<mji>
Hi all. Any chance anyone knows the answer to this? I'm working on a project with a custom module called String, but I'd like to get at some of the core library String functions as well. Is there any way to do this?
<Drup>
Don't call your internal module String.
<Drup>
It's a bad idea
<mji>
It's a coq export and a bunch of the code relies on it as a result. Hard to get around now but yeah I understand that
<mji>
No other way to access it without renaming my string?
<Drup>
not really, no :/
<Drup>
if your new string is a submodule of Foo, you can do "module S = Foo.String" and use it like that
<mji>
hmm sounds like i've got some work to do then. Thanks
q66 has quit [Quit: Leaving]
<t4nk387>
Hey :)
<Drup>
mji: or alias String, it works as well :)
<Drup>
(the new String is necessarily a submodule anyway, the compiler would refuse it otherwise)
<t4nk387>
Is rgrinberg here?
<rgrinberg>
t4nk387: yeah
<t4nk387>
Hey again
<t4nk387>
I tried figuring out that problem
darkf has joined #ocaml
<t4nk387>
I had some issues with it though
<t4nk387>
I didnt know what the acc should start off being
<rgrinberg>
your call to fold_left should be made with xs i believe
<rgrinberg>
not list
<rgrinberg>
your already handling the first element in your acc
<t4nk387>
darn
<t4nk387>
Cheers
<t4nk387>
didnt spot that
<rgrinberg>
hence you ended up double counting your 1
<t4nk387>
Done
<t4nk387>
Thank you so much :D
<t4nk387>
<3
<t4nk387>
Sometimes I hate ocaml, sometimes I love it
<rgrinberg>
np
<t4nk387>
Still getting used to functional programming
<rgrinberg>
i dont know how much you learned about the algorithm itself but i think you understand how to turn simple recursion into folding by now :D
<t4nk387>
Hell yeah I did :P
<t4nk387>
I shall certainly be using fold in the future
<t4nk387>
instead of rec
<t4nk387>
And I shall remember your name in case I have more issues :P
<t4nk387>
Did I hear there was an ocaml subreddit?
<daftluck>
There is! Keep an eye out for articles on Markov chain generators. :P
<t4nk387>
hahaha ;)
<t4nk387>
Im going to pretend I know what that is
<t4nk387>
Anyway, goodnight all!
<rgrinberg>
night!
<rgrinberg>
reddit.com/r/ocaml
t4nk387 has quit [Quit: Page closed]
samrat has joined #ocaml
<struktured>
daftluck: markov chain generators?
<struktured>
daftluck: got a project link?
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
chaptastic has quit [Read error: Connection reset by peer]
Submarine has quit [Remote host closed the connection]
chaptastic has joined #ocaml
manizzle has joined #ocaml
marynate has joined #ocaml
dav has quit [Remote host closed the connection]
dav has joined #ocaml
mji has quit [Quit: Leaving]
samrat has quit [Quit: Computer has gone to sleep.]
larhat has quit [Quit: Leaving.]
chinglish has joined #ocaml
JokerDoom has quit [Ping timeout: 245 seconds]
ggole has joined #ocaml
mearnsh has quit [Ping timeout: 272 seconds]
mearnsh has joined #ocaml
jcloud has quit [Ping timeout: 272 seconds]
jcloud has joined #ocaml
Submarine has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
<daftluck>
Hey, struktured! Sorry, I was away. I'm gonna throw the code up on GitHub shortly after I make some cosmetic changes.
<daftluck>
I should warn you, though: it's a bit naive. I think I could definitely tail-call optimize some stuff, and I definitely do multiple operations on a list that I think degrades performance with a large corpus.
ygrek has quit [Ping timeout: 244 seconds]
<daftluck>
It takes about five minutes to prepare a hash table with a 4.2-MB plain-text version of the KJV Bible, which seems long.
samrat has joined #ocaml
<ggole>
Is it just a plain Hashtbl.t?
<ggole>
And did you presize it?
<daftluck>
Polymorphic Hashtbl.t. Keys are (string * string). Alas, I did not presize it, which would explain slowness.
<ggole>
I would consider specialising that, polymorphic hashtables can be a bit slow
<daftluck>
Yeah, Real World OCaml tried to warn me. :P
<ggole>
I think rehashing involves invoking equal, so there might be a bit of a cumulative effect too
rgrinberg has quit [Quit: Leaving.]
jao has quit [Ping timeout: 244 seconds]
<daftluck>
How so?
<ggole>
If your (polymorphic) equal is slow, and lack of presizing leads to calling it more often, you get bit harder.
<daftluck>
Aah.
<daftluck>
I'll add that to my list of improvements for v2.0. ^_^
<daftluck>
I definitely want to fix it up.
rgrinberg has joined #ocaml
psy_ has quit [Ping timeout: 264 seconds]
segmond has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
WraithM has joined #ocaml
psy_ has quit [Max SendQ exceeded]
n1ftyn8 has quit [Ping timeout: 272 seconds]
n1ftyn8 has joined #ocaml
segmond has joined #ocaml
arj has joined #ocaml
MercurialAlchemi has joined #ocaml
WraithM has quit [Ping timeout: 245 seconds]
divyanshu has quit [Ping timeout: 272 seconds]
JokerDoom has joined #ocaml
divyanshu has joined #ocaml
pyx has joined #ocaml
<struktured>
daftluck: cool looking forward to seeing it nevertheless
pyx has quit [Client Quit]
rgrinberg has quit [Quit: Leaving.]
ygrek has joined #ocaml
ggherdov has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
keen________ has quit [Read error: Connection reset by peer]
keen________ has joined #ocaml
mearnsh has quit [Ping timeout: 272 seconds]
mearnsh has joined #ocaml
ggherdov has joined #ocaml
jgjl has joined #ocaml
mearnsh has quit [Ping timeout: 272 seconds]
mearnsh has joined #ocaml
nox__ has quit [Ping timeout: 272 seconds]
Arsenik has joined #ocaml
nox_ has joined #ocaml
psy_ has joined #ocaml
larhat has joined #ocaml
ggole_ has joined #ocaml
davine has joined #ocaml
davine has left #ocaml [#ocaml]
ggole has quit [Ping timeout: 264 seconds]
oscar_toro has joined #ocaml
ggole_ is now known as ggole
matason has joined #ocaml
dav has quit [Ping timeout: 256 seconds]
dav has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
milosn has quit [Ping timeout: 245 seconds]
antinomy has quit [Ping timeout: 265 seconds]
dav_ has joined #ocaml
dav has quit [Ping timeout: 240 seconds]
jonludlam has quit [Quit: Coyote finally caught me]
art-w has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Quit: Leaving.]
fraggle-boate has quit [Ping timeout: 264 seconds]
milosn has joined #ocaml
art-w has joined #ocaml
fraggle-boate has joined #ocaml
fraggle-boate has quit [Ping timeout: 250 seconds]
arj has quit [Ping timeout: 260 seconds]
fraggle-boate has joined #ocaml
kakadu has joined #ocaml
arj has joined #ocaml
<ygrek>
can I put @@ocaml.deprecated in .ml ?
<ygrek>
looks like it is only checked on signatures?
<whitequark>
it is afaik
<companion_cube>
o/
<ygrek>
poor me
lopex has joined #ocaml
chambart has joined #ocaml
AlexRussia has quit [Ping timeout: 252 seconds]
oscar_toro has quit [Remote host closed the connection]
Simn has joined #ocaml
ikaros has joined #ocaml
AlexRussia has joined #ocaml
<arj>
there were some nicely formatted online docs for opam packages. Where were they again?
<companion_cube>
opam-doc isn't ready yet afaik
<whitequark>
it's not.
<arj>
but there was some website (at least for core)
<arj>
My history seem to have lost it and I can't find it anymore :/
<arj>
ah yes! :) it said opam documentation, so I thought it was opam related.
<arj>
thanks
<companion_cube>
it's generated by a version of opam-doc afaict
eyyub has joined #ocaml
jonludlam has joined #ocaml
dsheets has joined #ocaml
chambart has quit [Ping timeout: 245 seconds]
Submarine has quit [Quit: Leaving]
axiles has quit [Quit: Quitte]
koderok has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
eyyub has quit [Ping timeout: 252 seconds]
axiles has joined #ocaml
Arsenik has quit [Remote host closed the connection]
<companion_cube>
whitequark: if I fix the generation of documentation in containers, should I alter the tag (ugly), make a bugfix release or wait for the next release?
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oscar_toro has joined #ocaml
<whitequark>
either works
chambart has joined #ocaml
eyyub has joined #ocaml
<whitequark>
although I'd not change a tag referenced elsewhere
<companion_cube>
this will probably wait for the next release then, if you don't mind
<companion_cube>
agreed
<companion_cube>
so, you install documentation locally?
<whitequark>
I dunno, I have that turned on for some reason
<whitequark>
I don't think it actually installs it
<whitequark>
I run it also on CI
jgjl has joined #ocaml
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
rand000 has joined #ocaml
nox_ is now known as nox
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
HACKING-FACEBOOK has joined #ocaml
lordkryss has joined #ocaml
oscar_toro has quit [Ping timeout: 272 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
mfp has quit [Read error: Connection reset by peer]
<BitPuffin>
the bytecode interpreter is written in portable ansi C right?
<companion_cube>
C99 now, I think
<BitPuffin>
ah :/
<gasche>
the use of C99 is relatively minimal
<gasche>
but "portable", I don't think so
<BitPuffin>
was thinking if so maybe I would bootstrap my language in ocaml but if not then I guess I won't :P
hugomg has joined #ocaml
<whitequark>
and what is the platform which doesn't have C99?
<whitequark>
DOS?
<BitPuffin>
not sure if plan9 has it for example
<BitPuffin>
whitequark: windows 8.1? :P
<whitequark>
neither it has C89
<BitPuffin>
well unless you count gcc
<BitPuffin>
well, it has almost c89
<whitequark>
the parts which ocaml uses work on windows
<whitequark>
and the two users of plan9 will certainly be able to build it themselves
<ggole>
I suspect non-MS C99 compilers are available even on DOS
<whitequark>
ggole: that's apparently an issue.
<whitequark>
don't ask why I know.
<gasche>
the interpreter uses threaded code with variable labels, but there are #ifdef around this part
<BitPuffin>
whitequark: well I want to be able to port my language to all the weirdest places :P
<BitPuffin>
so I figured C89 or something written in C89 would be the best option
<BitPuffin>
and I like ocaml, it's fun
<ggole>
whitequark: which bit is an issue? non-MS or DOS?
<whitequark>
ggole: C99, apparently no one really makes that for DOS
<ggole>
Hmm.
<whitequark>
without extenders, that is.
samrat has joined #ocaml
<whitequark>
with DJGPP or similar you can easily find them
<BitPuffin>
what about freedos? does that have C99=
<gasche>
doesn't gcc run on those architectures?
koderok has quit [Quit: koderok]
<gasche>
(systems)
<whitequark>
gasche: not in pure realmode
<BitPuffin>
whitequark: is byterun c99 as well? or just bytecomp
<whitequark>
BitPuffin: build it with --std=c99 and you will see
<BitPuffin>
you mean -std=c89
<companion_cube>
gasche: my grief with clone is it's too complicated, and combinators make it worse
<companion_cube>
here I only suggest a "saver" function
<companion_cube>
grr
<companion_cube>
save/restore functions for the base iterator
<gasche>
I think you could simplify clone by assuming you only require semi-persistence
<gasche>
that is, the fact that you never go back to the main enum after you start using the cloned one
<whitequark>
BitPuffin: the three commits that refer to C99 are about {,u}int{32,64}_t, memcpy, snprintf, and built-i 64-bit type
<gasche>
which is enough for many backtracking use-cases
<gasche>
BitPuffin: another solution is to use OCamlCC that compiles OCaml bytecode into C code
<whitequark>
companion_cube: so I can solve my problem by doing Gen.persistent_lazy
<whitequark>
and then Gen.start to continue iterating
<whitequark>
I wonder how inefficient that is, especially after many iterations?
<gasche>
you still have to compile the runtime, however
tane has joined #ocaml
<whitequark>
companion_cube: I have a feeling it will add one level of closures on every backtrack
<companion_cube>
whitequark: oh, right
Hannibal_Smith has joined #ocaml
Hannibal_Smith has quit [Read error: Connection reset by peer]
<companion_cube>
whitequark: if you look into gen.ml, there is the "MList" module
Hannibal_Smith has joined #ocaml
Hannibal_Smith has quit [Read error: Connection reset by peer]
<companion_cube>
it is the storage used by persistent/persistent_lazy and should provide a relatively efficient access by index
<whitequark>
I don't need access by index though
<companion_cube>
sure
Hannibal_Smith has joined #ocaml
Hannibal_Smith has quit [Read error: Connection reset by peer]
<companion_cube>
but that could be the basis of your checkpoints
<companion_cube>
if it were exposed properly
<BitPuffin>
whitequark: hmm, as far as I'm aware a lot of the platforms that c89 is the only supported the inttypes.h header is available
<BitPuffin>
and probably memcpy snprintf as well
<BitPuffin>
what do you mean by built-i 64-bit type?
<BitPuffin>
gasche: it generates ansi c?
<whitequark>
uint64_t should be available.
<BitPuffin>
yeah, at least if it's 64 bit :P
<whitequark>
hm?
<BitPuffin>
replacing memcpy with a sloer portable one is also easy
<whitequark>
uint64_t can as well be available on a 8-bit platform
<BitPuffin>
yeah I guess
<companion_cube>
whitequark: so, save/restore would fit your needs?
<companion_cube>
rather than persistent (which might not be optimal anyway)
<BitPuffin>
whitequark: what do you think about memcpy then?
<BitPuffin>
and the others
<companion_cube>
also I suppose, for efficient backracking, you need Unix.lseek
<BitPuffin>
snprintf
<companion_cube>
or some memory mapping
<companion_cube>
ooohhhh there's seek_in
<companion_cube>
never mind
bytbox has quit [Remote host closed the connection]
ikaros has left #ocaml ["Ex-Chat"]
<whitequark>
BitPuffin: it's your platform, figure out what it supports or does not
<whitequark>
companion_cube: yse
<companion_cube>
ok, I can try to support this
<whitequark>
BitPuffin: imo any attempt to write pre-c99 code today is a complete waste of time anyway
<companion_cube>
+1
<companion_cube>
(except embedded systems, I guess)
<whitequark>
nah
<whitequark>
embedded migrated to c99 long ago too
<companion_cube>
ok
<whitequark>
well, there are a few outliers like sdcc with pic16 or 8051, but who cares
<whitequark>
*pic8
<companion_cube>
whitequark: if you wish, I can try to write a basic proof of concept of save/restore for Gen, + IO functions
<whitequark>
any embedded worth doing has c99.
<whitequark>
companion_cube: that would really help
<BitPuffin>
whitequark: I agree but a lot of platforms only support c89
<BitPuffin>
c89 is a pain in the ass
<whitequark>
very few platforms worth using only have c89
<whitequark>
lack of even c99 means nothing interesting runs there
toolslive has joined #ocaml
<BitPuffin>
whitequark: well I'd argue that p9 is interesting and it has c based on ansi with ommisions and extensions :P
<BitPuffin>
but yeah I reckon ocaml _should_ be portable enough for at least an initial bootstrapping interpreter
<toolslive>
I'm having some problems with ctypes: I try to wrap the statvfs struct in sys/statvfs but the structs definition is full of #ifdefs. Can I handle this in a generic way?
<whitequark>
no
<whitequark>
this is really the worst possible case for wrapping
<toolslive>
any suggestions here?
<whitequark>
write the wrapper in C
<whitequark>
perhaps abstract it in C and use ctypes around that
AltGr has left #ocaml [#ocaml]
shinnya has joined #ocaml
<companion_cube>
ok, it's not totally trivial to find a good interface for save/restore
<BitPuffin>
aw
<BitPuffin>
the ocaml cygwin package is outdated
_5kg has quit [Ping timeout: 240 seconds]
<adrien>
it targets cygwin anyway
<BitPuffin>
I know
<BitPuffin>
but it's nice to have it installed via a package manager :P
<daftluck>
So apparently the ^ operator allocates a new string every time.
<companion_cube>
yes
<daftluck>
That would also explain my slowness problems. :P
<companion_cube>
if you want to concatenate a lot of strings, consider using Buffer instead
badkins has quit [Ping timeout: 258 seconds]
<daftluck>
Thanks, I'll give that a look.
seanmcl has joined #ocaml
tane has quit [Ping timeout: 272 seconds]
<daftluck>
Honestly, I should just go straight from reading in lines to populating the hash table; I could avoid a lot of intermediate, unnecessary steps.
<daftluck>
I just need to handle the case of splitting an n-gram across lines.
<daftluck>
Which shouldn't be hard.
badkins_ is now known as badkins
<ggole>
daftluck: what are you actually doing?
<citrucel>
join #machinelearning
citrucel has left #ocaml [#ocaml]
<daftluck>
Generating text with Markov chains.
darkf has quit [Quit: Leaving]
chaptastic has quit []
<ggole>
So you're collecting words? If you have a whole bunch, maybe a simple lexer would be the way to go.
ygrek has joined #ocaml
<ggole>
That would avoid constructing temporary strings even for the lines.
jgjl has joined #ocaml
<whitequark>
sedleeeex
<companion_cube>
whitequark: do you know how sedlex' regex matching engine works?
<companion_cube>
(especially, how it handles unicode)
<whitequark>
companion_cube: I had a cursory look at it. why?
<companion_cube>
because Re doesn't have unicode and it's not obvious how to handle it
<companion_cube>
(jump table based on characters do not work anymore with unicode)
<whitequark>
why not?
jgjl has quit [Client Quit]
<whitequark>
sedlex uses a jump table
<companion_cube>
because the jump table would be arbitrarily large?
<whitequark>
oh, it does some binary search kinda thing
<companion_cube>
if it's on codepoints, I mean
<companion_cube>
ok
<whitequark>
look at the output
<companion_cube>
like, a "sparse" jump table?
<whitequark>
yes, exactly
<ggole>
You could do the common case (ascii) as a guarded jump table
<whitequark>
it's several (think under five) ifs plus an array lookup per character
<companion_cube>
oh, but it *generates* the code for the lookup table? that will not do for Re
<whitequark>
hmmm
<whitequark>
how so?
<companion_cube>
it might be slower (too slow)
<whitequark>
you can do the exact same thing using ... ... ... a closure
<companion_cube>
otoh maybe it's still ok if the table is a tree
<whitequark>
it will even have the exact same speed for ASCII
<whitequark>
because it will simply have no partitions at all
<whitequark>
so just an array lookup.
tani is now known as tane
<companion_cube>
(if c < 255 then lookup_table else decision_tree) ?
<whitequark>
no, just always decision_tree
nojb has quit [Quit: nojb]
<ggole>
That *is* a decision tree, really
<whitequark>
if the range from first to last known character is less than 8192, sedlex generates just one table
<ggole>
Just one that's rather favourable to ascii
<whitequark>
generally, it does not generate table bigger than 8192
<whitequark>
so if you need a bigger range, it makes more tree nodes instead
<companion_cube>
ok, ok
<companion_cube>
of course it matches on codepoints, I suppose
<whitequark>
yes
<whitequark>
Re also matches on ints internally
<companion_cube>
ints that are actually ascii bytes
<whitequark>
so? it doesn't matter
<companion_cube>
but I get the point, it's possible to combine array lookups with more complicated decision trees
<whitequark>
unless it assumes elsewhere that those ints are < 255, which is incredibly bad design
<whitequark>
(how about "private int")
<whitequark>
companion_cube: yeah, I think modifying it is trivial
<companion_cube>
currently it assumes the ints are < 255 I think, since there is no decision tree
<whitequark>
well, maybe it would just generate a really big table
<companion_cube>
not a good idea for unicode ^^
<whitequark>
so, Re would need to add decision tables, parse the regexps with Uutf, and use Uucd for character classes
<companion_cube>
yep :s
<companion_cube>
well, probably use Uucd for classes, but be generic on its source of codepoints
<companion_cube>
(which could be a rope, or Uutf on some channel, or...)
<whitequark>
I mean for regexps themselves
<whitequark>
not input
<companion_cube>
oh right
<companion_cube>
well Re can also build regex from combinators
<whitequark>
not mutually exclusive
<MercurialAlchemi>
that's the thing I found most interesting about it
<MercurialAlchemi>
companion_cube: looks like the PR I made for toml is going to be a go (convenience functions)
<companion_cube>
neat
<companion_cube>
btw, did you notice something about the parse error's locations
<MercurialAlchemi>
less bytes sacrified to the gods of API churn
<companion_cube>
?
<MercurialAlchemi>
hm, no?
<MercurialAlchemi>
they're wrong?
<companion_cube>
looked like it, would be nice if you confirmed
<MercurialAlchemi>
I'll try and have a look
<MercurialAlchemi>
if I can't make it work, I'll hook up a random int generator for the line and column
<whitequark>
wow, unicode normalization is such an enormous pain
<daftluck>
ggole: I'm collecting lines, but eventually they'll all be split into individual words, yeah.
<daftluck>
I'm guessing ocamllex would be the way to go for lexing.
<whitequark>
sedlex.
<whitequark>
ocamllex doesn't handle unicode
<daftluck>
Aah.
<daftluck>
Oh yeah. Scrollback.
koderok has joined #ocaml
jonludlam has quit [Quit: Coyote finally caught me]
koderok has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
<companion_cube>
too bad sedlex requires 4.02
ygrek has joined #ocaml
<nicoo>
companion_cube: Y'a moyen de te remotiver sur batteries-ng si t'as de l'aide ? :3
<Drup>
nicoo: wrong chan :)
<Drup>
(or wrong language)
<MercurialAlchemi>
companion_cube: I'll need to investigate some more, it does seem off sometimes
<nicoo>
Oops
<nicoo>
companion_cube: Could you be convinced to work again on batteries-ng, asusming some people help you?
<MercurialAlchemi>
(which is kind of odd, it's a) not rocket science and b) copy-pasted from the doc)
<Drup>
(nicoo: my understanding was that it was not an issue of manpower, but of acceptance ...)
<MercurialAlchemi>
do we also have a batteries-ng ?
<MercurialAlchemi>
or is this just a branch with more stuff ?
<Drup>
not more, less :D
<nicoo>
Drup: I remember C³ complaining about it being too much effort, but that might be my being sleep-deprived
<companion_cube>
it's a lot of efforts, especially if it's not merged in the end
<companion_cube>
batteries needs to have things *removed*, not really added
<MercurialAlchemi>
right
boogie has quit [Quit: Leaving...]
larhat has joined #ocaml
Valdo has quit [Excess Flood]
<Drup>
companion_cube: it was too much effort to split all the stuff up, no ?
Valdo has joined #ocaml
nojb has joined #ocaml
<companion_cube>
which splitting are you talking about precisely?
<companion_cube>
splitting into unix/non-unix was done in batteries-light
<Drup>
splitting the patch
<companion_cube>
ah
HACKING-FACEBOOK has quit [Ping timeout: 272 seconds]
nojb has quit [Quit: nojb]
chaptastic has joined #ocaml
rand000 has quit [Ping timeout: 250 seconds]
<companion_cube>
nicoo: why do you care about batteries anyway?
bytbox has joined #ocaml
<nicoo>
companion_cube: I use it :o
<adrien>
you're so 2014!
<companion_cube>
:)
<companion_cube>
nicoo: what do you use inside?
jonludlam has joined #ocaml
bytbox has quit [Ping timeout: 255 seconds]
struktured has quit [Ping timeout: 258 seconds]
<nicoo>
adrien: I think you have future-shock
<nicoo>
companion_cube: Result (seriously, life without an error monad isn't worth living :þ) BitSet, Option, and a lot of the functions added to stdlib's module when it makes sense.
planetlarg has joined #ocaml
<companion_cube>
BitSet is a bitvector?
<companion_cube>
well, nothing containers doesn't provide
<companion_cube>
but of course I understand you stick to batteries
<companion_cube>
do you use BatIO or BatEnum, just for my personal statistics? :)
struktured has joined #ocaml
bytbox has joined #ocaml
<nicoo>
Ahahahahahahahah
<nicoo>
Enough said.
<nicoo>
companion_cube: Basically, I've been sticking to batteries when it is in a potentially-public-facing API
matthewhill has joined #ocaml
matthewhill has quit [Client Quit]
<nicoo>
But I might just give up and jump on the containers bandwagon, I'm already using it for personal stuff :þ
<companion_cube>
:D
<companion_cube>
hmm yeah, of course, if you expose batteries' types, it's hard to change your API
<companion_cube>
(that's why I like structural types)
milosn has quit [Ping timeout: 260 seconds]
arj has quit [Quit: Leaving.]
planetlarg has quit [Ping timeout: 255 seconds]
rgrinberg has joined #ocaml
ontologiae has joined #ocaml
<adrien>
nicoo: you don't have to give up: you're sufficiently far away that companion_cube cannot coerce you into using containers!
badkins has quit [Ping timeout: 240 seconds]
<nicoo>
adrien: He doesn't need explicit coercion, I'm covariant.
eyyub has quit [Ping timeout: 255 seconds]
<adrien>
I knew he was doing it sneakily =/
luigy has quit [Ping timeout: 255 seconds]
toolslive has quit [Quit: Leaving]
planetlarg has joined #ocaml
<MercurialAlchemi>
companion_cube: I think the error location is 'correct' from the parser's point of view, but the problem is that the parser should halt sooner (eg, it tries to parse a group key but doesn't fail at the first linebreak)
<Leonidas>
is there some way to compose show methods?
<MercurialAlchemi>
there is something screwed up somewhere
<Leonidas>
like if i have a showMytype, can I compose it with showList to get a showMyTypeList?
<Leonidas>
I believe batteries had something like this
MrScout has joined #ocaml
planetlarg has quit [Remote host closed the connection]
rand000 has joined #ocaml
<companion_cube>
Leonidas: what's your definition of "show method"?
<companion_cube>
'a -> string?
<Leonidas>
companion_cube: yup
tharugrim has quit [Ping timeout: 245 seconds]
<companion_cube>
then most "standard libraries" provide printer combinators
<companion_cube>
or you can play with ppx_deriving if you're edgy
<Leonidas>
I cheated by declaring type whatever = mytype list [@@deriving show] but that is cheating, somehow
<companion_cube>
[%show: int list]
tharugrim has joined #ocaml
<whitequark>
(showList showMytype) should work if showList is appropriately generic
<whitequark>
and I don't see any reason it would not be
<Leonidas>
any idea where I can find Batteries' printer combinators?
<Leonidas>
I might need an alternative stdlib anyway
q66 has joined #ocaml
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
<companion_cube>
there's a BatFoo.print in each module as far as I remember
<companion_cube>
of course, containers also provides printers :>
mawuli has joined #ocaml
<rgrinberg>
core_kernel is a friendly library for printing your stuff if i may say so ;)
<whitequark>
friendly?
<rgrinberg>
it has sexp printers on everything
marynate has quit [Quit: Leaving]
<rgrinberg>
i just interjected you guys without much context so it could just be off topic :D
<Leonidas>
yeah, if compiling core wasn't such a pain
<rgrinberg>
Leonidas: you program on a raspberry pi or something?
<rks`>
ggole: ping
<Leonidas>
rgrinberg: no, but it had some severe build issues on 32 bit lately
<rgrinberg>
ocaml is crippled on 32 bit regardless
<ggole>
rks`: pong
<rks`>
I need your help writing some elisp :>
<ggole>
Sure.
<rks`>
more precisely
jonludlam has quit [Quit: Coyote finally caught me]
<rks`>
I would appreciate it if you could review some elisp I just wrote (I'm about to update an issue on merlin's bugtracker, i'll use their @ thingy so you are mailed)
<ggole>
OK, I'll look for that.
antinomy has joined #ocaml
<rks`>
thank you :)
phserr has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
jonludlam has joined #ocaml
<phserr>
Is there a documented way to have a "live ocaml system" inside an ocaml project? So that I could use ocaml to configure and execute actions in realtime somewhat like emacs lisp in emacs.
yomimono has quit [Ping timeout: 245 seconds]
<phserr>
Being more specific: A natively compiled ocaml program that exposes an ocaml api for configuration and "realtime execution" of ocaml (probably interpreted or compiled to bytecode) code
<mrvn>
batecode can run the toplevel on a string
<rks`>
ggole: I must go, I actually don't have the time to update the issue right now, I'll do it later tonight and ping you as I said
<rks`>
thanks again
<ggole>
OK, if I'm not still awake I'll get into it tomorrow.
<rks`>
OK :)
luigy has joined #ocaml
Hannibal_Smith has joined #ocaml
def-lkb is now known as def`
<phserr>
mrvn: batecode?
<mrvn>
bytecode
badkins has joined #ocaml
<phserr>
oh, ok - thought it was a library or something and couldn't find any info
<phserr>
do you have any pointers for me to look at about integrating it with compiled ocaml?
<mrvn>
you can't. it's a bytecode only thing
<ggole>
compiler-libs, maybe?
<ggole>
I don't think this would qualify as a "live" system though
<ggole>
You can't change what's already there, just compile new stuff.
milosn has joined #ocaml
<phserr>
I see
<ggole>
I mean, maybe that's enough. But it wouldn't be like emacs where you can redefine anything.
struktured has quit [Ping timeout: 258 seconds]
<phserr>
I have a lisp background, so perhaps I'm still thinking "in lisp"
<phserr>
but if I can have something that works like a plugin system - it will probably be good enough for this project
<ggole>
(I've really gotta play with that some time.)
phserr has quit [Remote host closed the connection]
mort___ has joined #ocaml
nojb has quit [Quit: nojb]
slash^ has joined #ocaml
<MercurialAlchemi>
companion_cube: there are good news and there are bad news
<hugomg>
thanks, I'll check that link out ggole.
<MercurialAlchemi>
good news are, the line and column now get updated when you have line endings in a string
<MercurialAlchemi>
bad news are, the bloody parser still stops at position byte 43 in your example
<MercurialAlchemi>
at the end of 'not'
kakadu has quit [Quit: Page closed]
<MercurialAlchemi>
mm
Hannibal_Smith has joined #ocaml
<MercurialAlchemi>
I guess that's the last token it managed to lex but it didn't fit any rule
nojb has joined #ocaml
axiles has joined #ocaml
manizzle has quit [Ping timeout: 258 seconds]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
matason has quit [Quit: Leaving...]
<struktured>
daftluck: cool looking forward to seeing it nevertheless
samrat has quit [Quit: Computer has gone to sleep.]
rgrinberg has quit [Quit: Leaving.]
Thooms has joined #ocaml
<pippijn>
ggole: that's kind of interesting
<pippijn>
ggole: but doesn't solve my problem :\
milosn has quit [Read error: Connection reset by peer]
<pippijn>
(which I solved with camlp4)
milosn has joined #ocaml
<ggole>
Eh?
<hugomg>
Could anyone help me with an ocamlbuild question? I have a module that uses the re2 package so right now I am calling ocamlbuild with the "-pkg re2" flag. Is there a way to put that in the _tags file so I don't need to pass the flag all the time?
q66 has quit [Remote host closed the connection]
q66 has joined #ocaml
claudiuc has joined #ocaml
_JokerDoom has joined #ocaml
<hugomg>
ah, looks like this line does what I want:
<hugomg>
<**/*>: package(re2)
<nojb>
or: true: package(re2)
<hugomg>
I wonder if it wouldn't be better to just link re2 against the modules that need it though instead of using it for everyone
<hugomg>
or is that a stupid idea?
JokerDoom has quit [Ping timeout: 244 seconds]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ebzzry__ has quit [Ping timeout: 245 seconds]
q66[lap] has joined #ocaml
ebzzry has joined #ocaml
manizzle has joined #ocaml
kakadu_ has joined #ocaml
WraithM has quit [Ping timeout: 260 seconds]
ggole has quit []
<jbalint>
does the "-" here mean anything special? type -'src encoder = {
rgrinberg has joined #ocaml
hugomg has quit [Ping timeout: 265 seconds]
dsheets has joined #ocaml
<companion_cube>
def`: ppx_deriving_yojson
<companion_cube>
of course ppx_deriving.show makes for nice printers too
rks` has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
slash^ has quit [Read error: Connection reset by peer]
matason has joined #ocaml
matason has quit [Client Quit]
chaptastic has quit []
MrScout_ has joined #ocaml
chambart has quit [Ping timeout: 250 seconds]
MrScout has quit [Ping timeout: 258 seconds]
MrScout_ has quit [Ping timeout: 258 seconds]
samuel02 has joined #ocaml
<def`>
jbalint: it means encode is contravariant in its 'src parameter
rgrinberg has joined #ocaml
Arsenik has joined #ocaml
struktured has quit [Read error: Connection reset by peer]
eyyub has joined #ocaml
arj has joined #ocaml
pgomes has joined #ocaml
Valdo has quit [Excess Flood]
milosn has quit [Ping timeout: 245 seconds]
<jbalint>
def`: thanks
Valdo has joined #ocaml
BitPuffin has quit [Ping timeout: 260 seconds]
arj has quit [Quit: Leaving.]
struktured has joined #ocaml
nlucaroni has joined #ocaml
<Drup>
rgrinberg: you should try ppx_derving :p
larhat has quit [Quit: Leaving.]
Hannibal_Smith has quit [Quit: Leaving]
badkins has quit [Ping timeout: 272 seconds]
manud has joined #ocaml
<pippijn>
ppx_derping
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
badkins has joined #ocaml
MrScout has joined #ocaml
<companion_cube>
whitequark: maybe the cloning stuff will go into GenClone, or somethng like this
milosn has joined #ocaml
pgomes has left #ocaml ["Leaving"]
samuel02 has quit []
Simn has quit [Quit: Leaving]
badkins has quit []
rks` has joined #ocaml
chambart has joined #ocaml
<rgrinberg>
companion_cube: qcheck ping
<companion_cube>
oh, yes, right
<rgrinberg>
would like to try ppx_test + qcheck
<companion_cube>
ppx_test?
<companion_cube>
[@ qcheck gen prop] ?
bezirg has joined #ocaml
<companion_cube>
something like this?
<Drup>
rgrinberg: btw, when I arrived at the office this morning, jerome already had merged/review your stuff, no need to push for it n_n
<companion_cube>
I'd be more interesting in you completing/reviewing my branch of ppx_deriving that generates random generators