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]
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 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>
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.
<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]
<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…]