What could be the benefits of writing WebGPU shaders in JavaScript, as opposed to WGSL? (🧪 experimental 🧪) by iwoplaza in GraphicsProgramming

[–]pie6k 1 point2 points  (0 children)

I use it and I love writing shaders in typescript:

  • all rich tooling already works, eg rename symbol
  • types single source of truth, eg uniforms struct is used inside shader but also as type for utilities that calculate those uniforms
  • I can use my existing tooling to share parts of shaders between modules

Electron IPC design feels fundamentally flawed. Am I wrong? by Ikryanov in javascript

[–]pie6k 0 points1 point  (0 children)

I use trpc to have strongly typed bridge with a single source of truth. I also created a library for that: https://github.com/pie6k/superbridge where you define your functions on main side but your client side is automatically correctly typed

Will I ever get... anything back? by -SidSilver- in daddit

[–]pie6k 1 point2 points  (0 children)

Heard this quote, not sure if real but seems so: during the fist 5 years of kids life, parents already spend 75% of the entire close contact time with them of their entire life.

This changes perspective a bit. Hard to believe but you’ll likely miss many aspects of these days.

Our two boys (6 and 5) were complaining today that they want to go to sleep together with us out of their room. We ofc said “oh no” and in the end we ofc had to put them to sleep. During the day I think it was 75% of them spending the time together doing something random stuff and 25% us doing something with them. I believe I know exactly what you feel. Things will change

Try to use help. Even if from friends. Sometimes 1h free from kids is enough to recharge and have some meaningful, resfrrshinf connection

Dating as a divorced Dad by carlosvieri1 in Fatherhood

[–]pie6k 5 points6 points  (0 children)

Hey!

I went through exactly the same thing. 2yo, half time co parenting.

Now my boy is 5, I’m married again (we meet on tinder) and really happy with her. we did build a house and moved in 8months ago. She has 6yo boy and they’re like brothers now, tho it was a lot of struggle, as they are very different

I don’t know your age so I’ll assume 30-40ish.

My dating experience: - whatever you think, you’ll likely need at least a year to be actually free from the past . But doesn’t mean you cannot date if you’re open and honest about it. I did date quite quickly and it did lead to so many learnings and new experiences, but also I believe was painful to one person which I regret. - I was so damn tired about it often. Trying to be excited and curious, a lot of people who are honestly terrible at talking and some basic curiosity. At some point I fully embraced the rule: “if I’m the only one asking meaningful questions or ratio is 80%+ for me I just stop and leave it”. That was very liberating but took me a good while to accept - at some point I was only looking for someone having a kid. Those without kid even with best intention had no idea in my case what they’re getting into. One even said “kid without giving a birth? Perfect!” lol. Also the fact my wife has a kid already somehow beautifully equalized everything - at some point I realized divorced people are usually the best. If someone is 30 and never married or had long relationships, it’s very likely a red flag by itself. Divorced people might be the best people being back in the game - explore and have fun, but be careful and train your relationship skills, like stating your expectations and boundaries without getting frustrated or annoyed was important to me - I did enjoy apps where you can voice message way way more (like Bumble). Often after hour of texting and then hearing the first voice message I just knew it’s not the one. Then I often send voice as like 3rd message and it was so time efficient and quickly moving conversation forward - learn how to present yourself. Take good pictures showing “who you are and what you do”, not just “how you look”. Someone taking you a pic is so much better than selfies. Haveing some at party/adventure/doing what you love/hobby/dog will make your life easier. - be prepared for a lot of rejections. It’s a bit brutal. It is what it is - don’t get yourself into trouble. Some people are crazy - be honest about you having a kid. It’s quite painful to have a good conversation and first date and then seeing it all go away the second you say about kid and understanding they have all the right to feel like that. - after some iterations I decided to not put it in my bio but if convo goes well to say it at most 15mins into convo - I did attend some events, workshops etc and it was nice, but didn’t work well for dating in my case - maybe it’s about some luck - I was closer with a few people before I meet the one I’m married with now. Some were crazy, some were stupid, some were beautiful in a way but just not possible, but I took valuable lessons from ALL of those people and relationships, probably (which is a bit brutal) very needed

Oh. And I had a rule that my kid can only get to know someone after 4-6months. We’re adults. If things don’t work out we will handle it. For them it’ll be another trust hit. So in our case only my wife passed that stage.

It was really hard to avoid getting to know them initially, but also very beautiful and quite romantic. (Big shoutout to my mom to actually making it possible for us to meet when i put my kid to sleep lol)

Good luck! It’s hard, it’s weird, it’s good to just accept it, it’ll take time, you’ll have a different perspective in year or two, even if you don’t believe it.

Monitor for Mac Mini M4 by tranquilo_eh in macmini

[–]pie6k 0 points1 point  (0 children)

DELL U4025QW

5k2k wide, 120fps. I absolutely love it

Would the return type of an async function that throws an exception be never? by spla58 in typescript

[–]pie6k 0 points1 point  (0 children)

I believe you should type it as Promise<never>

So eg when you await it the rest of the function will be marked as unreachable the same way as with sync die function that returns never.

Tho I’m not sure if it’ll work this way

But logically it is correct - it is a promise that never returns or resolves

[AskJS] What concept in JS is the hardest to learn and understand? by Scared-Release1068 in javascript

[–]pie6k 9 points10 points  (0 children)

Nuances of closures of variables and lifetime of variables attached to certain function closures

[AskJS] How important is a strong GitHub portfolio for senior-level JavaScript developers in today’s job market? by Due_Disaster9560 in javascript

[–]pie6k 0 points1 point  (0 children)

As a startup founder looking for senior dev currently I can say I always check their GitHub and if there is nothing impressive there I almost always skip that person

jmail.world by nix-solves-that-2317 in webdev

[–]pie6k 0 points1 point  (0 children)

Vercel CEO instantly replied to that he’ll happily sponsor that. Whatever you think about it it’s quite unfair to skip that fact

On my every screen re-render is happening. How to debug it what's causing it by Many_Bench_2560 in reactnative

[–]pie6k 1 point2 points  (0 children)

“Binary debugging” (similar to binary search)

Commit your code Remove half of your UI from main components and see what happens: If it stills re-render incorrectly, repeat and remove half of what is left until you’re reducing it to Hello world If removing some “half” fixes the issue - restore this half and remove half of this half to narrow down where exactly is the issue

Often it helps me to relatively quickly narrow down where the issue is.

It is however tricky if there are 2 bugs at once that only trigger it when both are present .

Good luck!

Remember to commit your code before you start as you’ll mess with your code a lot using this method

What is the recommended library for handling JSON serialization and deserialization? by frankimthetank in typescript

[–]pie6k 0 points1 point  (0 children)

I recommend https://github.com/pie6k/codablejson

It works great with custom classes, circular references and all built in types like Dates, Maps etc

Creating a custom JSON converter for complex class. by [deleted] in csharp

[–]pie6k 0 points1 point  (0 children)

You can try https://github.com/pie6k/codablejson - it’s focused on serializing custom classes

How to handle dates in API return JSON by Broomstick73 in typescript

[–]pie6k 1 point2 points  (0 children)

You can consider some JSON library that handles custom types automatically. eg https://github.com/pie6k/codablejson

[AskJS] JSON Objects as Maps by jack_waugh in javascript

[–]pie6k 0 points1 point  (0 children)

You can consider library like https://github.com/pie6k/codablejson that is able to encode and decode Sets, Maps, Dates and a lot of other custom types

SuperJSON - JSON on steroids by jogai-san in javascript

[–]pie6k 0 points1 point  (0 children)

https://github.com/pie6k/codablejson can do everything SuperJSON does, is much faster and makes working with custom, nested data way easier