profile
viewpoint

dbuenzli/cmdliner 190

Declarative definition of command line interfaces for OCaml

dbuenzli/logs 66

Logging infrastructure for OCaml

dbuenzli/brr 62

Browser programming toolkit for OCaml

dbuenzli/down 61

An OCaml toplevel (REPL) upgrade

b0-system/odig 58

Lookup documentation of installed OCaml packages

dbuenzli/bos 51

Basic OS interaction for OCaml

dbuenzli/fmt 51

OCaml Format pretty-printer combinators

dbuenzli/hmap 41

Heterogeneous value maps for OCaml

dbuenzli/jsonm 41

Non-blocking streaming JSON codec for OCaml

dbuenzli/gg 35

Basic types for computer graphics in OCaml

push eventdbuenzli/webs

Daniel Bünzli

commit sha f11a62533d14f70aff4ac5e3f1c61482a90f7275

Http.Pct: nail down encode's interface.

view details

push time in 2 days

PullRequestReviewEvent

Pull request review commentdbuenzli/ptime

Allow MSVC compiler to build

 let system_support_lib = match os with | "Linux\n" -> [A "-cclib"; A "-lrt"] | _ -> [] +let lib_a = Ocamlbuild_pack.Ocamlbuild_config.a+let clock_stubs_lib = "src-clock/os/libptime_clock_stubs." ^ lib_a

Not saying this is wrong. But could you follow what is done in mtime. That way everything fails according to same reasons when it does :–)

jonahbeckford

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentdbuenzli/ptime

Allow MSVC compiler to build

 * Fix `Ptime.truncate` to always truncate down. Thanks   to David Kaloper Meršinjak for the report & fix. +v0.8.6 2021-11-26 Jonah Beckford+--------------------------------++* Allow compiling with MSVC compiler+

Could you please simply add this to the list above with your name.

jonahbeckford

comment created time in 2 days

PullRequestReviewEvent

startedcs3110/textbook

started time in 2 days

issue commentocaml/ocaml

Consider providing a mutual exclusion primitive in the Stdlib for 4.14

At least for Mutex it now has. The problem is rather how do we ensure our libs are multicore-safe on day one while keeping compat. with (at least the last) stock OCaml.

dbuenzli

comment created time in 3 days

issue openedocaml/ocaml

Consider providing a mutual exclusion primitive in the Stdlib for 4.14

As per discussion it seems that as a first step Lazy.t will not be thread-safe in multicore.

A usage pattern for Lazy.t is for libraries to trigger initialisation bits on first use. Here's an example. Not a very good one, this particular one can be worked around with an Atomic.t, at the cost of maybe computing the value more than once. Things are worse if your lazy value performs effects or calls a C library's init function.

The problem is that currently Mutex.t lives in the threads library not in the Stdlib and some libraries may not afford that dependency (the example above is a good one for that, you may want to have your QR encoder in js_of_ocaml).

