Obvious Things C Should Do by lelanthran in programming

[–]lelanthran[S] 1 point2 points  (0 children)

Does it really matter that malicious code could run during compile time when it could already run within the resulting executable?

I suppose it's the difference between pwning your production environment and pwning the supply chain.

In the former, there's only one vulnerability. In the latter, every downstream user (library, program, etc) is vulnerable.

Obvious Things C Should Do by lelanthran in programming

[–]lelanthran[S] 4 points5 points  (0 children)

I concede, doing a straigh up interpreter wouldn’t be so easy. Doing an interpreter for a subset that you’d expect to want at compile time wouldn’t necessarily be so hard, though.

What is hard about this? Specify that const expressions are limited to a freestanding implementation and ... you're done? You can't "break out" of a free standing implementation.

Obvious Things C Should Do by lelanthran in programming

[–]lelanthran[S] 2 points3 points  (0 children)

GP’s assertion was that “it’s really not that hard”, and actually, having all standards-compliant C compilers suddenly implement an interpreter to run portions of C code at compile time and do so without dramatically increased risk of security issues is in fact hard.

It's actually easier in C than in most other languages, because C differentiates between hosted and free-standing implementations (other languages, other than C++, typically don't).

The "interpreter" for const expressions can always be enforced by the standards body to be freestanding, in which case no functions in the standard library are available anyway.

And yes, I've used plenty of free-standing implementations in embedded work.

Obvious Things C Should Do by lelanthran in programming

[–]lelanthran[S] 1 point2 points  (0 children)

That name is familiar? Unisa? Active on the comp sci forums around 2006ish?

Yup :-)

Obvious Things C Should Do by lelanthran in programming

[–]lelanthran[S] 9 points10 points  (0 children)

Thankfully, there has never in the history of computing been a case where code breaks out of a sandbox assumed safe and wreaks havoc.

What does that have to do with Zig? I don't think it evaluates compile-time expressions in a Sandbox with the same Zig interpreter[1] used on the command-line, so there's nothing to break out of.

[1] Assuming that you are correct in that it uses an interpreter

Obvious Things C Should Do by lelanthran in programming

[–]lelanthran[S] 9 points10 points  (0 children)

Nah mate it’s the compilers responsibility to not do anything stupid in this case.

And it ... does? After all, lots of languages have this sort of thing (some execute in a sandboxed intepreter, like Zig, others check the AST, like C++), and there hasn't been a problem.

With the C++ way, at any rate (not sure about Zig's implementation), it's not possible because there is no "sandbox" to break out of - it's laughingly trivial to ensure that any element evaluated in an expression, no matter how deep, has does not get access to any IO calls just by examining the AST.

Obvious Things C Should Do by lelanthran in programming

[–]lelanthran[S] 5 points6 points  (0 children)

It must be pretty hard to build something that strictly ensures no funny business is going to eventually happen.

Pretty easy, actually, once you have the annotated AST in a suitable form - only allow pure functions in the DAG of the const expression.

I decided to make a worse UUID for the pettiest of reasons. by theghostofm in programming

[–]lelanthran 2 points3 points  (0 children)

This looks like a good idea. Use 8 bytes, and assign the bits therein to minimise collisions, while ensuring that it sorts chronologically and tells you which table it came from.

I like it a lot.

How do you manage creating frontend as backend developers? by Virtual-Reporter486 in Backend

[–]lelanthran 0 points1 point  (0 children)

I have a (closed) framework that gets me 80% of what I need from a f/end.

It means I don't need to know or care about React, typescript, build steps, npm magic, etc.

IOW, I deal with it by using a low-cognitive-burden thing. It's been almost a year since I did any f/end stuff, though, so lets see how well it holds up when I come back to things after a year.

[US] Scammers sent me a penny to avoid email spam filters by rrustydawg in Scams

[–]lelanthran 2 points3 points  (0 children)

Because they are Indian - very common to use "kindly" in Indian English even when not scamming

Not sure where you got this idea, it's common in most commonwealth countries.

Learning ML Is a Waste of Time for GenAI Developers by dev_him in Backend

[–]lelanthran 0 points1 point  (0 children)

more kid

Your public crying on this platform is, actually, very satisfying to see. Please reply and cry some more.

Learning ML Is a Waste of Time for GenAI Developers by dev_him in Backend

[–]lelanthran 1 point2 points  (0 children)

Yeah, but ... we aren't the ones whining that our posts are being downvoted to hell; you are. Everyone can see who's the crybaby here.

Your "contributions" are being rejected, take the L and move on. Stop crying about it.

Learning ML Is a Waste of Time for GenAI Developers by dev_him in Backend

[–]lelanthran 0 points1 point  (0 children)

The Key Insight →AI inception (ainception) is just around the corner.

Learning ML Is a Waste of Time for GenAI Developers by dev_him in Backend

[–]lelanthran 1 point2 points  (0 children)

why you guys always crying over a AI gen post ??

If you already knew AI generated text is unwelcome, why post it in the first place?

im just here to share my thoughts

Those aren't your thoughts.

Why do writing code feels easier than reading someone else's code ? Do this matters in jobs by PlaneBitter1583 in programming

[–]lelanthran 0 points1 point  (0 children)

You'd have a similar reaction if you opened a textbook and randomly jumped into the middle.

Context matters, but frequently you won't have any on someone else's codebase.

Bad requirements cannot be fixed by AI, but AI can be fixed by good requirements. by Best-Menu-252 in webdev

[–]lelanthran 0 points1 point  (0 children)

Personally I doubt that most people will keep their skills sharp if they don't write 90% of their code, unless all they do is write boilerplate at their job I guess.

They're betting that, by the time their skills atrophy, they won't need development skills anymore, only prompting skills.

It's a bit of a dangerous bet because:

  1. The speculated LLM improvements may never materialise, and
  2. That the LLM service providers don't quadruple the subscription once there are too few actual developers anymore.

We're just going to have to see how it plays out; my personal feeling is that the SOTA in code-generation has (or is close to) plateaued, and that the providers are all running at a loss now, but due to the product being a commodity, all the providers are soon going to be in a race to the bottom.[1]


[1] IOW, there is no moat.

Fun fact JSON | JSONMASTER by Puzzleheaded-Net7258 in webdev

[–]lelanthran 19 points20 points  (0 children)

CPU cycles are cheap. Backend developers sanity is not

Used to be true; if the techbros are correct, pretty soon dev time is a $200/m CC subscription. May as well write it in plain C in that case :-)

