7 ms·
You can’t really move away from bash, unless there would be alternative as widely available on different Unix systems as bash is. Yes, you came up with a nice
by ekiauhce 3y ago
You can’t really move away from bash, unless there would be alternative as widely available on different Unix systems as bash is.
Yes, you came up with a nice syntax for your Haskell scripts, but what it cost to install all required dependencies on, for example, newly created Ubuntu server?
- pbiggar 3y agoWe're trying to do a similar thing with darklang right now: providing a single binary with a built-in package manager. The idea being making it easy to write readable "bash" scripts (including writing them with AI), but with just one dependency - the darklang binary itself.
- themk 3y agoYep, this is mainly used for turning those bash scripts that you let get too large into a real program. You port your script, basically line for line, into this, and then start chipping away at it until you have something less scary.
- forgotpwd16 3y agoToo bad Hugs98 (installation is few MBs) is no longer updated leaving only GHC (GB+).
- maleldil 3y agoYou don't need the compiler to run the program in production. You only need the binary. I'd argue that a heavy toolchain in the dev machine isn't a big deal.
- IshKebab 3y agoBash scripts tend to be used in situations where you want to edit them and not have to deal with a recompilation step, let alone a multi-GB compiler install. That seems like a deal-breaker to me. The best alternative I've found so far is Deno. It natively supports single file scripts with third party dependencies (this is a big issue with replacing Bash with Python). It uses an existing popular language (so now "learn our weird language" problem). Installation is very easy. The only real downside I've found is this stupid bug that they refused to fix: https://github.com/denoland/deno/issues/16466 https://github.com/denoland/deno/issues/16466
- johnisgood 3y agoThat is a very good point in favor of Bash.
- ReleaseCandidat 3y agoYes, but Shh works on Windows. And on OS X you need to install about the same things if you want to have a recent Bash > /bin/bash --version GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23) Copyright (C) 2007 Free Software Foundation, Inc.
- keybored 3y agoYou’re not always working in crummy environments. Sometimes you can have nice things (if you think this is nice). I don’t get the impression that this is supposed to be the final solution to Bash.
- marcosdumay 3y agoWhy do you want to develop Haskell programs in a newly created Ubuntu server? Or do you want to compile it down at the deployment target?
- aranchelk 3y agoI’m missing something — why would a newly created Ubuntu server be any better or worse than any other system for developing Haskell?
- marcosdumay 3y agoThere has been a couple of decades since I last had to do any development in a newly created server. Development is best done on well setup workstations.
- norir 3y ago> You can’t really move away from bash, unless there would be alternative as widely available on different Unix systems as bash is. Lua can be built from source in a few seconds on just about any system and can be used pretty easily as a bash replacement. You can even bundle the lua script in a bash script that idempotently installs lua and then calls the lua script embedded in heredoc.
- tikhonj 3y agoIt's pretty easy if you use NixOS :) That's been one of the somewhat unexpected benefits for me with NixOS: it's so easy to pull in tools and libraries that I don't have to worry about using less popular options.
- aliasxneo 3y agoThe caveat is that you're pushing the complexity somewhere else. I'm finally moving away from NixOS this month (after two years of using it) because I'm tired of edge casing interrupting my daily flow.
- crotchfire 3y agoAre you kidding? Half of NixOS is written in bash. Nixpkgs is just Nix used as a metalanguage for splicing together bash object language programs. Guix is what it looks like when you really get away from bash -- they use scheme as both the metalanguage and the object language.