Not sure we really need the full Mutex.t module a simple:

 Fun.synchronized : (unit -> 'a) -> 'a

function could do.

created time in 3 days

issue commentocaml-multicore/ocaml-multicore

Discussing the design of Lazy under Multicore

  • Lazy.t is specified as not being thread-safe: concurrent usage must add its own synchronization

Is Mutex.t the only tool here ? A usage pattern of Lazy is for libraries to trigger initialisation bits on first use. The slight problem is that unlike Atomic.t, Mutex.t doesn't live in the Stdlib.

gasche

comment created time in 3 days

issue openedocaml-ppx/ocamlformat

Combination of options that matches ocp-indent's `strict_with=always` ?

This is more a question than a feature request.

Is there a combination of options that allow to match ocp-indent's strict_with=always option ?

This option basically maximizes the space for your scarce 80 columns by always having | unindented – it also more consistent since | never get indented.

I managed to unindent function by setting function-indent = 0 but I didn't find how to:

  1. Unindent type declarations
  2. Have a way to bring the first, toplevel match, on the same line as arguments when there is space[^1]:
(* Assumes long definitions that do not get collapsed on a line *)

type t = 
| A … 
| B …

let f = function
| A -> …
| B -> …

let f v arg = match v with 
| A -> …
| B -> …

[^1]: I don't know if that's supported but I think it would be nice. If I add a new argument to a function after the one that is being matched with function, then I replace the function by match v with. But with the current ocamlformat this will reformat my whole function body.

created time in 3 days

pull request commentocaml/ocaml.org

Added bsc to the list of alternative compilers.

This is only a personal opinion. I've tried hard several times to learn js_of_ocaml but never succeed to make even a hello-world work.

@fccm did you try to use it with brr and dune's support ? Brr's docs have a web page howto with a hello world example.

There are also a few manuals here that detail the OCaml to JavaScript FFI in other terms than js_of_ocaml's website. Brr doesn't try to encode JavaScript objects as phantom types which I (and others it seems) find much more usable.

no community to get some help with

People may be less web focused on discuss.ocaml.org. But most technical questions about js_of_ocaml do eventually get an answer.

fccm

comment created time in 4 days

pull request commentocaml/opam-repository

bos.0.2.1 requires at least fpath.0.7.3 due to rresult/result packages

Not sure I grasped exactly what happens but I don't think it should be a problem for bos to require the lastest fpath.

dinosaure

comment created time in 4 days

pull request commentocaml/odoc

Format long signature

This PR is solving a problem, it's not just a styling change: code outputted by Odoc was unreadable, on every screen sizes.

Some of them were unreadable for reasons I already highlighted above. Are you seriously suggesting that the pages output by odoc or ocamldoc for the past twenty years were unreadable in the average case because they weren't dumbed down to one argument/result component per line ?

panglesd

comment created time in 4 days

pull request commentocaml/odoc

Format long signature

I rather think that in average the PR makes things worse than they were, especially on signatures that looked good before.

If you seriously think that for example for example this a lot better with what was before then there's no point in arguing this further. I'm tired of fighting with people who have little sense of usability and typographic rules.

panglesd

comment created time in 4 days

pull request commentocaml/odoc

Format long signature

I'm not sure, why it is terrible?

It lacks compactness and information density, show the data – grab a Tufte book if you don't understand what that means. Using pre-formatted code is not a good solution, you won't be able to reformat pre-formatted code with a CSS query. Things will be get unreadable on narrow viewports and you are not making a good use of the screen estate, pages will be mostly whitespace.

Layout on the web is not about making it look good on one or two viewport sizes, it is about making it accessible for users on a diversity of viewports. Not everyone out there is reading these pages on 27'' inches screens. On most laptops vertical space is extremely scarce (because you already have the OS + the browser chrome eating a good 10% of the vertical height) and viewports get narrow because you want to be able to have an editor and a web page side-by-side.

Scrolling to access content is extremely annoying for users, in fact if you design websites you'll quickly learn that a lot of users never read beyond the page fold. If the first thing you have to do as a user when you get on a page is to scroll to be able to access the content then your design is just failing at your users.

panglesd

comment created time in 4 days

pull request commentocaml/odoc

Format long signature

I think that one parameter per-line is a good approach to formating long function types. Or at least it is when the parameters are labelled, as they often are in long function types. It is parallel to the formating of record definitions.

For value signatures it's perfectly fine not doing this if you have 1) proper label highlighting for quickly scanning arguments (those are still not spanned and thus not highlighted in any stylesheet out there) and 2) mostly unsurprising break points which still seems quite doable to me. You just need to start in a principled way by defining good atoms which is possible by doing what was done for -> (e.g. to not break on the space of [> `Var]) or not to break on the : of the label:type).

Beyond values there are other problems with e.g. functors and with constraints and these ones do need a few well inserted <br> or block level wrapping elements to distinguish their parts. At the moment they are just dumped regardless which obviously makes them totally unreadable.

This just needs a bit more attention that has ever been given to up to now with a good eye for usability. And as far as the latter is concerned given the amount of pointless scrolling it will incur on most pages, I'm afraid the solution of this PR is really a terrible one.

panglesd

comment created time in 8 days

PR closed dbuenzli/logs

Allow a CLI app to set its default log level in `Logs_cli.level`

I'm adding support to several tools using logs and fmt of the tty, colors, and verbosity integration with cmdliner, fmt, and logs. Some of these tools were defaulting to the info error level (instead of Logs_cli default to Some Logs.Warning). It is tricky to keep that behavior with Logs_cli.level because it doesn't return whether the error level was set by the user or defaulted to Some Logs.Warning. The suggested workaround to use env seem to indicate that I could set that parameter, test the existence of the env var, do a putenv if it isn't set, and then call Logs_cli.level. Maybe I've missed something, but an easy and nice way is to add an optional default parameter (that still defaults to Some Logs.Warning) to Logs_cli.level. Using Logs.level_to_string default also allows the help page to report the app chosen default level.

+6 -6

1 comment

2 changed files

MisterDA

pr closed time in 9 days

pull request commentdbuenzli/logs

Allow a CLI app to set its default log level in `Logs_cli.level`

As per level semantics, the info level is for getting more information about how the program operates. It's not meant to be output by default. This PR would also break the convention established by this cli interface that adding -v increases verbosity, and that it does so in two steps, info and debug.

The more programs behave the same way, the better.

If you think it's justified for you to walk away from that convention, just define your own option.

MisterDA

comment created time in 9 days

issue closeddbuenzli/logs

Need a way to pass LDFLAG during build

On armv7l I'm only able to build by using ld.bdf, not ld.gold.

How would I pass LDFLAGS='-fuse-ld=ld.bfd' to an opam install of logs? (I believe this is the traditional way of passing a linker request but maybe there's an ocaml way here?)

(Continuation of https://github.com/dbuenzli/logs/issues/39 )

closed time in 9 days

satmandu

issue commentdbuenzli/logs

Need a way to pass LDFLAG during build

You should handle that at the OCaml compiler level.

satmandu

comment created time in 9 days

pull request commentocaml/odoc

Format long signature

Similarly to ocamlformat,

In general I wouldn't take ocamlformat as a good example of what to do. Degenerating to one argument per line as soon as you hit the line length somehow assumes you only have one neuron to process text which is insulting. And indeed your results seem to degenerate signatures into one argument per line which is a pure waste of the scarce vertical space.

Also in general on the web you should avoid fixed width layouts. Try to look your results in a narrow viewport (e.g. mobile) they are completely unreadable. They are still readable with the current strategy.

I still think the right strategy is to get a better understanding of the line breaking algorithm and hint breaks more appropriately. So that cut breaks appear at more natural places. A few other things were tried but had to be reverted due to browser usability issues (they either broke cut and paste or broke in page search in one major browser). Given the insane flexiblity of the web stack I'm still pretty confident we can find something that can accomodate fluid layouts in a better manner than this.

panglesd

comment created time in 9 days

issue commentdbuenzli/logs

fails to build on armv7l/ChromeOS

  • ocamlfind ocamlopt -shared -linkall -I src src/logs.cmxa -o src/logs.cmxs /usr/local/bin/ld: internal error in output_address, at ../../gold/output.cc:3075 collect2: error: ld returned 1 exit status

Doesn't look like a logs issue did you try to install other things ? Are you sure you have the right permissions:

opam install logs --root=/usr/local/opam

satmandu

comment created time in 10 days

issue commentdbuenzli/logs

fails to build on armv7l/ChromeOS

As you can read, without the full logs I cannot tell you anything.

satmandu

comment created time in 10 days

issue commentb0-system/b0

Improve B00_www_browser error reporting

@MisterDA thanks would mind having a look what in this logic makes Os.Cmd.find return None. Normally it should end up in this branch.

In particular what does Unix.access file [Unix.X_OK] say on these files ?

You could also call Unix.system.

There's too much unreliability and quoting complexity in using Unix.system, I prefer to know exactly which program I invoke with which data.

leviroth

comment created time in 10 days

issue commentb0-system/b0

Improve B00_www_browser error reporting

@MisterDA

  1. Maybe there is a bug in Os.Cmd.find. Could you please try to lookup these strings in the toplevel as mentioned in this this message.

  2. Do you think the following logic is good: Default to cmd.exe /S /C start if Sys.win32 is true ? (What are the /S and /C for ?)

leviroth

comment created time in 10 days

issue commentocaml/opam

MacOs: Cannot create a switch: `"./configure": command not found`

Yet, brew unlink binutils fixed the issue.

Yes sorry it was likely ranlib or ar.

rixed

comment created time in 10 days

issue closedocaml/odoc

Rename `odoc.mld` to `index.mld`

or provide an index.ml file for the package.

With the current install nothing useful shows up on the package page when you odig doc odoc which is a shame, given that new docs were written.

The pages are there of course but you have to guess the links :-(

closed time in 11 days

dbuenzli

issue commentocaml/odoc

Rename `odoc.mld` to `index.mld`

Fixed by #763. Thanks @jonludlam look forward to odig these new docs.

dbuenzli

comment created time in 11 days

push eventb0-system/b0

Daniel Bünzli

commit sha b9ea5f321fa825dd45ef1bbf0836c093d2de9d75

Add B0_unit.Action.scope_cwd.

view details

Daniel Bünzli

commit sha 939d4bf32ba9412b4b1b92b587ffe8642b876dc3

Handle cmdliner deprecations.

view details

Daniel Bünzli

commit sha 66504f9d12fb60974ff0ea2776595cc10a5a6504

Fmt: slightly rework the TTY capability stuff.

view details

Daniel Bünzli

commit sha 54a2d5355ce832879dcd824323dec6180a2a1c2b

Tweak Tid module implementation (and Tid.create becomes Tid.v).

view details

push time in 11 days

more