freemo, to ruby
@freemo@qoto.org avatar

Ya know the more I reflect on the languages I know the more I realize that outside of functional languages none of them really handle immutability well.

Consider that you want most of your objects to be immutable most of the time. Thats all well and good till you realize you want to be able to edit the objects in such a way that it creates duplicates that have some data changed but are likewise immutable.

This tends to stop working, almost entierly, once you get into subclassing. If you parent class has a method that returns a copy of itself with some data modified, this will break in children classes, since you want children classes to return instances of itself, not its parent.

Its not that you cant fix that, but the code gets very ugly very quickly. Generally you are forced to let the code handling the classes do the copying and editing itself, but that is pretty ugly too.

I have had this pattern problem in almost every OO language i messed with, Java, Ruby, Python, etc.

#Ruby #Python #Java #Programming #CS

shaedrich, to programming
@shaedrich@mastodon.online avatar

I've been for 14 years now, have been using , , , , and whatnot, but holy cow, when reading the following chapter, I've literally been yelling "what the heck" at every second paragraph:

https://tutorial.ponylang.io/types/traits-and-interfaces

I mean, really tries to explain everything in depth, and I appreciate the effort, but while it works fine in earlier chapters, it confuses the heck out of me in this at length.

purinkle, to rails
@purinkle@ruby.social avatar

Late into the night before , some of us discussed DHH and his leadership of . @ufuk did a fantastic job moderating the conversation and highlighted that the Rails team is more than one person.

At the conference, there was plenty of food for thought. Something from ‪@nickschwaderer‬’s talk stuck with me. It was the idea of “no dunking”.

I will now raise the likes of ‪@eileencodes‬ instead of putting others done.

masukomi, to ruby
@masukomi@connectified.com avatar

geeks do any of you know of a built in Ruby or Rails mechanism that will convert "foo/bar/baz.txt" to ["foo", "bar" , "baz.txt"]

Basically i'm looking for the opposite of Rails.root.join("foo", "bar", "baz.txt")

something that'll work in an OS agnostic way to give me the path as an array of elements.

And yes, i know i can just path.split("/") It just feels weird that we seem to have an OS agnostic way to MAKE paths from elements but not UNmake them.

mackuba, to twitter
@mackuba@martianbase.net avatar

I made another open source thing: BadPigeon 🐦 - a tool that lets you export tweets from without access to the API, by parsing JSON responses exported from a browser. Intended to be a drop-in replacement for Tweet class from the twitter gem: https://github.com/mackuba/bad_pigeon

Stark9837, (edited ) to Youtube
@Stark9837@techhub.social avatar

"Why We Left The Cloud"

Recently watched this video by on , and his hot-take 🔥 was that they were using , and half of their pain was caused by this.

I have no experience with Ruby at all and most probably won't even recognize it if I were to read it.

If Ruby is such a bottleneck and inefficient, why did :mastodon: use Ruby for its implementation?

I know Ruby is often praised for servers and backends, especially APIs, but we have many solutions for this in :python: , which I wouldn't recommend, but :golang: and .

Does anyone have opinions or sources for this statement?

Video: https://youtube.com/watch?v=6h4oiPwtwDk&feature=share

Original article:https://world.hey.com/dhh/why-we-re-leaving-the-cloud-654b47e0

inherentlee, to accessibility

Hey, I would really like to make an attempt on fixing so that it prefers terms for improved

I've done some basic reading on the current behavior and browsed the codebase a bit, but I'm a backend dev with minimal experience with or so I got a bit lost.

If you have relevant experience, would you like to spend some time over a video call or similar hacking on this?

Thanks in advance 💗

dansup, to ruby
@dansup@mastodon.social avatar

Imagine getting paid to work on @Mastodon full time!

They are looking for devs!

Apply: https://jobs.ashbyhq.com/mastodon/de1e4d8a-5639-4b6a-86d7-97bd9c768b02

masukomi, to random
@masukomi@connectified.com avatar

Geeks um... We got problems! rubygems.org is now considered a dangerous site.

Anyone got some contacts at ? Firefox claims the warning is coming from Google Safe Browsing. https://developers.google.com/safe-browsing/v4/advisory

This happens in Firefox AND Chrome.

vwbusguy, to ruby
@vwbusguy@mastodon.online avatar

These are the two lines of code (minus some constants and file operations) that saved me a while lot of tediousness, today...

It ended up being a bit more involved than my post earlier, but was able to script it to automate the patching and PRs. It looks terrible, but I'm pretty happy with the end result.

masukomi, to ruby
@masukomi@connectified.com avatar

Another day, another native gem that won't compile. I understand that there are some cases where you need to deal with external stuff via C, BUT so often native gems seem to be created because their devs felt that doing it in pure ruby provide performance that was too slow.

Ruby isn't a "high performance" language. If you want fast use C(++) or Rust or Go or any of the many "fast" options. Alternately, use your C skills to improve Ruby.

Stop injecting C into Ruby

