profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/rgrinberg/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

ocaml/merlin 1318

Context sensitive completion for OCaml in Vim and Emacs

ocaml/dune 1102

A composable build system for OCaml.

inhabitedtype/httpaf 467

A high performance, memory efficient, and scalable web server written in OCaml

ahrefs/atd 202

Static types for JSON APIs

ocaml-community/cppo 79

C-style preprocessor for OCaml

ocaml/vim-ocaml 75

Vim runtime files for OCaml

andrenth/ocaml-stdint 62

Various signed and unsigned integers for OCaml

ocaml-community/biniou 33

Extensible binary data format, like JSON but faster

ocaml-community/easy-format 29

Pretty-printing library for OCaml

inhabitedtype/bigstringaf 27

Bigstring intrinsics and fast blits based on memcpy/memmove

startedBlosc/caterva

started time in 4 minutes

pull request commentocaml/dune

[coq] Preliminary support for split native compilation

I don't think there is a very pressing need to have this in 2.9 if the next non-patch release (be it 2.10 or 3.0) has it and comes in just a few months.

ejgallego

comment created time in 4 minutes

pull request commentocaml/ocaml

stdlib: add `List.is_empty`

there's perhaps a case to be made for Seq.is_empty too, though it does force an unused element. (Containers and Base provide it.)

I would prefer not adding functions that force sequences.

CraigFe

comment created time in 8 minutes

issue commentocaml/ocaml

Minor improvement in module Switch

The proposed patch looks correct to me. There are two symmetric tests

let len1 = Array.length c1
and len2 = Array.length c2 in
let l1,h1,act1 = c1.(Array.length c1-1)
and l2,h2,act2 = c2.(0) in
if act1 = act2 then
  let r = Array.make (len1+len2-1) c1.(0) in
  for i = 0 to len1-2 do
    r.(i) <- c1.(i)
  done ;

  let l =
    if len1-2 >= 0 then begin
      let _,h,_ = r.(len1-2) in
      if h+1 < l1 then
        h+1
      else
        l1
    end else
      l1
  and h =
    if 1 < len2-1 then begin
      let l,_,_ = c2.(1) in
      if h2+1 < l then
        l-1
      else
        h2
    end else
      h2
   in (* ... *)

The first test len1-2 >= 0 checks that the following array access r.(len1-2) is valid. The second test 1 < len2-1 checks that the following array access c2.(1) is valid, but it is too conservative, 1 < len2 (or 1 <= len2-1 as suggested, which I find less clear) would be correct and indeed produce slightly better code in case c2 has two elements.

mhrde

comment created time in 16 minutes

PR closed ocaml-ppx/ppxlib

Make Astlib.Parser.token interchangable with Ocaml_common.Parser.token

This seems to be necessary to port https://github.com/janestreet/ppx_optcomp to ppxlib master. See in particular https://github.com/janestreet/ppx_optcomp/blob/v0.14/src/cparser.ml which contains the core of the issue. While trying to port it I tried to change the use of Parser.token to Ocaml_common.Parser however I got stuck when assert_no_attributes_in#structure_item was called with the wrong type.

Feel free to discuss and/or close this as this is pure guess and I am no expert in the new astlib layer. cc @pitag-ha

+1 -1

1 comment

1 changed file

kit-ty-kate

pr closed time in 20 minutes

pull request commentocaml-multicore/ocaml-multicore

Implement caml_alloc_dependent_memory and caml_free_dependent_memory

ergh, weaklifetime_par is failing

I believe this unrelated to this PR and actually another occurrence of #588.

ctk21

comment created time in 39 minutes

Pull request review commentocaml/dune

Add variables %{lib-private} and %{libexec-private}

+----------------------------------------------------------------------------------+Testsuite for the %{lib...} and %{lib-private...} variable.+TODO: Fix %{libexec} and %{libexec-private} variables and test them.++  $ cat >sdune <<'EOF'+  > #!/usr/bin/env bash+  > DUNE_SANDBOX=symlink dune "$@"+  > EOF+  $ chmod +x sdune++----------------------------------------------------------------------------------+* Find a public library using the %{lib:...} variable++  $ echo "(lang dune 2.0)" > dune-project+  $ mkdir -p src+  $ cat >src/dune <<EOF+  > (library+  >  (name private_lib)+  >  (public_name public_lib)+  >  (modules a))+  > EOF++  $ cat >dune <<EOF+  > (rule+  >  (alias find-a)+  >  (action (echo "%{lib:public_lib:a.ml}")))+  > EOF++  $ cat >src/a.ml <<EOF+  > let a = "A"+  > EOF+  $ cat >src/a.mli <<EOF+  > val a : string+  > EOF++  $ touch public_lib.opam+  $ ./sdune build @find-a+  ../install/default/lib/public_lib/a.ml++----------------------------------------------------------------------------------+* Error when finding a public library by its private name using the %{lib:...} variable++  $ cat >src/dune <<EOF+  > (library+  >  (name private_lib)+  >  (public_name public_lib)+  >  (modules a))+  > EOF++  $ cat >dune <<EOF+  > (rule+  >  (alias find-a)+  >  (action (echo "%{lib:private_lib:a.ml}")))+  > EOF++  $ ./sdune build @find-a+  File "dune", line 3, characters 18-39:+  3 |  (action (echo "%{lib:private_lib:a.ml}")))+                        ^^^^^^^^^^^^^^^^^^^^^+  Error: Library "private_lib" is not public. You can use the "lib" variable+  only with public libraries that are installed.

