HNHacker News
TopNewBestAskShowJobs

pfg_

239 karma · joined August 29, 2020

submissionscomments
pfg_··on Type-erased generic functions for C: A modest non-proposal
This proposal is different than how zig handles generic functions because it only emits one symbol and function body for each function.

In zig, genericMax([]i32) would emit seperate code to genericMax([]i16). This proposal has both of those functions backed by the same symbol and machine code but it requires a bunch of extra arguments, virtual function calls, and manualy offsetting indices into arrays. You could use zig to do the same with some effort.

pfg_··on Cohost to shut down at end of 2024
People were paid until today, the costs are mostly salary
pfg_··on Hacker Purity Test (1989)
It does ask about if you use, not have. So maybe some people have a terabyte but only use 600gb
pfg_··on Bold Edit: An editor written by power users
VSCode is only GPU accelerated in the same way every website is GPU accelerated - text rendering is done using the DOM. Every program on your computer is GPU accelerated in that sense.
pfg_··on How to save $13.27 on your SaaS bill
Presumably so that when it shows the checkmark and says your website was updated you don't go there and wonder why it hasn't updated for you
pfg_··on Node.js adds experimental support for TypeScript
Bun is doing that - every update usually has node compat fixes or improvements and the list of supported modules has gone up significantly since it was released
pfg_··on Node.js adds experimental support for TypeScript
Fortunately, code is generally bundled for browsers to reduce the number of network requests and total size of downloads. And node has access to the filesystem, so it can do path searches just fine if it wants to support existing code.
pfg_··on I mapped almost every USA traffic death in the 21st century
Environmentally, the optimal road is the road with no cars on it. Ideally, traffic calming is paired with cities where things are put closer together and where walking, biking, and transit are the most viable options for most trips. Traffic calming a road in a suburb a mile from the nearest store might help with safety, but people will still use cars to get everywhere.
pfg_··on Polychromatic Pixels
This seems like a non-problem, cut the display resolution in half on one axis and reserve two 'subpixels' for each pixel. Then you have a full color display with only one physical pixel type and that needs one less subpixel. These displays could even produce some saturated colors with specific wavelengths that can't be represented on regular rgb displays.
pfg_··on Optimizing the Lichess Tablebase Server
If you look at lichess financials they currently have two full time employees - in this case it's not a bad assumption. Wikipedia has significantly more users and does fundraisers
pfg_··on Round Rects Are Everywhere
I'm pretty sure it's a screen cutout - the corners are still rounded when fullscreen zooming, and on asahi linux. There's also another cutout for the notch at the top of the screen. Also, it's not a great panel and the blacks aren't very good - you can still see light coming from the monitor with a full back image in fullscreen and it changes based on brightness.

So if it is software, then it's very low level and with darker blacks than anything else on screen, and has a super tiny bezel right at the corner. I'm pretty sure it's a cutout.

pfg_··on What I think about Lua after shipping a project with 60k lines of code
I think they are. Rust is a general purpose programming language, and Lua is a language specifically designed to be embeddable. But that means if you're making a project that embeds Lua, like Factorio for example, you have the choice of what language you write the code in. The choice is whether to write a function as native or to write it in Lua, and that choice might not be super clear unless someone else already made that choice for you.

This is completely different than assembly vs PHP. Assembly is a 'don't use it unless you have to' programming language, while PHP is a programming language designed for website building. You wouldn't use assembly to make a website because there are no frameworks for it and you'll scream and cry. You wouldn't use PHP to write the entrypoint to your operating system because PHP can't do that.

Rust and Lua are a lot closer together than PHP and assembly and it often would be reasonable to compare these languages for the same problems. It's not relevant at all to the blog post though because the engine they're using is built for Lua, and it's not really up to them unless they want to work against the engine and try to use a different language.

pfg_··on AltStore PAL, the first alternative app marketplace on iPhone, is available now
This is a little bit apple's fault - if any app is distributed outside the app store, the developer now has to pay a fee per-install even for installs from the app store (50¢ per install!). He could have chosen not to put Delta in AltStore and only put it in the app store, then it could be free on the app store. Either way, you don't get a choice. You install from the app store, or you install from AltStore, but it can't be on both because of apple policy. This is what apple wants, and is why the fee exists. Hopefully it violates the DMA and they'll be forced to change that.
pfg_··on AltStore PAL, the first alternative app marketplace on iPhone, is available now
Cydia installs deb packages which can modify system files. The EU method only allows installation of signed .ipa apps
pfg_··on AltStore PAL, the first alternative app marketplace on iPhone, is available now
Why did they do that? Did they just decide to after 6 years randomly with no inciting incident? Or did they decide to because they were being forced to allow alternative app stores which would allow emulator installation anyway?
pfg_··on Converting C437 to XNA Spritesheets with Zig and Raylib
> Note, for a reason I cannot figure out, Raylib refuses to properly render characters when its numerical value is over 128 so I’ve had to directly call DrawTextCodepoint instead of DrawText, which seems to avoid the issue.

