0
101
TehPers

@beehaw.org

TehPers 24 points 10 months ago

This is more likely the actual incident report:

A change made to how Cloudflare's Web Application Firewall parses requests caused Cloudflare's network to be unavailable for several minutes this morning. This was not an attack; the change was deployed by our team to help mitigate the industry-wide vulnerability disclosed this week in React Server Components. We will share more information as we have it today.

Edit: If you like reading

path: 0 20858915, hotness: undefined, score: 24, children: 1
TehPers 17 points 10 months ago

That title should be illegal lol.

Congrats to everyone who made this possible!

path: 0 20937923, hotness: undefined, score: 17, children: 1
TehPers 15 points a year ago

Weird cutoff on the title. This is the full sentence:

Announce that Git 3.0 will make Rust a mandatory part of our build infrastructure.

I'm interested to see how this goes. Maybe they could work with the gitoxide devs to see if there's some work that's already been done.

Not really sure myself if Git needs to be RiiR, but that's their call to make I guess.

path: 0 19513033, hotness: undefined, score: 15, children: 4
TehPers 15 points 10 months ago

1500 tests is a lot. That doesn't mean anything if the tests aren't testing the right thing.

My experience was that it generates tests for the sake of generating them. Some are good. Many are useless. Without a good understanding of what it's generating, you have no way of knowing which are good and which are useless.

It ended up being faster for me to just learn the testing libraries and write my own tests. That way I was sure every test served a purpose and tested the right thing.

path: 0 20856547, hotness: undefined, score: 15, children: 4
TehPers 14 points a year ago path: 0 18914192, hotness: undefined, score: 14, children: 0
TehPers 14 points a year ago

Localization is a hard problem, but storing your translations in the DB is a bit unusual unless you're trying to translate user data or something.

I'd recommend looking into tools like Project Fluent or similar that are designed around translating.

As for the schema you have, if you're sticking with it, I would change the language into an IETF language tag or similar instead. The important part is that it separates language variants. For example, US English and British (or international) English have differences, Brazilian Portuguese and Portugal Portuguese have differences, Mexican Spanish and Spain Spanish have differences, etc.

Using an ID instead of the text content itself as part of the PK should be a no-brainer. Languages evolve over time, and translations change. PKs should not. Your choice of PK = (TextContentId, Language) is the most reasonable to me, though I still think that translations should live as assets to your application instead to better integrate with existing localization tools.

One last thing: people tend to believe that translating is enough to localize. It is not. For example, RTL languages often swap the entire UI direction to RTL, not just the text direction. Also, different cultures sometimes use different colors and icons than each other.

path: 0 19391659, hotness: undefined, score: 14, children: 5
TehPers 12 points a year ago

But this case is bigger than JavaScript. It’s about whether trademark law works as written, or whether billion-dollar corporations can ignore the rule that trademarks cannot be generic or abandoned. “JavaScript” is obviously both. If Oracle wins anyway, it undermines the integrity of the whole system.

If the law costs $200k to enforce, then the law already doesn't work as written.

Anyway, good luck Deno! We're all hoping you win this.

path: 0 19471943, hotness: undefined, score: 12, children: 2
TehPers 11 points a year ago

