6 ms·
NGS – Next Generation Shell
- rmetzler 5y agoI was excited when I saw the features like retry and timestamps in log. Then I saw it was written in C. I actually thought it would be Rust or Go. I don't think you should use C for a "next generation" thing.
- duckerude 5y agoIf it works it works. Very few of my problems with shells can be blamed on C. (Maybe two in total?) The oldest commit is from 2013. Rust hadn't hit 1.0 yet, Go only barely.
- ilyash 5y agoHere is a bit of history which might shed some light on the decision. First and very partial implementation - JavaScript. It was a prototype which I knew I will be throwing away... and I did. Second attempt, also very partial - Lisp. I used SBCL. Skipping the details here but the result was as follows: got stuck with two different unrelated issues. I did not know would I be stuck with additional issues even if I somehow solve these two. Third attempt - found a language in which I will never be stuck unable to solve something. C. Also, looked around: bash, Python, Ruby - they are all C. At the time I thought I might be "borrowing" some code from. It didn't happen. I did look though. Edit: unexpectedly a huge chunk of work, which is garbage collection, was already done for me. C has garbage collection! It is a library - https://en.wikipedia.org/wiki/Boehm_garbage_collector https://en.wikipedia.org/wiki/Boehm_garbage_collector
- jhoechtl 5y agoI avoid the rather uesless "Why not?" comment as it will naturally spark answers like immutable data structures, sane type model etc. Whole and profitable empires have been built with C. C compilers are darn good in optimizing code. There is a large workforce proficient in C. I would bet anytime on C rather on Rust. If Firefox will die it's because some overly eager (but certainly smart) people thought a rewrite will solve business problems.
- Zababa 5y ago> If Firefox will die it's because some overly eager (but certainly smart) people thought a rewrite will solve business problems. Rust is probably the least terrible business decision to come out of Mozilla in those past 5 years. If Firefox dies it will be because of the executive's rent-seeking behavior.
- jonathankoren 5y ago> I would bet anytime on C rather on Rust. If Firefox will die it's because some overly eager (but certainly smart) people thought a rewrite will solve business problems. That would be ironic given that a massive rewrite is what tanked Netscape, and gave rise to Mozilla, and eventually Firefox.
- SubjectToChange 5y ago> Whole and profitable empires have been built with C. C compilers are darn good in optimizing code. There is a large workforce proficient in C. Then why is it that all of the major C compilers are written in C++?
- kasperni 5y agoI don't have an opinion on the particular product. But I don't understand people who call a product something starting with "Next Generation". Such a name isn't really going to age well no matter how clever you are.
- formerly_proven 5y agoJust like xyz-ng has become the mark born by early 00s replacements for early 90s tools.
- hulitu 5y agoWhy not ? After "Next Generation" comes "Deep Space 9".
- compsciphd 5y ago(next)+ generation.
- alophawen 5y agoMega Shell Plus
- ithkuil 5y agoI remember when sufficing something with "2000" made it look futuristic... I guess that didn't age well either.
- netizen-936824 5y agonext gen 2k quantum blockchain
- deleted 5y ago[deleted]
- vardump 5y agoWorked for Windows NT (NT = New Technology). Used to see a lot of ads "... built on NT technology"...
- pjmlp 5y agoIt still misses the ability to call shared libraries entry points or interoperate via OS IPC (UNIX, D-BUS,...), if I am reading the documentation correctly. So not so much next gen.
- Iwan-Zotow 5y agoNext Generation Shell is called Powershell
- heavyset_go 5y agoI tried to like PowerShell, but found it unpleasant to use as a shell or scripting language.
- yjftsjthsd-h 5y agoThere are multiple, perhaps even many, next gen shells. PS is one, but it's not the only thing and shouldn't be.
- Iwan-Zotow 5y agoSure but it's the only widely used portable one which goes beyond just passing bytes. It has powerful object model with passing object handles around.
- yjftsjthsd-h 5y agoSo I'm a little out of the loop, but doesn't the nice object system fall apart once you use that portability, since only NT uses objects over bytes?
- Iwan-Zotow 5y ago> but doesn't the nice object system fall apart once you use that portability no e.g., directory listing returns handle to the object with IEnumerable interface. This is what would be passed through the pipe, not bunch of strings, such that next command (object) will iterate over files and do something specific. This will work on Windows/Linux/Mac the same way > only NT uses objects over bytes Modules. There are generic portable modules as well as NT specific stuff.
- ilyash 5y agoHello! Author here. AMA here or in Discord - https://discord.gg/6VqgcpM https://discord.gg/6VqgcpM
- eikenberry 5y agoThis seems to be more a simple programming language than a shell. A shell is first and foremost a UI, only secondarily a scripting language... That is the point, that you can easily take a series of commands you'd do manually and put them in a script.
- ilyash 5y agoHi! Author here. > This seems to be more a simple programming language than a shell. Currently it's only a programming language. The interactive part will be implemented in the NGS language itself. > simple programming language Since simple is relative: NGS is simpler than Java and more complex than awk I would say. NGS has exceptions, types with inheritance, multiple dispatch, guards (additional conditions to invoke a method), basic functional programming support, patterns, (new, in progress) facility for deeply nested data manipulation, automatic parsing of command line arguments when invoking the optional main(), threads, domain-specific syntax and facilities for running external programs and file manipulation. Simplicity is one of the language goals but not over expressive power. > A shell is first and foremost a UI, only secondarily a scripting language... I'm having hard time to agree or disagree. There is a lot of interactive usage but there are also a lot of scripts in bash. When I see the scripts I wish bash was "more of a programming language". > foremost a UI ... where surprisingly little innovation happened over the last decades. It's like in the movies when there is an object in the center of the screen and the whole world is rapidly changing around it. That object is the shell. My plans for UI are at https://github.com/ngs-lang/ngs/wiki/UI-Design https://github.com/ngs-lang/ngs/wiki/UI-Design . > easily take a series of commands you'd do manually and put them in a script You can do it in NGS and even in this simplest use case it will be better than bash - in case of an error the execution will stop (like with -e in bash) and NGS will print stack trace (which I don't know how to do in bash and not sure it can be done in a sane manner). Edit: $a will expand to exactly one argument (as opposed to zero or more), rm -rf "$mydir/" will throw exception if mydir is undefined. Typical things which are expected from modern programming languages. NGS uses small subset of syntax from bash so running external programs in the simple forms looks the same.
- opan 5y agoI'm still on zsh most places, but I'm always happy to see new shell projects like oil and elvish. This is my first time hearing of this one.