4 ms·
You’ve hit most of it. The desire is a lowest common denominator. Python, Ruby, etc would be great except that in some of the places there arent current versi
by TheCondor 8y ago
You’ve hit most of it. The desire is a lowest common denominator. Python, Ruby, etc would be great except that in some of the places there arent current versions and beyond the most mundane you end up wanting 3rd party packages, which complicates your packaging or removes that lowest common denominator property.
What it begs is for a new tool. A single file, statically linked “super shell” that lets you do structured scripting and has builtins for a bunch of common things (reading in addresses, daemonizing processes, reading the process table, etc. and that tool needs to be build able on nearly everything. Now I like rust and the attention it is getting and the interest in safety and correctness. I can’t think of many places where I’d reach for bash but be happier writing rust, a lot of it is 15minute disposable programming jobs. At a glance, I think I’d trade 5minutes of set -e to find some error I skipped for 45 minutes of trying to rejigger things to properly borrow some shared value.
- pas 8y agoI thought of Rust because of the strict typing. If something TypeScript-like could compile to Bash, that'd be amazing. (Maybe there's something like that already.) But now, to think of it, just using Node + TS (+ yarn) sounds better than Python.
- h1d 8y agoshelljs? https://github.com/shelljs/shelljs https://github.com/shelljs/shelljs
- rkeene2 8y agoTcl meets all of these requirements. I have a Linux distribution whose PID 1 is a Tcl shell and I can setup everything from there without spawning any new processes.
- oblio 8y agoYeah, but Tcl is old and quite crufty. The docs are a mess, everything is a string, a lot of concepts it uses are not very familiar and/or mainstream (upvar?). A modern take on Tcl is what we need, in my opinion. Surely we should be able to build something nicer 30 years after the first release of Tcl.
- blacksqr 8y agoThe modern take on Tcl arrived almost 20 years ago, when "everything is a string" turned into "everything is a typed object with a string representation". The docs are clear and complete, and the concepts it uses make it a powerful and elegant tool.
- oblio 8y agoThe docs are clear and complete?!? Has something changed suddenly in the last 5 years? Yes, the docs had a decent API reference but everything slightly higher up than "what parameters this command has" was on that wiki with comments from 2004 marked as out of date by out of date comments from 2007...
- blacksqr 8y agoHard to see what your standard is. In what sense do the official docs (https://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm https://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm) fall short in your opinion?
- rkeene2 8y agoI agree that Tcl isn't mainstream and thus a lot of concepts used by Tcl are not mainstream, but other than that it's got a lot going for it. Tcl's string representation for objects is just a serialization/deserialization mechanism, which seems to be pretty popular in other languages as well. Additionally all of the cool things in Tcl such as coroutines, threads (as an additional, but included, package), great documentation delivered as man pages, virtual filesystem access, virtual time, safe interpreters for running untrusted code, a stable ABI (stubs) so that compiled extensions can be used for decades, a small memory as well as disk footprint, extremely cross-platform, easy to embed into larger programs as an extension language, easy to compile a large static program with Tcl as the "main" entrypoint, native BigNum support, many thousands of great packages, .... What would a modern take on Tcl improve on Tcl that Tcl couldn't just build easier ?
- blacksqr 8y ago>I have a Linux distribution whose PID 1 is a Tcl shell Interested! Available?
- rkeene2 8y agoNot really, it's really used to setup the environment for a network boot, it supports VLANs and network configuration and loading modules and stuff (even from Tcl virtual filesystems), it's basically just Tcl+TUAPI[1] [1] https://chiselapp.com/user/rkeene/repository/tuapi/doc/trunk/USAGE.md https://chiselapp.com/user/rkeene/repository/tuapi/doc/trunk...