<companion_cube>
it's just that they are close to C/fortran
<companion_cube>
and they are limited to a handful of primitive types (including floats)
<orbifx[m]>
But (1) are they purely OCaml or do they have C bindings? (2) Are the immutable?
* orbifx[m]
is checking them out now
<companion_cube>
they are not immutable
<companion_cube>
and they use C primitives
<companion_cube>
but… numerical computations with immutable data, who does that?
mbuf has quit [Quit: Leaving]
MercurialAlchemi has quit [Quit: Lost terminal]
<orbifx[m]>
:D
<orbifx[m]>
Am I the first one? :P
<orbifx[m]>
Safety is important in this case.
<companion_cube>
well I think it's one of these domains where imperative is several order of magnitudes faster
danieli has joined #ocaml
danieli has joined #ocaml
argent_smith has quit [Quit: Leaving.]
<orbifx[m]>
So I preferring: immutability > pure ocaml > performance
<thizanne>
then use lists
<companion_cube>
you might want to try maps, then, I guess‽
<companion_cube>
or lists indeed
<orbifx[m]>
because we are talking about arrays of 10-20 elements
<companion_cube>
ah
<companion_cube>
then immutable arrays and Array.sub probably won't be slower
danieli has quit [Read error: Connection reset by peer]
danieli has joined #ocaml
danieli has joined #ocaml
sh0t has joined #ocaml
sh0t has quit [Remote host closed the connection]
<orbifx[m]>
You mean use Array.sub and then return CCImmutArray.of_array_unsafe?
sh0t has joined #ocaml
<companion_cube>
yeah
<companion_cube>
ah I should add a `sub` function tho at some point
Jesin has joined #ocaml
<Leonidas>
I am obviously very confused, but I have a Js.js_string Js.t Js.opt Js.prop = < get : Js.js_string Js.t Js.opt; set : Js.js_string Js.t Js.opt -> unit > Js.gen_prop
<Leonidas>
but whenever I try to call #set I get that the value has no method set?
Pedro2018 has joined #ocaml
argent_smith has joined #ocaml
<Pedro2018>
Hi guys! I have a type related question : I'd like to transform an element of some inductive type (say int list) into a polymorphic recursor of the form "fold : 'acc . ('acc -> int -> 'acc) -> 'acc -> 'acc". So it would have to be a function of type transform : int list -> ('acc . ('acc -> int -> 'acc) -> 'acc -> 'acc).
<companion_cube>
you need to wrap the recursor into a record
<Pedro2018>
In OCaml, universal type quantification is only allowed in prenex form, which prevents the above type
<Pedro2018>
I see, so it would be int list -> { fold = ... }
<companion_cube>
type int_recursor = {iter: 'a. ('a -> int -> 'a) -> 'a -> 'a}
<octachron>
Leonidas, "obj##.prop := value" for Js.prop
<companion_cube>
something like that
<companion_cube>
you can have a 'b recursor, too
<companion_cube>
but yeah, quantfication needs to be wrapped in record (or object) fields
<companion_cube>
also, not sure, but I think you can [@@unboxed] the record
<Pedro2018>
I'm not familiar with these new funky annotations, I'll have a look too
<companion_cube>
it's just for optimizing tho
<octachron>
companion_cube, yep this kind of record is a prime candidate for unboxing
<Pedro2018>
do you know where I could find examples of such uses of polymorphic records ? it must be a standard exercise I guess
<Pedro2018>
unrelated: does this kind of unboxing rely on using the flambda branch ?
<oh_lawd>
is there something like python's argparse for ocaml, that would also support positional arguments
<Drup>
oh_lawd: use cmdliner
<companion_cube>
or Arg, for starters
<octachron>
Leonidas, in this case, it is jbuilder that does not work. Do you have any outstanding reason to use jbuilder here? Jbuilder purposely breaks a lot of ppx's.
<oh_lawd>
using Arg now, but I'd like to repeat the functionality of my command line client I always write with a new language
<companion_cube>
what kind of functionality are you talking about, in this case?
<oh_lawd>
so here I can use positional arguments, such as `client GET /path/to/resource`
<oh_lawd>
I'll do it a bit differently first, but definitely having a look to the cmdliner
<Drup>
octachron, Leonidas: jsoo's ppx should work though, but I can't help more than that, jbuilder's conf for ppx is ... weird
<Leonidas>
octachron: all the rest of the code uses jbuilder and I don't really feel like switching to the 3rd build system in 4 weeks, we just got rid of omake :-/
<Leonidas>
Drup: yep, I also saw that it uses omp so in theory it should be fine
argent_smith has quit [Quit: Leaving.]
<Drup>
I guess your best bet is to manage to catch rgrinberg's attention
argent_smith has joined #ocaml
<Leonidas>
yep, that's why I posted to the discuss with a git repo to reproduce.
Jesin has quit [Quit: Leaving]
sz0 has quit [Quit: Connection closed for inactivity]
Jesin has joined #ocaml
Onemorenickname has joined #ocaml
<Onemorenickname>
What does "type new_type = .." mean ?
<Onemorenickname>
(I don't know how to make Google searches with symbols)