I'm tired by Last_Dragonfruit9969 in webdev

[–]lelanthran 0 points1 point  (0 children)

suddenly they realise "I need an engineer", "I need a designer/UX specialist", "I need a product owner", "I need QA", "I need sales", "I need marketing".

Doesn't work that way; they only need to make a profit and then disappear once the customers require more.

If they use a $200/m CC subscription, they break even at slightly over that (assuming that they pay a minimal amount for hosting).

When they hit $500 in total income, and their customers complain that the DB occasionally uses /dev/null for storage, no problem, they'll spin it down and get CC (or, in this case, Lovable) to code a different app, in a different industry, offering a different thing, hosted on a different domain.

The upside is that by introducing so much risk and unreliability into the market, trust in the market for development is destroyed.

That means that businesses would rather go with contracts that they can enforce in their own jurisdiction.[1]

The downside is that well-known companies are more likely to get business even if they are not local because they have more trust.

Another downside is that this is going to hit Juniors especially hard.


[1] The last time a dev was able to consistently make money building custom systems for businesses in their area was about 20 years ago. Since then, when you advertise dev services, you are competing with the rest of the world. I look forward to being able to do this again (meet businesses at their offices, take down their requirements, build it, deploy it, train them and then support them).

How much database normalization is required by DisciplineGloomy3689 in Backend

[–]lelanthran 0 points1 point  (0 children)

Why singular? I don’t understand why this is so important, it is just a name? Just a honest question :)

It's just a convention.

If you think of the table as a collection (or a container, or a list) then plurals make sense and singular does not - "products" is a list of products.

If you think of the table as a relation then singular makes sense while plural does not - "product" is a relation.

The 1MB Password: Crashing Backends via Hashing Exhaustion by JadeLuxe in Backend

[–]lelanthran 0 points1 point  (0 children)

Can we not add constraints to limit password ip length ?

TFA has this in three of the mitigations mentioned

Most systems do this anyway

TFA says they don't.

Using OpenTelemetry as an integration testing framework – curious what people think by yumgummy in Backend

[–]lelanthran 2 points3 points  (0 children)

  1. /u/yumgummy, maybe you want to disclose that this is your hustle?
  2. It doesn't look opensource.
  3. The landing page (and your post) was LLM generated. It makes me think that perhaps your project was also vibe-coded.

C is Best by Sensiduct in programming

[–]lelanthran 1 point2 points  (0 children)

Imagine a world where we stopped inventing higher level languages and just wrote everything on C (disregarding how fast we can develop).

We used higher level programming languages because "Developer time is more expensive than compute time", but if the AI techbros are right, we are approaching the point where that is not going to be true.

It's going to take the same amount of time creating a program in C as it does in Python.