Readit News logoReadit News
mbell commented on Why Ruby on Rails still matters   contraption.co/rails-vers... · Posted by u/philip1209
mbell · a year ago
> Rails has started to show its age amid with the current wave of AI-powered applications. It struggles with LLM text streaming, parallel processing in Ruby

Not at all my experience, actually it was incredibly easy to get this working smoothly with hotwire and no javascript at all (outside the hotwire lib).

We have a Rails app with thousands of users streaming agentic chat interfaces, we've had no issues at all with this aspect of things.

mbell commented on Can SpaceX land a rocket with 1/2 cm accuracy?   theshamblog.com/can-space... · Posted by u/scottshambaugh
mbell · a year ago
Armchair aerospaceing here, but it feels like he's a whole class of positioning sensors in this analysis. It seems to be you only need GPS and related absolute positioning systems to get you close to the tower. At that point, what you care about is the relative positioning of the tower and the booster. I would think this can be done very accurately with a host of options: cameras, radar, lasers, ILS style systems, etc, etc.
mbell commented on What's New in SQLAlchemy 2.1?   docs.sqlalchemy.org/en/21... · Posted by u/hackandthink
sickblastoise · 2 years ago
Sqlalchemy stands out as a library having probably one of the most complete and pragmatic APIs for database access across all languages.

It is no small feat to create compatibility for modern Python features like type hints and async in a library that has its roots in Python 2, it has absolutely exceeded expectations in that regard.

mbell · 2 years ago
> Sqlalchemy stands out as a library having probably one of the most complete and pragmatic APIs for database access across all languages.

I can't disagree more. Identity map based ORMs are _awful_ to use, in almost every way.

mbell commented on Speedup of deletes on PostgreSQL   ivdl.co.za/2024/05/29/ach... · Posted by u/Ianvdl
arp242 · 2 years ago
You're not wrong, but unfortunately many teams don't.

Probably my favourite "ya'll don't understand how databases work" was where they "reserved" space for MySQL enums; for example for the "active" column it would be something like:

  enum(
      'active',
      'deleted',
      '_futureval1',
      '_futureval2',
      '_futureval3',
      '_futureval4',
      '_futureval5',
      '_futureval6',
      '_futureval7',
      '_futureval8',
      '_futureval9'
  )
Enums don't work like that at all; it's just a mapping of int to a string value for readability, and you don't need to "reserve" space to add future values just like you don't need to for ints. Adding a new enum value is easy and cheap. Removing them is not as it requires a full scan of all rows to verify they're used. Even worse, you couldn't easily rename enum labels (at the time, don't know if you can now), making it all worse than useless.

Since this was all on large tables and the effort to fix it was relatively large, but without adding much business value, we never fixed it. We were basically stuck with it. It sure as hell annoyed me every time I looked at it.

I'm not an DBA either, but spending about 5 seconds on the documentation for "enum" would have prevented this. This really doesn't require a PhD in SQL.

mbell · 2 years ago
I'm not sure what the current state of things are since I haven't use MySQL recently but this used to be a perfectly valid thing to do.

The issue was that MySQL doesn't use a full int to store enums. If your enum has 8 values, it stores in 1 byte, if it has more than 8, it stores it in 2 bytes. Adding that 9th value thus requires re-writing the entire table. So yes - it can make sense to "reserve space" to avoid a future table re-write.

You also had to be careful to include `ALGORITHM=INPLACE, LOCK=NONE;` in your `ALTER TABLE` statement when changing the enum or it would lock the table and rewrite it.

mbell commented on I don't care about memory safety (2023)   linkedin.com/pulse/i-dont... · Posted by u/kaba0
mbell · 2 years ago
"If addition doesn't work, I have no way of reasoning about anything in a program."

Hardware addition is filled with edge cases that cause it to not work as expected; I don't see it as that much different from the memory safety edge cases in most programming models. So by corollary is there no way to reason about any program that uses hardware addition?

mbell commented on InfluxDB 3.0 System Architecture   influxdata.com/blog/influ... · Posted by u/ren_engineer
mbell · 3 years ago
We used InfluxDB back in the 0.8/0.9 days and it worked really well, scaled nicely with the large number of metrics we were storing.

The switch to a tag based architecture in 1.0 completely broke the database for our use case, it could no longer handle large metric cardinality. Things improved a bit around 1.2, but never got back to something usable for us.

We ultimately moved to using clickhouse for time series data and haven't had to think about it since.

Where is influx at now? Can they handle millions of metrics again? What would bring us back?

mbell commented on OpenAPI v4 (aka Moonwalk) Proposal   github.com/OAI/moonwalk... · Posted by u/mooreds
mbell · 3 years ago
I've tried using OpenAPI a few times, it's been...lackluster... I probably won't use it again.

Here are my gripes:

1) For me one of the biggest selling points is client code gen (https://github.com/OpenAPITools/openapi-generator). Basically it sucks, or at least it sucks in enough languages to spoil it. The value prop here is define the API once, code gen the client for Ruby, Python and Scala (or insert your languages here). Often there are a half dozen clients for each language, often they are simply broken (the generated code just straight up doesn't compile). Of the ones that do work, you get random PRs accepted that impose a completely different ideological approach to how the client works. It really seems like any PR is accepted with no overarching guidance.

2) JSONSchema is too limited. We use it for a lot of things, but it just makes some things incredibly hard. This is compounded by the seemingly limitless number of version or drafts of the spec. If your goal is interop, which it probably is if you are using JSON, you have to go our and research what the lower common denominator draft spec JSONSchema support is for the various languages you want to use and limit yourself to that (probably draft 4, or draft 7).

