ka Invites - VideoChat

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sridhar Ratnakumar

@Kit Langton @TheMatten @Bolt I've invited you all to ka GitHub repo.

Kit Langton

Thanks @Sridhar Ratnakumar ! I was just poking around the Neuron repo :)

Bolt

Is there any "homework" you recommend doing?

Sridhar Ratnakumar

@Bolt Install Nix, and follow the README to get the app running on ./guide ... then on your own notes.

Sridhar Ratnakumar

With ka open by side, edit the notes using an editor (vscode preferred; using guide/.vscode configuration)

Sridhar Ratnakumar

Basically run these two commands:

code ./guide  # `nix-shell --run code` if you don't have it; but of course you can edit with any editor
$(nix-build)/bin/ka ./guide

(Assuming you are on Linux; otherwise, see web app section in README to replace the second command)

Sridhar Ratnakumar

(Install the recommended extensions if you open with vscode; you'll get nice auto complete for links)

TheMatten

Invitation returns 404 for me :sweat_smile:

Bolt

Same for me but I realised I wasn't logged in in GitHub. Then everything worked out fine!

Bolt

Building with Nix, I can see it's quite heavy, almost 10Gb

Bolt

Is that supposed?

Bolt

10Gigabytes of disk memory

Bolt

Because Nix installs every dependency

Sridhar Ratnakumar

If it is the nix store, see which derivations take the most space by running:

nix-shell -p ncdu --run 'ncdu /nix'
Sridhar Ratnakumar

I'm curious if anybody is able to run the Gtk+ app.

Bolt

Also I'm getting Error : Unexpected Duplicate. syncCallbacks=True nBatch=7 nExpected=9

Bolt

When I run the webapp

Sridhar Ratnakumar

Try refreshing? Does the web app otherwise work?

Bolt

The UI freezes when I refresh

Sridhar Ratnakumar

Restart server. Close tab; open tab.

Sridhar Ratnakumar

(It uses jsaddle-warp, which is like unreliable 5% of the times; which is why I use the Gtk+ version)

Sridhar Ratnakumar

And I don't compile a GHCJS version, because that would require splitting frontend and backend. Right now, they all run in the same process. This is a neat thing about jsaddle bridge; you can do anything including IO from your reflex "frontend" app.

Bolt

image.png

I refreshed and the UI was responsive but as soon I clicked something it froze

Sridhar Ratnakumar

The bridge is also the reason why the web app might feel laggy (because everything, including frontend logic, runs on the server - with the bridge communicating all DOM updates to the browser)

Sridhar Ratnakumar

Might be this bug:

It fails in Firefox because Firefox completely disallows synchronous XHR requests. Chrome is less strict.
https://github.com/ghcjs/jsaddle/issues/64#issuecomment-646254884

Sridhar Ratnakumar

Just use Chrome :grinning_face_with_smiling_eyes:

Bolt

Oh I see! Yeah I'm using firefox!

Sridhar Ratnakumar

@Bolt Did the Gtk+ version compile and run?

Bolt

I'll try the GTK version just need to delete the nix build eheh

Bolt

no space left on mymachine

Sridhar Ratnakumar

I was buying a laptop before joining my first Haskell job (Obsidian Systems); and when asked for advice, the only thing they told me was to get at least 1TB, because NixOS (which nearly everybody at the company uses) uses a lot of diskspace.

Bolt

Yeah I'm planning to do that as well :stuck_out_tongue:

Bolt

Got the GTK app working ! But it's a bit ugly :stuck_out_tongue:
image.png

Wonder if the problem is in my end

Sridhar Ratnakumar

Oh yea, that looks weird. Looks like semantic UI CSS is not loading?

Sridhar Ratnakumar

Can you send the full app screenshot? Also logs.

Sridhar Ratnakumar

src/Ka/View.hs line 27; that's where semantic UI css is getting included.

Sridhar Ratnakumar

Right click inside the app, and click "Inspect Element". This will open a DOM inspector

Bolt

I have the DOM inspector opened

Sridhar Ratnakumar

In the Network tab, select "All" and you should see the status of semantic.min.css

Sridhar Ratnakumar

On my end it looks like this:
image.png

Bolt

There's an error loading that resource!

Sridhar Ratnakumar

Why is it failing? can you fix that?

Bolt

I found the source of the error

Bolt

Failed to load resource: TLS/SSL support not available; install glib-networking

Bolt

maybe some dependency issue

Sridhar Ratnakumar

Output of ldd $(nix-build)/bin/ka?

Sridhar Ratnakumar

In theory nix should have taken care of it; if it works on NixOS, why does it not work on Arch? Or is nixpkgs doing some conditional stuff, depending on linux distro? No idea...

Bolt

Doesn't seem to to be there

Bolt

Is glib-networking listed on the dependencies?

Bolt

I do have it installed on my system tho

Sridhar Ratnakumar

is glib-networking running as a service (systemd)?

Bolt

I don't think so, probably

Sridhar Ratnakumar

it seems to be a library, and a service. cf. https://github.com/NixOS/nixpkgs/blob/7f6dda737a11165c71128f46c631b3cd4dfadbda/nixos/modules/services/desktops/gnome3/glib-networking.nix#L17

Nix Packages collection. Contribute to NixOS/nixpkgs development by creating an account on GitHub.
Bolt

Is glib-networking on the input build of the derivation?

Sridhar Ratnakumar

@Bolt Looks like you hit this bug: https://github.com/reflex-frp/reflex-dom/pull/80

This is a continuation of @mageshb's work fetching headers from XHR responses (originally PR #76) There is a new field in XhrRequestConfig called _xhrRequestConfig_responseHeaders that allows u...
Sridhar Ratnakumar

Maybe we can get glib-networking into reflex-platform to fix this?

Bolt

Is that a hard thing to do?

Sridhar Ratnakumar

@Bolt I have no idea. We don't have to touch reflex-platform (ka doedsn't use it); just nixpkgs. So maybe we need to see how reflex-dom is packaged up in nixpkgs, and change there. You can check with @maralorn as he might have some ideas.