Hacker News new | ask | show | jobs
by sargstuff 394 days ago
Historically, the lower the level of coding, the more the programming is expected to manage the environment(s). But somewhat dependent upon standards & how programming language abstractions/constructs permit interaction with different logic planes/levels. aka OS, user gui, user shell, hardware, etc.

Lisp and C focus on different logic planes (historically, os/hw for C vs. os/user for Lisp) & different categorical approaches to programming (linear vs. non-linear).

Human doing envObs management on own doesn't make for 'standard' approaches needed by a compiler to do optimizations.

Check out turing machine[1] for the 'extreme' example of 'endless memory' & what binary file formats 'hide' from the user.

----------------------------------------

Messing around with typical unix shell (ksh, sh), one can impliment the equivalent of what C & Lisp language level provide natively, but gets really unwieldy fast relative to using Lisp/C).

Traditional unix shells pass around "flattened" list/object data bound to variable(s) where scope is defined by how script was envoked. aka discard variable changes on exit or overwrite values of existing values.[0]

For shell script concurrency, one can dump to file, call script, load data from file, and overwrite file with new values before returning to 'caller' in order to make sure things aren't over written by multiple envoked shell scripts. Within shell script file, when calling a function, need to define scope. Not defining scope when 'program' get's large (~5000) lines of code, makes figuring out where in program value is being used/changed, difficult.

----------------------------------------------------

[0] : https://www.baeldung.com/linux/sourcing-vs-executing-shell-s...

[1] : https://www.geeksforgeeks.org/turing-machine-in-toc/

1 comments

Thanks, it is an insightful consideration of the subject.