RSS Logo

by Mountaineerbr

#40 - Ksh2020 Flamewars


I don't think any clone of ksh can beat the original in term of speed because Korn's C code cannot be beat.

Feature-wise, mksh wants to be compatible with bash and oksh is a little more true to ksh however it has gone a different path and has got less features than ksh. But I haven't read nor used near enough about these yet to have any due criticism..

ksh code is also dependent on other software from Advanced Software Technology suite, developed by Mr Korn and a few others through many decades of work.

When Siteshwar and Kurtis Rader started to work on ksh code in 2017 thereabouts, they could not understand it very well and chose to remove large chunks of the code and rewrite whatever was left in such a C idiomatics and using compilers that made the shell terribly slow compared to original stable ksh93u+ and ultimately led to the AST code reversion.

In retrospective, if Siteshwar and kdrader1961 wanted to change so much of the code, they should have forked ksh repo in the first place

I am happy some stepped up and manage to get AST (and ksh93) official repo back on the correct track.

ksh seems like a suitable default shell for scripting. Feature-wise, that is comparable to bash+zsh in some sense. Even though Mr Korn, Mr Glenn and others stopped developing AST tools, I reckon these tools can be useful for quite some time yet almost unrivalled..

For example, instead of using GNU or busybox default utilities such as grep, one can use AST grep, wc and so on..

AST repo was easy to compile in my machine and ksh93 had many features enabled by defaults. I wonder why Siteshwar decided to change the compiler if this works so well in my current machine and, as I have read, in so many legacy hardware architectures, too.

I will be using ksh for scripting more often. There are some specific cases ksh beats zsh and bash by a lot, in other cases just by little. Still, it does not let the user expectations down as it seems to always be faster than these other big shells.

In fact, I rewrote a bash bitcoin parser script in ksh. Unfortunately, in this case, as the script is so big, convoluted and makes heavy use of external tools (mainly bitcoin-cli and jq), it cannot be get much faster.. Still I got a 10-15% speed increase and sometimes more than that depending on the functions used. However, if you are going to use that script parser, prefer the bash version as the ksh code is experimental and not fully tested to match bash output..

Below are some references I spent almost a full day reading. They are related to ksh more recent developments and some other references from a live event I made recently on YouTube..

Entrevista David Korn
https://news.slashdot.org/story/01/02/06/2030205/david-korn-tells-all
Demissão do David Korn , Glenn e outros da AT&T
https://www.mail-archive.com/ast-developers@lists.research.att.com/msg01462.html
Repo Oficial da AT&T (att/ast)
https://github.com/att/ast
KornShell 2020 - Impossible Happens!
http://situ.im/posts/kornshell-2020-impossible-happens
Anúncio da Restauração do Repo do Ksh93u+ (att/ast)
https://github.com/att/ast/issues/1466
Issue #1466 - Rewinding [ast/ksh93] repo and encouraging community
https://github.com/att/ast/issues/1466
Issue #1446
https://github.com/att/ast/pull/1446
Issue # 1449
https://github.com/att/ast/issues/1449
Issue # 1464
https://github.com/att/ast/issues/1464
Site do Korn Shell oficial
http://kornshell.com/
Repo do Ksh93u+m
https://github.com/ksh93/ksh
Sobre os double floats (notação matemática interna do Ksh/Zsh)
https://unix.stackexchange.com/questions/422122/why-does-0-1-expand-to-0-10000000000000001-in-zsh
echo(1) and printf(1)
https://www.in-ulm.de/~mascheck/various/echo+printf/
Biology for Cynics
https://mountaineerbr.github.io/blog/16/
Computer for Cynics (Ted Nelson)
https://www.youtube.com/user/TheTedNelson/videos