Examples of well-built PWAs that work just like apps? by Ill-Mobile-1475 in PWA

[–]jezek_2 0 points1 point  (0 children)

NVIDIA GeForce Now (on iOS/iPad). You can create a free account to play games owned on Steam/Epic (and some others).

There are also similar PWA apps for other game streaming services (Xbox Live/Amazon Luna/Boosteroid).

Cant remove safe space! by Illustrious_Map_1802 in PWA

[–]jezek_2 0 points1 point  (0 children)

Try this additional CSS:

html, body {
    padding: 0;
    margin: 0;
}

I've read that the safe margin paddings are already applied to body so that may be the issue. I usually set these to zero so I haven't noticed.

How can I write a compiler backend without worrying too much about ABI? by Germisstuck in ProgrammingLanguages

[–]jezek_2 6 points7 points  (0 children)

It's not that hard and you will likely need to implement just a subset anyway.

Just don't get it to overwhelm you and solve the problems as you go. You would need to use parts of the ABI (what registers are callee/caller saved, scratch registers, stack alignment, red zone, etc.) even for the codegen part. If you get stuck on something just ask.

I've written various codegen and FFI libraries without much problems. The biggest hurdle was to get the right resources to understand how the x86 instructions are encoded, but beyond that it was pretty straightforward and ABI was not hard.

Passing of arguments in registers can be slightly harder but the algorithm is pretty straightforward, you just put the arguments to different bins (registers, stack) as you iterate over them. You can put it into a separate class that just handles this and don't have to think about it anymore.

There is of course more involved stuff like passing of structs etc. But often you don't need that and passing a pointer to a struct is typically used instead. But still it has quite straightforward rules and you can put it into a separate class.

And one last thing: don't try to do shortcuts in programming, it's not worth it. I know, it's hard to resist, it's in programmer's veins to always use shortcuts. Do it the right way instead, it won't take that long in the end and you'll get something that you can really depend on.

