Better HN
topnewbestaskshowjobs
Log inSign up

nmz

679 karma · joined Mar 3, 2019 (7y ago) · 680 submissions

Submissions

comment 1y ago · link · parent

Why not go with redbean?

comment 1y ago · link · parent

Forgot chicago

comment 1y ago · link · parent

I didn't say it was forth, I said it was concatenative.

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.

https://concatenative.org/

comment 1y ago · link · parent

Every single coder that uses chaining operators is using concatenative programming concepts. Shell piping is also a form of concatenative programming.

Just because you don't specifically use forth does not mean forth is dead.

comment 1y ago · link · parent

750 lines and 0 comments.

comment 1y ago · link · parent

Thankfully streaming video games never took off, otherwise we couldn't really use that excuse.

comment 1y ago · link · parent

One of the best features of the language IMO, no more style guides, do whatever you want.

comment 1y ago · link · parent

It's wild to type this up instead of just checking in your package manager for the dependencies, literally 1 minute to check

comment 1y ago · link · parent

Isn't this more telling though? that with vastly less developers they've built a system comparable to linux? This is what happens when you have direction.

comment 1y ago · link · parent

> Awk fit this. So did D, actually. Lua certainly does.

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

In lua? It works for one.

comment 1y ago · link · parent

I didn't trick anybody, this was a pitfall that was patched in 5.2

comment 1y ago · link · parent

> If you already know your code will reach 10 kloc in a project where catching a type related bug is that important, choose an appropriate type safe language. So many wasted man hours dealing with truly pedantic details.

Oh... like teal?

comment 1y ago · link · parent

> Lua's syntax is beautifully simple and unambiguous

    local print = print
    ("hello"):format()

    local foo = func
    ("args to func"):itreturnedatable("!")

comment 1y ago · link · parent

For bignums, have you tried this?

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

Isn't that called a transpiler?

comment 1y ago · link · parent

Because when your project reaches the 10k lines mark, you want something telling you "Woops, that function you declared only accepts numbers as the first parameter" and there's nothing preventing lua to have minimal compile time safety while also being backward compatible in fact, I think one of the lua transpilers allowed for function (n number, s string, a) (a is any type here)

comment 1y ago · link · parent

I do think you're better off using ruby, but if you insist.

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

Isn't this a bug of the software and not of the technology?

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

If you're worried about security, A less than 10k lines of SOC is your aim. mtm, abduco, dvtm achieve this. screen? Impossible for it to ever be secure. You'll be playing an endless game of whack-a-mole.

comment 1y ago · link · parent

From what I remember, Go started out because a C++ application took 30 minutes compiling even though they were using google infrastructure, you could say that they set out to create a systems programming language (they certainly thought so), but mostly I think the real goal was recreating C++ features without the compile time, and in that, they were successful.

comment 1y ago · link · parent

How?

The software world was basically created by Xerox and AT&T research.

comment 1y ago · link · parent

CSV is also a display format for humans and also for computers. Its also a terrible one because its too variable FS is variable, escapes could exist, "" could be used, this slows down parsing.

comment 1y ago · link · parent

For starters, It's not really a linux thing, Xorg runs everywhere, from BSDs to even windows.

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.

comment 1y ago · link · parent

BEGIN and END are still bulky, Even C got it wrong by making () mandatory instead of {}, which is something go fixed.
12345
23