miry, to Kubernetes
@miry@mastodon.social avatar

Just got the chance to dive into #Kubernetes with #Crystal for deploying a #Ruby web app (for now) to the cloud! 😎

Exploring @jamie repo: https://github.com/jgaskins/kubernetes.

It will be Awesome!!!

#infrastructure

EricMesa, to golang

A few thoughts on Programming languages

Just a few thoughts on programming languages that have been rattling around in my head this week, but which don’t each merit a full blog post. The main theme is that the culture behind each programming language leads to some interesting choices, as is the case with spoken languages.

This week I started learning how to program in Rust. Even though I’m using the project-based Command-Line Rust to learn, the author still went with the traditional “Hello, world!” project for the first intro to the language. I was also working on a Go project last week and so it immediately stood out to me that (at least as taught by this author) Rust has the print! macro that allows you to succinctly print to the command line. By contrast, Go requires importing fmt before you can print. This was the first topic that was swirling around in my head this week. What makes language designers choose whether printing output (one of the most basic things a program can do) is built-in or requires an import. I even remember back when I was learning Java in undergrad (I think it was Java 1.8, but I don’t remember) we had to use the savitch library just to get program input (another very basic computer program concept). As I thought about it, I wondered if it has to do with thoughts around compilation and whether the language designers think you’re mostly making user-interactive programs or libraries? It makes sense to me that scripting languages like Python, Ruby, and Perl would have print built-in since you always have to have the interpreter along with you, so all the basics should be there. (The original Batteries Included Python promise, for example) But perhaps the Go developers thought you wouldn’t always be printing to the command line so a more efficient binary could be compiled by forcing you to import the functionality? I’m not entirely sure.

The next thing I started thinking about, again due to learning Rust, was the mutability of variables. In most languages I’ve come across (I think all, except Haskell) all variables are mutable by default. It almost seems pointless to have a non-mutable variable. I understand why many languages have the concept of a “contanst” modifier/keyword. Unlike normal variables, THIS ONE does not change. But the opposite seems so weird since most of what we often do in programming involves changing the value in a variable. Perhaps as I learn more about Rust, I’ll understand their reasoning, but this seems completely backwards to me.

Both Rust and Golang use structs to organize variables where Ruby, Python, and Java use objects. But when both Go and Rust allow you to “attach” methods/functions to structs – is there a true distinction between object-oriented programming and struct-based programming? It seems like it’s just semantics (in the generic sense of the word) – at least at the level at which I program. The only difference I can see is that structs don’t have inheritance, although Go’s “types” solve some of the same problems.

Today’s (the day I’m writing this, not the day it’s going to be posted) shower thought was about programming language versions. On one end you have Java (I think now on version 22) and C# (now at version 12). On the other you have Python and Ruby (both at version 3). Perl essentially stopped at 5 with Perl 6 evolving into Raku. I don’t know what Java is up to. But I think C# is actually using the versions correctly – I’ve heard that each version introduces completely different ways of doing things and that the way you program C# depends strongly on when you jumped in. This is why Python is probably never moving to v4 unless they need to make some kind of huge change. Rust is an outlier with year-based versions. I guess that’s fine, but doesn’t tell you anything like a proper semantic versioning could.

Finally, I know that Rust is the newest of all the programming languages I’ve learned, but I really love how new projects are started. Python isn’t horrible, but it’s currently suffering from a lots of ideas, none of which has complete market share. You could do a simple virtual environment or you could do a more complex virtual environment/lock file situation with Poetry. (And there are about another half dozen variations on these two themes) But Rust….Rust deserves a chef’s kiss. When you start a new project with “cargo new project-name”, not only does it set up your directory structure, but it does a whole bunch of great setup tasks. It creates your Cargo.toml file (with Python, which only really started supporting toml files at the project level a few years ago, you need to look at documentation to figure out what goes in there) so that you have all the basics in there already. But it doesn’t stop there! It also, in a nod to modern programming, creates a git repository AND a gitignore file. It’s a thing of beauty. I would absolutely love for Python to move in this direction officially (not through a random user choice) for their defaults. Even “go mod init” could benefit from setting up a git repo and a git ignore (since the toml is not how Go works – I think they would probably best set up a README.md since Go’s default packaging is through git repos).

