<companion_cube>
I don't think there's a convention
<companion_cube>
my own is to suffix with _ but it's kind of weak
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
<d_bot>
<geoff> `Dont_you_dare_Foo`
wingsorc has quit [Remote host closed the connection]
<companion_cube>
in practice I'd consider `Foo_internal_ ` to be pretty ok
wingsorc has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 272 seconds]
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
zebrag has joined #ocaml
waleee has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
<greenbagels>
whats the space/time complexity of String.sub again?
<companion_cube>
`String.sub s i len` allocates a block of size len(+2), does a linear time copy into it, and returns it
<companion_cube>
so it's one allocation and one memcpy, more or less
<greenbagels>
ah right it was recursing over a string's tail repeatedly using sub that was a bad idea
<greenbagels>
because its quadratic space usage
<greenbagels>
and the solution was... using buffers?
<companion_cube>
the solution is using an integer offset I think
<greenbagels>
ahh right
brettgilio has quit [Remote host closed the connection]
brettgilio has joined #ocaml
<companion_cube>
kind of low level, but well
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
chrisz has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml
motherfsck has quit [Ping timeout: 268 seconds]
<greenbagels>
Say I have a huge string, and i have a list of tiny strings with positions that i want to overwrite substrings in the original string with
<greenbagels>
what would be the idiomatic way to do this? i guess it boils down to thinking about an idiomatic way to overwrite some (offset, length) of a given string
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
motherfsck has joined #ocaml
xd1le has joined #ocaml
adanwan has quit [Ping timeout: 268 seconds]
adanwan has joined #ocaml
trev has joined #ocaml
<williewillus>
have a type that is just the original string + a range?
<d_bot>
<jumpnbrownweasel> an array with an offset and length is called a slice, and Bigarray in the stdlib supports them
<d_bot>
<jumpnbrownweasel> ```
<d_bot>
<jumpnbrownweasel> Bigarrays support interesting high-level operations that normal arrays do not provide efficiently, such as extracting sub-arrays and 'slicing' a multi-dimensional array along certain dimensions, all without any copying.
azimut has quit [Remote host closed the connection]
jpds has quit [Remote host closed the connection]
adanwan has quit [Remote host closed the connection]
jpds has joined #ocaml
azimut has joined #ocaml
adanwan has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
mbuf has joined #ocaml
adanwan has quit [Ping timeout: 268 seconds]
adanwan has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
Serpent7776 has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
williewillus has quit [Quit: Leaving]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
Haudegen has joined #ocaml
neiluj has joined #ocaml
<neiluj>
Hi! is it possible to add a stanza in dune files to retrieve files from internet for use in tests? will these stanzas be executed by the opam CI when the package is published?
Sankalp has joined #ocaml
<neiluj>
because several packages that were published on opam need common files for tests, either we vendor them in each package but there's duplication, either we make one big package that centralizes the other packages as submodules
Tuplanolla has joined #ocaml
<octachron>
neiluj, pam is sandboxed and I think that the sandbox doesn't allow internet connection at all.
<neiluj>
thanks, so this rules out the download file from internet option
orbifx has joined #ocaml
<d_bot>
<Et7f3 (@me on reply)> Do you use in outside file ? If no then their is open struct hidden decl end
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
azimut_ has quit [Ping timeout: 268 seconds]
azimut has joined #ocaml
bartholin has joined #ocaml
adanwan has quit [Ping timeout: 268 seconds]
adanwan has joined #ocaml
waleee has joined #ocaml
Serpent7776 has quit [Ping timeout: 260 seconds]
waleee has quit [Ping timeout: 272 seconds]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
Serpent7776 has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
orbifx has quit [Remote host closed the connection]
adanwan has quit [Remote host closed the connection]
orbifx has joined #ocaml
adanwan has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
perrierjouet has joined #ocaml
orbifx has quit [Remote host closed the connection]
orbifx has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Ping timeout: 268 seconds]
orbifx has quit [Ping timeout: 252 seconds]
* Anarchos
is trying to enable native compilation of 5.0.0 on the Haiku platform
<companion_cube>
octachron: wait, Parsing has global state?
<zozozo>
companion_cube: looks like it indeed
<companion_cube>
and does menhir? :s
<octachron>
companion_cube, yes, all ocamlyacc parsers share a global state
<zozozo>
companion_cube: I don't think it's the case for menhir
<zozozo>
since in dolmen i now uses two menhir persers interleaved and it works correctly
<companion_cube>
octachron: yikes to the yikes
<companion_cube>
sadly it's also the case for 100% of compiler-libs, but that's not too surprising
<drakonis>
time to redesign the parsers
<zozozo>
time to move on to menhir ?
<octachron>
worse it is enshrined to the api with the way rhs_start_pos works and friends with ocamlyacc
<zozozo>
I mean, are there any good reasons right now to use ocamlyacc instead of menhir ? (even the compiler switched to menhir a while ago)
<drakonis>
oh, did it now?
<companion_cube>
ocamlyacc is stable, zozozo
<companion_cube>
that's one plus
<companion_cube>
probably the only plus, though :D
<zozozo>
companion_cube: menhir is also stable I think: it has new features added to it, but it doesn't break things afair
<companion_cube>
is ocamlyacc still going to ship with 5.0 btw?
<companion_cube>
it is not stable, nor does it promise stability, zozozo
<companion_cube>
recently the type inference stuff broke my code in many places
<companion_cube>
worth it, but still a breakage
<companion_cube>
and it doesn't use semver
trev has quit [Remote host closed the connection]
<zozozo>
companion_cube: ah, right...
<zozozo>
but if you really want stabilkity, you can always just commit the generated parser ?
<d_bot>
<darrenldl> reliance on global state in old api is always...curious
<companion_cube>
erf zozozo :D
<companion_cube>
then you also need to vendor menhirSDK
<zozozo>
right...
<companion_cube>
I think it's still worth it, but it's a bit sad that fpottier doesn't care about giving stability guarantees
* Anarchos
uses dypgen in a project, and it is a pain that it is unmaintained
xd1le has quit [Quit: xd1le]
<companion_cube>
so you're maintaining it?
<octachron>
ocamlyacc will still be distributed with the compiler. I imagine that companion_cube is indirectly referencing my proposal to have domain-local state for ocamlyacc, which would extend a bit the usability of ocamlyacc parsers.
<companion_cube>
yeah that's where I saw that :p
<companion_cube>
how is DLS implemented btw? I'm really curious
<companion_cube>
it would have been nice to have that for threads all these years :)
<Anarchos>
companion_cube i try...
<zozozo>
companion_cube: iirc, DLS is an array in the caml_state struct for each domain
<sim642>
Ugh, odoc's @canonical must contain a dot. But I want my library entry to be canonical
<companion_cube>
zozozo: very nice, so it must be reasonably efficient
<companion_cube>
will come in handy for instrumentation and the likes
spip has quit [Ping timeout: 240 seconds]
bobo_ has joined #ocaml
<d_bot>
<darrenldl> Anarchos: are you in the grain lang group?
<companion_cube>
does… grain use dypgen? :/
<Anarchos>
d_bot no
<Anarchos>
companion_cube yes
<Anarchos>
companion_cube they forked it
<companion_cube>
but why?
<companion_cube>
if you write a language, you really should aim for a simple parser technology?
<Anarchos>
companion_cube i am not in the grain group so can't say \o/
Serpent7776 has quit [Quit: WeeChat 1.9.1]
<d_bot>
<mbacarella> you're using ocaml modules that were translated from python. python allows "foo" as well as "Foo". ocaml requires all modules to be capitalized. if you naively translate pythin foo to ocaml Foo you will collide with python Foo.
<companion_cube>
if your python code has Foo and foo, you're fucked :D
<d_bot>
<mbacarella> what do you find less horrible
<d_bot>
<mbacarella> foo -> Lc_foo
<d_bot>
<mbacarella> foo -> Foo_lc
<d_bot>
<mbacarella> ?
<companion_cube>
fail if python has both
<companion_cube>
:p
<d_bot>
<mbacarella> that's what happens currently and I'd like to keep it that way but alas
<d_bot>
<hockletock> Prepend every imported module with a fixed prefix?
zebrag has joined #ocaml
<d_bot>
<hockletock> e.g. Foo in python becomes PyFoo
<d_bot>
<hockletock> and foo becomes Pyfoo
adanwan has quit [Ping timeout: 268 seconds]
spip has joined #ocaml
bobo_ has quit [Ping timeout: 272 seconds]
adanwan has joined #ocaml
gwizon has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
<d_bot>
<mbacarella> I would but 80% of the time no fixup is needed so that just adds extra noise
<d_bot>
<mbacarella> I think what I'm converging on is: check to see if the module needs fixups because of collisions at all, if it doesn't, do naive capitalize. otherwise do the hideous thing
motherfsck has quit [Ping timeout: 255 seconds]
williewillus has joined #ocaml
motherfsck has joined #ocaml
gwizon has quit [Quit: Lost terminal]
bobo_ has joined #ocaml
rgrinberg has joined #ocaml
spip has quit [Ping timeout: 264 seconds]
<d_bot>
<Bluddy> that's a pretty common solution for this kind of issue
<neiluj>
hey! with OCaml-C bindings is it possible to pass a C function to a C stub? the idea would be to have generic algos in C that take pointers to functions f_i as arguments and have an OCaml functor that takes the f_i's and produces the bindings to the algos with the f_i's functions
<neiluj>
that would be funky, and very useful to avoid duplicated C code
<neiluj>
the functor would be parametrized by the external C functions
mbuf has quit [Quit: Leaving]
<theblatte>
ocaml doesn't let me use a type variable in the definition of a local exception: let aux ~(f: _ -> 'a) = let exception Prout of 'a in raise Prout (f 42)
<theblatte>
Error: The type variable 'a is unbound in this type declaration.