3 ms·
This is fascinating. I assumed it was yet another ridiculous attempt to build something in an environment completely unsuited for it, but it seems that they are
by mikeash 13y ago
This is fascinating. I assumed it was yet another ridiculous attempt to build something in an environment completely unsuited for it, but it seems that they are serious. But they're also sufficiently aware of the craziness of the project that the first thing they do is explain just why the heck they're doing it:
https://github.com/alandipert/gherkin/wiki/Why-gherkin%3F https://github.com/alandipert/gherkin/wiki/Why-gherkin%3F
The short version is that bash is the closest thing to being universally available on every UNIXoid system no matter what, and so by writing stuff in bash, you make it so that it can run everywhere. But because bash sucks to program in, this is a minimalist interpreter for a sane language. You can then write programs in that language, and they will only depend on bash and on this interpreter, and the interpreter is simple enough not to need any sort of complex installation.
I can't quite think of a use case for this where it's not worth e.g. installing Python first, but it's an interesting project all the same.
- parfe 13y agoWritten for Bash 4.0 so OS X will not run without additional work because Apple refuses to ship GPL 3.0. Otherwise really cool project. I love bash software (when other people do the coding).
- deleted 13y ago[deleted]
- chubot 13y agoYeah, I guess bash is technically more available than a C compiler. But I think for the overwhelming number of use cases, you could just do "cc -o lisp single-file-lisp-interpreter.c" (there are many compact options). Not to mention just installing Python :) Also I wonder if awk would have been a better language than bash. I think awk is more available across various Unixes. If anything, the length that they are willing to go to do this points to the brokenness of package managers. There are still a lot of disadvantages to a package manager versus cp-ing some code.
- seryoiupfurds 13y ago> lisp in awk Here you go! http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/awk/ http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/l...
- rogerrohrbach 13y agoI made that 25 years ago. I've just downloaded it onto my MacBook Air, changed the shebang to reference /usr/bin/awk, and fired it up ("./walk walk.w p -"); it works as advertised. You can still format the doc with "nroff -ms walk.ms", too.
- chubot 13y agoThat's awesome! A testament to the timeless power and stability of Unix :)
- lloeki 13y ago> I can't quite think of a use case for this where it's not worth e.g. installing Python first Whereever you get Bash, you can reasonably assume Perl5 (unless in an initrd or something). Even on some old AIX 4 I had a readily available Perl 5.005. Nonetheless I wish there were more actual shells that were not sh descendants.
- mmastrac 13y agoBash is probably a stretch in more initrds anyways (IIRC, Redhat used a very light sh-like shell).