9 ms·
Replit now supports every programming language in Nix
- Bostonian 5y agoNo, you don't. Fortran is still an important language in scientific computing, and you don't support it. The gfortran compiler is part of gcc, so I think you should be able to. I also don't see Cobol, Ada, and Pascal. If you don't think these languages are worth supporting, so be it, but asserting that they don't exist may irk people using those languages.
- cbrewster 5y agoWe don't have templates for every language, but if it's available in Nix, you can set this up in a repl. https://replit.com/@ConnorBrewster/fortran https://replit.com/@ConnorBrewster/fortran We will be expanding our collection of templates over time, but Nix allows us to make language setup be a user-space concern instead of us internally maintaining a collection of languages configurations and docker images.
- Bostonian 5y agoThanks, it works for me. Gfortran is a traditional compiler, but LFortran is "is a modern open-source (BSD licensed) interactive Fortran compiler built on top of LLVM. It can execute user’s code interactively to allow exploratory work (much like Python, MATLAB or Julia) as well as compile to binaries with the goal to run user’s code on modern architectures such as multi-core CPUs and GPUs." When LFortran is ready, it would be nice if you supported it too, since it is a Fortran REPL.
- cbrewster 5y agoNeat, if it gets added to nixpkgs it will be available on Replit! https://github.com/NixOS/nixpkgs https://github.com/NixOS/nixpkgs
- whelming_wave 5y agoI was just able to set this up by looking at their Nix example and swapping out pkgs.nix for pkgs.gfortran then changing the `.replit` file to compile and run a hello world example I found online. Worked great!
- dang 5y ago(This comment was posted when the title was still "Replit now supports every programming language".)
- WayToDoor 5y agoDoes that mean I can finally use PHP+sqlite in a REPL ?
- ethanpil 5y agohttps://github.com/ethanpil/php-with-sqlite-on-replit https://github.com/ethanpil/php-with-sqlite-on-replit
- azhenley 5y agoCan't wait to finally try out COBOL!
- itsarnavb 5y agoHere ya go! https://replit.com/@ArnavBansal/nixed-cobol https://replit.com/@ArnavBansal/nixed-cobol
- saagarjha 5y agoThis wouldn’t be Hacker News without pedantic corrections, but the title should really say “every programming language in Nix”.
- deleted 5y ago[deleted]
- jchw 5y agoYeah. Somewhat notably, GNU Ada/gnat has been broken in Nix forever, and generally the difficulties of making things work correctly under Nix is great enough that some stuff is pretty hard to keep up to date or available at all. Of course it works well for almost everything, but there are limitations; it definitely is a complex thing. edit: It looks like my information might be out of date as it appears gnat is back in Nixpkgs. That's great news, although I think the point regarding complexity still stands, since I believe it was broken for quite a while at some point, and broke a few times since too.
- dang 5y agoOk, we've Nix'd the title above. Thanks!
- amasad 5y agodang — did the title change unintentionally dock this story? It was at the top and in a second jumped down at least 20 spots.
- Kinrany 5y agoOpening code in the example repls shows the contents of the .replit file, but the file itself is not visible in the list of files.
- cbrewster 5y agoHi, one of the authors here. The Nix environment on Replit is under development right now, we hid the configuration files to clean up the filetree as most users shouldn't need to know about the config files unless they are customizing the repl environment. However, we are reverting that change for now since we don't offer a good way to access those files yet. I'll reply here once they are visible again.
- cbrewster 5y agoThe config files should be visible again, sorry for the delay!
- jeppesen-io 5y agoIt's really exciting to see the Nix ecosystem start to gain traction here and there. I expect and look forward to greater adoption over the next half decade or so
- faitswulff 5y ago> The novel layout of Nix's content addressable store make this conflict free even with many versions of the same package. Is there a simple English explanation for how Nix does this?
- forgotpwd16 5y agoEach package in /nix/store is in a directory $hash-$pkg-$vers (technically $vers isn't even required since the $hash can already distinguish them). Therefore each can have its own independent dependency tree. For a more detailed explanation see https://shopify.engineering/what-is-nix#:~:text=Language-,the%20nix%20store,-The https://shopify.engineering/what-is-nix#:~:text=Language-,th....
- geofft 5y agoLet's say you're building Python. You write a rule to build Python, which is something like "Get a tarball from python.org/... with hash abcd1234; depend on glibc and zlib and OpenSSL; ./configure && make install." The libraries each of which have their own rules like that, say "Get a tarball from gnu.org/glibc/... with hash dbca4321; ./configure && make install." You can hash these build descriptions themselves, and that hash is available to you before you start building. So the hash of that glibc description is 98765432 - which includes the hash of the tarball. So you install glibc into /nix/store/98765432-glibc-2.30. (The name and version there are just for human convenience.) Then, when you install Python, you point it at the glibc in that directory and build it into e.g. /nix/store/aaaabbbb-python-3.9. If anything changes - tarball hashes, build steps, dependencies - the Nix hashes of everything affected also change. So the two versions, with and without the change, can be installed side by side. There are separate mechanisms in Nix to do things like get the hash of the "current" version of Python and put it on your PATH. (The downside is that Nix does not make use of the ordinary dynamic-library behavior where you can upgrade OpenSSL without recompiling Python. It does use dynamic linking, but it always points at exact paths and the thing being pointed to never changes versions. But there are good reasons to prefer this anyway, and the only downside is compilation time, and computers have gotten a lot faster since Linux distros and dynamic linking itself were originally designed.)
- cercatrova 5y agoEvery? Even Shakespeare? Whitespace? Piet?
- cbrewster 5y agoIf they are in Nixpkgs they will likely work in a repl. Nixpkgs search: https://search.nixos.org/packages https://search.nixos.org/packages Piet: https://search.nixos.org/packages?channel=unstable&show=haskellPackages.piet&from=0&size=50&sort=relevance&query=piet https://search.nixos.org/packages?channel=unstable&show=hask...
- deleted 5y ago[deleted]
- Jtsummers 5y agoI've been using Replit to make demos for some lunch & learn events at work. It's easier when we don't all have the same development stack, various combinations of languages + IDEs + OSes. I've done most of the demonstrations with Java. However, there were some demos in other languages I was wanting to do that weren't feasible within Replit that now will be (at least theoretically). I'm looking forward to trying this out later this week.
- sigjuice 5y agoNo assembly language of any sort? I just did a quick search, so it is possible I missed it.
- cbrewster 5y agoHere's a template for nasm: https://replit.com/@ConnorBrewster/nasm https://replit.com/@ConnorBrewster/nasm
- sogen 5y agoIs there a way to try Racket?
- cbrewster 5y agoHere's a template for Racket: https://replit.com/@ConnorBrewster/racket https://replit.com/@ConnorBrewster/racket
- fn-mote 5y agoRacket without graphics is ok but lacks a certain connection for teaching. Maybe someone will come along and make the graphics for Racket work the same way i3 works (which is really cool).
- jarcane 5y agoOK, experimenting with this example, I attempted to import a simple Racket web app (https://github.com/jarcane/RantStack 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 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 https://replit.com/@jarcane/racket
- cbrewster 5y agoSorry, 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 https://replit.com/@ConnorBrewster/racket-server
- 120bits 5y agoI came to know replit after a coding interview. It was coding editor on the page and I picked Java. I was used to leetcode coding environment. I use tab. My biggest mistake. Every time write something and hit tab, the editor goes out of focus. It was so frustrating that I could barely focus on the coding part. Not only that, it wasn't full screen coding editor. I was coding in small window and had to scroll up and down. I didn't clear the interview, but the memories for replit stuck with me.
- amasad 5y agoThis is impossible. There was never a time where the Replit editor didn't capture the tab key (that would be dumb). It must've been something else. Maybe it was a homemade "REPL" the company you were interviewing with made?
- 120bits 5y agoI was surprised too! I was sent a link and then it opened the replit site. The window was split vertically and one half it was coder editor. It looked like a "free" version where you can type some code and run it. And every time I hit tab the editor went out of focus.
- tazjin 5y agoThis looks pretty cool. I've been working on a bunch of monorepo tooling with Nix, and something like this (especially with LSP integration via Nix) would be amazing. A bit difficult to experiment with though, as it is one of the "GitHub-only" tools :/
- faraaz98 5y agoI'm just gonna say it. Replit is probably one of the most innovative companies right now
- butt__hugger 5y agoIt's a great product but a REPL into a docker container is hardly innovative.
- apsillers 5y agoThe actual REPL is the least impressive thing about replit! If you use an HTTP server it will automatically route whatever port you opened to 443 on its own replit.co subdomain. If you use a program with an X11 context, replit will automatically detect that and render it in its own in-page visual context; plus they allow VNC connections to that environment via NoVNC. They have an HTTP API that allows repl-instance-specific persistent storage. I'm not a paying customer or an employee or anything but I gotta say they're pretty innovative. (I will agree with others that the documentation IS definitely their weakest point, but that in part because they have so many features.)
- giovannibonetti 5y agoWhen Dropbox lanches many people dismissed it as just rsync
- butt__hugger 5y agoDropbox isn't innovative either.
- zild3d 5y agoagree, anyone know if they are on any equity markets like equityzen?
- lilyball 5y agoI’m a huge fan of Nix, and this looks like an absolutely fantastic way to use Nix.
- rgoulter 5y agoI like the idea of nix; and I love having the confidence of being able to easily install the same versions of software I like using on whatever machine I'll be using. Typically, though, the number of times I'm setting up a computer so that I can work on it is best measured in "x times per year". For that case, it's harder to argue that Nix is worth spending the time compared to just slowly setting up each computer manually. I think in this case, each user being able to use an ephemeral environment and quickly set up a familiar environment is where use of Nix seems much nicer than alternatives.
- SkyMarshal 5y ago> For that case, it's harder to argue that Nix is worth spending the time compared to just slowly setting up each computer manually. Actually that’s an even better justification for using NIx instead of slowly setting up each computer manually. If you’re setting up a new computer every week, or even every month, you tend to remember all the packages, configs, and tweaks you need just from frequently doing it. But if you need to set up a computer once a year, you forgot all that stuff, making it even more valuable to have it all scripted in a deterministic build. This blog post “Erase Your Darlings” discusses this issue, along with a really interesting solution to it: https://grahamc.com/blog/erase-your-darlings https://grahamc.com/blog/erase-your-darlings
- lilyball 5y agoSo much this. I’ve been setting up a new computer recently, first time in a while, and in the process I’ve been moving a bunch of stuff into Nix that was previously ad-hoc, specifically so I don’t have to remember about this again (and especially since I know I’ll be setting up another computer again in the near future). I even finally adopted nix-darwin and home manager in order to move more things under the Nix umbrella.
- jameslk 5y agoJust don't expect a response from their support, even if you're a paying customer. I've reached out multiple times for different issues via email and haven't heard back. Trying to find their support email was hard enough since it seems to only be randomly posted in their community support forums: https://replit.com/talk/ask/Where-can-I-contact-technical-support/49341 https://replit.com/talk/ask/Where-can-I-contact-technical-su... https://replit.com/talk/ask/How-to-change-username/7326/18945#:~:text=Email%20us%20at%20contact%40repl,-%20Replit https://replit.com/talk/ask/How-to-change-username/7326/1894... Here's what paying customers see when they press on the "Get help" button: https://imgur.com/a/9U8WGme https://imgur.com/a/9U8WGme > Check documentation > Ask the community > Request a feature > Check out recent updates and changes > Report a bug Funny enough this company should come up since earlier today I tried to reach out to them over Twitter. Just crickets so far. I get being a startup and all is hard, but if you're taking customers money and the only way to get help is community forums, that's pretty inexcusable. EDIT: They've responded to me via Twitter now. I really like the Replit product and I think it's pretty innovative. I've commented about it on HN before in a positive light. It's unfortunate they haven't given as much attention to their customer support and that I had to post something negative here to get attention. I do hope they make a change. It would be a net benefit for their customers and their brand overall.
- Oalbaro 5y agoHi, Appreciate you reaching out to us and being patient. Our average response time is under a day, but it looks like your emails were being archived before reaching our shared inbox. Either way this is on us and we are looking into why it was the emails never got to us as well as the issue you reported. I have also responded on the email, so will continue the conversation there. If you (or anyone else) does not hear back from us after reaching out feel free to add urgent to the subject line or cc me obaida@replit.com to the email and I will make sure we get to it. Thank you!
- amasad 5y agoHi James -- we do pride ourselves on our customer support and as you've seen on Twitter I do a lot of support personally too, and have my email publicly to help people. In this case, it was a technical issue -- we're still trying to understand what and why it happened but GMail automatically trashed your email and so Front didn't assign it to our support staff. Here is a screenshot from Front: https://imgur.com/a/POb5hEE https://imgur.com/a/POb5hEE Nonetheless this is good feedback and we'll do better in the future and make it easier to contact us from the site.
- smw 5y agoSeems like it would be cool if it (by default?) left you in the nix-shell environment? This would let people who don't grok nix just run `zig`, for instance.
- cbrewster 5y agoThis is coming soon!
- rmason 5y agoI hate to be that guy but he did say every programming language. So I work with three on my current project. I was pretty certain one that wouldn't be on the list, but never suspected that all three wouldn't be there. For the record they're Vue, Nuxt and CFML (Lucee), all open source.
- callahad 5y agoEvery programming language on Nix, where Nix specifically means https://github.com/NixOS/nixpkgs https://github.com/NixOS/nixpkgs The ambiguity versus "*nix" as shorthand for Linux/Unix is unfortunate, but here we are. :)
- lilyball 5y agoIf you want them on Replit, go add them to Nixpkgs. Edit: Searching for Vue, I mostly find Vue.js. Since you said programming language, are you talking about what seems to be an esoteric language for programming probe traces on an AIX? https://www.ibm.com/docs/en/aix/7.2?topic=concepts-vue-programming-language https://www.ibm.com/docs/en/aix/7.2?topic=concepts-vue-progr... As for Nuxt, I again find a framework Nuxt.js, based on Vue.js. I can’t even find a programming language called this. So… are you in fact talking about JavaScript frameworks?
- lilyball 5y agoI just tried out the i3 repo linked at the bottom of the blog post, and uh wow. Here we have what looks like an X Window session, accessible via (presumably) VNC embedded into the browser, running a custom tiling window manager (i3), with xterm, neovim, and firefox available. All on a site that’s supposed to be for writing code and hosting apps.
- ithkuil 5y agoAlso https://github.com/google/nixery https://github.com/google/nixery is nice. I used to easily add a sidecar container to my k8s workload, with the tools I need, without having to maintain a dockerfile and setup an automation to build the container.
- yewenjie 5y agoSo what is the evaluation server now? And how is security/ isolation being managed if it is not the Polygott docker container anymore?
- z3t4 5y agoI think it would be cool if projects/repos had a .envconf or .envsetup that described how to setup the environment in order to compile,run, and develop the software. So that different IDE's could use this information to automatically setup the workspace/environment.
- matt-snider 5y agoNix shell does this! https://nixos.wiki/wiki/Development_environment_with_nix-shell https://nixos.wiki/wiki/Development_environment_with_nix-she...
- jarcane 5y agoNeat. If this works as advertised (and it seems to), this rockets it past the capabilities of Glitch when it comes to language support. I had to do a fair bit of work to get anything but node running on Glitch, and since then it seems like the performance limits and startup time have gotten a lot worse, making it more and more painful to use. I have an Elm framework for slideshows I use there, and was constantly frustrated by my editor timing out every time I alt-tabbed and taking ages to reload.
- WmyEE0UsWAwC2i 5y agoDoes this applies to Haskell? I tried a project that pulled the lens library and it exceeded the memory/time limitations (in 2019)
- cbrewster 5y agoYup, you can setup Haskell with Nix. I'm not too familiar with Haskell, but it looks like Nix even has a collection of Haskell packages (including lens). This looks like it is a good resource for getting started with Nix + Haskell https://notes.srid.ca/haskell-nix https://notes.srid.ca/haskell-nix, you should be able to follow along in a Nix repl. I recommend forking on of the example repls from the blog post.
- abathur 5y agoIt should. I'm not a Haskell-er, but there are a lot of Haskellers in the Nix community.
- pwm 5y agoYup, Haskell has great nix support. Shameless plug if you wanna do do local (ie. non-replit) Haskell: https://github.com/pwm/nixkell https://github.com/pwm/nixkell