Hrefna (DHC) · @hrefna
1372 followers · 5676 posts · Server hachyderm.io

I _suspect_ I am seeng performance problems where I am because Condition doesn't expose signal yet, but it'd be nice if I could confirm this. >_>

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1372 followers · 5675 posts · Server hachyderm.io

I wish there were an easier way to hook up a profiler here. perf doesn't work in gitpod and gprof hasn't worked with since early in version 4.

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1372 followers · 5674 posts · Server hachyderm.io

Spent a while implementing a mailbox in . This got me introduced to the benchmarking tools, the assembly code tools, and helped me get a lot more familiar with references.

I wanted my own because Eio.Stream has some significant drawbacks for the use cases I have in mind, unfortunately, and I wanted something with the capability to time-out messages built in.

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1372 followers · 5646 posts · Server hachyderm.io

In terms of difficulty:

1. This is largely a socialization problem. How do you get others to play ball? Doing it for yourself is easy. Doing it for others and gaining consensus around the choices is hard.

2. This is not _easy_ per se, but it is also not _difficult_. The biggest time sink here is going to be writing the drivers in cases where there's substantive divergence or where you are dealing with a more minimalistic tool than what SList inherently supports.

3. Very Difficult™

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1372 followers · 5641 posts · Server hachyderm.io

Broadly speaking I think I want one of three things for a standard library configuration in . Probably all of the above.

1. The ability to have a canonical way of saying "include Iter (<args>)" and get a basic iter function that looks the same as every other iter function.

2. The ability to say "module List = SList (CoreDriver)" and use a standard interface backed by Core.

3. The ability to say "module List = SList (Lookup)" and have it look up the same implementation used elsewhere.

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1372 followers · 5641 posts · Server hachyderm.io

signatures for `iter`:

lst ~f
f lst
()
(fold's signature)
~f lst

whyyyyyyyyy

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1369 followers · 5624 posts · Server hachyderm.io

Okay this was a fun bug to diagnose.

The problem is that when you call := (or ^:= in this case since it wraps it in a Some) it doesn't actually replace the value that the reference points to, it _updates_ the value of the reference.

so if you have:

let n = ref <foo> in
let s = {
x = n;
y = n;
} in
s.x := <bar>.

Now s.y will also equal <bar>.

If this isn't what you want you can do:

let n = <foo> in
let s = {
x = ref n;
y = ref n;
}

Now you have two separate objects.

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1369 followers · 5611 posts · Server hachyderm.io

This error feels like I'm in a Monty Python skit. Or the Joey/Phoebe conversation meme:

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1369 followers · 5610 posts · Server hachyderm.io

Dear type checker:

But why. And don't.

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1369 followers · 5589 posts · Server hachyderm.io

I love it when a plan comes together.

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1372 followers · 5555 posts · Server hachyderm.io

@sanityinc A wrapper is perfectly copacetic. That's how the Core.Time library works, for example ( ocaml.janestreet.com/ocaml-cor ).

It's also what Eio.Time.Mono does and backs its result with Mtime, which is exactly that: erratique.ch/software/mtime/do

What makes the example a bit jarring in part is that:

Eio.Time.now -> float (ocaml-multicore.github.io/eio/)
Eio.Time.Mono.now -> Mtime structure (ocaml-multicore.github.io/eio/)

It's also how the modern time library works: docs.oracle.com/en/java/javase

#ocaml #java

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1370 followers · 5543 posts · Server hachyderm.io

Developers: "my language gives me strong type constraints! it's amazing! you can just reason through the type system and have a working product."

Also developers: "what if time were a unitless float?"

#ocaml

Last updated 1 year ago

guto :verified: · @guto
44 followers · 30 posts · Server hachyderm.io

hey folks!

a while ago I saw this t-shirt artwork being shared separately and would like the artwork for personal use! has anyone seen this image or have it in high quality?

#ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1369 followers · 5536 posts · Server hachyderm.io

Took a step back on my toy project and started mostly over with a clean template now that I know a heck of a lot more about and have a clearer vision. So now things like my actor tools are not embedded inside of my JSON-LD experiment.

I also rewrote the actor component in the process now that I know more about how to manage around the type system there. Seems to work so far and is a _lot_ cleaner, relatively pleased with how it is progressing.

#activitypub #ocaml

Last updated 1 year ago

Hrefna (DHC) · @hrefna
1369 followers · 5534 posts · Server hachyderm.io

I really want this semaphore (Eio.Semaphore in ) to have the ability to acquire multiple permits at the same time, but I don't think I want it badly enough to _implement_ it efficiently.

#ocaml

Last updated 1 year ago

· @ELLIOTTCABLE
193 followers · 516 posts · Server kolektiva.social

tl;dr i'm feeling hella validated in my last couple years' expenditure of time and spoons, language/community-wise.

i don't want to be somebody who uses one language for his whole career, (and i am absolutely not someone who thinks a single language is correct for Every Task) … but learning all this has me internally extending my "time i plan to spend mostly in the -sphere" number outwards by another five or ten years?

#ocaml

Last updated 1 year ago

· @ELLIOTTCABLE
193 followers · 515 posts · Server kolektiva.social

anyway, the last bit from my notes, is a bit more personal:

I’ve always been harping, for years, on how and VMs are just such a surprisingly-fantastic, low-impedance match (see the whole , , , category — they're _fantastic_ to use in practice); …

but now i’m learning that Wasm is … basically OCaml’s semantics, EVEN MORE DIRECTLY, in a bunch of cases, lmao.

#ocaml #javascript #melange #bucklescript #rescript

Last updated 1 year ago

· @ELLIOTTCABLE
194 followers · 510 posts · Server kolektiva.social

so, talk moved on to big new things coming in 3.0 — and this stuff was super-exciting, and over and over has amazing parallels to ???

first: garbage collection? in a low-level VM???

reasoning: “GC is kinda the worst-case situation, for working on top of an abstraction-layer like WebAssembly”

#wasm #ocaml

Last updated 1 year ago

· @ELLIOTTCABLE
194 followers · 516 posts · Server kolektiva.social

tl;dr i'm feeling hella validated in my last couple years' expenditure of time and spoons, language/community-wise.

i don't want to be somebody who uses one language for his whole career, (and i am absolutely not someone who thinks a single language is correct for Every Task) … but learning all this has me internally extending my "time i plan to spend mostly in the -sphere" number outwards by another five or ten years?

#ocaml

Last updated 1 year ago

· @ELLIOTTCABLE
194 followers · 514 posts · Server kolektiva.social

(i said 'finally' i lied i am sick leave me alone okay ugh)

actually-finally, he touched on the module system, the missing pieces there, what all has been missing … and how after working hard to add and reconcile all the missing pieces to the existing modularization, they basically ended up with -style functors … and then realized that … and then just decided to add to . 😱

(i had to duck out, so, again, no screenshots. cool as fuck, though.)

#ocaml #functors #wasm

Last updated 1 year ago