New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
Trying
ii
IRC client from suckless.org.Tutorial at https://www.reddit.com/r/vim/comments/48t7ws/vim_ii_irc_client_xpost_runixporn/
Using the
ii
installed at ctrl-c.club, from which Libera.chat seems to disallow certain connections. So, instead of Libera, reverting to Freenode for this trial.About
ii
:ii
creates in and out directories in~/irc/$server_name
. One uses command line tools liketail
andecho
to read and write messages. One reads from theout
file and writes to thein
file. What could be simpler . . . or perhaps more masochistic?A few snippets:
In a second terminal window:
Back to the first terminal window:
More on
ii
at https://tools.suckless.org/ii/usage/This is the
main
function fromii.c
. Is anyone here good at C and interested in thisii
code?It's pleasingly clean code. I like their macronized argument parsing. Getopt is annoyingly convoluted (and GPL'd if i remember correctly). I usually use argtable (who really enjoys writing argument parsing code after all? ...) but generalizing it down to some macros to be included in some kind of common header could probably work out quite nicely too.
@totally_not_banned
Thanks for your comment!
Looks like you are talking about three different ways of processing command line arguments: macro, getopt, and argtable?
Maybe pointers and loops provide a fourth way of processing command line arguments? Here is discussion of a K&R code example using loops to parse arguments to the
find
utility. See also HN discussion.Briefly, the K&R
find
code uses pointers and loops. There is a while loop and a for loop. ". . . [T]he for loop traverses concatenated flags (i.e., it moves the pointer from the “x” to the “n” in “-xn”) and the while loop traverses separated flags (i.e., it moves the pointer from the “-x” to the “-n” in “-x -n”)." I think this K&R code is not what you meant by "macronized."FreeBSD has an ARG(3) function. Plan 9 also had an ARG(2) function. These man pages talk about ARGBEGIN and ARGEND, so I guess they must be relevant to what you mean by "macronized?"
There is an example of
getopt()
in the GNUman 3 getopt
page.From https://www.argtable.org/ : (This page also has code examples.)
"Argtable is an open source ANSI C library that parses GNU-style command-line options. It simplifies command-line parsing by defining a declarative-style API that you can use to specify what your command-line syntax looks like. Argtable will automatically generate consistent error handling logic and textual descriptions of the command line syntax, which are essential but tedious to implement for a robust CLI program."
See also https://github.com/argtable/argtable3
K&R says:
"4.11.2 Macro Substitution
A definition has the form
#define name replacement text
It calls for a macro substitution of the simplest kind - subsequent occurrences of the
token name will be replaced by the replacement text. "
For
ii
ARGBEGIN and ARGEND are defined in thearg.h
header which is part of the ii source code (git clone https://git.suckless.org/ii
).Well, there's a bunch of ways options can be parsed. I'd guess the most common ones are likely getopt and brewing something custom.
Kind of, yes. I was not aware of FreeBSD formalizing any kind of argument parsing macros but if it does that obviously also fits the description. I was basically thinking of any kind of any kind of custom code approach boiled down to macros for simple reuse, even if in this case it's somewhat arguable how custom system supplied code actually is.
Well, i'm really just still going on about the same thing
That'll obviously do the job and it's a very suckless approach to it. The thing with argument parsing is that you don't really safe a whole lot by simplifying it. Sure going for something like argtable is a little decadent but you automatically get some nice usage description with very little actual code of your own and all that while not having much impact on the complexity of your code (you easily statically link against argtable so you don't incur a dependency or anything).
If your goal is of the suckless kind as in achieving the absolute maximum of minimalism using anything more than a more or less simple loop is obviously prohibitive but in general i don't think any approach can be seen as objectively better than the other here. It's really mostly about style, personal preference and actual circumstances. Personally i'd still very much prefer suckless's idea over getopt most of the time though.
Hey! Hope you guys are doing great! I'm trying irssi. It seems to work.
Libera requires SASL to connect from ctrl-c.club.
ah i have just installed unreal with webpanel and ssl for myself, just to remember.
my eggdrops doing nothing just idling (like the servers they are)
lol xD
inspircd and anope best i have irc server user clients above 10k.
10k? Which network is that? (if I may ask)
https://netsplit.de/networks/top100.php
InspIRCd or UnrealIRCd, Anope or Atheme.
But having 10 users on a single server isn't good practice anyway. Typically, those users are shared among multiple servers.
There were servers that were part of a larger network serving an extremely high number of users (twisted.dal.net with 50K users in 2003 as example), but this almost never ended well.
Happy birthday libera.chat !!!
https://libera.chat/news/three
Hi @Carlin0 !
It looked like nobody had submitted Libera's birthday to Hacker News, so I posted there. Thanks to you @Carlin0 for showing me the link here!
Haha, @jbiloh, see everything first right here on LET!!!
Thanks to Libera.chat for hosting the #metalvps channel! Happy Third Birthdday to Libera.chat!!!
Best!
Tom