HNHacker News
TopNewBestAskShowJobs

SuboptimalEng

296 karma · joined September 3, 2020

Indian-American software engineer and YouTuber interested in computer graphics, anime, video games, and long-distance running.
submissionscomments
SuboptimalEng··on Ask HN: If you dislike AI, why don't you prove it?
I see you didn't read the description under the title :)
SuboptimalEng··on Ask HN: If you dislike AI, why don't you prove it?
Exactly. Be prepared to switch companies/models at moments notice.

I mean, if someone truly disliked AI, the only natural course would be to ensure that they can switch to open source and not willingly give money + data to the frontier labs.

SuboptimalEng··on Ask HN: Can distributed data centers in individual households provide UBI?
True. Maybe we could start with smaller sized GPUs until it becomes the norm in society to have GPU clusters in homes, then upgrade where necessary?

Get those AI companies to compete on who installs the GPUs, and let them offer incentives to you (the house owner) on who to choose :)

SuboptimalEng··on STFU
Indian-American here. Thank you for this!

I have hearing sensitivity and have repeatedly asked my parents to lower the volume on TVs, whatsapp videos, insta reels 100s of times. They always lower it for 5 minutes before raising it back. Likely because they are losing their hearing, but unable to admit that.

I tend to be very mindful of others (maybe because I grew up in America), but my parents are not even mindful of my requests. Maybe it's a cultural thing? I expect those who have grown-up (or spent their whole lives) in India would do the same.

Definitely need to test this out app out when I go home.

SuboptimalEng··on Ask HN: If AI wins, don't AI companies lose?
That's a fair point. Model prices can increase. This raises the next question.

Doesn't this mean that any company that depends on headcount growth (every SaaS), loses?

100 SWE -> 10 SWE, 100 slack/gmail/notion/zoom/etc. subscriptions become 10.

And now let's recurse.

These SaaS companies that use AI and dropped 90% of engineering headcount lose revenue because their customers also drop headcount.

Let's say AI costs 89% more than it did before, so the SaaS companies still get 10x productivity from the 10 engineers, but now all their customers headcount is 90% smaller too. So what now? Does every company make a pact to grow headcount ;)

SuboptimalEng··on Ask HN: If AI wins, don't AI companies lose?
That's a fair point. Model prices can increase. Let's say Anthropics/OpenAI/Gemini figure this out.

Doesn't this mean that any company that depends on headcount growth (every SaaS), loses?

100 SWE -> 10 SWE, 100 slack/gmail/notion/zoom/etc. subscriptions become 10.

SuboptimalEng··on Ask HN: If AI wins, don't AI companies lose?
But AI companies would want more engineers generating more tokens.

In this case, Anthropic would want 100 SWEs generating 100,000/mo of revenue. Replacing the very headcount that is responsible for token usage would hurt company growth.

Not to mention what happens when companies start doing this recursively. 100 SWE -> 10 SWE, 100 slack/gmail/notion/etc. subscriptions become 10.

SuboptimalEng··on Ask HN: What happens when AI doesn't need human tools?
And what happens, when enough percent of the population has nothing to lose?
SuboptimalEng··on Ask HN: What happens when AI doesn't need human tools?
That's exactly my question.

If there are fewer engineers, then there will be fewer dev tool companies, and fewer managers, etc. meaning fewer Slack, Gmail, MSFT, Zoom subscriptions, etc.

Companies are showing good profits, but if every company downsizes, then every company loses... right?

So, what happens now? (To the economy, lets say.)

SuboptimalEng··on Origami by Meenakshi
Sad to see this. Posted on their instagram: https://www.instagram.com/p/C8IHZXYvh8y/?img_index=1

With deep sorrow, the Mukerji family announces the passing of Meenakshi Mukerji on June 11, 2024. Meenakshi fought very hard and bravely against stage 4 lung cancer for nearly 5 years, and she passed peacefully surrounded by close family and so much love.

Meenakshi was born and raised in Kolkata, India. She obtained her BS in electrical engineering from the prestigious Indian Institute of Technology Kharagpur, and a MS in computer science from Portland State University, Oregon. After working in the software industry for more than a decade, Meenakshi dedicated her time to her family, her community, travel, and to the arts. She authored many origami books and spread her love and passion for the craft across the world.

Meenakshi was a beloved daughter, sister, mother, wife, and friend. Her strength, creativity, positivity, and love will continue to inspire and touch the lives of those who knew her, and also those who didn’t.

