Recent submissions

Comment · 5 months ago
I think the parent may be getting at the continuation aspect of effects? Effect systems make the stack a first class object you can reuse, I think a standard example is implementing a scheduler. I'm not familiar with your Bluefin library so maybe it already handles this:

  effect Sched =
    yield : unit -> unit
    fork  : (unit -> unit) -> unit
  end
  
  let mut run_queue = []
  let enqueue t = run_queue := List.concat run_queue [t]
  
  let dequeue () =
    match run_queue with
    | [] -> ()
    | t :: rest ->
      run_queue := rest;
      t ()

  let rec spawn task =
    handle
      task ()
    with
    | return _ -> dequeue ()
    | yield () k ->
      enqueue (fn () -> resume k ());
      dequeue ()
    | fork f k ->
      enqueue (fn () -> resume k ());
      spawn f

  let run main = spawn main

  let worker name steps =
    let rec loop i =
      if i > steps do ()
      else do
        print $"{name}: step {i}";
        perform yield ();
        loop (i + 1)
      end
    in
    loop 1
  
  let () =
    run (fn () ->
      print "main: starting";
      perform fork (fn () -> worker "A" 3);
      perform fork (fn () -> worker "B" 3);
      print "main: forked workers, now yielding";
      perform yield ();
      print "main: done")
output:

  main: starting
  A: step 1
  B: step 1
  A: step 2
  main: forked workers, now yielding
  B: step 2
  A: step 3
  main: done
  B: step 3
Comment · 8 months ago
Comment · 10 months ago
For a computer, text is a binary format like anything else. We have decades of tooling built on handling linear streams of text where we sometimes encode higher dimensional structures in it.

But I can't help feel that we try to jam everything into that format because that's what's already ubiquitous. Reminds me of how every hobby OS is a copy of some Unix/Posix system.

If we had a more general structured format would we say the opposite?

Comment · 1 year ago
Comment · 1 year ago
I will say I really love the outcome of a Nix development environment. Especially with nix-direnv having a reproducible build environment by doing git clone on any machine is amazing. NixOS has also saved my ass a couple times doing kernel updates on an old laptop, rollbacks are nice. Having consistent commands "nix build"/"nix run" is great. It's a universal build system that works across different technology stacks. Pain to setup, but bliss when it's working.

The bad part is the impenetrable errors and obscure configuration. Although, with the rise of LLMs I find it's not as bad. Getting a non-trivial flake.nix setup is much easier now. Could never remember the override system before, but can manage with Chat GPT haha.

Comment · 2 years ago
Comment · 2 years ago
Intentional Software was working on a system like this many years ago: https://youtu.be/tSnnfUj1XCQ?t=230

Part 2: https://m.youtube.com/watch?v=ZZDwB4-DPXE

You can project your programs into different views and add lots of metadata about the program and use that data in various contexts. Also extends to source control and other use cases. It looked really neat.

I'm not sure what happened to it.

Comment · 2 years ago
I buy into this theory, and the other one about consciousness being a step or two behind and fabricating some cohesive explanation for why you did what you did.

If you are unfortunate enough to experience some human body failure modes you can get a glimpse into this process. The cohesive "veil" breaks down and you realize there's more "you" than that voice in your head. The distributed nature of the brain/body peeks through.

Comment · 2 years ago
Comment · 2 years ago
I've noticed this too! It's especially bad after using discover weekly and liking a song or two, the shuffle then gets stuck on similar songs. It seems disabling "automix" in the settings returns the shuffle to be more like a traditional random shuffle.
Comment · 2 years ago
I've also had floaters and sometimes flashes (pin pricks) of light since childhood. Still have 20/20 vision, and every time I've gotten an eye exam they've said the retina looks healthy. From what I understand it'll be more of a "blizzard" of floaters when detachment is happening. At least for me the number of floaters seems to be highly correlated with my sleep quality. The flashes seem correlated with my blood pressure.
Comment · 3 years ago
I've been keeping an eye on https://github.com/cozodb/cozo which is pretty close to something I've wanted, a sqlite version of datalog/datomic.
Comment · 3 years ago
If you do take the teleporter it mentions that as well:

> Your three choices show that this is what you see as central to your sense of self, not any attachment to a particular substance, be it your body, brain or soul. However, some would say that you have not survived at all, but fallen foul of a terrible error. In the teletransporter case, for example, was it really you that travelled to Mars or is it more correct to say that a clone or copy of you was made on Mars, while you were destroyed?

Comment · 3 years ago
I appreciate you sharing your story. I had a similar journey over the last couple years because of the pandemic. Looking back now it was definitely an issue at least as far back as early teens.

I used to work out a lot, and very intensely as that was the only thing that made me feel "awake". It wasn't until the lockdowns when I couldn't get to the gym that it got bad enough that I also started my own journey to this diagnosis.

I had started living more in the dream world than the real world and being awake was a daze. I became distant to the world and lost my imagination, memory, and emotion. I was also questioning how I could ever go on with my current job and life.

Thankfully, I also started a sleep apnea treatment (oral appliance, and later CPAP) after many discussions with my doctor. This mostly fixed my condition. The difference is incredible and I don't have the words to describe how it has changed my life.

So I want to say thank you for sharing your story, you're not alone and I hope others see your story and get the help they need.

If you've read this story and suffer any of the symptoms mentioned, I highly recommend doing a sleep study, it's truly life altering.

Comment · 3 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton