Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
I can totally understand the frustration.
Bash is OLD. Like methusalem old.
And there are many many many many many things in Bash that can drive someone insane....
magicMirror683418dDo what my insane startup founder does:
wrap bash scripts in a makefile!
I will show myself out....
bahua1319918dBash was modern and innovative in the late 90s when I first started using it, but it hasn't changed much since then.
@magicMirror That is.... pretty dumb.
@bahua Yes... And I don't think it will change much. Since it is essentially the backbone of a lot of stuff ^^
All in all I only use bash for simple tasks.
Everything else -> Python / PHP
As Python 2 is finally dead, it's safe to use Python 3
Aldar71318d@IntrusionCM I mean, yes, bash is totally not well suited for complex projects, but I recently found myself writing a, more complex than I would have liked, cli completion script, and...
The way arrays are handled in bash hurts my brain. Yet I cannot use something like python as the spinup time of the interpreter can be anything, from half a second, to a couple of seconds... And that would make the completion unusable with how often I spam tab.
Which is why I found myself looking for a way to communicate over XML-RPC in pure bash whilst screaming to all the gods out there to rid me of this curse.
ok... might have sounded a bit harsher than I wanted it to be...
The startup time shouldn't be extreme in python, since it usually compiles the stuff on first generation and generates PYC files.
And what do you mean by completion? Like in bash completion?
And why XML-RPC....
It sounds really terrifying... Oo
Aldar71318d@bahua i wish, but ever since I saw some of our internal tools that are written in perl, I got scared for life. Its soooooo weeeeeeird x.x
@IntrusionCM no worries, its an absolutely ugly thing. On top of xml-rpc, it also has to communicate over a unix socket, adding another layer of complication.
And, yes, bash completion.
As to why it takes that long, well... My only guess is... It runs on servers under load, and many different machines that do not have it compiled already.
IntrusionCM255117d@Aldar I cannot stop being curious..
Just what the hell is it what you're building?
Bash Completion. OK.
XML RPC / Socket? Does it call an service to get the completion sequence?
And yes. Perl isn't less terrifying.
Although... XML parsing in Bash... Sockets maybe, painful. But possible.
But XML? Ay caramba...
Aldar71317d@IntrusionCM We use this thing called supervisord - a supervisor daemon written in python.
Across our server base, I can only be sure that it provides a socket to communicate over.
And the service only communicates over that socket using XML-RPC.
Yes, I could use REST when there is also HTTP server in use, but that's not everywhere.
And, although I tried, I failed to parse out and differentiate which supervised services are running and which not. Issue came only when there are multiple instances of one program, leading me into having to communicate with the daemon itself... No other way I could think of solving that.