[ prog / sol / mona ]

prog


Scsh - the Scheme Shell

1 2020-04-23 02:28

Shell programming terrifies me. There is something about writing a simple shell script that is just much, much more unpleasant than writing a simple C program, or a simple Common Lisp program, or a simple Mips assembler program. Is it trying to remember what the rules are for all the different quotes? Is it having to look up the multi-phased interaction between filename expansion, shell variables, quotation, backslashes and alias expansion? Maybe it's having to subsequently look up which of the twenty or thirty flags I need for my grep, sed, and awk invocations. Maybe it just gets on my nerves that I have to run two complete programs simply to count the number of files in a directory (ls | wc -l), which seems like several orders of magnitude more cycles than was really needed.

2 2020-04-23 02:31

https://www.opennet.ru/docs/FAQ/soft/scsh-faq.html

3 2020-04-23 15:19

The unmaintained Scsh still runs perfectly on Scheme48. OTOH the Guile port was always incomplete and seems forgotten.
I'm trying to write a basic supervisor for other processes with it. It's a weird feeling to scoop bits of documentation from 25-year-old newsgroups archives. It's software archaeology.

4 2020-06-06 02:29

Yeah you can still build scsh 0.7 (the new one) on Mac and Linux, using Scheme48 1.9.2.

Every attempt to do a "scsh in Scheme X" fails, because they're all "80% solutions"

Shivers himself explains the problem with 80% solutions in http://www.ccs.neu.edu/home/shivers/papers/sre.txt

Quote:

There's a problem with tool design in the free software and academic
community. The tool designers are usually people who are building tools for
some larger goal. For example, let's take the case of someone who wants to do
web hacking in Scheme. His Scheme system doesn't have a sockets interface, so
he sits down and hacks one up for his particular Scheme implementation. Now,
socket API's are not what this programmer is interested in; he wants to get on
with things and hack the exciting stuff -- his real interest is Web services.
So he does a quick 80% job, which is adequate to get him up and running, and
then he's on to his orignal goal.

Unfortunately, his quickly-built socket interface isn't general. It just
covers the bits this particular hacker needed for his applications. So the
next guy that comes along and needs a socket interface can't use this one.
Not only does it lack coverage, but the deep structure wasn't thought out well
enough to allow for quality extension. So *he* does his *own* 80%
implementation. Five hackers later, five different, incompatible, ungeneral
implementations had been built. No one can use each others code.

The alternate way systems like this end up going over a cliff is that the
initial 80% system gets patched over and over again by subsequent hackers, and
what results is 80% bandaids and 20% structured code. When systems evolve
organically, it's unsuprising and unavoidable that what one ends up with is a
horrible design -- consider the DOS -> Win95 path.

As an alternative to five hackers doing five 80% solutions of the same
problem, we would be better off if each programmer picked a different task,
and really thought it through -- a 100% solution. Then each time a programmer
solved a problem, no one else would have to redo the effort. Of course, it's
true that 100% solutions are significantly harder to design and build than 80%
solutions. But they have one tremendous labor-savings advantage: you don't
have to constantly reinvent the wheel. The up-front investment buys you
forward progress; you aren't trapped endlessly reinventing the same awkward
wheel.

5 2022-08-02 13:23 *

Does anyone actually use this?

6 2022-08-02 13:26

Forgot link: https://github.com/scheme/scsh

Is scheme48 dead?

7 2022-08-02 15:12

I know your feeling.. I hate scripting, too!

8 2022-08-03 12:53

>>6
It is merely stagnated. But still one of the nicest schemes out there.

9 2022-08-03 21:44 *

I learned a little scsh long ago, so thought I'd give it a spin. I just installed the "scheme48" package from my package manager, it was 1.9.2, and followed the few steps in scsh's README. 1 minute later, painlessly, I have an up-to-date scsh. Still works like I remember.

I also found https://srfi.schemers.org/srfi-170/srfi-170.html , which is a standardised version of half of the scsh functionality.

In conclusion, I still like the tool and would recommend it. Shame the interfaces were never implemented on top of other interpreters, e.g. Gerbil , but I am forced to agree with >>4 that for whatever reasons all attempts in other Schemes failed around the 80% mark.

10 2022-08-06 23:51 *

>>1

Maybe it just gets on my nerves that I have to run two complete programs simply to count the number of files in a directory (ls | wc -l), which seems like several orders of magnitude more cycles than was really needed.

#include <dirent.h>

DIR *d;
int n;

int main(int c, char *v[])
{
	if (v[1]) d = opendir(v[1]);

	if (d) while (readdir(d)) ++n;

	return n;
}
11 2023-02-11 11:31

It's software archaeology.

Sounds nice.

12 2023-02-15 16:25

What is it about scheme48 that resulted in so many good large projects being written in it? Was it one or two prolific programmers who just really liked it for whatever reason or is it something deeper?

13 2023-02-18 14:49

>>10
I am slightly disgusted by this program.

14 2023-02-22 23:55 *

>>13
Why?

15


VIP:

do not edit these