3

Is it possible to call external commands in Scheme on a Unix system? What is the easiest way to do this?

Thanks.

user279540
  • 33
  • 4
  • 1
    See [Execute command line from Scheme](https://stackoverflow.com/q/33210533/4739247). – assefamaru Aug 07 '18 at 16:20
  • @assefamaru Not the same question as it asks especially after `guile`, while this question doesn't. – Sylwester Aug 07 '18 at 16:29
  • 1
    What did you try already? Have you tried to read a manual - sounds old fashioned - but Scheme systems usual have some documentation. I would expect that most Scheme implementations on Unix can call external programs. – Rainer Joswig Aug 07 '18 at 16:58
  • I looked everywhere including this site, but I didn't find anything for scheme specifically. – user279540 Aug 07 '18 at 17:15

1 Answers1

1

There are no such features and FFI (Foreign function interface) is not part of the Scheme standard.

There are implementations that extend Scheme with other features and Racket is one of them.

Chicken Scheme has an extension to call a command and several FFIs, including Lazy FFI.

Racket has the possibility to execute commands though Processes and it also has FFI making it possible to interface with anything on your machine.

There is a related question specific to Guile version of Scheme.

Since you have tagged Lisp, there is a related question specific to Common Lisp.

Sylwester
  • 47,942
  • 4
  • 47
  • 79
  • Hmm...given there isn't a way to call external binaries in scheme generally, do you know any scheme-derived language that allows for this and is good for unix scripting? (I rather wouldn't use racket because it's a bit bloated and simplicity and 'niceness' are the reason I'm trying to move away from bash. – user279540 Aug 07 '18 at 17:19
  • @user279540 I've added Chicken, but I do not use it much. You probably could look the [different implementations](http://community.schemewiki.org/?scheme-faq-standards#implementations) and fin the best one for you. – Sylwester Aug 07 '18 at 17:43
  • 1
    @user279540 There's scsh but is seems a while since anyone updated it. – WorBlux Aug 07 '18 at 23:27
  • The minimal racket distribution on MacOS is an 8.6MB DMG file, it's not that huge. –  Aug 08 '18 at 15:20
  • I have heard of scsh, but was reluctant to use it for that very reason. – user279540 Aug 12 '18 at 01:18