SuboptimalEng··on Rewriting my website in plain HTML and CSS
I started a portfolio website with Netlify (iirc), then I moved to Vue + Gridsome (on GitHub pages), then Next.js with Tailwind CSS, and was about to move to Vite.js over winter break.

That's 4 stacks over the course of 5-6 years. Not worth it.

Decided to do the sensible thing and use GitHub's README functionality. I prefer this approach and wish more folks in the tech community adopted it: https://github.com/SuboptimalEng

SuboptimalEng··on Show HN: WebGPU + TypeScript Slime Mold
Thanks! I didn't use the link with the live demo because it doesn't run on all devices.
SuboptimalEng··on Linear Algebra Done Right [pdf]
Logged in to comment this. Very much agree. It's crazy (to me) that books like this gets so much hype on HN when there are much better videos that explain these topics better.

Most of my math learning starting in high school all the way through undergrad was done by watching YouTube videos. I used books to practice problems, but when it came to understanding topics more deeply, it was always some random person on YouTube who did it better.

I hope in the future, all math (at least applied math) is explained using nice visualizations + videos instead of books like this.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
Thank you! Hope you (or the intern) can pick up right where I left off.
SuboptimalEng··on GPU compute in the browser at the speed of native: WebGPU marching cubes
Ah, so that's how you do it. Having a template for WebGPU projects is a good idea. I'll have to do the same so I don't waste time setting up web graphics projects.

Cool project btw! Adding this to my long list of graphics blogs to read.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
I need to do what you did and sit down and make a perfect Vite + React + TS boilerplate that I can use for all my web graphics experiments.

Also, your project, Shademap, is really cool btw! I remember seeing it just around the time I was getting into Three.js and graphics programming - well before the time I fully understood what a shader was.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
Oh interesting, I always read (on r/GraphicsProgramming) that XCode has some of the best debugging tools out there. That's the main reason it's been on my mind. I just need better debugging tools on Mac!

Fair point about the health tech industry.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
It's interesting to hear that Cpp is faster even though there is an overhead of moving data from WASM <-> JS/TS. I'm not yet ready to "take the leap" to learn Cpp + Metal + XCode + WASM because those are some big hurdles to jump through (especially just in my free time), but you do raise some good points.

I'm certain you could turn this knowledge into a blog post and help many more engineers who are silently struggling through this path. Self-studying graphics programming is tough!

It should pop up first on YouTube if you search "What is WebGPU Suboptimal Engineer", but I'll link it here[0] in case anyone else wants to watch it. (No need for you to actually fact-check it. I didn't mean to put random work on your plate on a Sunday haha.)

[0] https://www.youtube.com/watch?v=oIur9NATg-I

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
Wow! First of all, thank you for your amazing blog posts and tutorials! I wouldn't have been able to make it this far without them. Seriously, I was stuck for so long until a random Google search linked me to that WebGL ray-casting article you wrote. (I'd pin your comment if I could.)

The funny thing is that I was getting more confident about using JS + WebGL/WebGPU ecosystem for graphics programming after having read your posts. Very interesting to hear that you've come full circle back to Cpp + WebGL/WebGPU + WebAssembly. I'll look more closely to assess options as I head down this journey. Thank you for your tips and advice!

Edit: Perhaps you'd find my "What is WebGPU" video on YouTube interesting. I'd love to get it fact-checked by someone who's been doing WebGl/WebGPU way longer than most people! I only got into this field ~2 years ago.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
Good question! If I knew how to do it, I'd probably write this in just TypeScript. Turns out I don't know how to set that up. So I instead start with Vite and throw React in there to handle rerenders and simple state management. I think R3F is interesting, but I never used it because it makes graphics programming too front-endy.

The most important reason for my code structure is that I just like writing GLSL shaders! It's annoying that I need to set up Vite, TypeScript, Tailwind, React, etc. all so that I can write some shaders. I know I can write shaders in ShaderToy, but then I won't be able to upload custom 3D texture files or add simple user controls.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
My app does not support DICOM files as input. Just Uint8 256x256x256 raw files that are scaled 1x1x1. Maybe if I had the chance to work on it full-time I'd have the time to add those features, but it's just a side project for now.

Have you looked into Slicer3D[0] which is a multi-platform desktop app or Open Health Image Foundations dicom viewer[1] which is web-based? Perhaps one of these will help.

[0] https://www.slicer.org/

[1] https://github.com/OHIF/Viewers

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
Cool thank you! I'm using a library called Dat.gui which was easy to download and use thanks to NPM. Maybe I've been too hard on the JS ecosystem heh.

