Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
pistolero :thispersondoesnotexist: (p@freespeechextremist.com)'s status on Sunday, 24-Dec-2023 20:57:56 JSTpistolero :thispersondoesnotexist: @hazlin
> I've been enjoying the book.
_why is really fun. Left when he got doxed. Like, DFE-and-nuke left. He explained some in the book he released "posthumously".
> I noticed some of the things, that require leg work to do in JavaScript, are the default in Ruby.
This is one of the things I like a lot about it: I don't want to rewrite some things that are primitive operations in Lisp or Perl or even awk, C, whatever. That also makes it very convenient for interactive use, like I'm looking at a new dataset or a new Postgres DB or something like that, I don't have to bash out a lot of basic stuff to do basic analysis or data exploration.
> Why does python even exist? (though after talking with a friend, the answer seems to be, people prefer a simpler smaller syntax)
Neither was very popular at the time they were created, so they probably weren't aware of each other, ha. Ruby is slightly older but I think it's by months. The languages appeal to different sensibilities, though, and that has made different communities spring up around them, which means different libraries and whatnot, and so some stuff is lower-friction in one language versus the other. Python's not likely
> My primary interest in coding these days, is either a micro controller, or to make something with graphical user interaction.
Ah, you might be interested in mruby, designed to be an embeddable subset of the language. Lua-but-it's-Ruby; I believe it runs on some microcontrollers.
To be honest, if I am doing a GUI with Ruby, I usually just open up a pipe to wish (though I have played with the SDL library a lot). I don't think I have attempted to use ruby2d before.
> So, I am guessing there will be some kind of "make Window current context" command to be covered.
I had a look at https://www.ruby2d.com/learn/get-started/ and it's actually pretty cool, looks like fun. Their sample code runs for me. I don't know where you got your sample code from, but it looks like they create the basic window and then merge that with the top-level object, and it looks like `Window` gives you (per https://www.ruby2d.com/learn/window/ ) a reference to the Window singleton.
You can actually tell it's added things to the toplevel by doing this in irb:
irb(main):001:0> require 'ruby2d'
=> true
irb(main):002:0> method(:show)
=> #<Method: Object(Ruby2D::DSL)#show() /usr/lib/ruby/gems/3.0/gems/ruby2d-0.12.1/lib/ruby2d/dsl.rb:44>
Or just sticking `puts method(:show).inspect` in your code right after the require.
> I am enjoying Ruby,
Very cool! I think it's a really fun language.