3 ms·
Curious, what are you using it for? Would you say it is well suited for writing operating system helper tools (working with files, pipes, kernel api, calling ot
by effie 10y ago
Curious, what are you using it for? Would you say it is well suited for writing operating system helper tools (working with files, pipes, kernel api, calling other programs)? I like bash expressiveness a lot but sometimes I feel I could use a more powerful scripting language.
- cassowary 10y agoI just discovered Turtle yesterday, a library for Haskell. Obviously I haven't used it much in that time, but superficially it looks amazing. See http://hackage.haskell.org/package/turtle-1.0.0/docs/Turtle-Tutorial.html http://hackage.haskell.org/package/turtle-1.0.0/docs/Turtle-... and http://www.haskellforall.com/2015/01/use-haskell-for-shell-scripting.html http://www.haskellforall.com/2015/01/use-haskell-for-shell-s... Here's an example: #!/usr/bin/env runhaskell {-# LANGUAGE OverloadedStrings #-} import Turtle main = do cd "/tmp" mkdir "test" output "test/foo" "Hello, world!" -- Write "Hello, world!" to "test/foo" stdout (input "test/foo") -- Stream "test/foo" to stdout rm "test/foo" rmdir "test" sleep 1 die "Urk!" Haskell is strongly typed: the first argument of `output` is a `FilePath`; the second is a `Text`. In some respects, strongly typed is the opposite of power tho, because there's all these things you can do, like accidentally (or deliberately) pass a Text to a function expected a FilePath without translating it first.
- qwertyuiop924 10y agoSCSH, a scheme library/derivitive built on scheme48, works well here. It's got functions and macros for doing all those things. It works quite well, but is sadly seemingly barely maintained. However, its features have been ported to just about every scheme out there, to some extent.