!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

755 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org150 Servers

Load older messages


SenderMessageTime
24 May 2026
@tks_123:matrix.orgtks_123 alexfmpe As for HLS (vscode, etc.) should I put js backend programs and normal backend programs into different .cabal projects somehow? So HLS/cabal (somehow) knows which backend to use? (I'm assuming you can put both normal haskellPackages and and pkgsCross.ghcjs.haskellPackages into the same nix environment?) 12:56:04
@tks_123:matrix.orgtks_123 * alexfmpe As for HLS (vscode, etc.) should I put js backend programs and normal backend programs into different .cabal projects somehow? So HLS/cabal (somehow) knows which backend to use?I'm assuming you can (somehow) put both normal haskellPackages and and pkgsCross.ghcjs.haskellPackages into the same nix environment?) 12:57:10
@tks_123:matrix.orgtks_123 * alexfmpe As for HLS (vscode, etc.) should I put js backend programs and normal backend programs into different .cabal projects somehow? So HLS/cabal (somehow) knows which backend to use?I'm assuming you can (somehow) put both normal haskellPackages and and pkgsCross.ghcjs.haskellPackages into the same nix environment?) 12:57:13
@tks_123:matrix.orgtks_123 * alexfmpe As for HLS (vscode, etc.) should I put js backend programs and normal backend programs into different .cabal projects somehow? So HLS/cabal (somehow) knows which backend to use? I'm assuming you can (somehow) put both normal haskellPackages and and pkgsCross.ghcjs.haskellPackages into the same nix environment? 12:57:24
@tks_123:matrix.orgtks_123 * alexfmpe As for HLS (vscode, etc.) should I put js backend programs and normal backend programs into different .cabal projects somehow? So HLS/cabal (somehow) knows which backend to use? (I'm assuming you can (somehow) put both normal haskellPackages and and pkgsCross.ghcjs.haskellPackages into the same nix environment?) 12:57:36
@alexfmpe:matrix.orgalexfmpeYou probably mostly want HLS only for native builds, if nothing else for speed12:58:17
@alexfmpe:matrix.orgalexfmpeThere's no ghci for js backend12:58:25
@alexfmpe:matrix.orgalexfmpeI don't know if there's conflicts shoving both compiler/package sets in the same nix env, and it also depends on whether you just want the tooling from nix or also the dependencies13:00:15
@alexfmpe:matrix.orgalexfmpeSafest thing might be to make the native backend the default, and have a separate shell for js builds13:01:03
@alexfmpe:matrix.orgalexfmpePast that you're into tinker-with-infra territory 13:01:35
@alexfmpe:matrix.orgalexfmpeThis is a bit old in early-adopter terms, but might help as a reference:13:05:08
@alexfmpe:matrix.orgalexfmpehttps://github.com/bfeitknecht/impli/pull/6/changes#diff-93b556800e5bfe30a541d4c38712e88fc5763a362ab43de7446476ed3bddcee013:05:10
@alexfmpe:matrix.orgalexfmpeWell, technically you can throw your package into the nixpkgs haskelloverides, and then nix-build like normal or with pkgsCross.ghcjs 13:06:11
@alexfmpe:matrix.orgalexfmpeBut you asked about cabal.project so I assume you meant everyday local dev, not 'prod' build13:06:38
@tks_123:matrix.orgtks_123Yes, everyday local dev :) But... for everyday local dev, I'd want to... check if the website ... works in the browser (I guess)?13:08:19
@tks_123:matrix.orgtks_123* Yes, everyday local dev :) But... for everyday local dev, I'd want to... check if the website ... works in the browser.13:08:50
@tks_123:matrix.orgtks_123while also develop the website's frontend and backend (in vscode)13:09:20
@tks_123:matrix.orgtks_123(yes how the final thing is built is technically a separate question..)13:09:42
@tks_123:matrix.orgtks_123* while also developing the website's frontend and backend (in vscode)13:10:02
@alexfmpe:matrix.orgalexfmpeOh gotcha. Out of habit I was assuming jsaddle-warp for dev so the frontend would also be using native builds13:26:23
@alexfmpe:matrix.orgalexfmpeBut it sounds like you don't assume that for your project13:27:43
@tks_123:matrix.orgtks_123 alexfmpe Hmm, it seems I was using jsaddle 2-3 years ago in my projects. it seems for some reason i wasn't aware of jsaddle-warp :S 13:48:03
@tks_123:matrix.orgtks_123so i thought i had to always run a full ghcjs (the old ghcjs in this case) build just to preview my web apps... :S13:48:30
@tks_123:matrix.orgtks_123which makes me wonder, why i was even using jsaddle. Now i'm confused13:49:11
@tks_123:matrix.orgtks_123* which makes me wonder, why i was even using jsaddle13:49:29
@tks_123:matrix.orgtks_123

This is how my JS program looked:

main :: IO ()
main = do
  doc <- jsg "document"
  x <- doc ^. js1 "getElementById" "jspage"
  -- ...

Some of the imported modules:

import GHCJS.Foreign.Callback
import GHCJS.Marshal
import GHCJS.Types
import JSDOM.Custom.Window

Some of the packages in the .cabal file:

ghcjs-base
ghcjs-dom
jsaddle
jsaddle-dom
13:53:56
@tks_123:matrix.orgtks_123Are these things (modules, cabal packages) still relevant for the new JS backend? (Is this still the modern way to do it?)13:54:32
@tks_123:matrix.orgtks_123 *

This is how my JS program looked:

main :: IO ()
main = do
  doc <- jsg "document"
  x <- doc ^. js1 "getElementById" "foo"
  -- ...

Some of the imported modules:

import GHCJS.Foreign.Callback
import GHCJS.Marshal
import GHCJS.Types
import JSDOM.Custom.Window

Some of the packages in the .cabal file:

ghcjs-base
ghcjs-dom
jsaddle
jsaddle-dom
13:55:00
@alexfmpe:matrix.orgalexfmpejsaddle-* all works with js backend just the same13:57:37
@alexfmpe:matrix.orgalexfmpesame for ghcjs-dom13:57:53

Show newer messages


Back to Room ListRoom Version: 6