| 17 Jan 2025 |
Profpatsch | nrs-status: We’ve all been there, it’s the bargaining phase | 15:40:39 |
Profpatsch | depression is next! fun! | 15:40:55 |
Profpatsch | nrs-status: fwiw https://github.com/openlab-aux/vuizvui/blob/master/pkgs/profpatsch/xdg-open/default.nix#L109-L120 | 15:41:53 |
Profpatsch | https://github.com/openlab-aux/vuizvui/blob/master/pkgs/profpatsch/importPurescript.nix#L1 | 15:42:03 |
Profpatsch | it works pretty ok | 15:42:11 |
Profpatsch | just make sure you use a static binary release of purs-to-nix, otherwise your eval time goes into the gutter with IfD | 15:43:11 |
thirdofmay18081814goya | ah neat! thanks for the references, I'll be looking at what they've done | 15:43:46 |
thirdofmay18081814goya | ah yeah that's the compiler maralorn was talking about, I haven't had time to give it a look, will begin reading | 15:44:11 |
Profpatsch | nrs-status: it’s essentially a minimal working purescript-to-nix integration | 15:44:35 |
Profpatsch | You can just copy most of it and adapt | 15:44:47 |
Profpatsch | (just note that it’s GPLv3, but since I’m the sole author I give you permission to relicense as you see fit) | 15:45:16 |
thirdofmay18081814goya | oh you're the author? very cool stuff | 15:45:52 |
thirdofmay18081814goya | will definitely ping you about this (if you're interested), because I am in it for the long ride | 15:46:26 |
thirdofmay18081814goya | * will definitely ping you about this (if you're interested), because I am in it for the long run | 15:46:41 |
Profpatsch | nrs-status: Well, it’d be interesting if somebody tries to really use this in anger | 15:47:41 |
Profpatsch | Originally, this used the same idea with dhall-to-nix, but dhall is kind of a lost cause ino | 15:47:59 |
Profpatsch | *imo | 15:48:01 |
Profpatsch | purescript is not great, but works better | 15:48:15 |
Profpatsch | I’d just advise strongly against trying to compile the purescript stdlib to nix | 15:48:37 |
Profpatsch | and instead use it as a very simple nix frontend with typing | 15:48:48 |
Profpatsch | e.g. all of these are just pkgs.lib functions passed through from the nix side verbatim with type annotations https://github.com/openlab-aux/vuizvui/blob/master/pkgs/profpatsch/xdg-open/purs/XdgOpen.purs#L6 | 15:49:20 |
Profpatsch | I really like that you can just foreign-import named versions of + and ++ from the nix side and then create infix operators on the purescript side again | 15:50:48 |
Profpatsch | nrs-status: A major unsolved problem I have is that there’s no real way to pass things from outside to the foreign-import mechanism so far | 15:52:07 |
Profpatsch | e.g. https://github.com/openlab-aux/vuizvui/blob/master/pkgs/profpatsch/xdg-open/purs/XdgOpen.nix | 15:52:11 |
Profpatsch | I do an import <nixpkgs> {}; here which is super wasteful | 15:52:22 |
Profpatsch | that’s a hard blocker | 15:52:25 |
Profpatsch | i.e. would need to patch purs-to-nix to deal with this | 15:52:45 |
Profpatsch | In this case it was ~somwhat okay because I used only lib functions and no packages | 15:53:36 |
Profpatsch | well, I guess I worked around it by having main be a function which takes everything it needs, but that’s not very ergonomic cause then I can’t use any of the foreign import system for that | 15:54:53 |
thirdofmay18081814goya | hmm thanks a lot for the comments I can't totally parse yet, I'll begin reading source a bit and come back | 15:56:36 |