The conclusion of this experiment is objectively wrong when generalized. At work, to my disappointment, we have been trying for years to make this work, and it has been failure after failure (and I wish we'd just stop, but eventually we moved to more useful stuff like building tools adjacent to the problem, which is honestly the only reason I stuck around).

There are a couple reasons why this problem cannot succeed:

  1. The outputs of LLMs are nondeterministic. Most problems require determinism. For example, REST API standards require idempotency from some kinds of requests, and a LLM without a fixed seed and a temperature of 0 will return different responses at least some of the time.
  2. Most real-world problems are not simple input-output machines. When calling, let's say for example, an API to post a message to Lemmy, that endpoint does a lot of work. It needs to store the message in the darabase, federate the message, and verify that the message is safe. It also needs to validate the user's credential before all of this, and it needs to record telemetry for observability purposes. LLMs are not able to do all this. They might, if you're really lucky, be able to generate code that does this, but a single LLM call can't do it by itself.
  3. Some real world problems operate on unbounded input sizes. Context sizes are constrained and as currently designed cannot handle unbounded inputs. See signal processing for an example of this, and for an example of a problem a LLM cannot solve because it cannot receive the input.
  4. LLM outputs cannot be deterministically improved. You can make changes to prompts and so on but the output will not monotonically improve when doing this. Improving one result often means sacrificing another result.
  5. The kinds of models you want to run are not in your control. Using Claude? K Anthropic updated the model and now your outputs all changed and you need to update your prompts again. This fucked us over many times.

The list keeps going on. My suggestion? Just don't. You'll spend less time implementing the thing than trying to get an LLM to do it. You'll save operating expenses. You'll be less of an asshole.

path: 0 20282370, hotness: undefined, score: 11, children: 0
TehPers 11 points a year ago

Browsers have supported the javascript: scheme for a long time, so I guess it just abuses that.

path: 0 19575454 19575824 19576411 19577536, hotness: undefined, score: 11, children: 0
TehPers 11 points 7 months ago

By which I mean maybe the author enjoys different parts of coding than you do.

It seems to me like the part of coding the author enjoys least is coding.

Trying to wrangle AI into writing something decent is generally an exercise in frustration for me.

This is my issue with it. The output of these tools, unchecked, evolves into something abysmal over time. I find it quicker to just rewrite the output than to try to prompt it over and over again to produce something good.

path: 0 22703758 22704203 22704929, hotness: undefined, score: 11, children: 0
TehPers 9 points a year ago

This doesn't represent the mutual exclusivity through the type system (which is what the article is all about).

I love clap and I use it a lot, but the only way to represent the exclusivity through the type system in Rust is through an enum.

path: 0 19244906 19245320 19245783, hotness: undefined, score: 9, children: 1
TehPers 9 points 7 months ago

The high-level directory structure looks reasonable, but every language and build tool has its own recommended structure that people should use instead. For example, by default, cargo looks for a src/main.rs or src/lib.rs as an entrypoint. uv expects one of a couple different project structures before you need to touch the pyproject.toml. C# will create namespaces for each of these nested subdirectories if you don't carefully configure it in your .csproj file. And so on.

It's best to just use whatever's recommended for your environment by your tools. Maybe this directory structure works well for Guile Scheme, but I wouldn't touch it at all if I were writing Rust.

path: 0 22698481, hotness: undefined, score: 9, children: 0
TehPers 9 points 10 months ago

Because if it never returns, then it has no return value.

Then how would you annotate having no return value?

path: 0 20966076 20973851 20976256 20976389 20976755, hotness: undefined, score: 9, children: 2
TehPers 8 points 25 days ago

If you have a repo cloned locally and hosted on the remote, then you have the repo saved to two different places (although possibly without all the refs locally but you likely have your main/dev/etc branch at least).

What I've been wanting to do once I get my NAS working again is host the repos on that instead. You can make a mirror of a repository very easily, so if you want to mirror a GitHub repo onto another service or a NAS or something (or the other way around, NAS -> GH for example), it's really only a couple commands to fully back it up, and you could just put that in a cron job or hook.

path: 0 25914259, hotness: undefined, score: 8, children: 1
TehPers 8 points 7 months ago

I was able to turn the string into a char iterator, but I could not figure out how to change elements of said iterator (this can be seen at line 55).

You have a few options here, but the easiest is to collect into a Vec<char>, replace the character there, then do a String::from_iter(chars) to get it back as a string.

You can also manipulate the original chars iterator directly through takes, skips, and so on and collect it into a string, but that's more complicated.

Also, "character" is such a complicated concept because unicode is not simple. If you can work directly with bytes though, you can convert the string to a Vec<u8> (which is the underlying type for String), manipulate that directly, then do String::from_utf8 (or the same method for str) to convert it back to a string.

path: 0 22681500 22682570 22687948, hotness: undefined, score: 8, children: 2
TehPers 8 points 3 years ago

I think the devs have already been made aware, but warp is also the name of a well known web framework for Rust.

path: 0 733546, hotness: undefined, score: 8, children: 1
TehPers 8 points a year ago

A lot of code doesn't really care where the error came from. This can be useful when using anyhow in application code, for example.

For library code, I don't see myself really using it, so it'll live next to all the other functions I don't use there I guess.

path: 0 18671518 18673225 18673405 18675435 18675716, hotness: undefined, score: 8, children: 0
TehPers 8 points 10 months ago

I am interested to see if these tools can be used to tackle tech debt, as often the argument for not addressing tech debt is a lack of time, or if they would just contribute it to it, even with thorough instructions and guardrails.

From my experience working with people who use them heavily, they introduce new ways of accumulating tech debt. Those projects usually end up having essays of feature spec docs, prompts, state files (all in prose of course), etc. Those files are anywhere from hundreds to thousands of lines long, and there's a lot of them. There's no way anybody is spending hours reading through enough markdown to fill twenty encyclopedia-sized books just to make sure it's all up-to-date. At least, I can promise that I won't be doing it, nor will anyone I know (including those using AI this way).

path: 0 20841346 20856480, hotness: undefined, score: 8, children: 0
TehPers 7 points a year ago

Mentioned this to the other commenter, but this doesn't use the type system to enforce the mutual exclusivity constraint. In Rust, the main way to do that via the type system is through enums.

path: 0 19244906 19245374 19245815, hotness: undefined, score: 7, children: 1
TehPers 7 points 25 days ago

Tailwind class soup is something I see often in LLM-generated code. For some reason, every starter template in existence decided to include Tailwind, and then the coworker generating this code (who doesn't have frontend experience at all) just rolls with whatever the LLM shits out.

I believe there's a proper way to use Tailwind, but I can't be bothered to read the docs for it. It makes far more sense to me to either use plain CSS or, if I'm using a component library, then whatever that library comes with for its theming system.

Also, this whole article basically boils down to "use a proper theming system", which it even admits can be as simple as some CSS classes with standardized names.

path: 0 25920908, hotness: undefined, score: 7, children: 1

thanks for using Leebra!

go to feed...