679 karma · joined Mar 3, 2019 (7y ago) · 680 submissions
comment 1y ago · link · parent
Forth itself is hard to categorize since it refuses to standardize but we all know what it looks like, I'd say its a low level language/VM that manages everything through stacks (usually 2) there's forthlike languages and also concatenative languages. concatenative languages can be far removed from forth, I don't mean that the shell itself is concatenative, but only the shell pipelining aspect, which you can imitate in any forth. take an object and keep passing it to subsequent functions without popping that know s how to handle that object, that's a shell pipeline to me, all of unix can be passed the /dev/std* objects and they can all modify it and pass it along to the next function/program.
comment 1y ago · link · parent
I do like awk and it definitely should be used more, but I stopped using it because of modules. gawk added it, but its strange having a script end in .awk and then its actually .gawk, and not working with mawk and so on.
So to me, modules are paramount, Lua focuses on embeddability and being an extension language means that writing to _G is fine. But as a system language you should never write to _G. this means that you may find a module for lua, but in reality its not lua, its a module for a program, usually a game.
Frankly, I think lua should not even be offered in your package manager and instead some sort of wrapper that works on POSIX systems should be used, batteries included and sane defaults as well. No more installing luaposix for basic functionality (if bash has it, this should as well). I and you are disparaging bash and claim lua is fast, but at the end of the day, bash has many builtins like test,cd,setenv while lua does not.
Also can D be used as a scripting language? I'm genuinely amazed and would give it a try.
> Why not use it if it's there, it's faster, and you don't need features beyond 5.1?
Sure, but I doubt anybody will need the performance unless of course you do.
FWIW there is a killer feature that I consider essential that everybody needs and that is <close>. I no longer have to worry about closing files, and I could probably use it for something else.
> They're almost regex, they're faster than regex, and for 90% of use cases, you don't need full regex
You may not need full regex (PCRE) but you usually need EREs specifically {} and | are used a whole lot.
> Isn't a table basically just a JavaScript object, where metatables are the prototype object? Sort of, at least...
I'd say JS is a weird language as well.
Mind you, I'm not disparaging lua, I do use it, but these are the foot guns. (Bundling is also a mess)
comment 1y ago · link · parent
https://web.tecgraf.puc-rio.br/~lhf/ftp/lua/#limath
luajit does have integers (try 5ull+6), bit operations via the bit library (absorbed from lua5.2)
comment 1y ago · link · parent
comment 1y ago · link · parent
Lots of default functionality missing so you MUST have these packages: inspect, luaposix, lrexlib-pcre, lrexlib-posix, lpeg, luastd/stdlib, luasocket, luahttp, luasec, luacheck, penlight
* luajit is unnecessary in almost all cases, you don't need the speed.
* use lsp or luacheck whenever you write something, entr -c luacheck file on everything.
* patterns are not regex which means they do not support lookups, backtracking or |, so you must install lrexlib-pcre or lrexlib-posix (frankly I never need pcre so I stick to lrexlib-gnu or lrexlib-posix).
* overload _ENV so it auto requires unknown things, I have a lua wrapper that does this and it makes it a joy not having all of my scripts with a bunch of require"posix" on all of them
* install inspect to inspect tables
* os.execute and io.popen only accepts strings as parameters which means you should overload it and make a function that accepts tables as well.
* 5.4 is still lacking support for many libraries, 5.3 has most of the libraries.
* assignments default to the global environment so you have to use local keyword or set _ENV to error on assignment (or better yet, don't care, just local _ENV = mymodule)
Overall, Lua is just a mixture of C with a pascal syntax and garbage collection (and also tables which is a weird data structure)
comment 1y ago · link · parent
refetching terminfo capabilities seems an easy fix, you also get sigwinched which I imagine happens on a new terminal.
Mind you, I don't use abduco but do use dtach sometimes, I've accepted that I need screen and tmux with all its warts, like instead of using a scripting language like TCL/Lua for configuration it built its own frankenstein language that is severely limited.
comment 1y ago · link · parent
comment 1y ago · link · parent
Secondly, XDG is a much better standard than FHS and actually supports normal users, needing to be root to install a random application is a security vulnerability waiting to happen.
Lastly XDG is not complicated at all. its around 10 envvars pointing to directories that you have to mkdir, its preferable that you put these paths in your .login as a shellscript so they're static, that's it, that's all.
And its well supported, nearly everyone is moving and using $XDG_CONFIG_HOME which is $HOME/.config instead of throwing their configuration files into $HOME/.MYPROGRAM
FWIW I would love if Everyone just used $HOME/.local/$FHS that way everything is reused
But then again a /tmp/usr/$USER or /var/cache/usr/ should also exist, nobody cares.