It may be using utf-8? If DrawText("\x80") doesn't draw character U+80, then maybe DrawText("\xC2\x80") would

pfg_··on Bun 1.1
This is how typescript is run today. Typescript types never exist at runtime regardless of how typescript is run. There is no overhead defining types because they are deleted at runtime. The purpose of typescript is to make the editor experience better (autocomplete, error highlight). Typically typechecking is run in addition to tests to make sure there aren't a bunch of errors no one saw in editor.
pfg_··on Bun 1.1
It's realy nice when I need to do shell stuff - much nicer to be able to use js to write a shell script than either go look up shell syntax again or use js with child_process.spawn()
pfg_··on Should toggle button show its current state or the state to which it'll change? (2010)
It does as long as you mark the label as being for the checkbox or put the checkbox inside the label, which you are supposed to do.
pfg_··on Reddit's Recently Announced API Changes, and the future of /r/blind
Apollo (a third party client) has requested half the price and 90 days transition period. The price and transition period seems non-negotiable. Apollo is shutting down: https://www.reddit.com/r/apolloapp/comments/144f6xm/apollo_w...

> I hope I explained above why the 30 day time limit is the true issue. However in a perfect world I think lowering the price by half and providing a three month transition period to the paid API would make the transition feasible for more developers, myself included. These concessions seem minor and reasonable in the face of the changes.

pfg_··on Reddit's Recently Announced API Changes, and the future of /r/blind
.json pages are part of the API and will likely be taken down eventually
pfg_··on Reddit's Recently Announced API Changes, and the future of /r/blind
Specific issues from when I used it for a bit to create image posts a year ago:

- On my screen size, it was incredibly hard to navigate the profile. The profile header covered over half the screen - Notifications were often bugged - You can only have one thing open at once - no way to quickly toggle between two pages. Apollo at least has four buttons in the bottom you can use to go to seperate pages - It was extremely laggy - It sends notifications by default for random junk ("your post got one upvote!!!" "check out this trending subreddit;!!!") and at least once there was a server bug where it ignored me having turned those off and sent marketing notifications anyway

The real issue for me is it just feels bad to use. Everything lags, it constantly loses my place, ...

new.reddit was nice, I was using it back in the beta period. But it's so slow. It's barely usable. Opening a reddit thread from google if I'm not signed in shows like three comments and a bunch of random unrelated junk. Opening new reddit when I am signed in just feels slow. Every action pauses for a moment to do a bunch of react rerenders.

I don't know if they've fixed it by now but back two years ago it was doing react rerenders of practically the whole page while moving the mouse.

Using the mobile app feels similarly bad to using new.reddit

pfg_··on Show HN: I made CSS Pro, a re-imagined Devtools for web design
It is. There is a $900 lifetime license available
pfg_··on 300ms Faster: Reducing Wikipedia's total blocking time
Citation previews are nice, much more convenient than clicking the citation and then trying to find the back button. Link previews on desktop are useful too.
pfg_··on 300ms Faster: Reducing Wikipedia's total blocking time
> it apparently doesn't finish rendering at all

What's happening here is the browser did a first paint, and then the javascript started eating up all the CPU. You can scroll because of asynchronous pan/zoom, but when you get to the edge of the rendered region, it asks to render more and it never gets rendered because the page is stuck executing javascript. Recording: https://share.firefox.dev/3C2DE9C

pfg_··on VanJS (Vanilla JavaScript): smallest reactive UI framework
Don't minifiers convert these anyway?

    const a = 1;
    let b = 2;
    console.log(a, b);
bun build --minify a.js // bundles this to:

    var o=1,l=2;console.log(o,l);
It's not even using const or let, it's flattened these multiple statements into one 'var' statement
pfg_··on VanJS (Vanilla JavaScript): smallest reactive UI framework
If you just want to make vanilla js reactive, you can use solid js but without jsx (or something similar). This library could likely do the same.

    import { createRoot, createSignal, createRenderEffect } from "solid-js";  

    function SomeComponent() {  
      const [count, setCount] = createSignal(0);  

      const result = document.createElement("button");  
      createRenderEffect(() => result.textContent = "++ (" + count() + ")");  
      result.onclick = () => setCount(count() + 1);  
      return result;  
    }  


    createRoot(cleanup => {  
      const appv = document.getElementById("app");  
      appv.appendChild(SomeComponent());  
    });
pfg_··on Malicious VSCode extensions with more than 45k installs
Android used to ask for all permissions upfront, you have no choice. You want the app? Too bad, it is gets access to your contacts. Now apps have to ask when they need them and they are working on making file permissions more granular as well
pfg_··on Malicious VSCode extensions with more than 45k installs
my user's privileges contain my ssh keys, my passwords database, my personal files, ...
pfg_··on Building a Signal Analyzer with Modern Web Tech
The specs that firefox chooses not to implement are stuff like web midi for security concerns. Firefox does not try to market itself as a "website viewer" that does not support "web apps"
← PreviousPage 3 of 4Next →