I've heard good things about ImGUI so I'll have to check that out if I ever go down the Cpp route.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
That's one of the main benefits of Metal and it's made me think twice about it. I struggled quite a bit trying to debug my shaders. But Brendan Duncan's WebGPU Inspector caught my eye so I'll check that out for now.

Oh wow, your project looks really cool too! I'll check it out.

Interesting. I did not know that CDs did not need to get HIPAA compliance. I suppose web apps would certainly need that. I wonder what will happen once Gen Alpha starts needing to get MRI scans.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
I also heard that sometimes you need to physically carry CDs to doctor's office. I suppose getting pictures of your MRI scans via Web is a good middle ground.

It just really irked me that people got CDs instead of being fully digital. The last time I used a CD (besides my PS4) was 10+ years ago. I don't even have a CD player anymore. I'm sure Gen Alpha will look at CDs the way I look at floppy disks.

SuboptimalEng··on Show HN: Volume rendering 3D data in Three.js and GLSL
Yea, that's what I love about the web. Though I do consider myself to be pretty experienced on the JS side as I've worked with it for a while. I think the main reason I ran into these issues is because I've been trying to use the Web for something that it's not fully built for (graphics programming). And also, it's been a while since I started setting up a new project.

Here are some questions that came up:

- Do I use Next.js or Vite.js or CRA (is that still used these days)

  - With Vite.js do I pick React or go with TypeScript template?
- Okay now I need Tailwind (because quite honestly, I'm terrible at CSS which I admit is my own doing)

- But what if I don't want to write GLSL files in raw text, and use GLSL file extension?

  - Oh now you want to import GLSL files directly, well you can't do that

  - Oh, I needed to install a Vite plugin but then TS throws errors saying it can't read files that end with .glsl

  - Wait is my TS server running? No, I thought this always starts up in VS Code

  - Okay so I can't even find the button to restart TS server, so now I need to... okay figured that out

  - That still didn't fix it the TS errors

  - After some more research, ah so you can import text files like this a.glsl?raw extension
SuboptimalEng··on Ask HN: Is it better to specialize in economic downturns?
It is interesting to hear that you prefer generalists. A glance at your profile tells me that you are a tech lead (focused on data engineering) and it looks like you are hiring data engineers -- which to me is a specialized role.
SuboptimalEng··on Write shaders for the (sim) Vegas sphere
Here is a slowly rotating checkerboard.

  uniform float time;
  varying vec2 vUv;
  varying vec3 vNormal;

  vec2 rot(vec2 uv, float angle) {
    float c = cos(angle);
    float s = sin(angle);
    mat2 rot = mat2(s, -c, c, s);
    return uv * rot;
  }

  void main(){
    vec3 black = vec3(0.0);
    vec3 white = vec3(1.0);
    vec3 color = black;

    vec2 uv = vUv;
    uv = rot(uv, sin(time) * 0.05);

    float boardSize = 24.0;
    uv = uv * boardSize;

    vec2 gridId = floor(uv);

    if (mod(gridId.x + gridId.y, 2.0) <= 0.01) {
      color = white;
    } else {
      color = black;
    }

    gl_FragColor = vec4(color, 1.0);
  }
SuboptimalEng··on How do I become a graphics programmer?
You can start learning graphics by writing shaders on Shadertoy. It’s where tons of graphics programmers get their start.

Shameless self promotion, I’ve made 10+ tutorials going over topics like: how to write shaders in VS Code, SDFs, ray marching, noise functions, fractional brownian motion, etc.

https://github.com/suboptimaleng/shader-tutorials

I’m certainly standing on the shoulders of giants like Inigo Quilez, The Art of Code, SimonDev and Acerola.

SuboptimalEng··on Goodbye, Node.js Buffer
Typed arrays are essential for web apps that use WebGL and WebGPU. Being able to send this type of data to run computations on the GPU can give you 1000x speed up.

You can see it in action on this WebGL fluid simulator[0] by PavelDoGreat.

[0] https://github.com/PavelDoGreat/WebGL-Fluid-Simulation

SuboptimalEng··on Career advice for young system programmers
I feel this is a weak argument. Like saying Bill Gates and Zuckerberg dropped out — but they dropped out of Harvard.

IIRC, George Hotz studied at CMU for a semester, took 4 difficult classes, got a 4.0, and won a CTF competition before dropping out.

My take is that the normal programmer (frontend, backend, systems, etc.) would benefit greatly from a CS degree.

Page 1 of 3Next →