<Momentum>
this may sound controversial, but i don't feel like ruby is suitable for GUI development
<resica>
It does come with the Tk toolkit.
<resica>
But ncurses is probably better because it won't require X or wayland either way.
<resica>
Or some curses like environment.
<Momentum>
one problem with using a language like ruby is performance and another is packaging
<Momentum>
this applies to python too
<resica>
And perl. Don't forget perl.
<Momentum>
:D
<Momentum>
totally
<resica>
Ruby exists because perl was still in its early years.
<Momentum>
C, C++, Rust and hell even Java
<Momentum>
are better
<resica>
I think, Momentum, if you're making a simple vi clone (and not something like photoshop), performance won't be an issue.
<resica>
Just as an example.
<resica>
And scripting language package managers have gotten way better these days. I never have a problem with pip for python.
<resica>
Don't know how good ruby gems is on windows however, doubt it's that great since like perl, ruby was meant more for unix like systems.
<Momentum>
yeah that's fair, although i disagree a bit on not having problems with pip :)
<Momentum>
like now a standalone pip command won't work without setting up a virtual envirnoment
<resica>
I like that because on msys2 with windows, it pollutes the rest of the database without venv.
<resica>
I get install or update errors if I put pip packages into where the rest of the python packages are.
<Momentum>
yeah i understand the merit for isolating pip installs, but it's just there
smp has quit [Ping timeout: 252 seconds]
<resica>
How often does a ruby gem require a C or C++ compiler? If so, it's like perl where it's a pain in the arse to use gems or cpan without cygwin or msys2.
<resica>
If you're not familiar with msys2, it's the recommended way to install ruby on windows. It's a fork of the original MinGW (Minimalist GNU For Windows) with a huge load of compilers or libraries available.
smp has joined #ruby
<resica>
Unlike cygwin, msys2 does not come with an X emulation environment. So anything X mandatory will not work with msys2 like say xeyes.
<Momentum>
I don't know, probably depends on what kind of gems you need
<Momentum>
if i'd have to guess probably the majority of gems don't
<resica>
I guess stuff like anything GNOME/GTK related, absolutely.
<resica>
Which is going to be HUGE.
<Momentum>
I don't GTK binding gems for ruby would require a C compiler, just the relevant shared libraries should be present in the system
<Momentum>
s/I don't/I don't think
<resica>
Well, I'm not on my windows machine right now, so I cannot confirm this, but I'll take your word for it. :)
<Momentum>
uhh actually i'm not sure
resica has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
Pixi` has joined #ruby
factor3 has joined #ruby
desnudopenguino1 has joined #ruby
donofrio__ has joined #ruby
desnudopenguino has quit [Ping timeout: 264 seconds]
desnudopenguino1 is now known as desnudopenguino
Pixi has quit [Ping timeout: 256 seconds]
factor has quit [Ping timeout: 268 seconds]
factor3 is now known as factor
donofrio_ has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire1 has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
donofrio_ has joined #ruby
wbooze has quit [Remote host closed the connection]
wbooze has joined #ruby
donofrio__ has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
wisegopher has joined #ruby
wisegopher has quit [Changing host]
wisegopher has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
Trivial has joined #ruby
factor has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jardsonto has joined #ruby
wbooze has quit [Quit: Konversation terminated!]
Inline has joined #ruby
wbooze has joined #ruby
wisegopher has quit [Ping timeout: 268 seconds]
wbooze has quit [Remote host closed the connection]
wbooze has joined #ruby
wbooze has quit [Remote host closed the connection]
wbooze has joined #ruby
wbooze has quit [Remote host closed the connection]
<havenwood>
sphex: Delegator is a BasicObject. You can reproduce this with `class Sphex < BasicObject def self.sphex = defined?(Array) end` but the issue is BasicObject.
<havenwood>
Your Delegator usage seems odd. Did you mean to make a SimpleDelegator or just discovered this and are showing a minimal reproduction case?
<havenwood>
It's not too often you see Delegator used directly. I'm accustomed to seeing SimpleDelegator or DelegateClass.
<havenwood>
You then would wrap a thing, rather than using your delegator directly.
Inline has quit [Remote host closed the connection]
Inline has joined #ruby
wbooze has quit [Remote host closed the connection]
wbooze has joined #ruby
Trivial has quit [Quit: WeeChat 4.2.2]
Trivial has joined #ruby
Trivial has quit [Client Quit]
Trivial has joined #ruby
user71 has quit [Quit: Leaving]
<sphex>
havenwood: ohhh interesting. yeah that was just a minimal way to reproduce. but why does this happen with BasicObject though?
Trivial has quit [Quit: WeeChat 4.2.2]
Triviality has joined #ruby
<mooff>
>> [defined? BasicObject::Object, defined? Object::Array, class Bar < BasicObject; [defined? Array, defined? ::Array]; end]
<ruby[bot]>
mooff: I'm terribly sorry, I could not evaluate your code because of an error: JSON::ParserError:A JSON text must at least contain two octets!
ruby-eval has joined #ruby
<mooff>
== [defined? BasicObject::Object, defined? Object::Array, class Bar < BasicObject; [defined? Array, defined? ::Array]; end]
<sphex>
well, it's different in a Delegator though. "class Test < Delegator; def self.test = Array.new; end; p Test.test". There "Array.new" works but "defined?(Array)" doesn't.
<mooff>
huh, weird
<sphex>
anyway not a huge deal, I can make my thing work now, but that's still a bit confusing... so thanks guys.
<sphex>
mooff: alright I'm going to check this out
<mooff>
== require 'delegator'; class Delegator; [Array, defined? Array]; end
<ruby-eval>
ERROR: cannot load such file -- delegator
<mooff>
== require 'delegate'; class Delegator; [Array, defined? Array]; end
<ruby-eval>
=> [Array, nil]
<mooff>
that's very weird o_O
<mooff>
they must override const_missing or const_defined? on the Delegator class itself
<sphex>
mooff: oh yeah. I just checked. it does that.
<mooff>
though i don't think defined? actually uses const_defined?. must be const_missing ?
<sphex>
So that works for regular constant references, but not "defined?"...
<mooff>
makes sense
<mooff>
good luck with it.. mind sharing your use case?
<sphex>
mooff: it only redefines const_missing. I wonder if redefining const_missing? would make defined? work...
ruby[bot] has quit [Remote host closed the connection]
<sphex>
mooff: nothing special really. I just have a Delegator class and I tried using "defined?" in it and it wasn't working right. While other constant references seemingly worked.
ruby[bot] has joined #ruby
<mooff>
sphex: const_missing? is instead const_defined? :-) but defined? is a syntactic statement rather than a method call.. it doesn't seem to call const_missing?, so we can't override it
<mooff>
sphex: use case for the Delegator i mean :-)
<sphex>
mooff: a class to temporarily capture $stdout/$stderr in a thread-local way. it delegates to either a StringIO or whatever the real IO object was before that.
<mooff>
nice. shame there are no thread-local global variables!
<sphex>
yeah I wish there was a simpler/more elegant way to do that. not sure what that would be like though. with Fiber[] the semantics seem good though. it gets inherited between both threads and fibers. works well in ractors too apparently.
<sphex>
mooff: what could it miss? I'm OK with it working just for the same process (and not across exec()s), I want the capture to be fast and not do syscalls.
<mooff>
i've got a vague memory only, but i think some of the stdlib, probably C parts, won't actually send messages to the $stdout / $stderr objects
<mooff>
and/or some use STDOUT instead of $stdout
<sphex>
ok. well, will see if I spot any of them. I did see some code doing #reopen on $stdout to capture it. that didn't work with my thing either.
<mooff>
might be able to #reopen to a pipe, siphoned into your StringIO from a fiber/thread
<mooff>
oh, how would the pipe thread know what thread wrote to it in the first place
ua_ has quit [Ping timeout: 255 seconds]
ua_ has joined #ruby
<sphex>
eh maybe I'll try to improve it later. I would want it to work across forks/execs eventually I think. if possible. maybe it could switch to a "pipe mode" only when it needs to. so that it stays fast in simple cases. don't really need it right now though.
donofrio_ has quit [Remote host closed the connection]