havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.2.2, 3.1.4, 3.0.6, 3.3.0-preview1: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://t.ly/9ua4 | Logs: https://libera.irclog.whitequark.org/ruby/
roadie has joined #ruby
desnudopenguino1 has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
desnudopenguino has quit [Ping timeout: 240 seconds]
desnudopenguino1 is now known as desnudopenguino
gonix has joined #ruby
gonix has quit [Remote host closed the connection]
markong has quit [Ping timeout: 240 seconds]
jposer has quit [Server closed connection]
jposer has joined #ruby
Rounin has quit [Remote host closed the connection]
Rounin has joined #ruby
Rounin has joined #ruby
<wakaflaka> now this is defiitely the death of irc
<wakaflaka> after chatgpt nobody's asking questions anymore, ad the questions channels were the backbone
<wakaflaka> theother channels are run by "volunteers", power-hungry waabe-bulies, you know how that is
<wakaflaka> but now there's no real reason to stay on irc anymore
<weaksauce> chatgpt doesn't produce anything that good
<weaksauce> it just hallucinates bullshit
<leftylink> I would like to think that most people aren't here for the questions channels anyway though? people don't derive pleasure from answering questions. people want to discuss topics they are interested in
gonix has joined #ruby
<aesthetikx> im here to socialize and because I love ruby
gonix has quit [Remote host closed the connection]
<leftylink> yup see it has nothing to do with the questions. if anyone actually thinks they enjoy feeding vampires and answering their questions, oh boy do they have another thing coming (they get sucked dry and therefore stop coming)
<leftylink> so it stands to reason nobody in an irc channel likes answering questions
<leftylink> by simple process of elimination
<EvanR> I have seen many help channels flooded with "I tried this code I got from chat-GPT and it doesn't work, why"
<EvanR> so it's generating new problems
TomyLobo2 has quit [Read error: Connection reset by peer]
niv has quit [Quit: Powered by LunarBNC: https://LunarBNC.net]
roadie has joined #ruby
niv has joined #ruby
caedmon has joined #ruby
gonix has joined #ruby
gonix has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 240 seconds]
caedmon has quit [Ping timeout: 252 seconds]
caedmon has joined #ruby
gonix has joined #ruby
caedmon has quit [Quit: caedmon]
jhass has quit [Ping timeout: 252 seconds]
caedmon has joined #ruby
gonix has quit [Ping timeout: 240 seconds]
goldfish has quit [Remote host closed the connection]
goldfish has joined #ruby
goldfish has quit [Remote host closed the connection]
jhass has joined #ruby
caedmon has quit [Ping timeout: 252 seconds]
___nick___ has joined #ruby
ccooke has quit [Server closed connection]
ccooke has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jhass has quit [Ping timeout: 240 seconds]
shokohsc59 has joined #ruby
shokohsc5 has quit [Ping timeout: 252 seconds]
shokohsc59 is now known as shokohsc5
John_Ivan has quit [Ping timeout: 240 seconds]
jhass has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
Munto has quit [Quit: Leaving]
Linux_Kerio has joined #ruby
___nick___ has quit [Ping timeout: 252 seconds]
roadie has joined #ruby
twopoint718 has quit [Server closed connection]
twopoint718 has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
mattf has quit [Server closed connection]
mattf has joined #ruby
caedmon has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
caedmon has quit [Ping timeout: 252 seconds]
lena64t1 has joined #ruby
lena64t has quit [Ping timeout: 240 seconds]
compli has joined #ruby
caedmon has joined #ruby
keypresser86 has quit [Ping timeout: 252 seconds]
_ht has joined #ruby
entropie has quit [Ping timeout: 240 seconds]
grenierm has joined #ruby
caedmon has quit [Ping timeout: 252 seconds]
compli has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
clemens3 has quit [Server closed connection]
clemens3 has joined #ruby
friendlypunk has quit [Quit: Leaving.]
roadie has joined #ruby
friendlypunk has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
toastloop has quit [Read error: Connection reset by peer]
caedmon has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
caedmon has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
roadie has joined #ruby
duderonomy has joined #ruby
entropie has joined #ruby
entropie has quit [Quit: ""]
entropie has joined #ruby
teclator has joined #ruby
otisolsen70 has joined #ruby
reset has quit [Quit: reset]
pandabot has quit [Server closed connection]
pandabot has joined #ruby
hololeap has quit [Server closed connection]
hololeap has joined #ruby
moldorcoder7 has joined #ruby
MrLukiiiloo has joined #ruby
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
BazzaBazaa has joined #ruby
lena64t1 has quit [Ping timeout: 240 seconds]
MrLukiiiloo has quit [Remote host closed the connection]
lena64t1 has joined #ruby
BazzaBazaa has quit [Ping timeout: 246 seconds]
BazzaBazaa has joined #ruby
TomyWork has joined #ruby
desnudopenguino has quit [Ping timeout: 258 seconds]
grenierm has quit [Ping timeout: 246 seconds]
BazzaBazaa has quit [Remote host closed the connection]
MalusVulgaris has joined #ruby
BazzaBazaa has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
c10l683 has quit [Ping timeout: 252 seconds]
adam12 has quit [Remote host closed the connection]
adam12 has joined #ruby
c10l683 has joined #ruby
c10l6834 has joined #ruby
infinityfye has joined #ruby
c10l683 has quit [Ping timeout: 240 seconds]
c10l6834 is now known as c10l683
c10l6836 has joined #ruby
c10l683 has quit [Ping timeout: 258 seconds]
c10l6836 is now known as c10l683
lena64t1 has quit [Remote host closed the connection]
lena64t1 has joined #ruby
markong has joined #ruby
BazzaBazaa has quit [Remote host closed the connection]
<sarna> hey, is there something like traveling ruby (ie "I just ship a zip to my friend and it works") but for ruby 3.0+? traveling ruby seems to support only 2.4 which is pretty old :(
<ox1eef_> My understanding of that project is that it takes Ruby and produces C++ from it, which can then be compiled and distributed as a binary.
BazzaBazaa has joined #ruby
<sarna> leah2: oh neat! I thought appimage was mostly for GUI stuff, let me see if I can get it working
<sarna> ox1eef_: interesting 👀 "very early-stage work-in-progress" though :( but it'd be great if they succeeded
<adam12> I think this will get better in the next year or so
<adam12> but better might be shipping it as WASM.
<adam12> (or something else, once YARP ships and it's easier to parse Ruby)
<adam12> Natalie had to roll their own Ruby parser, so I can't help but wonder how far it would be along if it just linked to yarp and then had to build the compiling piece.
Sankalp- has joined #ruby
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp- is now known as Sankalp
<sarna> oh right, when wasm gc lands..
<adam12> I do wish that there was some investment here. And/or a Ruby LTS release.
<havenwood> Once WASI gets thread and networking support, that'll be an option too.
<havenwood> If you don't need them ^ it's an option now.
<adam12> I wonder if there's a way to wasmtime+.wasm->single archive
BazzaBazaa has quit [Remote host closed the connection]
<sarna> I mean I'd be fine with even shipping a full ruby distribution in a zip file, as long as I can mail it to somebody and it works
<adam12> sarna: Might be worth looking at .jar files too. They'd need a JRE but that might not be an unreasonable install.
<sarna> bundler's great, but I have to tell people how to install ruby itself :(
<sarna> adam12: with jruby/truffleruby you mean?
<adam12> sarna: Yes.
<sarna> whoa jruby supports 3.1 now, nice
<adam12> It requires Warbler, which may or may not drive you crazy.
<adam12> I never had any success with it, but the Andy from the Glimmer project uses it with great success.
<havenwood> adam12: There's wasm2c and Binaryen's wasm-opt but I haven't tried either with Ruby WASI.
<sarna> hmm warbler looks webserver-oriented - I don't have issues shipping backend apps, it's the CLI apps that hurt
<havenwood> I think the latter may not be far enough along.
<havenwood> Ruby WASI may just work with wasm2c?
<adam12> sarna: Warbler is both. .war for server, .jar for CLI..
<adam12> (CLI/GUI)
<sarna> ah!
<adam12> The Python equivalent of TruffleRuby just gained static binaries. I wonder if that will trickle into TruffleRuby too.
<adam12> I think Python had it easier because of the import syntax.
<adam12> havenwood: I only tried a helloworld type app with WASI. I want to try something more, but only so much time in the day.
<havenwood> adam12: TruffleRuby kinda exposes that through SubstrateVM.
<adam12> I'm interested in this a bit as well, since I want to ship some Ruby to a CentOS7 machine with a stock Ruby 2.0.0 install from yum.
<adam12> (and ideally not use Ruby 2.0.0 ... )
<adam12> havenwood: Yeah? I havent seen it, but I just installed the new TruffleRuby. I've been "avoiding it" because of the Oracle licensing crap.
<sarna> havenwood: lol @ wasm2c :D compiling to C just got cool again
BazzaBazaa has joined #ruby
<havenwood> adam12: Substrate can build a static binary of TruffleRuby itself. Theoretically it should be able to compile your app, even up to the point of serving the first socket, but I haven't seen it done.
<havenwood> sarna: Yeah, full circle from emscripten. :O
<adam12> C is probably a great IR, in reality.
<adam12> I know almost everyone uses the LLVM IR but then fights the LLVM version churn.
<sarna> adam12: it kinda is, but once you hit UB your program is invalid 🤠
<adam12> Heh
<havenwood> Zig maybe?
<havenwood> Not OO style but maybe a good primer.
<adam12> I wonder if Zig can compile Ruby.
<adam12> CC="zig cc" style.
<adam12> (and I wonder if that would help interim for Portable Ruby)
caedmon has joined #ruby
shokohsc5 has quit [Ping timeout: 252 seconds]
<leah2> why tho
tweaks has quit [Quit: tweaks]
tweeeaks has joined #ruby
tweeeaks is now known as tweaks
<adam12> leah2: me?
<leah2> the c compiler is not the problem
<adam12> Easier cross-compiling. I think a challenge with Portable Ruby was the multi-platform buidls.
<adam12> CC="zig cc -target some-triplet" ...
donofrio has joined #ruby
BazzaBazaa has quit [Remote host closed the connection]
MalusVulgaris has quit [Ping timeout: 240 seconds]
keypresser86 has joined #ruby
BazzaBazaa has joined #ruby
Hobbyboy has quit [Server closed connection]
Hobbyboy has joined #ruby
Guest68 has joined #ruby
<Guest68> Hi all :-)
Guest68 has quit [Client Quit]
<adam12> Hi.. bye?
friendlypunk has quit [Remote host closed the connection]
caedmon has quit [Ping timeout: 240 seconds]
reset has joined #ruby
BazzaBazaa has quit [Remote host closed the connection]
caedmon has joined #ruby
_ht has joined #ruby
markong has quit [Ping timeout: 252 seconds]
caedmon has quit [Ping timeout: 258 seconds]
markong has joined #ruby
John_Ivan has joined #ruby
John_Ivan has quit [Quit: Disrupting the dragon's slumber one time too often shall eventually bestow upon all an empirical and indiscriminate conflagration that will last for all goddamn eternity.]
teclator has quit [Ping timeout: 260 seconds]
John_Ivan has joined #ruby
lena64t1 has quit [Remote host closed the connection]
caedmon has joined #ruby
<isene> Need a hand if anyone can help. It's an issue with rsh (https://github.com/isene/rsh). Doing this crashes rsh: Start rsh, then enter the command `ls | less` and do Ctrl-c. Why? I've spent a couple of hours trying to debug this, but I'm getting nowhere. And so I'm turning to the pros.
<adam12> isene: can you share a paste somewhere of what the output is?
markong has quit [Ping timeout: 240 seconds]
<isene> adam12: There's no output :-/
<adam12> isene: What do you expect to happen?
<isene> If I do `ls | less` and then Ctrl-c from zsh, it stays in less, but with rsh, it crashes rsh. Worse with `irb` - irb run from zsh and then Ctrl-c does nothing, it stays in irb. But irb run from rsh and then Ctrl-c throws garbage onto the command line and then crashes rsh.
infernix has quit [Server closed connection]
<adam12> isene: trap("ABRT") { # Ignored }
<adam12> Oh, actually, you'll want to trap them and then send to the child process?
<adam12> Just ignoring them does prevent the exit, but not the abortion of the current process inside rsh.
<adam12> and you need to trap `INT` too.
<adam12> I don't think you could continue to use `system` in this case.
TomyWork has quit [Quit: Leaving]
duderonomy has joined #ruby
<adam12> ie. switch `system` to `spawn`. Start process and record pid somewhere. Set up `trap` to send signal to pid of started process (if any).
<isene> adam12: I'm not sure how to go about tackling this. So, first spawn instead of system. Then trap what and how?
<adam12> isene: system doesn't give you running pid. So first step would be to be able to start a process with stdin/stdout/etc redirects in place, and a pid available. I think this is `spawn`.
<adam12> isene: Once you have the pid, store it somewhere (even a global temporarily, I guess).
<adam12> isene: set up a trap for INT that sends a "INT" to the `$running_pid` if there's a value for it. I feel like that alone should work.
<adam12> Maybe it's as simple as replacing `system(` with `$running_pid = spawn(` and then `Process.wait($running_pid)`
infernix has joined #ruby
<isene> I started with this `pid = spawn(@cmd); Process.wait pid`
<isene> But it still crashes/exits rsh upon Ctrl-c inside less
<havenwood> Signal.list.keys.to_h do |signal|
<havenwood> trap(signal) { warn 'Ignoring!' }.then { [signal, {ok: :ignoring}] }
<havenwood> end
<havenwood> rescue ArgumentError, Errno::EINVAL => e
<havenwood> [signal, {error: e}]
<havenwood> I think it's interesting which signals aren't trappable.
<isene> havenwood: So I add this code right after `Process.wait pid`?
<adam12> Getting the signal right is gonna be a challenge I bet.
<adam12> I can get it to exit fine, but `less` is still running in the background for whatever reason.
<adam12> Maybe because of the pipe.
<adam12> So perhaps there's a process group that needs a signal instead.
<johnjaye> how does ruby interpret the expression 1 || 0
<johnjaye> does it do logical or, does it convert to true/false first?
<isene> This is an interesting challenge methinks
<havenwood> isene: Didn't mean to actually use the code above for a solution, more just interesting.
<havenwood> isene: If you try it in IRB you can see a good handful of them won't trap.
<havenwood> johnjaye: Everything is truthy except for nil and false.
<johnjaye> ok. in that case 1 || x will always just return 1 which it does
<havenwood> Only `nil` or `false` to the left of `||` will ever proceed to evaluate what's to the right.
<isene> havenwood: Ah, I see - I got the list in irb
<isene> havenwood: That's some interesting code you landed on my screen
<isene> So, we think the spawn way is the right way? And then trap the right signals? Any example code for that so I can start traversing the signals for testing?
caedmon has quit [Remote host closed the connection]
caedmon has joined #ruby
<havenwood> isene: If I'm following the backlog, you're implementing pipes?
<havenwood> isene: You might consider splitting on pipes before shelling out then connecting the streams, like Jesse Storimer does in A Unix Shell in Ruby.
<havenwood> isene: For a minimalist example, see: https://github.com/jstorimer/shirt/blob/master/shirt
<havenwood> Just an aside, but Shell used to ship with Ruby stdlib and was quite odd. https://gist.github.com/havenwood/742ed2d922622a7bc1f9
<havenwood> It in turn reminded me a bit of Matz other lang, Streem. https://gist.github.com/havenwood/979fbe4b0c07a627c05a
<havenwood> I was glad to see Shell gemified and extracted.
<sarna> do you not like DSLs? :)
<EvanR> you got shirt, you got shoes, all we need now is pants
<adam12> I'm finding I'd rather less DSL where possible.
infinityfye has quit [Quit: Leaving]
<havenwood> What adam12 said.
<havenwood> Or at least fewer cross-language wrappers.
EvanR has quit [Remote host closed the connection]
nmollerup has quit [Remote host closed the connection]
nmollerup has joined #ruby
Liothen_ has quit [Ping timeout: 240 seconds]
supay has quit [Ping timeout: 240 seconds]
Bounga has quit [Read error: Connection reset by peer]
graemefawcett has quit [Read error: Connection reset by peer]
patrick has quit [Read error: Connection reset by peer]
Bounga has joined #ruby
graemefawcett has joined #ruby
patrick has joined #ruby
Argorok has quit [Write error: Connection reset by peer]
Argorok has joined #ruby
Liothen_ has joined #ruby
supay has joined #ruby
infernix has quit [Quit: ZNC - http://znc.sourceforge.net]
matoro has quit [Remote host closed the connection]
EvanR has joined #ruby
cata has quit [Ping timeout: 265 seconds]
matoro has joined #ruby
cata has joined #ruby
_ht has quit [Quit: _ht]
infernix has joined #ruby
caedmon has quit [Quit: caedmon]
<isene> adam12: Not getting anywhere with spawn either, is spawn a dead end as it leaves backgound processes?
<adam12> isene: I think the issue is that you get only the pid from the first process, and not the second one.
<isene> How do I trap specific signal after knowing the pid, though?
<adam12> isene: so you send SIGINT to `ls`, but `less` is still running and somewhat confusing.
<isene> But how about irb, then there's no piping involved. Just a simple `irb` and the Ctrl-c does the same type of crash...
<adam12> isene: I don't get the `irb` example.
<adam12> using `system`?
<isene> Yes, the current rsh; launch `irb` and then do Ctrl-c immediately - I think this should highlight an underlying problem here
lena64t1 has joined #ruby
<adam12> Doesn't work for me, but for possible unrelated reasons.
<adam12> adam@Adams-MacBook-Air.local: ~/tmp/ruby-playground/ irb
<adam12> 16:50:58: irb
<adam12> Users/adam/.gem/ruby/3.2.1/gems/reline-0.3.3/lib/reline/terminfo.rb:108:in `setupterm': The terminfo database could not be found. (Reline::Terminfo::TerminfoError)
otisolsen70 has quit [Read error: Connection reset by peer]
<isene> But no error from rsh itself?
petracvv has joined #ruby
<adam12> gotta run. bbl.
<ox1eef_> Kernel.spawn without a shell is what you should probably use.
<ox1eef_> or, fork & exec.
<isene> Guys - this simple one did it (with system); trap "SIGINT" do end
<ox1eef_> system depends on #!/bin/sh
<ox1eef_> IMO your shell should be independent of other shells
<isene> ox1eef_: I am not going to reimplement everything sh does - and sh is there regardless
Munto has joined #ruby
roshanavand_ has joined #ruby
<ox1eef_> Not guaranteed it will be there, and a shell that depends on another shell doesn't sound right. And, when background jobs come along, system won't cut it.
<isene> ox1eef_: As it stands now, I'm only running rsh (as login shell and otherwise) and it works nicely - end better than my 15+ years tweaked zsh setup with a bunch of antibody plugins. And it's just one file with 720 lines of code. This makes me happy. Back to creating my curses IMDB program that will serve med the movies and series I should like.
<isene> s/end/and/
<ox1eef_> Fair enough. I'm happy with ksh.
Mexica1 has joined #ruby
Mexica1 has quit [Client Quit]
eddof13 has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
markong has joined #ruby
<isene> 🤗
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<isene> Main reasons?
<isene> Main advantages?
<ox1eef_> Over time I configured it to something I like. And it is the default shell on OpenBSD. That's how I was introduced to it.
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
m_antis__ has joined #ruby
m_antis__ has quit [Client Quit]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
goldfish has joined #ruby
caedmon has joined #ruby
roshanavand_ has quit [Ping timeout: 252 seconds]
tomtmym has quit [Quit: Gone.]
caedmon has quit [Ping timeout: 258 seconds]
Linux_Kerio has quit [Ping timeout: 240 seconds]
sagax has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
szkl has joined #ruby
<isene> ox1eef_: Nice
<isene> Notice; rsh (https://github.com/isene/rsh) Version 1.0 release. Several fixes. Celebrating rsh as my sole shell.
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]