Hacker News new | ask | show | jobs
by jarcane 1849 days ago
OK, experimenting with this example, I attempted to import a simple Racket web app (https://github.com/jarcane/RantStack). I've provided links to the REPLs too for both attempts.

attempt 1) I was able to import a Racket app from Github, added a similar nix config to it as described in the docs, but it would not run as it says nix-shell is not present. Apparently a repl needs to be blessed some how as a Nix instance to work, but there's no option to select that when importing or creating a repl. URL: https://replit.com/@jarcane/RantStack

attempt 2) Next I tried just forking your template, and literally just copy-pasting the code from my app (it's a single file anyway) into the main.rkt. This runs the app ... but I can't actually access it, because apparently the ports aren't being forwarded. Going to the URL as described in the repl.it docs just gives me an eternal "Repl waking up" screen that loads forever, but never resolves. URL: https://replit.com/@jarcane/racket

1 comments

Sorry, building nix environments from scratch is still rough around the edges and we are working to improve that at the moment.

When hosting a web server, your app must listen on 0.0.0.0, adding that to your repl seems to make that work. I will make sure that is in our docs for web hosting.

Working Racket web app: https://replit.com/@ConnorBrewster/racket-server

Ahh! That was the missing piece of the puzzle, thank you.

Also played a bit with the Glitch import on an Elm import but found it broke npm in weird ways (something about a file being moved but not found?), but then the Github import of the same project wouldn't work either because of Node version incompatibilities that don't seem to be repl.it's fault exactly other than just "it runs node 12 and some stuff is broke on node 12".

Does look promising otherwise though, with the Nix support I can see soooo many things being possible that simply weren't on other similar options like this.

Yeah, we are really excited about the future Nix will bring for us at Replit. Soon, language version incompatibility will be a thing of the past on Replit.