masukomi, to random
@masukomi@connectified.com avatar

A on mystery in 3 images. Solution in 🧵

controller has 2 actions, which i've called first_action and second_action just to distinguish them.

Rails will ALWAYS send you to first_action even when the route, and the action_name are second_action.

images: controller, debugger at breakpoint, routes

I stared at this for SO long before i figured it out while rubber-ducking it.

a screenshot of the debugger stopped at a breakpoint.
a screenshot of the routes.

mackuba, to ruby
@mackuba@martianbase.net avatar

Current status: I opened about 100 links to articles and threads from Google results comparing #ruby, #golang and #rustlang and I'm planning to read them 🫠

(no, I'm not really considering Go, mostly just trying to convince myself that I'm not making a mistake starting to learn Rust and not Go 🦀😛)

kedare, to dotnet
@kedare@g33ks.coffee avatar

Is there anyone using other languages than C# and F# on .NET ?
I remember back then there was the #boo language but looks like it's not much used now.
Other alternative languages like #ironpython and #ironruby are either lagging a lot on supported version or abandoned apparently.

#dotnet #csharp #fsharp #python #ruby

dekkzz76, (edited ) to random
@dekkzz76@emacs.ch avatar
hl, to haskell
@hl@social.lol avatar

but programming language names:
Ghost in the
Is For Heros
In The Name Of The
Schindler's
Star Wars: The Awakens
Manchester By the #C
The Truman
Bringing Up
Anyone get any other good ideas?

profoundlynerdy, to python
@profoundlynerdy@bitbang.social avatar

With #Python stealing everyone else's thunder, what makes a project a good fit for a scripting language OTHER than Python?

#Perl #Raku #Lua #Ruby #PHP #powershell #bash #programming

Sinjo, to random

Spent a little time today playing with distroless images and supply-chain security, and man, this stuff has a long way to go.

It's not that practical to use for languages that don't spit out a statically linked binary 😅

Called it quits after half a day trying to get a Ruby app working in that environment.

ivan18rod, to fediverse

Hello, ! We have a on the scene! Let me introduce you all to @JokeBot!

I created an account on botsin.space to showcase a framework I made, also called JokeBot, for posting on the fediverse; I originally posted jokes on my current account, but it was posting a bit too "loudly." Hence, that's why @JokeBot is here.

@JokeBot is currently fully operational; I already boosted its first post, and I will continue to boost its posts for my existing followers to see them.

Let's give @JokeBot a round of , shall we?

👏👏👏👏👏👏👏👏👏👏👏

masukomi, to rust
@masukomi@connectified.com avatar

geeks who use & I can't get rs-sys to compile. This is affecting my job and I could really use help. Ticket here: https://github.com/oxidize-rb/rb-sys/issues/207

even if the help is just "works for me" or "broke for me" I'd love to hear it.

henrik, to ruby
@henrik@ruby.social avatar
stefan, to mastodon
@stefan@stefanbohacek.online avatar

Mastodon fetching all replies to a post you're viewing would hugely improve user experience on small and one-person instances. If you know a bit about Ruby and/or Mastodon, please spend a moment reviewing this work in progress:

https://github.com/NeuromatchAcademy/mastodon/pull/44

via https://neuromatch.social/@jonny/112307981094627966

Schrank, to php German
@Schrank@phpc.social avatar

You are used to and want to in ?
Do this:

puts object.inspect
raise "Stop the program here"

https://winkelwagen.de/2024/04/23/ruby-as-a-php-developer/

thisismissem, to ruby
@thisismissem@hachyderm.io avatar

Huh, the docs for OpenSSL::HMAC.hexdigest doesn't specify what the format of the key parameter is, appears to just be a string, but doesn't explain how it's used?

https://docs.ruby-lang.org/en/3.2/OpenSSL/HMAC.html

Contrast this with the Node.js documentation on the same thing: crypto.createHmac: https://nodejs.org/docs/latest-v20.x/api/crypto.html#cryptocreatehmacalgorithm-key-options

This even makes a note about “using strings as inputs to cryptographic APIs”: https://nodejs.org/docs/latest-v20.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis

mackuba, to ruby
@mackuba@martianbase.net avatar

I've been playing with benchmarking some regexp matching code in several languages last week (I want to replace that part of code with something faster - I was thinking of Crystal or Swift). ChatGPT helped me write some versions :)

The results were… unexpected. & Crystal didn't do well, but JS & PHP did 🤔

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • Durango
  • thenastyranch
  • ngwrru68w68
  • InstantRegret
  • DreamBathrooms
  • modclub
  • magazineikmin
  • Youngstown
  • everett
  • ethstaker
  • slotface
  • rosin
  • anitta
  • kavyap
  • osvaldo12
  • GTA5RPClips
  • cisconetworking
  • provamag3
  • khanakhh
  • tacticalgear
  • cubers
  • Leos
  • normalnudes
  • megavids
  • tester
  • lostlight
  • All magazines