HN user

sweetsocks21

123 karma
Posts0
Comments41
View on HN
No posts found.

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

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?

This reminds me of expect tests in OCaml[0]. You create a test function that prints some state and the test framework automatically handles diffing and injecting the snapshot back into the test location. It helps keep your code modular because you need to create some visual representation of it. And it's usually obvious that's wrong through the diff.

[0] https://github.com/janestreet/ppx_expect

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.

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.

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.

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.

Staying Alive 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?

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.

Is there a note taking app/knowledge database that auto-magically tags + adds metadata to everything and is searchable?

I've tried many different tools in the past and I find I can't stay organized. I don't want to sit there linking stuff together, I just want to jot down a quick note or thought and have it link up with enough stuff that I can find it easily later.

I was thinking of making a personal tool based on some kind of database like datalog. Where I can dump a bunch of facts and have the computer automatically tag and link items.

I'd love something that knows I'm currently in a meeting with X,Y,Z persons while I took a note and automatically links it with them and any keywords etc from my note to other notes and topics.

I saw a demo for outreach? I think that did some cool stuff for sales, listening to phone calls and making notes linking people etc. I want that but for _everything_ haha. Have it link in with JIRA, slack, GitHub, Gmail etc. One stop shop.

I think you're correct in this assessment. I've recently switched from many years of low-level programming, doing real time animation/graphics into the large scale SaaS world.

The things these two camps of software engineers care about are completely different. In the SaaS world it's all about interfacing between systems and managing complex business processes. There's often a lot of organization/political problems, along with auditing and legal requirements. There seems to be a lot more emphasis on developer productivity than end user performance.

Not that these engineers don't care about performance, but their tolerances are much higher. For example 100-200ms turn around is entirely acceptable, or even fast, in the SaaS world. While in my previous job that was absurdly slow, and unacceptable.

I think another under appreciated thing is that the scale and complexity is truly larger today than yesteryear. Even in real time graphics, Unreal Engine incorporates literally decades of cutting edge research into a framework that a new game programmer can start running with in hours. There's the various platforms like mobile, PC/Mac/Linux, graphics APIs like DX12, Metal, Vulcan, multiplayer syncing, animation, model importing, etc etc. There's just so many more things to support these days that there's going to be some slippage.

And each of these new tools and platforms were made with the intention of doing something better than a previous one, but then the real world creeps in and here we are.

It would be great to see more effort and research into rethinking from the base level, maybe even hardware, of how we can simplify this entire software stack and have our cake and eat it too.

I think that's could be focusing too much on the "inner voice" and assigning that the "you" label. At least for me I have a normally chatty inner voice, and usually think of that as "me", but if I step back I realize there is a lot more to "me". There's other thoughts/knowledge/processes happening that can bubble up. At least my interpretation is the voice is just the aggregator, but there's really multiple systems coming together.

If I switch tasks and do something very creative, say playing music or drawing, the inner voice goes away and I can enter a "flow" or meditative state where things just happen. It's a very different mode where it's just feelings/emotions/imagery and no language based thoughts.

Also when I get really really tired, but power through it, I have a "recursive observer" where I kind of view myself on a delay and analyse everything I do, it's kind of annoying.

I've often wished for some kind of dream recorder. I have had some very intense dreams, even "inception" style where I fall asleep inside a dream. In these dreams I'll talk to witty people, hear incredible music, see fantastic sights. But once I wake up 90% of the dream is gone and I only remember some highlights.

A weird realization for me is all the events in the dream were produced by me. Yet in real life I'm useless in front of a piano, or a paint brush. It would be great if there was a way to tap into that creativity once awake.

It's surprisingly general purpose. I mostly use it for toy side projects. I've used it for basic CRUD apps, like a reddit aggregator. I've written a couple opengl graphics libraries with it. Used it instead of JS for a web implementation of a board game. a toy Datomic clone, and I'm currently working on an alternative unix shell.

It's pretty comfortable for organizing and refactoring because of the nice module and type system. And once you grok Dune (the build system) you can get going pretty quick. Builds are very fast compared to most of the languages I use at work. And if you're not doing anything egregious the optimizing compiler (Flambda) can usually be within ~2x of C for most things. When it's not dropping down to C is very easy because the FFI system is very straight forward, and has built in support in Dune.

It is lacking a bit in libraries and when you need to drop down to imperative features you may find it a bit rough. For example not having a return keyword can make it annoying to port over libraries.

Overall I like it because I think the pros outweigh the cons, but I've also been using it for a decade so I'm probably getting set in my ways now. I'd say it's worth trying at least to understand Sum types (and maybe GADTs), and use a language with first class modules, it can change your approach to problems once you see some extra tools.

The S,D shortcuts work for me, but I can't get J or K to do anything? Some UX feedback on what is valid at the current time may be useful. One problem with structural/projection editors is it's not as clear what is a valid operation in the current state.

There's some existing work in this area you might find interesting as well:

https://twitter.com/dm_0ney/status/1414742742530498566

https://hazel.org/

https://hazel.org/build/dev/ (expand the left side pane by clicking the (?) to see the valid operations)

Stack Graphs 5 years ago

I don't know of any generic editor that can take a current (popular) language and do that. There is however a lot going on in this space, and I'll list some examples. Most are about editing the tree structure better, but some do branch out a bit more to the graph idea.

https://docs.darklang.com/structured-editing

https://hazel.org/

http://lighttable.com/

Emacs has some structural editing plugins like ParEdit

Many graph/node based editors like Blender shaders (3D), Reaktor (music)

https://www.unisonweb.org/ (this has some of the function versioning ideas)

https://enso.org/

Smalltalk

There's many many more, these are just some I remembered off the top of my head.

If you go to about:support and scroll to the end of the graphics section you should see two entries:

X11_EGL

DMABUF

and should say something like "available by default"/enabled or similar wording. Otherwise it'll either say unsupported/disabled or will be missing.

I can both see it and "unsee" it. If I'm actively doing something and using my eyes for things I don't notice. But if I'm just sitting listening to music or whatever I can notice the "fuzz" and noise. In low light it's a very fine grain. In daylight it's a coarser pulsing of white and black.

I've always thought this was normal. I've asked a couple other people and they've said they see it too, :shrug:

Have you had a sleep study? I used to have tons of vivid lucid dreams during sleep apnea. Now I have much less detailed dreams and they're less frequent, after fixing my sleep apnea. It's a bit sad because the dreams were fun, but I do feel way more rested these days.