<whitequark>
I don't think it's possible to shadow like this
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
<struktured>
ok, I'll find another way to go about it, maybe functorize something
q66 has quit [Quit: Leaving]
seanmcl has joined #ocaml
BitPuffin has quit [Ping timeout: 264 seconds]
MrScout has quit [Ping timeout: 258 seconds]
<Drup>
struktured: define Foo first and then with Foo := Foo
<Drup>
or something like that
bytbox has quit [Remote host closed the connection]
<struktured>
Drup: yeah I figured it on my own just 1 minute ago. Wish I saw this earlier!
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
WraithM has quit [Quit: Lost terminal]
lordkryss has quit [Quit: Connection closed for inactivity]
bytbox has joined #ocaml
kapil__ has joined #ocaml
enquora has quit [Quit: enquora]
emmanueloga_ is now known as emmanueloga
tg has joined #ocaml
claudiuc_ has joined #ocaml
claudiuc_ has quit [Remote host closed the connection]
claudiuc_ has joined #ocaml
claudiuc has quit [Ping timeout: 272 seconds]
claudiuc_ has quit [Read error: Connection reset by peer]
claudiuc has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
chaptastic has quit [Read error: Connection reset by peer]
chaptastic has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
manud___ has quit [Ping timeout: 250 seconds]
AlexRussia has joined #ocaml
antinomy has joined #ocaml
jao has quit [Ping timeout: 264 seconds]
jhaberstro has joined #ocaml
siddhart1v_away is now known as siddharthv
siddharthv has left #ocaml [#ocaml]
jhaberstro has quit [Quit: jhaberstro]
claudiuc_ has joined #ocaml
claudiuc_ has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has joined #ocaml
claudiuc has quit [Ping timeout: 250 seconds]
struktured has joined #ocaml
jhaberstro has joined #ocaml
psy_ has joined #ocaml
jhaberstro has quit [Quit: jhaberstro]
c74d has quit [Remote host closed the connection]
ggole has joined #ocaml
c74d has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 258 seconds]
yomimono has joined #ocaml
darkf has joined #ocaml
<ocfx>
hi darkf
darkf_ has quit [Ping timeout: 258 seconds]
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
matason has joined #ocaml
matason has quit [Client Quit]
expo873 has quit []
Stepan_Timoshenk has joined #ocaml
samrat has joined #ocaml
mcc has joined #ocaml
Valdo has quit [Ping timeout: 258 seconds]
Valdo has joined #ocaml
vincom2 has quit [Ping timeout: 258 seconds]
vincom2 has joined #ocaml
Stepan_Timoshenk has quit []
StepanTimoshenko has joined #ocaml
StepanTimoshenko has quit [Changing host]
StepanTimoshenko has joined #ocaml
MercurialAlchemi has joined #ocaml
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
chinglish has joined #ocaml
ygrek has joined #ocaml
libertas has quit [Ping timeout: 264 seconds]
libertas has joined #ocaml
struktured has quit [Read error: Connection reset by peer]
struktured has joined #ocaml
struktured__ has joined #ocaml
struktured_ has quit [Ping timeout: 272 seconds]
c74d has quit [Remote host closed the connection]
myyst has quit [Ping timeout: 255 seconds]
c74d has joined #ocaml
AlexRussia has quit [Quit: WeeChat 1.1-dev]
ggole has quit [Read error: Connection reset by peer]
wting_ has joined #ocaml
larhat has joined #ocaml
arj has joined #ocaml
psy_ has quit [Remote host closed the connection]
psy_ has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
<MercurialAlchemi>
Is it possible to twist menhir's arm into giving a reason for a parsing error?
<MercurialAlchemi>
Like "Exported token FOO or BAR, got 'stuff' instead"
<MercurialAlchemi>
Exported->Expected
c74d has quit [Remote host closed the connection]
<flux>
did you try compiling it?-)
<flux>
oh, sorry, I confused that with merlin :)
<MercurialAlchemi>
:)
<flux>
I thought its main feature was better error messages
<MercurialAlchemi>
Is it?
c74d has joined #ocaml
<MercurialAlchemi>
right now I've progressed from "parsing error, find yourself where it is" to "parsing error with location"
<flux>
well, dunno. aren't you usually supposed to add your own error handling to rules in bison-like generators?
<MercurialAlchemi>
which is already great, mind you
<MercurialAlchemi>
no idea
<flux>
it's been time, but basically at the end of the matches just | x -> Printf.ksprintf failwith "expected (write out the matches above in plain english), got " (to_string x) " instead" or something
<MercurialAlchemi>
mm
<flux>
(oops, I intended to use %s at some point when writing that ;-))
<MercurialAlchemi>
I can handle the syntax part
<MercurialAlchemi>
just figured this sort of thing could be done in an automated fashion
<flux>
maybe it can be abstracted somehow, merlin has some abstractions available..
<MercurialAlchemi>
I'll have a look at the examples this evening
<flux>
perhaps someone more familiar with more recent exposure to menhir can chime in, any minute now.. ;)
<MercurialAlchemi>
maybe I can find something useful in there
<flux>
did you check out the magic 'error' token?
<flux>
(chapter 8 in the menhir manual)
<MercurialAlchemi>
I was quite disappointed, when I tried the last version of mustache, that not only it refused to parse my template which its previous version had no trouble with, but even refused to say anything more specific than "parsing error"
<MercurialAlchemi>
flux: no, I skimmed that chapter yesterday, but I think I need an example to make use of it
<flux>
seems very simple to use in basic case
<flux>
just use the error token when you reach a case that isn't ok :)
<flux>
there is some --error-recovery -feature that can be optionally enabled as well
<flux>
I don't know if any of this helps making more helpful error messages, though
myyst has joined #ocaml
<flux>
(hmm, or maybe not :))
<flux>
mercurialalchemi, please share if you do manage to get better error messages :)
<MercurialAlchemi>
expect Toml.of_foo and Toml.to_foo methods shortly
<MercurialAlchemi>
one downside of the new approach is that you can't introspect an unknown config file
<MercurialAlchemi>
but I don't think that's a widespread use case
<companion_cube>
well, thanks
<companion_cube>
good thing I had a wrapper around toml for my config
<MercurialAlchemi>
:)
<companion_cube>
pfiu, migration 1.0 to 2.1
<companion_cube>
anyway.
<MercurialAlchemi>
I think one problem was that the tests weren't using the public interface
<MercurialAlchemi>
so no feeling the pain when the API asks for twice as many characters in sacrifice to do the same thing as before
<MercurialAlchemi>
but it does now
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
seanmcl has joined #ocaml
seanmcl has quit [Client Quit]
sgnb has quit [Read error: Connection reset by peer]
koderok has joined #ocaml
koderok has quit [Remote host closed the connection]
ysz_ has joined #ocaml
darkf has quit [Read error: Connection reset by peer]
hyperboreean has quit [Quit: leaving]
darkf has joined #ocaml
ysz has quit [Ping timeout: 244 seconds]
axiles has quit [Ping timeout: 252 seconds]
paracetamolo has joined #ocaml
<Leonidas>
pippijn: yes, opam tracks that.
<paracetamolo>
Hi, I'm having troubles with the GC: my program takes up all the memory (7GB) and gets killed by the OS, however if I put explicit calls to Gc.compact every now and then everything is fine and memory consumption is actually very low. Any idea what may cause this behavior?
<flux>
does your program use custom C bindings?
<flux>
if not, then I think you most likely have a memory leak.
<flux>
(well, that would have been the case with C bindings as well, but the leak would be more hidden)
<flux>
you could try ocamlviz
<paracetamolo>
yes, I use a C library, but can you explain what is happening?
<flux>
well, it's probably easier to leak memory when using a C library
<adrien>
do you allocate memory from the C library binding?
<flux>
you should try valgrind with your program
<flux>
and exit it before it crashes
<adrien>
especially abstract blocks (or custom)
<flux>
valgrind may lie a bit with ocaml programs, but it may also point you to the right direction
<flux>
ocaml garbage collector is probably one of the most robust pieces of software I know of ;-)
<paracetamolo>
My point is why isn't the GC triggered?
<pippijn>
I've never seen valgrind lie about ocaml programs
<Leonidas>
someone asked yesterday about opam config var arch on 32 bit
<Leonidas>
it is i686
<adrien>
<adrien>
15:24 adrien : do you allocate memory from the C library binding?
<flux>
paracetamolo, maybe you allocate from OCaml heap in C and say that their memory pressure of said allocations is 0
<paracetamolo>
adrien: I'm using binding to GSL, although I'm not even sure that this code gets called, then I have no idea if the library is allocating memory.
<flux>
toolslive, doesn't seem like ocp-memprof is available via opam, though :-o
<toolslive>
no, I had to clone the repo and build the compiler myself
<toolslive>
ocamlviz is not a walk in the park neither.
<flux>
java has some nice memory profilers, you can monitor it in real time..
<toolslive>
and I think ocaml exits without cleaning up the memory so valgrind will complain.
ysz_ has quit [Quit: Leaving]
<toolslive>
haskell has them too.
<MercurialAlchemi>
java tooling is pretty good
<MercurialAlchemi>
(let's not talk about debuggers here... )
<paracetamolo>
I'm not sure how the gc behaves with c code but what puzzles me is that if it doesn't keep track of memory allocated by c code then why is it able to collect it when I call it?
<ggole>
paracetamolo: sticks calls to free on finalizers, maybe
<mrvn>
the C code connects it via finalizers
bytbox has quit [Remote host closed the connection]
<mrvn>
And ocaml indeed does not run the GC at exit so anything still allocated then leaks.
Thooms has quit [Ping timeout: 245 seconds]
<ggole>
I'm not familiar with the binding in question, but I suppose that it contains operations to free the C-side memory explicitly which you are supposed to invoke.
axiles has joined #ocaml
<ggole>
(With the finalizers as a backup.)
<paracetamolo>
ok I'll have a closer look at the documentation of the library
<paracetamolo>
thanks for all the advices
seanmcl has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
darkf has quit [Read error: Connection reset by peer]
mort___ has joined #ocaml
darkf has joined #ocaml
chris2 has quit [Ping timeout: 264 seconds]
iorivur has joined #ocaml
Simn has quit [Read error: Network is unreachable]
<companion_cube>
not sure it does track memory/tail calls
Haudegen has joined #ocaml
zeugma has joined #ocaml
davine has joined #ocaml
<zeugma>
hi fellow ocamlers
<companion_cube>
hi
davine has left #ocaml [#ocaml]
bytbox has joined #ocaml
<zeugma>
I have a question regarding Oasis. I am not new to OCaml but had stepped back from this language some 15 years ago so I'm rediscovering this universe.
<companion_cube>
welcome back then :)
<flux>
it's a new world ;-)
<zeugma>
I have a source hierarchy in a directory src/. Only one executable in src/. I'd like to put most ml[ily] files in subdirectories of src/
<zeugma>
(thanks)
<zeugma>
In the _oasis file I have an Executable section, with a Path field set to src/. However, with this configuration, ocamlbuild does not recurse in subdirectories.
psy_ has quit [Read error: Connection reset by peer]
<zeugma>
Anyone knows how to handle this? (The doc is not very helpful on this topic)
<flux>
unfortunately I have no idea if it has the recursion ability
<zeugma>
All examples I found on Github seem to either have only one src/ directory OR to rely on libraries
<zeugma>
Aw too bad
slash^ has joined #ocaml
<companion_cube>
zeugma: you can refer to some module with b/Mod if src: a/ and the module is a/b/Mod
<zeugma>
c_cube: thanks, unfortunately Module isn't defined for the Executable section
bitbckt has quit [Ping timeout: 258 seconds]
bytbox has quit [Remote host closed the connection]
bitbckt has joined #ocaml
<Drup>
InternalModule*
<zeugma>
neither InternalModule
<Drup>
ok
darkf has quit [Quit: Leaving]
<zeugma>
it's easy to have ocamlbuild recurse with '-r' option or a _tags field
chris2 has joined #ocaml
<zeugma>
but when a module src/A/M1 uses src/B/M2, then M2 isn't found
<companion_cube>
zeugma: so, sadly, build systems are (still?) in a sad state
<Drup>
zeugma: define little libraries :)
<zeugma>
c_cube : or I didn't find the good option in the doc ;-)
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
<zeugma>
:)
badkins has quit []
shinnya has joined #ocaml
badkins has joined #ocaml
<zeugma>
besides Ocamlbuild seems to forbid globbing patterns for its option regarding inclusion of subdirectories ('src/A or src/B : include' is allowed but not 'src/*' neither 'src/**')
<zeugma>
ah no it may be sthg else...
<Drup>
try by putting brackets around it.
thomasga has joined #ocaml
<zeugma>
yeah did it. But it's not it
dsheets_ has joined #ocaml
yomimono has joined #ocaml
<zeugma>
Well actually this is another error coming from Menhir now. Menhir can't find a module used in semantic actions, as it is not in the same directory
<companion_cube>
thomasga: instead of generating a makefile, couldn't assemblage provide a tool that would do the compilation itself?
<companion_cube>
that could help porting on windows, for instance, I suppose
kapil__ has quit [Quit: Connection closed for inactivity]
<thomasga>
companion_cube: yup, but build engines are tricky to get right as well
<thomasga>
but it is an option we have in mind
<companion_cube>
that would be quite interesting
<thomasga>
daniel really likes the design of http://gittup.org/tup/ so an ocaml port of that could be interesting
BitPuffin has quit [Ping timeout: 258 seconds]
<thomasga>
you are very welcome to do it if you are interested :-)
* companion_cube
sees tup-react coming
<companion_cube>
I could *really* use a single tool with few dependencies, one file to describe the project, that could compile efficiently my projects
arj has quit [Quit: Leaving.]
<ggole>
No chance. When it comes to build systems, there is only doom.
<companion_cube>
well, I think it's possible to do better than oasis
<companion_cube>
although the problem is that ocaml is really complicated to compile
chaptast_ has quit []
<companion_cube>
thomasga: can assemblage infer the linking order for a library/bin, right now?
<thomasga>
the previous version did somehow, but not totally sure it is a good idea because of side-effects
<thomasga>
and it was quite hackish in the Makefile backend
<thomasga>
if I remember correctly …
<Drup>
can't you infer it by default bu allow to provide the order ?
<Drup>
side-effectful modules where the order is relevant but not indicated by dependencies is not the common case, to say the least.
<thomasga>
correction: the previous infers the compilation units dependencies, not the link order
<thomasga>
would be much easier to do that kind of stuff if you control the build backend (instead of using the crappy Makefile interface, but well)
<toolslive>
some tools use inotify to register the order in which the compilation process touches the source files and generates the object files, and deduce dependencies from that.
zeugma has quit [Quit: Page closed]
<companion_cube>
dependencies are enough for the linking order
<companion_cube>
it's just a topological sort, isn't it?
<toolslive>
depends on what you're linking....
samrat has quit [Ping timeout: 256 seconds]
<companion_cube>
in ocaml that should be right
<toolslive>
for C shared libs it *should* be alright too.
<companion_cube>
we're talking about OCaml right now :P
BitPuffin has joined #ocaml
bytbox has joined #ocaml
samrat has joined #ocaml
<Drup>
MercurialAlchemi, flux: pippijn and def lkb did some stuff for error recovery in merlin
<Drup>
in menhir*
<Drup>
it's not upstreamed yet
<MercurialAlchemi>
tantalizing
<Drup>
flux: the "menhir is better with error reporting" is often said, but very misleading ... it's about reporting errors *in the grammar* ...
<Drup>
(on which menhir is indeed much better than ocamlyacc)
Submarine has quit [Ping timeout: 264 seconds]
<MercurialAlchemi>
Drup: it could be nice if the location reporting was less ad-hoc
<Drup>
?
araujo has quit [Read error: Connection reset by peer]
<Drup>
It's not really ad-hoc, you get the location informations easily from the parser
<Drup>
it's not by default, though, which is a bit ...
araujo has joined #ocaml
<MercurialAlchemi>
Why not just feed it a line separator expression?
<Drup>
?
Submarine has joined #ocaml
<MercurialAlchemi>
eg, be able to tell it "this is what a line ending looks like, now your job is to bump the line counter and column counter yourself"
<Drup>
ah, yeah, that would be nice, but it's the lexer's job
<Drup>
not much to do with menhir
<MercurialAlchemi>
I agree, it's more a lexer problem
<MercurialAlchemi>
but it's still useless boilerplate :(
<MercurialAlchemi>
I don't know if sedlex is smarter
<MercurialAlchemi>
(another of these pun names... :) )
<Drup>
sedlex is not smarter
<Drup>
(but I have plans to contribute something about that :)
<MercurialAlchemi>
its lexbuf doesn't seem to have any kind of line number...
<Drup>
no it doesn't, you track the lines by yourself
<MercurialAlchemi>
"
<MercurialAlchemi>
The OCaml source is assumed to be encoded in Latin1 (for string and character literals).
<MercurialAlchemi>
"
<MercurialAlchemi>
duh
<Drup>
is it still true ?
<MercurialAlchemi>
that's what sedlex' readme claims
<MercurialAlchemi>
that's ironic
chaptastic has joined #ocaml
samrat has quit [Ping timeout: 272 seconds]
samrat has joined #ocaml
chaptastic has quit []
ollehar has quit [Ping timeout: 255 seconds]
chaptastic has joined #ocaml
thomasga has quit [Quit: Leaving.]
yomimono has quit [Ping timeout: 256 seconds]
bytbox has quit [Ping timeout: 250 seconds]
thomasga has joined #ocaml
hbar has joined #ocaml
mort___ has quit [Quit: Leaving.]
torono has joined #ocaml
gdsfh1 has joined #ocaml
thomasga has quit [Ping timeout: 240 seconds]
Arsenik has joined #ocaml
gdsfh has quit [Ping timeout: 256 seconds]
hugomg has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
Hannibal_Smith has quit [Remote host closed the connection]
<def`>
struk_at_work: that's alpha, but I need feedback so don't hesitate to report ;)
q66 has joined #ocaml
samuel02 has quit [Remote host closed the connection]
nicoo has joined #ocaml
torono has quit [Quit: Page closed]
<struk_at_work>
def`: is a there trick to enabling recognition of a ppx extension in the .merlin file?
<def`>
struk_at_work: normally, just adding the findlib package as a normal package
<def`>
for instance:
<def`>
PKG ppx_deriving.show
milosn has joined #ocaml
chaptastic has quit []
bezirg has joined #ocaml
samuel02 has joined #ocaml
<struk_at_work>
argh I think in my case I think camlp4 is polluting things. getting a parse error reported by merlin that usually means camlp4 parser busted something
<def`>
Wow, I have no idea how camlp4 and ppx in merlin interact
<def`>
What is the error message ?
samuel02 has quit [Client Quit]
samuel02 has joined #ocaml
<Drup>
camlp4 choke on extension/atributes anyway
larhat1 has quit [Quit: Leaving.]
<Drup>
you mostly can't use them both.
psy_ has joined #ocaml
<Drup>
(in regular ml)
bezirg has quit [Ping timeout: 240 seconds]
<struk_at_work>
def`: Parse error: "end" expected after [str_items] (in [module_expr])
<def`>
scary :)
oscar_toro has quit [Ping timeout: 264 seconds]
<def`>
sounds really camlp4-ish, I have no idea what's happening
<struk_at_work>
def`: yeah its kind of a known issue but I don't know why merlin is injecting camlp4 either.
<rgrinberg>
v.s. the more simple one from str : Text of string | Delim of string
<companion_cube>
if the delimiter has subgroups, does it yield the delimiter then all its groups?
<companion_cube>
it's a bit strange
<rgrinberg>
that's exactly the behavior
<companion_cube>
maybe Text of string | Delim of substrings?
<companion_cube>
more efficient, as flexible
badkins has joined #ocaml
<rgrinberg>
yeah, a little awkward to fetch the delimeter though
AlexRussia has quit [Quit: WeeChat 1.1-dev]
AlexRussia has joined #ocaml
<companion_cube>
Re.get sub 0
<companion_cube>
it's ok, I think
<companion_cube>
or if you prefer Text of string | Delim of string * substrings
ghast has joined #ocaml
_andre has quit [Quit: leaving]
samrat has quit [Quit: Computer has gone to sleep.]
chaptastic has quit []
bytbox has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
<ghast>
hi. noob question here. Does the String module have a 'split' function (as suggested in chapter 2 of Real World Ocaml)? Because i get "unbound value (did you mean blit?)" each time i try to use it.
eyyub has joined #ocaml
dsheets_ has quit [Ping timeout: 264 seconds]
<tokenrove>
ghast: Core.Std.String has a split function.
<tokenrove>
Real World OCaml is all written around the assumption that you'll use Core as your standard library
<ghast>
oh so it's from Core.Std
<ghast>
i thought it was a standard ocaml function
<rgrinberg>
companion_cube: has anyone tried to hack off batio into its own lib?
<Drup>
rgrinberg: this question is funny, somehow
<companion_cube>
I had a PR once
<companion_cube>
the problem is that BatIO-related types are sprinkled over every module, because printrs
<companion_cube>
printers
<companion_cube>
smondet: meh.
MrScout has quit [Ping timeout: 258 seconds]
<rgrinberg>
hacking off the printers would be good too :/
<rgrinberg>
companion_cube: i'd use an aggressive fork of batteries made by you
<companion_cube>
there's an old branch...
<companion_cube>
ask Drup ;)
<companion_cube>
the problem is, I don't feel like maintaining that big a fork by myself, batteries is huge and contains a lot of complicated stuff
<companion_cube>
example: iterators on unicode ropes (oh my.)
Arsenik has quit [Remote host closed the connection]
<Drup>
rgrinberg: I used it, it worked fine
<Drup>
it was called batteries-light
bytbox has joined #ocaml
<dmbaturin>
I'm tempted to try out batteries for its list comprehensions. But I don't think I would link something that big to a program just for list comprehensions.
<Drup>
list comprehensions are not in batteries anymore anyway :)
<dmbaturin>
Oh. Good to know. :)
<dmbaturin>
Why not?
<companion_cube>
it was in batteries 1.*, now it's batteries 2.*
<companion_cube>
batteries 2 stopped using camlp4
<companion_cube>
dmbaturin: maybe you can try to write a ppx for list comprehensions
<companion_cube>
but really, since |> appeared, it's become less useful imho
axiles has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<dmbaturin>
companion_cube: Where do I find PPX usage examples?
<companion_cube>
lwt.ppx, ppx_deriving are the two main current uses of ppx I know of