HN user

SuboptimalEng

296 karma

Indian-American software engineer and YouTuber interested in computer graphics, anime, video games, and long-distance running.

Posts21
Comments63
View on HN
news.ycombinator.com 24d ago

Ask HN: Examples of AI taste?

SuboptimalEng
1pts3
news.ycombinator.com 26d ago

Ask HN: Can distributed data centers in individual households provide UBI?

SuboptimalEng
1pts6
news.ycombinator.com 6mo ago

Ask HN: If AI wins, don't AI companies lose?

SuboptimalEng
2pts10
news.ycombinator.com 7mo ago

Ask HN: What happens when AI doesn't need human tools?

SuboptimalEng
5pts7
github.com 1y ago

Show HN: WebGPU + TypeScript Slime Mold

SuboptimalEng
71pts11
github.com 1y ago

Show HN: WebGPU + TypeScript Slime Mold Simulation

SuboptimalEng
1pts0
github.com 2y ago

Show HN: Volume rendering 3D data in Three.js and GLSL

SuboptimalEng
108pts37
old.reddit.com 2y ago

The tech industry favors specialized engineers over generalists

SuboptimalEng
1pts1
news.ycombinator.com 2y ago

Ask HN: Is it better to specialize in economic downturns?

SuboptimalEng
4pts4
news.ycombinator.com 3y ago

Ask HN: Have you ever pivoted your career?

SuboptimalEng
4pts2
happycoding.io 4y ago

Ten Lessons from “Senior” Software Engineering

SuboptimalEng
9pts0
github.com 4y ago

Show HN: Gamedex, my collection of Three.js game dev experiments

SuboptimalEng
66pts3
news.ycombinator.com 4y ago

Ask HN: What are some great game developer engineering blogs?

SuboptimalEng
8pts0
news.ycombinator.com 4y ago

Ask HN: Hackernews for game developers?

SuboptimalEng
5pts9
dion.systems 4y ago

Dion Systems' Metadesk – open-source IDE written in C

SuboptimalEng
4pts2
github.com 4y ago

Show HN: Open-source, local-first video file browser like YouTube

SuboptimalEng
8pts2
news.ycombinator.com 4y ago

Ask HN: Why do I think better while walking?

SuboptimalEng
10pts6
github.com 4y ago

Show HN: Orbital, a video file browser for digital hoarders (like me)

SuboptimalEng
5pts1
news.ycombinator.com 4y ago

Ask HN: What was your BrandonM moment?

SuboptimalEng
5pts1
github.com 4y ago

Show HN: AtomicEdits – automatically remove silences from videos

SuboptimalEng
3pts3
news.ycombinator.com 5y ago

Ask HN: What Is Your Blog?

SuboptimalEng
23pts36
STFU 6 months ago

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.

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 ;)

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.

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.

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.)

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.

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

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.

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.

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.

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

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.

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.

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

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.

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.

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.

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

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);
  }

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.

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.

PyTorch for WebGPU 3 years ago

And operator overloading. TS code tends to look like this `c.add(b.add(a))` or `add(add(a, b), c)` instead of `a + b + c` as you might write in Python.

That was my biggest pain-point with using TS for graphics related projects. If operator overloading existed, then TS would be a no brainer for entry level graphics + AI/ML projects.

Edit: This gets more complicated when doing operations that force you to manually respect PEMDAS. For example, `add(div(a, b), multiply(c, d))` in TypeScript would simplify to `a / b + c * d` in Python. The TS version is unreadable.

I started my channel[0] in 2019 focusing on LeetCode style tutorials in Python. This was before NeetCode and the best source for coding interview prep (at the time) was Tushar Roy's YouTube channel.

Turns out this was a super fast way to grow, but I decided to change directions as I didn't want to become an interview prep channel. Unlisted most of my videos and started fresh in early 2021. (You can still find them on a playlist on my channel.)

From then I made videos focusing on tech I was interested in like Vue.js, Tailwind CSS, React, TypeScript, VS Code, and Vim! Late 2021, I stumbled upon Three.js and graphics programming and that's the main focus of my channel now. My latest video was a tutorial on the Phong lighting method.

Stats: 14k+ subscribers, 1M+ total views, $100-200 per month (passive) income.

[0] https://www.youtube.com/SuboptimalEng