<raboof>
nojb: unfortunately what I'm actually trying to do in install 'cow', which depends on ulex
<nojb>
ah ok
<raboof>
(what I'm actually actually trying to do is build the 'hello world' from https://github.com/rgrinberg/opium - it now can't find 'cow.syntax' and I assumed installing cow would be the way to fix that)
<nojb>
did you install camlp4 ?
<nojb>
opam install camlp4
<raboof>
'Package camlp4 is already installed (current version is 4.01.0).'
<nojb>
check in ~/.opam/4.01.0/bin
Gama11_ has joined #ocaml
<nojb>
can you see camlp4orf there ?
<raboof>
'find ~/.opam | grep camlp4orf' comes up empty (I don't have a ~/.opam/4.01.0/bin though?)
<nojb>
what's your version of ocaml ?
Gama11 has quit [Ping timeout: 256 seconds]
mengu has joined #ocaml
<raboof>
4.01.0 (from Debian)
<nojb>
ahh
<nojb>
try installing camlp4-extra (or something like that) with apt-get
<nojb>
yep, camlp4-extra
kushal has quit [Quit: Leaving]
<raboof>
yes that did the trick! thanks
theblatt1 has left #ocaml [#ocaml]
Submarine has quit [Quit: Leaving]
sdothum has joined #ocaml
Gama11 has joined #ocaml
ggole has joined #ocaml
Gama11_ has quit [Ping timeout: 240 seconds]
larhat1 has joined #ocaml
_andre has joined #ocaml
rgrinberg has joined #ocaml
larhat1 has quit [Client Quit]
larhat1 has joined #ocaml
larhat1 has quit [Client Quit]
dav- has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
dav has quit [Ping timeout: 240 seconds]
Algebr has joined #ocaml
thomasga has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
larhat has quit [Quit: Leaving.]
mengu has quit [Remote host closed the connection]
larhat has joined #ocaml
psy_ has joined #ocaml
shinnya has joined #ocaml
nojb has joined #ocaml
milosn has quit [Quit: leaving]
mengu has joined #ocaml
dav- is now known as dav
thomasga has joined #ocaml
kushal has joined #ocaml
thomasga has quit [Client Quit]
kushal has quit [Read error: Connection reset by peer]
jabesed has quit [Remote host closed the connection]
jabesed has joined #ocaml
rgrinberg has joined #ocaml
Thacib has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
Thacib has left #ocaml [#ocaml]
nojb has quit [Quit: nojb]
dav has quit [Ping timeout: 256 seconds]
dav has joined #ocaml
nojb has joined #ocaml
javamonn has joined #ocaml
agarwal1975 has joined #ocaml
Hannibal_Smith has joined #ocaml
yomimono has quit [Ping timeout: 250 seconds]
osa1 has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
<apache2>
is there a rule of thumb for when it's ok to use (=) vs when one should use (compare) ?
javamonn has quit [Remote host closed the connection]
<companion_cube>
compare is only for cases in which you need to order values (e.g. sorting)
thomasga has joined #ocaml
<flux>
just (=) when you feel lazy
<flux>
compare when you want to be general :)
<flux>
oh, right the polymorphic compare?
<flux>
then it's as companion_cube said
javamonn has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
<nojb>
there is also a difference between how compare treats the float nan
<flux>
but if you want to make a polymorphic algorithm that depends on equality, inequaliy or order, take the comparison function as a parameter, don't use the polymorphic compare
<nojb>
nan = nan is false
<nojb>
but compare nan nan = 0
tg has quit [Ping timeout: 256 seconds]
<companion_cube>
awwww
<nojb>
so in general you should use compare if your data structures have floats in them .
<xificurC>
nojb: could it be any other way? nan = nan is false by the standard right? But I can't imagine what else than 0 should compare return
<apache2>
I may be misguided, but I was under the impression (=) was for pointer equality testing
<companion_cube>
it's just that compare shouldn't work at all on floats
<companion_cube>
floats are evil
<apache2>
thank you. I think I must have made a mental note that there was something fishy about mistakingly using == instead of = and decided to just use compare
<thizanne>
I disagree with you, companion_cube
<thizanne>
I think compare should work, but maybe =, < and this stuff might not
<companion_cube>
apache2: let (==) = `Use_single_equal_instead, à la Janestreet
<thizanne>
but we want to be able to sort a float list or to build a float set, whatever this means
<companion_cube>
I don't think so, since it makes no sense
rgrinberg has joined #ocaml
<companion_cube>
or just make compare raise an exception on the nan/nan case
<companion_cube>
Not_comparable
<apache2>
companion_cube: in the top of every file in my projects?
<companion_cube>
apache2: well... :/
<thizanne>
nan/nan case could fail
struktured has quit [Ping timeout: 256 seconds]
<companion_cube>
yeah
<companion_cube>
that would be more reasonable
<thizanne>
but even if ( = ) on floats does not work as you expect, comparing two floats should be doable
<apache2>
companion_cube: it's alright, even if it would be nicer to have it as a compiler flag
Hannibal_Smith has quit [Quit: Leaving]
<companion_cube>
thizanne: it's just that compare's contract implies it is a total order
<companion_cube>
and floats are not totally ordered because of terrible corner cases like this
<thizanne>
then just make it arbitrarily totally ordered, so you can build a set of floats
<thizanne>
(that's what compare seems to do ?)
<companion_cube>
I'm not sure I want a set of float to contain NaN
<companion_cube>
:D
<companion_cube>
should it contain several instances of NaN?
<ggole>
I've never understood the "just use (=)" people. It's the wrong operation in many cases.
<companion_cube>
you can't even test if NaN is inside
<ggole>
Not just slow, but failing at runtime or giving wrong results.
<thizanne>
probably not, if you cannot distinguish two nan in OCaml anyway
<companion_cube>
just use ppx_deriving.eq
rgrinberg has quit [Ping timeout: 255 seconds]
<octachron>
companion_cube: a set of floats sounds like a very painful way to learn the difference between real arithmetic and floating point arithmetic
<companion_cube>
:)
thomasga has quit [Quit: Leaving.]
idegen has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
steshaw has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
wildsebastian has quit [Read error: Connection reset by peer]
BitPuffin|osx has joined #ocaml
badkins has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
agarwal1975 has joined #ocaml
osa1 has joined #ocaml
nojb has quit [Quit: nojb]
<cmtptr>
there's no way to parameterize a module defined by a file, is there?
freling has joined #ocaml
<cmtptr>
that is, the file-scope module
<companion_cube>
I don't think so
<companion_cube>
it would be useful, but would make the build even more complicated imho
<Drup>
not in the compiler at the moment, no
<Drup>
there is the big functor proposal, but it's not implemented
thomasga has joined #ocaml
Submarine has joined #ocaml
nojb has joined #ocaml
Submarine has quit [Remote host closed the connection]
<cmtptr>
well then
<cmtptr>
ocaml sux!!1
<ggole>
Stick a module inside that is parameterised?
<cmtptr>
I don't even really know that I'll ever need it, it was just an idea I had and wondered if there was a way to do it
darkf has quit [Quit: Leaving]
<thizanne>
it's a quite common need cmtptr, and then people do indeed write a single Make functor in the file
<cmtptr>
ah, so Foo.Make is the convention?
<ggole>
And S for the signature
<cmtptr>
makes sense. tanks
rgrinberg has joined #ocaml
mbac has quit [Quit: leaving]
rgrinberg has quit [Ping timeout: 244 seconds]
<cmtptr>
oh, so I just realized that a functor's definition actually has to appear in the mli
<nojb>
the signature has to appear in the mli
<cmtptr>
or, I guess I should ask: does it? I see that Map.Make does
<flux>
hmm, map.mli does not have the signature in the functor definition, rather it references to the module type S?
<cmtptr>
oh, you're right
mort___ has joined #ocaml
<cmtptr>
so when I do define my Foo.Make in foo.ml, do I need to copy the whole of "module Foo (Key : Eq) (Value : Type) : S with type key := Key.t and type value := Value.t = sig..."? Do the substitutions have to appear in both places?
<flux>
hmm, I don't think so. you just write it like: module Foo (Key : Eq) (Value : Type) = struct type key = Key.t ... in the implementation
<flux>
the 'with' is part of the syntax for making a variation of a module type, but you don't even need the module types in the implementation
<flux>
(though you must have the module type S replicated there sadly)
<cmtptr>
oh, that's a shame
<companion_cube>
unless you use the foo_intf.mli trick
<flux>
there'a a way around it, but it's not pretty: stick the module type into another file and include it
<flux>
well, I suppose no need to include it either, you can just refer to it
mort___ has quit [Quit: Leaving.]
<cmtptr>
hmmmmmm
<flux>
though one might expect the signature be there in the 'main' .mli file. you could just module type S = Foo_intf.S it there.
agarie has joined #ocaml
<companion_cube>
yep
<cmtptr>
or what if I named it foo/s.mli
<flux>
module names aren't automatically formed from directory hierarchy
<cmtptr>
oh
jeffmo has joined #ocaml
<cmtptr>
yeah I guess that would conflict with submodules in foo.mli
<cmtptr>
I guess it's not a huge deal since theoretically implementation should change more often than interfaces
<flux>
the compiler will kindly indicate if the signatures don't match :)
<Drup>
yep, it helps a bit with interface stability
<Drup>
flux: "kindly" :3
<flux>
yes, compiler the friendly companion
<flux>
btw, has someone tried the enhanced error messages branch?-o
<flux>
ie. 4.02.0+improved-errors
<ggole>
Does it try to improve on good old "Error: Syntax error"?
<osa1>
ocamlc failing with syntax error, I probably need a preprocessor but I have no ideas what
slash^ has joined #ocaml
<Drup>
osa1: ./configure --enable-camlp4
<Drup>
then make
<Drup>
and oasis will build them
<osa1>
awesome, thanks
rgrinberg has joined #ocaml
<Drup>
cmtptr: an example: if you have a module M with signature "type t val compare : t -> t -> int"
<Drup>
and you use destructive substitution on it
<Drup>
you won't be able to use the resulting module with Map.Make
mengu has quit [Remote host closed the connection]
<cmtptr>
oooh, right
kdef has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
Haudegen has joined #ocaml
calderonth has quit [Quit: Konversation terminated!]
palomer has quit [Quit: palomer]
<cmtptr>
so when writing a module that will be a functor's parameter, is it conventional to specify the signature too (which means I might have to sharing constraints) or to just leave it open?
swgillespie has joined #ocaml
<flux>
well, nowadays one can use the syntax "module type of Foo", so perhaps it's not essential
<flux>
but there used to be a time, not far far a way, when such syntax didn't exist
<cmtptr>
oh, how does that syntax work? I haven't seen it
<Drup>
cmtptr: yes, it's rather conventional
<Drup>
and it should be prefered. "module type of" is useful but still kind of a workaround
<flux>
simply where you would use "S" you can use the "module type of Foo". but perhaps drup is right about this.
<cmtptr>
"module Foo : Bar with type t = int = struct type t = int end" becomes ??
<Drup>
it doesn't help you in this specific case :p
<cmtptr>
oh
<cmtptr>
just feels like I'm having to duplicate a lot of information
swgillespie has quit [Client Quit]
javamonn has quit [Read error: Connection reset by peer]
<Drup>
well, not that much
tane has joined #ocaml
<cmtptr>
well not in this particular example, but between this and the .ml/.mli thing earlier...
<Drup>
you can use ppx_import for the .ml/.mli interface duplication
<cmtptr>
I'll take a look. thanks
kdef has quit [Quit: Leaving]
kushal has quit [Excess Flood]
srcerer has joined #ocaml
kushal has joined #ocaml
kushal has quit [Read error: Connection reset by peer]
kdas_ has joined #ocaml
kdas_ has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
javamonn has joined #ocaml
Choups314 has joined #ocaml
struk|work has joined #ocaml
Denommus` has quit [Ping timeout: 256 seconds]
freling has quit [Quit: Leaving.]
freling has joined #ocaml
sepp2k has quit [Quit: Leaving.]
octachron has quit [Quit: Leaving]
agarwal1975 has quit [Quit: agarwal1975]
Sorella has quit [Ping timeout: 264 seconds]
Sorella has joined #ocaml
mal`` has quit [Ping timeout: 276 seconds]
<ilia>
I am sorry to ask what I've already asked: ocamlfind list shows the module I want to open, but ocamlc complains about "unbound module", I reinstalled ocamlfind, but it did not help
kushal has quit [Ping timeout: 264 seconds]
<Drup>
how do you compile ?
mal`` has joined #ocaml
<ilia>
opam reinstall ocamlfind
slash^ has quit [Read error: Connection reset by peer]
<ilia>
it recompiled
<Drup>
No. How do you compile your stuff ..
<ilia>
ocamlc -o <name> <source.ml>
<ilia>
or "open Re;;" in utop
<Drup>
yeah, that doesn't work
<kakadu>
ocamlfind c -package PACKAGE_NAME sources
n3ss3s has joined #ocaml
<kakadu>
How did you get where Re module is from?
<ilia>
opam install
<kakadu>
opam packages <> ocamlfind packages
<jpdeplaix>
ilia: What Kakadu said. in your case: ocamlfind ocamlc -package re <source.ml> -o <name>
<ilia>
thanks, jpdeplaix, I know
<jpdeplaix>
if <name> is an executable add -linkpkg to the arguments
<ilia>
how to use Re in utop?
<jpdeplaix>
#package "re";;
<jpdeplaix>
I think
<ilia>
does not work
<ggole>
#require? Unless utop has different directives.
<reynir>
^
<jpdeplaix>
oh yes right, bad memory, sorry
<ilia>
many thanks!!
ncthom91 has joined #ocaml
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
kushal has joined #ocaml
ygrek has joined #ocaml
freling has quit [Quit: Leaving.]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kdef has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
thomasga has quit [Ping timeout: 256 seconds]
jonludlam has quit [Ping timeout: 240 seconds]
robink has quit [Ping timeout: 255 seconds]
robink_ has joined #ocaml
ncthom91 has joined #ocaml
agarie has quit []
jabesed has quit [Quit: Konversation terminated!]
ollehar1 has joined #ocaml
Choups314 has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 264 seconds]
matason has quit []
matason has joined #ocaml
<apache2>
anyone got any advice for debugging problems like this: [13832.866728] camlp4[4657]: segfault at 41 ip 00002b8b42fb9bd0 sp 00007fffb90d4670 error 4 in dllbigarray.so[2b8b42fb7000+5000]
<apache2>
happens every time I try to compile something that uses camlp4. I've tried on two different linux install running different distributions now
<apache2>
(in virtual machines). makes me wonder if it dies because it fails to check a memory allocation (that fails due to low memory) and proceeds to use it?
nullcat_ has joined #ocaml
ollehar1 has quit [Ping timeout: 246 seconds]
<n3ss3s>
How do I do integer division that allows for a float result?
<n3ss3s>
(I hope there is a prettier way than float_of_int'ing the two numbers)
<apache2>
you can use mod to get the remainder
<apache2>
or define a helper: let divide_with_float_result a b = float a /. float b
<apache2>
`float` is an alias of float_of_int in Pervasives
Simn has joined #ocaml
Hannibal_Smith has joined #ocaml
freling has joined #ocaml
manizzle has quit [Ping timeout: 272 seconds]
javamonn has quit [Remote host closed the connection]
oscar_toro has joined #ocaml
n3ss3s has quit [Ping timeout: 244 seconds]
ggole has quit [Ping timeout: 246 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
jonludlam has joined #ocaml
<smondet_>
apache2: are you sure the camlp4 you are using is at the same version as the ocaml compiler?
smondet_ is now known as smondet
javamonn has joined #ocaml
<cmtptr>
using String.iter, I need to skip the first element. Is there a better way than having a "isfirst" ref and in the closure, "if !isfirst then isfirst := false else (* stuff I actually want to do *)" ?
<Drup>
Use a for loop ?
<apache2>
smondet: I'm using the one supplied by opam, how do I check?
<cmtptr>
er, sorry I meant Stream.iter
<cmtptr>
I'm terrible at this whole typing thing today D:
<Drup>
errr, Stream.iter
<apache2>
camlp4 -v says 4.02.1 which is also my opam switch. which camlp4 points to my .opam/4.02.1/bin/camlp4
<Drup>
just ... don't use Stream
<cmtptr>
oh
<apache2>
strace -f says it fails after reading through sexplib.cma
<Drup>
cmtptr: what do you want to do ?
<smondet>
apache2: ok, so version mismatch must not be the problem
<apache2>
I do have camlp4 installed in debian, apparently, I'll try getting rid of that and see if it helps
<apache2>
it didn't :(
<cmtptr>
Drup, I want to parse a file, but skip the first line because it's a column header
<smondet>
apache2: the sexpllib.cma comes also in the right opam switch?
<Drup>
cmtptr: just call either input_line or Stream.junk once before iterating
<apache2>
oh, smondet, you were right about the version mismatch I think
<apache2>
[pid 2177] stat("/home/user/.opam/4.02.1/lib/stublibs/dllbigarray.so", 0x7fff0653f990) = -1 ENOENT (No such file or directory)
<apache2>
so first it looks in lib/stublibs in opam, which doesn't exist. then it tries the system lib (and segfaults if I don't remove it from there), then it tries ocaml/stublibs/ in the opam dir and finds it
<apache2>
that is the output of `strace -f make |& fgrep dllbigarray` in a directory with a project that uses camlp4
hugomg has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
<smondet>
weird order indeed
<apache2>
I guess for now I can probably symlink ~/.opam/4.02.1/lib/stublibs to ocaml/stublibs
<apache2>
oh. no, those are two different directories
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Denommus>
does anyone have any idea on how I can create tests for arrows that represent continuous values?
ollehar has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
ollehar has joined #ocaml
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
TheLemonMan has joined #ocaml
kushal has quit [Quit: Leaving]
<Denommus>
does it make sense to run utop under Emacs?
<flux>
well, maybe after you disable some features from it. but I think no.
<flux>
though emacs could benefit from it.. perhaps best would be to write some specific top level driver support to utop to make this situation work great.
<flux>
just today I was hoping merlin would work in toplevel ;)
mort___ has joined #ocaml
nullcat_ has joined #ocaml
<Denommus>
hm. Is there a package with ('a, 'b) result?
<Algebr>
Denommus: yea, I use utop under emacs, its pretty good
<Denommus>
ah, it's Result.t
<Algebr>
Result.t from core is that, I thought
<Denommus>
yeah
<flux>
algebr, so how does the expanding stuff work?
<Denommus>
but core is huge
<Algebr>
What do you mean expanding?
<Algebr>
So what its huge, (I never understood that argument)
<flux>
utop has some dynamic functionality when you write stuff down, it suggests completions
<apache2>
Algebr: the size means it's hard to compile it on VPS'es, and it takes for fucking ever to compile
jonludlam has quit [Ping timeout: 272 seconds]
<apache2>
if ocaml had dead module/code eliminination that might help
<Algebr>
flux: Yea, that's regular tab completion, just opens up the possible completions in another buffer
Haudegen has joined #ocaml
wraithm has joined #ocaml
<Denommus>
Algebr: I'm doing a library. As of now the only dependency is unix. Putting core as a dependency may be too much for the user
<flux>
algebr, so I guess it has then some emacs magic in it?
<flux>
I mean how else could it work
<Algebr>
like all other code completion ways that emacs does with other repl like things.
<flux>
well is emacs knows nothing about it, it can only do dynamic completion
<smondet>
Denommus: flux there is already a utop.el (that's how I use utop)
<flux>
but utop knows which modules are in the scope and can complete them
<flux>
but yes, I see there is indeed utop.el, so that probably gives all nice stuff
<flux>
maybe I'll start using it :)
<Algebr>
I installed core from scratch on a 3 year old macbook, took 10 minutes and its a one time deal. I just don't see why people complain about rock solid code given away so that you don't have to reimplement everything again and again.
<flux>
algebr, bbbut the binary size!
<Denommus>
smondet: I didn't know, thanks
<apache2>
a three year old macbook is more than most people have, Algebr
<Denommus>
Algebr: I personally don't care about dependencies, but my users may
javamonn_ has joined #ocaml
<flux>
science time! I have raspberry pi without core, I'll benchmark :)
<Algebr>
Most people is what? Regular people off the street, or developers? Because I would bet that over 90% of developers have at least a 3 year old macbook
<flux>
time opan install -y core
<flux>
my laptop is much older than 3 years. but I do have a desktop..
javamonn has quit [Ping timeout: 245 seconds]
<Denommus>
Algebr: most developers I know never had a macbook
<Algebr>
I mean something at least the equavalent of a 3 year old macbook in computing strenght
<apache2>
Algebr: most people I know. feel free to use Core with your uptown friends
<flux>
;-)
<smondet>
Algebr: on the machine I'm using to write this; compiling core_kernel goes out of memory
<Denommus>
I never had a macbook
<cmtptr>
hey since we're in anti-core mode, any reading recommendations that don't depend on core?
<flux>
welll, in general the non-core counterpart is Batteries
<Algebr>
smondet: a VM?
<flux>
and maybe OcamlNet
<flux>
and some other libraries
<apache2>
Algebr: also: how about smartphones? surely your friends have smartphones and want to run ocaml apps? or do they all use iphone and do you want to suggest core + ocaml_of_js ?
<apache2>
or js_of_ocaml i guess is the name
<cmtptr>
flux, looking for tutorials/books, not libs
<flux>
apache2, well, even smartphones are pretty kickass
<apache2>
not in terms of memory
<Algebr>
What ocaml apps? No one is doing ocaml on iphone, that posteros thing not counting.
<flux>
the resulting apps are not huge, or at least not all the code needs to be loaded to memory :)
<apache2>
which is what breaks the build flux, the processing time is sort of bearable I guess
<Denommus>
I wish there was a library with nothing but result
<Denommus>
because that's all I want now, really
<smondet>
Algebr: yes a VM, everything I do in OCaml compiles & works on that, and on my ARM chromebook as well. Binary size and compilation craziness is just part of what I have against core-like blobs.
<Algebr>
You could implement it, right, its not a complicated type
<Denommus>
Algebr: I know, but will it be compatible with Result from other libraries (including core)?
<apache2>
there's batteries and containers, Denommus, are they usable?
<Denommus>
I'm not very knowledgeable on OCaml's type system yet
<Denommus>
screw it, I'm going to implement it
<smondet>
Denommus: there are already 3 or 4 libs that implement only Result
<smondet>
the interesting ones use polymorphic variants, so they are compatible between each other
<Algebr>
smondet: I guess I just don't care about Binary size at all and compliation of code to me is a big so what if I get solid reusable code.
<Denommus>
smondet: any particular one I should use?
<smondet>
Algebr: you also get absurd version constraints, for little changes. You get C code --that you don't even use-- linked-in and running module initializations every time the program starts. etc.
matason has joined #ocaml
<Algebr>
smondet: I haven't experienced that pain yet, but I see this as a valid complaint.
mengu has joined #ocaml
ollehar has joined #ocaml
ollehar has quit [Remote host closed the connection]
jonludlam has joined #ocaml
kakadu has joined #ocaml
matason has quit [Ping timeout: 256 seconds]
javamonn_ has quit [Remote host closed the connection]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ollehar has quit [Remote host closed the connection]
nullcat has joined #ocaml
ollehar has joined #ocaml
javamonn has joined #ocaml
ollehar has quit [Remote host closed the connection]
matason has joined #ocaml
ontologiae has joined #ocaml
xificurC has quit [Remote host closed the connection]
<flux>
I'll report the time in the morning.. if it has passed..
Choups314 has joined #ocaml
<Drup>
nullcat: re's implementation is insane
<nullcat>
insane?
<Drup>
it's literally a jewel of design-for-efficiency
<Drup>
it has various clever trick that makes it really really fast
<Drup>
(and it's also absolutely not documented)
Choups314 has quit [Client Quit]
<ilia>
not documented :(
<Drup>
ilia: I'm talking about the internal implementation
n3ss3s has joined #ocaml
<Drup>
ok, the external interface is also poorly documented ...
<nullcat>
external interface is ok to me...
<ilia>
I have to look into internal source code
<Drup>
eeh, you do ?
<ilia>
nothing bad with it though
<nullcat>
Drup: I am planning to read the internal code... I am just afraid there might be too many clever tricks I don't understand
<Drup>
because the name and the types are pretty explanatory most of the times.
<Drup>
nullcat: it's very hard to understand, but it might be ocasionally enlightening
ollehar has joined #ocaml
s1n4 has joined #ocaml
<Drup>
but the transition function is .... wow
<nullcat>
ok i may seek help from you later...
<Drup>
ahah, seek my help
<Drup>
like I understand it :D
<nullcat>
... well
<Drup>
so, basically
<Anarchos>
Drup which transition function ?
<nullcat>
i just hate when beautiful code is not documented... like typing/typecore.ml. This community has many amazing project but they are barely readable...
<Drup>
yeah
ollehar has quit [Remote host closed the connection]
<nullcat>
at least typing/typecore.ml is obscure to me
<Drup>
Anarchos: well, the transition table of the automaton.
<Drup>
it's regular expression matching, there is an automaton :3
<nullcat>
i think my skill can improve after reading the source code of a good project, but some of them are not possible for me to read. this is sad...
<Drup>
nullcat: bunzli's libraries are readable
<nullcat>
ok..!
<Drup>
after that, it depends a lot of what you are looking for
rgrinberg has quit [Ping timeout: 264 seconds]
<nullcat>
Drup: I'm also wondering how you guys start to have the ability to hack ocaml compiler. i guess one may need to accumulate lots of knowledge and experience to do that?
<Anarchos>
nullcat as for every big project : tackle little problems, and go slowly deeper and deeper in the code... (i do'nt hack the ocaml compiler)
<Drup>
I have access to jerome vouillon, pierre chambart and grégoire henry in the next offices.
<Drup>
that's how I do :D
jwatzman|work has quit [Quit: jwatzman|work]
<nullcat>
...!!
<nullcat>
working at OCamlPro?
<Drup>
No, but same offices
<nullcat>
oh ok
<nullcat>
i have access to Jeremy Yallop this summer. hope I can learn something
<Drup>
Indeed, that tend to helps :p
jwatzman|work has joined #ocaml
<Drup>
nullcat: what are you going to do at OCamllabs ?
<Drup>
you are going to be the one working on that, nice.
<nullcat>
the paper is straightforward though
<nullcat>
yes... I don't feel very confident though
<nullcat>
and jeremy wants to implement in MetaOCaml. We first agreed the prototype can be written in OCaml and then we program in ppx.
<Drup>
ok
tsumetai has joined #ocaml
<Drup>
that seems sensible
<nullcat>
but it seems like we are going to stick with MetaOCaml eventually
freling has quit [Quit: Leaving.]
swgillespie has joined #ocaml
struktured has joined #ocaml
mort___ has quit [Quit: Leaving.]
ygrek has joined #ocaml
<nullcat>
and to be honest, I haven't written any parser generator before (but i still choose it, hoping to challenge myself)
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
nullcat has joined #ocaml
s1n4 has joined #ocaml
nojb has joined #ocaml
nullcat has quit [Client Quit]
divyanshu has joined #ocaml
<orbitz>
Is there a good document explaining the migration path to Bytes? I'm tryign to do it and concerend my code won't be valid..
<nojb>
there's not too much to it really : with -safe-string bytes and string are different types . if you want to know if your code will be valid just use -safe-string and see if it compiles. if it compiles, it will be :)
<orbitz>
Swell, thanks
<orbitz>
Do you know if you can set this in utop to play around?
<Drup>
orbitz: if anything, the main risk is your code being more valid
<Drup>
not less
<Drup>
(and with more copying)
<nojb>
utop -safe-string ?
<orbitz>
Hrm looks like that might work
<Drup>
btw nojb, we were talking re earlier. Are you still working on your unicode patch
<orbitz>
Drup: Yes, in this particular code I'm trying to avoid the copying, but have itbe safe
<orbitz>
I know in one place I can cheat and get away with Bytes.unsafe_to_string;;
<orbitz>
The main problem is Core though
<struktured>
orbitz: what project is this, if you don't mind?
<nojb>
Drup: haven't really made much progress since the initial patch
<orbitz>
struktured: I'm writing a little on-disk queue
<nojb>
(not enough time)
<Drup>
ok
<nojb>
but am interested in improving it
<orbitz>
ment for simple things where you want to have a queue that survives between process restarts
<struktured>
orbitz: opensource? if so got a link?
<orbitz>
struktured: It doesn't exist yet :)
<struktured>
ok ok sorry :)
<orbitz>
Well, right now it's just some brokeen code
<orbitz>
Right now I'm working on the log portion
<orbitz>
and trying to get my bytes and core aligned
<nojb>
Jerome sketched a way to implement the missing features (lookahead and lookbehind)
<nojb>
I need to dive into the code and figure out how to actually do it ...
<Drup>
I can try to give a hand in a few weeks
<nojb>
sure that would be great !
rgrinberg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<struktured>
orbitz: what makes your real life problem merit it's own queue implementation? Is ocaml lacking a good disk based (pure) one?
<Denommus>
the ArrowChoice names don't make a lot of sense in OCaml
<Denommus>
ondering if I should call the functions "ok" and "error" instead
<orbitz>
struktured: It isn't pure (on the file system, after all), but yes, I have not been able to fidn a trustworthy disk based queue in any language other than maybe Erlang
<orbitz>
an that one isn't even that trustworthy
<Denommus>
s/ondering/wondering/
tane has quit [Quit: Verlassend]
MercurialAlchemi has joined #ocaml
<struktured>
orbitz: I will at least consider ocaml-kafka, although it's possibly a little too much middleware for your needs
<struktured>
*will/would
<orbitz>
struktured: I'm not looking after middleware. I'm looking after something that will queue things when my middleware is down
<orbitz>
so I need an on disk queue library
<struktured>
I see, well looking forward to your future project announcement :)
<struktured>
Denommus: where is this ArrowChoice code?
<orbitz>
struktured: It's pretty small piece of code thankfully. Just data + length + crc-32 (for now). But will be open and probably in opam of course!
<Denommus>
struktured: in my library? Still haven't pushed it
<struktured>
Denommus: what are the function names called now? Also do you mean actually functions or just a (polymorphic) variant /
Gama11 has quit [Read error: Connection reset by peer]
<Drup>
so, directly in the eval/extract/match functions ?
ygrek_ has joined #ocaml
<Drup>
well, extract could not care
nojb has quit [Quit: nojb]
<Drup>
rgrinberg: but in theory, we could have routes with different host names
<nicoo>
Drup: Your usecase would be binding web APIs that are not served from a single canonical location (i.e. any web API provided but some soft you can install yourself, for instance), I guess ?
<ollehar1>
why is there no consensus about how a macro system should be built for a PL? lack of research?
<Drup>
nicoo: simple. You have the concat function over path.
<nicoo>
Ok, so the “host” component would just be a regular path
<Drup>
well, currently, it's part of the path, yes
<nicoo>
I see
<Drup>
ollehar1: because nobody designed a genuinely good one for typed languages.
<ollehar1>
hm
<Drup>
nicoo: also, don't forget it's also for server, not only for client
tsumetai has joined #ocaml
<rgrinberg>
Drup: that's a good point. I imagine the main use case is just tweaking the host for different environments and/or testing
<Drup>
or virtual hosts
<Drup>
just serving multiple website with one server, in general
osa1 has joined #ocaml
<nicoo>
Drup: That was part of my point
<rgrinberg>
IMO those use cases are secondary but if they can be supported, then hey, why not
<Drup>
currently, it's sort of supported out of the box, because the host is literally integrated with the path
<Drup>
but it generates some discutable semantic points, like the concatenation of two paths drop the host of the second one.
<rgrinberg>
one thing furl reminds me of is this java lib called retrofit - http://square.github.io/retrofit/. furl is a lot more focused than retrofit but i really like how fast retrofit lets me wrap rest api's.
<rgrinberg>
it's not that relevant, but a good inspiration
<Drup>
why do people keep thinking pure white background is elegant and grey code on white background is a good idea
<rgrinberg>
it's probably some common bootstrap theme :P
<Drup>
I call that "internet brainstroke", but I guess it's equivalent
<Drup>
rgrinberg: I don't see anything that can't be done already with furl
<Drup>
oh, header and post, yeah, that's not here yet
<Drup>
the whole return type thing is a great question, though
<Drup>
rgrinberg: do you think I should care about it ?
<rgrinberg>
Yeah, retrofit isn't directly comparable. I'd imagine wanting to build something like retrofit on top of furl though
<rgrinberg>
and no i don't think you should care about it
<Drup>
ok
<Drup>
I should care about post parameters and http verb at some point, though
<rgrinberg>
yeah, it's not so clear if those require cutesy combinators however
<Drup>
why not ?
<rgrinberg>
maybe i just don't have the imagination ;)
<Drup>
Don't worry, I'll find combinators :D
<rgrinberg>
but OTOH i imagine something simple and applicative (drawing inspiration from cmdliner)
<Drup>
I don't see why the API shouldn't be exactly the same than for query parameters
larhat has quit [Quit: Leaving.]
<rgrinberg>
can you give an example? To me, the point of furl is to have something "url like"
<rgrinberg>
i could be missing the point though
<Drup>
except the mode of transmission, do you make any difference between get and post parameters ?
<Drup>
some are in the url, some are not
ncthom91 has joined #ocaml
<Drup>
but from an API point of view
<Drup>
this is completely insignificant.
<Drup>
so I don't see why the combinators to manipulate the should be different
<Drup>
you would just say "this pile of stuff is for get params, this for post params" at the end, that's all
<rgrinberg>
hmm, ok let's see an example of you imagine a couple of extra headers a json body would be inserted
<rgrinberg>
s/a json/and a json/
<Drup>
headers is something else :p
<Drup>
we were talking post params ;)
<rgrinberg>
true, but post params is just a url encoded body. json is just as common.
<Drup>
what's the issue with json ?
<rgrinberg>
there isn't
<rgrinberg>
i just want to get a flavor for the api
<Drup>
I wonder if I should special case Json handling
<jcloud>
is there overview documentation for cohttp somewhere?
<rgrinberg>
jcloud: no. but feel free to ask here
<Drup>
it's not really possible to make that fit into Re though, so probably not a good idea
<jcloud>
rgrinberg: I see, thanks
<Drup>
(ahah, parsing json with Re, krkrkr)
Cyanure has quit [Remote host closed the connection]