who here uses shcomp ? #851
Replies: 4 comments
-
I'm interested in that as well. I've sometimes wondered whether it's even worth keeping. |
Beta Was this translation helpful? Give feedback.
-
i personally find it a fun thing to have, even if there is no real use case for it |
Beta Was this translation helpful? Give feedback.
-
Although it doesn't always work, it can be useful in a tight loop. When you have a couple thousand database servers to cycle through, and need a wrapper around the sql utility for password encryption, it both renders the script less readable and in the vicinity of twice as fast (parallel background jobs aside). Doing benchmarks, I had a "Hello World" script in various forms (python, golang, ksh, bash, perl). The shcomp was almost as fast as the compiled golang. Calling /bin/echo was about 3 times faster, and the builtin echo an order of magnitude from there (no subprocess). As exotic as binary datatypes are for a ksh script, it's still likely easier for future DBAs to support, and pretty close to what they'd get from a C program (most current day DBAs wouldn't be able to support that). If only it were truly "compiled" (opcodes and operands like compiled C). This was a bigger thing in the 80s before the PC really took off. The Apple ][ couldn't pull off more than a buzz with sound without compiled code of some sort. Conceptually, I see a strong purpose for it, and possibly trying to get a few of the kinks out, if not attempt a C/Rust like translation for gcc to pick up for real compiled code. Maybe gcc will take a whack? |
Beta Was this translation helpful? Give feedback.
-
Considering POSIX requires the shell to not "over-read" the source file during the course of evaluation, scripts making use of that property will be broken by almost any sort of compiler. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
for those who don't know, shcomp is a command which compiles any shell script into ksh93 bytecode. i've only used this once to see what it does to hfetch which is my *fetch program but i'm curious if anyone here uses it for anything else :]
Beta Was this translation helpful? Give feedback.
All reactions