On the pros side:

It does make pretty docs - kinda wish it would just focus on this and in the process not be as strict, I think it would be a better project.

mbell commented on A few words on Ruby's type annotations state   zverok.space/blog/2023-05... · Posted by u/todsacerdoti
mbell · 3 years ago
The biggest issue with current attempts at typing in Ruby is the choice of a nominal type system. If there ever was a language that called for structural typing, it's Ruby.
mbell commented on Twenty five thousand dollars of funny money   rachelbythebay.com/w/2022... · Posted by u/zdw
jacobn · 3 years ago
Had exactly that bug in production, was using ruby on rails & active merchant, and some version change in ActiveMerchant switched from cents to dollars for one of the integrations.

Our test harness didn't catch it (weird combination of reasons, too long ago for me to remember the details) & it rolled out.

Shortly thereafter I get an anxious customer call that we'd charged their debit card $2500.00 instead of $25.00 and they'd gotten an overdraft notice. At first I was incredulous ("how is that even possible!?"), then I remembered that we'd just version bumped ActiveMerchant.

My endocrine response as I realized what must have happened was amazing to experience - the sinking feeling in my gut, hairs standing up, sweaty palms, dread, pupils dilating, and my internal video camera pulling back poltergeist-style in a brief out-of-body experience.

Fun times. Live and learn.

mbell · 3 years ago
> Our test harness didn't catch it (weird combination of reasons, too long ago for me to remember the details) & it rolled out.

This is why I'm pretty dogmatic about variable comparison in tests.

This is dangerous and stuff like this has caused a lot bugs to slide though in my experience (and maybe ops):

    expect(account1.balance).to eq account2.balance
This is safe and specifc:

    expect(account1.balance).to eq 2500
    expect(account2.balance).to eq 2500
Unfortunately I've run into a lot of folks that take major issue with the later because of 'magic numbers' or some similar argument. In tests I want the values being checked to be be as specific as possible.

mbell commented on Tesla Semi’s Enormous Battery Might Weigh 11,000 Pounds on Its Own   thedrive.com/news/tesla-s... · Posted by u/ourmandave
verdenti · 3 years ago
Thanks for that math. Seems relatively cheap. How does it compare to gasoline?
mbell · 3 years ago
(500mi / 6.5mpg) * $5.313 = $408.69

6.5mpg - I just Googled average MPG for a fully loaded Semi, could be wrong.

$5.313 - Most recent highway diesel price (https://www.eia.gov/petroleum/gasdiesel/). I'd expect this is high due to fleet discounts and such.

u/mbell

KarmaCake day5270April 15, 2011View Original