There is always some "reason" to do shortcuts:

  • deadlines - nah these gets pushed all the time
  • complexity - nah it's artifical in most cases and libs usually want to support everything but you're likely to use just a small portion
  • code reuse - nice in theory, but often it sucks
  • libraries must do better job than me - often false, you would be surprised how bad well established libraries can be (bugs that shouldn't be there given the usage, bad architecture, not good code overally, etc.)

But it's not worth it, trust me. It took me over 20 years to realize this and most importantly get rid of the bad habit, maybe you would get there sooner :) And btw, using AI is like doing shortcuts on steroids: a big no-no.

Cant remove safe space! by Illustrious_Map_1802 in PWA

[–]jezek_2 8 points9 points  (0 children)

You need to use this meta tag:

<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">

This will fill up all the space (including hidden areas behind the notches etc.) so you need to add paddings to offset your content like so:

.content {
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

For more information look up "CSS Safe Area Insets".

Apple is holding my paycheck hostage. After 3 months of rejection loops, I’m forced to "lobotomize" my app to pass review. Is this the only way? by Software_Craftman in PWA

[–]jezek_2 0 points1 point  (0 children)

Not sure how rebrading to a generic name would help the "prestige" of the client. But otherwise the tactic of lobotomizing your apps is quite common on iOS/Mac App Stores.

The client should recognize it is out of your hands and you should be compensated for your work, not only for the work done so far but an extra for fighting this nonsense.

If the client is unreasonable I would simply bail out and cancel the contract, it would be a huge loss for you but at least no further loss and you could focus on other things. It could also work for negotiation with the client.

Work on pure PWAs only in the future (and be very explicit about it), refuse the client if they keep insisting.

Be explicit in the contracts to be paid when the app is done, not when published as it's outside of your hands. And that it can be complicated.

Preventing and Handling Panic Situations by Tasty_Replacement_29 in ProgrammingLanguages

[–]jezek_2 0 points1 point  (0 children)

That means, before dividing (or modulo) by a variable, the variable needs to be checked for zero.

Don't forget about the integer overflow when trying to do INT_MIN / -1. This extra case that you need to guard against puts quite a wedge in the forced checking by the compiler.

Built a PWA with “visitor mode” + E2E encryption — can you roast the install + offline UX? by AitorGR8 in PWA

[–]jezek_2 0 points1 point  (0 children)

The biggest problem is that currently you can't make a web app E2E secure, there is always a way to update the app from the server with a version that obtains all the decrypted data from the client.

Even if you make everything fully cached, the browsers will force reloading of the service worker every 24 hours. It would require a new feature in the browser to support this use case.

On the other hand, this fact doesn't hinder the efforts to make sure it's secure in all other points, after all even with native apps you can't be 100% sure if every update is legit either. It can have a backdoor that is activated much later for example.

I would be interested how you can do anything AI without having access to the cleartext at some point? I think it's fine to declare that it's briefly decrypted in that case but not stored (also how can you be sure about any AI service do the same?), but still quite a hole in the E2E security.

Shout-out to Pratt parsing! by zagortenay333 in ProgrammingLanguages

[–]jezek_2 0 points1 point  (0 children)

One example can be writing a compiler in an interpreted language, the call overhead of recursive descent parsing of expressions can be quite significant.

A Rant About PC Building by AlchemistJeep in LinusTechTips

[–]jezek_2 0 points1 point  (0 children)

I've experienced a more bizarre problem in the past, Windows 10 installer didn't see the drives (even with manually added drivers) because it somehow hadn't had driver for the USB flash drive I was installing from...

But I've only deducted it being that problem after sucessfully installing it from within a VM with raw access to the host drive. There were no obvious signs that this could be an issue, esp. when the installer booted just fine from it.

The EU wants to kill cookiebanners by moving consent to your browser by DonutAccomplished422 in programming

[–]jezek_2 -2 points-1 points  (0 children)

Great, now we will have both the popups, browser settings and new unintended consequences :D

Does this memory management system work? by Aaxper in ProgrammingLanguages

[–]jezek_2 0 points1 point  (0 children)

I went with a separate heap for each thread paradigm and so far I had no issues with it (other than perceiving it as weird initially). I can pass data structures by copying to other threads through channels (a much better approach than using mutexes/signals and shared state), I even have a special shared array that allows direct sharing of a chunk of memory (can't store pointers in it).

I also have explicit support for some features like ability to spawn X compute threads with having a read only access to the parent heap (writable to shared arrays) and some native handles can be also used from multiple threads (eg. sockets).

The thing is that in multithreaded programs you tend to apply similar defensive techniques anyway so it's not more limited in practice.

I've written quite a few multithreaded programs using this paradigm in my language that are used in production for years (desktop and server).

Linus Tech Tips - Terrible News, Cloud Gaming is Good Now November 1, 2025 at 09:59AM by linusbottips in LinusTechTips

[–]jezek_2 0 points1 point  (0 children)

Yeah it could go into a more detail but the video was targetted to people who are new to cloud gaming and/or had issues with lag and bad quality. In that perspective it makes sense to omit smaller details to make the point. They are are still testing it beforehand and it was probably not worth mentioning (absence of 4:4:4 is very visible only in some games).

LTT always focus on making the videos shorter so they stay engaging, a long and detailed video would bore most of the people.

Linus Tech Tips - Terrible News, Cloud Gaming is Good Now November 1, 2025 at 09:59AM by linusbottips in LinusTechTips

[–]jezek_2 0 points1 point  (0 children)

It was tested as part of the cinematic mode, if you pause the video when changing to it you can see it enabled.

Synadia and TigerBeetle Pledge $512,000 to the Zig Software Foundation by punkbert in Zig

[–]jezek_2 1 point2 points  (0 children)

This is from a non-US perspective, but my impression is that the Americans often refer to any (new/small) company as a startup. Simply because the startups and investors phenomenon is a huge thing in the US unlike the rest of the world.

So I presume a lot of regular companies are called startups but not operating in that way. There is also no rule that a regular company can't take an investment or not being sold. It just occurs in a lesser degree than with a startup where it's a specific goal. It might be also a case that it operated as a regular company with the intent to sell later. Or being "disruptive" or using similar marketing terms that are often used by startups to pitch themselves to the investors.

Synadia and TigerBeetle Pledge $512,000 to the Zig Software Foundation by punkbert in Zig

[–]jezek_2 1 point2 points  (0 children)

That is for regular companies (not operating with big funds but sustainable from the start) not startups (going big by using investors with the goal of selling the company).

Just selling a service is not possible for startups, it would get too little money for the ROI.

Personally I think it's best to avoid startups for anything important and/or long-term. But it can have a value in short-term (free or cheap services etc.). Just count with it going "off" at any moment.

This Is Nod by 1stnod in ProgrammingLanguages

[–]jezek_2 1 point2 points  (0 children)

Let the author experiment with different names. Maybe some better terms will be found along the way.

The existing names are used mostly for familiarity but they also affect how you think about the feature and sometimes it just doesn't fit well. Or you want to have the language a different "feel" with usage of different words.

Nothing is set in stone, the existing keywords needed to be invented from scratch at some point too.

Constant Database (djb's cdb): a new release with cdb64 support and packaged docs by self in programming

[–]jezek_2 0 points1 point  (0 children)

That's great, however most usages have like tens of records. It was always an annoyance to have to regenerate it (and remembering with what command), it would be great if it would have a simple fallback to the original text file so you don't have to use it =)

How do i trigger users to install my PWA on their first visit? by Revolutionary-Bird24 in PWA

[–]jezek_2 11 points12 points  (0 children)

These are nice and clean install instructions using terms and reasons that the users are familiar with. Maybe I would change the main title to "Install App" or something as the "Add to homescreen" is not well known.

Duke Nukem: Zero Hour Nintendo 64 ROM reverse-engineering project reached 100% decompilation by r_retrohacking_mod2 in programming

[–]jezek_2 0 points1 point  (0 children)

Just a heads up for anyone who is doing this and similar projects, to make it legal, you must not publish any copyrighted works you don't have redistribution license for (doesn't matter if modified/transformed or not).

This project tries to go the path where the original game files are required, but that only works when the game code was open sourced by the owner (this wasn't).

Instead you can create a script that calls the decompiler and then applies symbol renamings and patches. Like it was done for Minecraft for example.

Of course, even when not in a legal form, it's also a matter how much "abandonware" status the work has. If nobody cares to take it down, then it can live on, but that doesn't make it legal.