#Go #Golang #perl #python #Ruby #rust

https://wp.me/p5cs3g-4HT

tranxuanthang, to ruby
@tranxuanthang@fosstodon.org avatar

Hey and Mastodon!

I'm Thang and I'm a 26-year-old software engineer from Vietnam.

👍 What I'm good at: ,
📝 What I'm learning: , ,
🔜 What I'm planning to learn in the near future: Qt6 with C++ or Python (to overcome my Electron addiction)

I'm the author of LRCGET (https://github.com/tranxuanthang/lrcget), a small tool that helps finding synchronized lyrics, written in Rust and .

Thank you all for reading!

riffraff, to ruby
@riffraff@mastodon.social avatar

just watched @tenderlove's stream with Maxime on adding an optimization to #YJIT for Array#pack and it's pretty cool, if you have ~1 hour it's a good way to spend it.

https://www.youtube.com/watch?v=YRSA36-LuZw

#ruby

mackuba, to ruby
@mackuba@martianbase.net avatar

Hmm… ok, so this looks promising. The middle is #Ruby Rake task loading records and passing them to #RustLang regexps, the bottom one is a Rust program loading from SQLite itself.

I don't want to duplicate all the feed/model logic in 🦀, but maybe I can hire it to do some more of the work somehow? 🤔

mackuba, to ruby
@mackuba@martianbase.net avatar

Btw, Rust vs. no Rust - rescanning 3 days of posts on the server for the #ATProto feed:

(This is the same #Ruby rake task, but using the native #rustlang module that I've been experimenting with last week to do regexp matching only. Rust version below, obv. 😛)

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

You are used to #PHP and want to #debug in #ruby?
Do this:

puts object.inspect
raise "Stop the program here"

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

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

#mastodon #ruby #MastoDev #opensource

mackuba, to rust
@mackuba@martianbase.net avatar

Ok, looks like we have a winner… 🏆 , run directly from as a native module, using this tool: https://github.com/matsadler/magnus. Should give me a 2-4x total speedup (regex matching is 15x faster, but some of that time is reading data from SQLite & ActiveRecord). JS via mini_racer works ok too.

mackuba,
@mackuba@martianbase.net avatar

The module code is actually super short, just two short functions, less than a page total. I'll try to wrap it into a gem at some point, because it's totally generic and could be used in other projects to speed up regex matching 🦀 The configs to build it took me a while to figure out though since I've never made a native gem before.

(One small caveat though is that it doesn't support regexps with "lookbehind" sections, I had to work around that a bit on the side)

hunleyd, to ruby
@hunleyd@fosstodon.org avatar
cdarwin, to ruby
@cdarwin@c.im avatar

Georgia lawmaker runs secret election-conspiracy Telegram channel

A Fulton county commissioner in Georgia has been
operating a private Telegram channel for years,
propagating debunked claims about the 2020 election,
and spreading accusations of crimes by county employees,
including #Ruby #Freeman, an election worker defamed by Rudy Giuliani in the wake of Donald Trump’s 2020 loss.

#Bridget #Thorne, a Republican representing the relatively conservative cities of Fulton county north of Atlanta,
indirectly identifies herself as the creator and administrator of the Fulton County Elections channel on Telegram,
a mobile messaging platform,
in multiple posts to its page.

The channel uses the official logo of the Fulton county board of registration and elections.

The channel, created in May 2021, had 133 subscribers as of Tuesday night.

In a post from 14 February, the administrator of the page accused
Ruby Freeman,
a former Fulton county elections worker,
of misconduct,
despite a Georgia elections board finding that all of the conspiracy theories about her were “false and unsubstantiated”.
“We clearly see her double scanning ballots,” the channel administrator wrote about Freeman, a regular target of attention on the Telegram page.
“We see her incriminating Facebook posts. Yet, she is made to be a victim and given hero awards.”
https://www.theguardian.com/us-news/2024/apr/18/fulton-county-telegram-election-conspiracy-bridget-thorne?CMP=Share_iOSApp_Other

flavorjones, to ruby
@flavorjones@ruby.social avatar

I really loved this post by Kevin Newton and the Shopify team about the new Ruby parser, Prism:

https://railsatscale.com/2024-04-16-prism-in-2024/

So much Ruby history!

#ruby

watzon, to golang
@watzon@watzonmanor.com avatar

Ok peeps, we're 4 months into 2024 and I've been without work this whole time so we're going to try this again. If you know of any senior software engineering positions that are actually being hired for, please drop them below.

I have 12 cumulative years of experience, so that shouldn't be an issue, and I know most of the languages in use nowadays well enough to be dangerous, but I am extremely proficient in TypeScript, Python, and Ruby. What I'd rather do more than anything though is have an opportunity to use Go professionally.

#fedihred #programmer #softwareengineer #lookingforwork #remotework #golang #typescript #php #ruby #crystal #nodejs #rust

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 #Ruby code with something faster - I was thinking of Crystal or Swift). ChatGPT helped me write some versions :)

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

nithinbekal, to neovim
@nithinbekal@ruby.social avatar

PSA: If you're using Ruby LSP on neovim with nvim-lspconfig, I just renamed the config name from ruby_ls to ruby_lsp, and you might see a warning like this:

ruby_ls is deprecated, use ruby_lsp instead.
This feature will be removed in lspconfig version 0.2.0

The LSP will continue to work, but if your LSP setup doesn't use something like mason, you should be able to replace ruby_ls with ruby_lsp to avoid this warning.

Context: https://github.com/neovim/nvim-lspconfig/pull/3105

juuh42dias, to ruby
@juuh42dias@mastodon.social avatar

#Ruby Job alerts
Get jobs delivered to your inbox.

https://rubycentral.jobboardly.com/

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

MastodonEngineering, to mastodon
@MastodonEngineering@mastodon.social avatar

We are looking for a new member for our core team to work with @Gargron, @renchap and @Claire on building the Mastodon and web app!

This is a position and requires an overlap with the CET timezone.

Ideally:

For more info and to apply:

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

mackuba, to ruby
@mackuba@martianbase.net avatar
budu, to ruby
@budu@ruby.social avatar
83r71n, to Cybersecurity
@83r71n@ioc.exchange avatar

A critical vulnerability, named BatBadBut, was discovered in the Rust programming language, affecting not just Rust but also Erlang, Go, Python, Ruby, and potentially others. This vulnerability, with a severity score of 10/10, could allow attackers to execute arbitrary commands on Windows systems by exploiting how Rust handles batch files. The issue arises from Rust's standard library improperly escaping arguments when invoking batch files on Windows, leading to potential command injection. The vulnerability has been addressed with a fix in Rust version 1.77.2, which developers are urged to update to. Other programming languages and systems, including Node.js, PHP, and Java, are also affected and are working on patches.

https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows/

https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html

#cybersecurity #rust #batbadbut #vulnerability #erlang #go #python #ruby #nodejs #php #java #windows #commandinjection #RyotaK #Grub4K #flattsecurity

MoskitoHero, to ruby
@MoskitoHero@ruby.social avatar

Why not to raise NotImplementedError in

Couldn't agree more. https://nithinbekal.com/posts/abstract-methods-notimplementederror-ruby/

tosbourn, to ruby
@tosbourn@masto.ai avatar

jemalloc is some job!

#Ruby #RubyOnRails

chakie, to ruby
@chakie@toot.community avatar

Meh, I fucking hate messing with Ruby to try to get it to work for Fastlane. The various tools all make no sense. It's gem this and bundle that and it's all a mess. I wish Fastlane used Python which has good ecosystem management.

#ruby #rubbish

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