I'm hitting this error 1.5 years later and I'm confused: why do we say the library is private even though it's actually public? At the very least the error message is confusing, but I can't even tell why it's an error in the first place.

snowleopard

comment created time in 40 minutes

issue commentocaml/ocaml

Minor improvement in module Switch

The proposed patch is as follows:

diff -Naur ocaml/lambda/switch.ml ocaml-patched/lambda/switch.ml
--- ocaml/lambda/switch.ml      2021-06-18 16:19:45.050255694 +0200
+++ ocaml-patched/lambda/switch.ml      2021-06-18 16:25:05.844442177 +0200
@@ -269,7 +269,7 @@
             end else
               l1
           and h =
-            if 1 < len2-1 then begin
+            if 1 <= len2-1 then begin
               let l,_,_ = c2.(1) in
               if h2+1 < l then
                 l-1

(Note: I would recommend using git, making commits, and then using git format-patch if you want a patch file.)

mhrde

comment created time in an hour

created repositorykostja/scylla-cpp-example

created time in an hour

issue commentLnL7/nix-darwin

Using the new native M1 support

For those like me that use a pure nixpkgs install (i.e don't use nix-darwin, flakes, or whatever), I'm popping up a nix-shell with arm64 derivations quite easily:

$ sh <(curl -L https://nixos.org/nix/install) --daemon  # install as usual
$ cat /etc/nix/nix.conf                                 # add extra-platforms

build-users-group = nixbld
extra-platforms = x86_64-darwin aarch64-darwin
$ cat shell.nix
{
  pkgs ? import <nixpkgs> { localSystem = "aarch64-darwin"; },
}:
let
  ruby = pkgs.ruby_3_0;
in pkgs.mkShell {
  buildInputs = [
    pkgs.openssl
    ruby
  ];
}
$ nix-shell
nix$ which ruby
/nix/store/sc54smx4gqa80nxwpfvpxfw8slh7fgyd-ruby-3.0.1/bin/ruby
nix$ file $(which ruby)
/nix/store/sc54smx4gqa80nxwpfvpxfw8slh7fgyd-ruby-3.0.1/bin/ruby: Mach-O 64-bit executable arm64

Now I'm a complete beginner, so if only I knew how to pivot the nixpkgs install into arm64 😅

purcell

comment created time in an hour

PR opened ocaml-multicore/ocaml-multicore

Implement caml_alloc_dependent_memory and caml_free_dependent_memory

This PR fixes #512.

caml_adjust_gc_speed was handled in #589 and this PR just gives implementations (matching upstream OCaml) for caml_alloc_dependent_memory and caml_free_dependent_memory.

+37 -3

0 comment

4 changed files

pr created time in an hour

issue closedocaml/merlin

Merlin unable to locate operators

Consider:

let ( +++ ) x y = x ^ y

let z = "foo" +++ "bar"

When one hovers over +++ in the definition of z, merlin correctly returns the type. But it fails to find the definition of +++.

closed time in an hour

rgrinberg

startedraven2cz/awesomewm-config

started time in an hour

pull request commentocaml/ocaml

stdlib: add `List.is_empty`

Note: the structural equality version is better now, but only because the pattern-matching compiler generates sub-optimal code. In an ideal world the pattern-matching case should compile to l & 1 (one bit comparison) while the equality will be compiled to l == 1 (full-length comparison). (I believe that this is already the case in Flambda 2, and could be the case in the current compiler if a switch was generated instead of an if-then-else).

CraigFe

comment created time in an hour

issue commentocaml/merlin

Merlin unable to locate operators

I think it got fixed. I can't reproduce it with ocamllsp either.

On Fri, Jun 18, 2021, 19:36 Ulysse ***@***.***> wrote:

I just noticed this issue is from April, maybe it has been fixed since then ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ocaml/merlin/issues/1332#issuecomment-864085185, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4YR6Z7QXKRX4EDHG6MLM3TTNKX3ANCNFSM43X67AMA .

rgrinberg

comment created time in an hour

issue openedocaml/ocaml

Minor improvement in module Switch

Hello OCAML team,

on inspection of the code in lambda/switch.ml I found a slight unsymmetry in the function case_append. The low and high boundaries are changed to close gaps, if neighbouring cases have the same action. This is done, if the first case list has more then one case or if the second case list has more then two cases. In order to also optimize the latter for exactly two cases, one comparison must be changed as done in the lambda-switch.patch.gz.

This might slightly produce better code.

Kind regards,

Michael Rose

created time in an hour

issue commentocaml/merlin

Merlin unable to locate operators

I just noticed this issue is from April, maybe it has been fixed since then ?

rgrinberg

comment created time in an hour

issue commentocaml/merlin

Merlin unable to locate operators

I tried to reproduce in a test with no success:

  $ cat >test.ml <<EOF
  > let ( +++ ) x y = x ^ y
  > let z = "foo" +++ "bar"
  > EOF

  $ $MERLIN single locate -look-for ml -position 2:16 \
  > -filename test.ml < test.ml
  {
    "class": "return",
    "value": {
      "file": "$TESTCASE_ROOT/test.ml",
      "pos": {
        "line": 1,
        "col": 4
      }
    },
    "notifications": []
  }

Maybe OCaml-LSP does not use the same command ?

rgrinberg

comment created time in an hour

pull request commentocaml/ocaml

stdlib: add `List.is_empty`

Implementation switched to use structural equality rather than pattern matching (thanks to a hint by @dra27). It seems the compiler has an easier time eliminating the branch this way:

 |(seq
-|  (let (is_empty/80 = (function l/82 (if l/82 0a 1a)))
+|  (let (is_empty/80 = (function l/82 (== l/82 0a)))
 |    (setfield_ptr(root-init) 0 (global Test!) is_empty/80))
 |  0a)
CraigFe

comment created time in an hour

issue closedocaml/dune

[REQUEST] OCaml presence check should be delayed.

<!-- Thank you for filing an issue to help us improve Dune! -->

Desired Behavior

dune should not check for presence of OCaml <!-- Please describe the desired behavior in as much detail as you can. This should include the context in which you think this would be useful. --> I use dune cram in other project (without one line of OCaml) but we still need to install OCaml has dependency. On archlinux it pull 300Mo. Maybe expose the cram runner as second binary to reduce even more the size.

Example

<!-- Please provide a concrete example of the proposed functionality. This would include a minimal working example of the files you're trying to build with. --> Just hide OCaml from your env and you won't be able to run a cram test.

closed time in 2 hours

Et7f3

issue commentocaml/dune

[REQUEST] OCaml presence check should be delayed.

Thanks for workaround.

Et7f3

comment created time in 2 hours

pull request commentocaml-multicore/ocaml-multicore

Fix two issues with ephemerons

ugh. The CI is failing with the same bug as this one is purportedly fixing. I've marked this PR as draft. I'll continue working on it next week.

kayceesrk

comment created time in 2 hours

pull request commentocaml/ocaml

Preserve the bracketed lists in the Parsetree

The testsuite is currently broken:

List of failed tests:
    tests/parsetree/'locations_test.ml' with 1 (toplevel) 
gpetiot

comment created time in 2 hours

push eventocaml-multicore/ocaml-multicore

Enguerrand Decorne

commit sha 3ecdeb8b0db8d81902135262e0e16b25eff1a266

runtime: reintroduce adjust_gc_speed

view details

Enguerrand Decorne

commit sha 1bab86f547b5dcd41d6a9d3397d1845db5a7d7ab

runtime: account properly for custom blocks in the minor segment

view details

Enguerrand Decorne

commit sha 4209a0a56c1b03c452e693bb7f448de7a6760c99

runtime: reshaping a bit the adjust_gc_speed code to match trunk and be accurate to its current state

view details

Enguerrand Decorne

commit sha c97167dfd89429e14dce9b4f001c217045969ad7

runtime: we should adjust_gc_speed for every custom blocks during the minor collection

view details

Enguerrand Decorne

commit sha c1397d23895bf9de81812542641155e954cc1a90

runtime: remove unused caml_extra_heap_resources_minor variable from minor_gc.c

view details

Tom Kelly

commit sha 2ce54b0bd304bb1a8b2312d8d6de82d42b272d75

Merge pull request #589 from Engil/adjust_gc_speed Reintroduce adjust_gc_speed

view details

push time in 2 hours

PR merged ocaml-multicore/ocaml-multicore

Reintroduce adjust_gc_speed

This PR reintroduce the caml_adjust_gc_speed function in the runtime. The core logic of the function is mostly unchanged from trunk.

Caml_state now holds a specific variable (extra_heap_resources) to track additional work to be done by the garbage collector during a major collection. caml_adjust_gc_speed will set this variable to a desired factor, that will be taken into account in update_major_slice_work. It will be as well reset (to 0.0) at the end of work computation.

I've reintroduced the call to adjust_gc_speed in alloc_custom_gen as well. (in the default branch where custom values are allocated onto the shared heap, since the minor heap case is commented away.)

+39 -12

1 comment

7 changed files

Engil

pr closed time in 2 hours

Pull request review commentocaml/dune

Mdx stanza rework

 let gen_rules_for_single_file stanza ~sctx ~dir ~expander ~mdx_prog src =   Super_context.add_alias_action sctx (Alias.runtest ~dir) ~loc:(Some loc) ~dir     diff_action +let name = "mdx_gen"++let mdx_prog_gen t ~sctx ~dir ~scope ~expander ~mdx_prog =+  let loc = t.loc in+  let dune_version = Scope.project scope |> Dune_project.dune_version in+  let file = Path.Build.relative dir "mdx_gen.ml-gen" in++  (* Libs from the libraries field should have their include directories sent to+     mdx *)+  let open Resolve.O in+  let directory_args =+    let+ libs_to_include =+      Resolve.List.filter_map t.libraries ~f:(function+        | Direct lib+        | Re_export lib ->+          let+ lib = Lib.DB.resolve (Scope.libs scope) lib in+          Some lib+        | _ -> Resolve.return None)+    in++    let mode = Context.best_mode (Super_context.context sctx) in++    let libs_include_paths = Lib.L.include_paths libs_to_include mode in++    let open Command.Args in+    let args =+      Path.Set.to_list libs_include_paths+      |> List.map ~f:(fun p -> S [ A "--directory"; Path p ])+    in+    S args+  in++  let prelude_args =+    Command.Args.S (List.concat_map t.preludes ~f:(Prelude.to_args ~dir))+  in++  (* We call mdx to generate the testing executable source *)+  let action =+    Command.run ~dir:(Path.build dir) mdx_prog ~stdout_to:file+      [ A "dune-gen"; prelude_args; Resolve.args directory_args ]+  in+  let open Memo.Build.O in+  let* () = Super_context.add_rule sctx ~loc ~dir action in++  (* We build the generated executable linking in the libs from the libraries+     field *)+  let obj_dir = Obj_dir.make_exe ~dir ~name in+  let main_module_name = Module_name.of_string name in+  let module_ = Module.generated ~src_dir:(Path.build dir) main_module_name in+  let modules = Modules.singleton_exe module_ in+  let flags = Ocaml_flags.default ~dune_version ~profile:Release in+  let compile_info =+    Lib.DB.resolve_user_written_deps_for_exes (Scope.libs scope)+      [ (t.loc, name) ]+      (Lib_dep.Direct (loc, Lib_name.of_string "mdx.test") :: t.libraries)+      ~pps:[ (*Preprocess.Per_module.pps t.preprocess*) ] ~dune_version

It's not, there is no need to preprocess the source generated by mdx for the test executable.

voodoos

comment created time in 2 hours

startedrahuln/lm-bio-kgc

started time in 2 hours

PR closed ocaml/dune

OCaml's version is included instead of cpp <version>

The issue is dune use -I so path look like

/path/to/ocaml/ <- contain version /standard/path <- contain cpp file version

This cause this issue https://github.com/onivim/oni2/issues/3489 The compiler try each folder in the same order that this list. with idirafter (it should be a really old option so no backward compat failure are to be expected).

With this we have

/standard/path <- contain cpp file version /path/to/ocaml/ <- contain version

so the right path is taken.

I have seen other with find . -name '*.ml' -exec grep -Hn '\-I' \{\} \; I don't know which one we should fix. Just this one fix the issue.

+1 -1

6 comments

1 changed file

Et7f3

pr closed time in 2 hours

pull request commentocaml/dune

OCaml's version is included instead of cpp <version>

No particular need here. A project that was broken by this now use 4.12. If the patch is back ported I think I can close this issue https://github.com/ocaml/opam-repository/issues/18811

Et7f3

comment created time in 2 hours

pull request commentocaml-multicore/ocaml-multicore

Reintroduce adjust_gc_speed

Thanks, I think this one looks good to merge.

Engil

comment created time in 2 hours