6

Section Syntax – Next Generation Shell

 3 years ago
source link: https://lobste.rs/s/gert97/section_syntax_next_generation_shell
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Section Syntax – Next Generation Shell

cup

edited 1 year ago

| link

a = [1, 2, 3]
arr = a.map(X*2) # arr is now [2, 4, 6]

https://github.com/ngs-lang/ngs#arrays

Respectfully, arent you just reinventing the wheel here? That looks pretty similar to Ruby:

a1 = [10, 20]
a2 = a1.map { |n1| n1 * 2 }

Wouldnt it be better to just have a dumb shell, that can call programs to do heavy lifting (read: programming languages). This way you have a “division of labor”. Shell works best for launching executables, and programming languages work best for handling data structures and algorithms.

I have found when one trys to borrow too much from the other you get bad results. For example, when a shell trys to add too many programming features, you get a slow bloated result. Compare Bash versus Dash. Similarly programming languages should avoid calling executables when possible, as it leads to performance bottlenecks. For example using LibcURL instead of cURL and LibGit instead of Git.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK