5

Does anyone know of any semi-portable way to write console applications (e.g. basic animation) in scheme? I heard of an ncurses wrapper but I couldn't find anything.

Lily Chung
  • 2,919
  • 1
  • 25
  • 42

3 Answers3

5

You can't do any GUI in a portable way in Scheme -- because you only get very basic file IO.

Eli Barzilay
  • 29,301
  • 3
  • 67
  • 110
  • Hmm. Thanks; I guess the best solution is perhaps to use an external script to redirect output to a C program or something. – Lily Chung Jul 24 '11 at 13:59
  • You can certainly try that. IIRC, there is some gnome server thing around, where you run a process and interact with it via stdin/stdout. (I don't remember the name though.) That will make it possible to write portable scheme code that can do gui this way, but the gui itself will obviously be only gnome. – Eli Barzilay Jul 25 '11 at 03:36
  • @Eli Barzilay Are you talking about the [GTK Server](http://www.gtk-server.org/)? It's definitely interesting. I wonder whether it is actually being used productively. – Matthias Benkard Jul 25 '11 at 17:28
  • Matthias Benkard: Yes -- that's the one. (I just searched for "gnome server" and didn't see anything...) – Eli Barzilay Jul 26 '11 at 01:45
3

Depends on your scheme of choice. Chicken Scheme, for instance, has good ties with C and has various Curses libraries. See their code examples:

mike3996
  • 17,047
  • 9
  • 64
  • 80
  • Thanks, but I need something portable across most, if not all schemes. Cross-platform doesn't matter as much, as long as there is a way to do it for each platform. – Lily Chung Jul 25 '11 at 13:36
  • @Arafinwe: Chicken can compile a subset of its scheme to C for maximum portability. The Scheme part is also very well covered as the frontpage says. – mike3996 Jul 25 '11 at 13:40
  • Thanks, but this is for a library, and so it needs to be portable across schemes. – Lily Chung Jul 25 '11 at 13:57
2

Have you checked out Guile? I've never used it myself except just to play around, but it is pretty cool, and even has a little GUI support. Not sure about portability, except it should port just fine between different Unix systems, but the same can be said about ncurses.

Don't give up hope! If you're dedicated to developing in Scheme, you can.

Dmitri
  • 2,658
  • 2
  • 25
  • 41