Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nikki93
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
91.
▲
by
nikki93
6y ago
Honestly, I love it! Thanks for that. :) Yeah I care about this: we have scaled bakeries that make lots of stuff, and we've industrialized it and commercialized it and ... etc. And that's great! But we also bake at home in our kit
92.
▲
by
nikki93
6y ago
This is interesting. I wonder what it's like also to kind of... Not really make it about that at all. Say you're hanging out with your friends IRL, and you're not paying them to hang out with you, or didn't pay the grass
93.
▲
by
nikki93
6y ago
Just to clarify: do you still have a realm where you would use Rust?
94.
▲
by
nikki93
6y ago
Was your `std::string` SBO comment meant to relate to the `std::vector` quote? `std::vector` can't use SBO bc. `std::swap` on `std::vector`s can't invalidate pointers to elements.
95.
▲
by
nikki93
6y ago
https://youtu.be/W3aieHjyNvw I think this talk on how an ECS actually reduced coupling in the case of Overwatch would be a good concrete real world example to look at. It enabled some architectural benefits for implementing
96.
▲
by
nikki93
6y ago
It seems like in these cases often at least in frame-based systems like games it makes sense to sort your data in a parent->child partial order, then visit in that (or reverse depending on which algo) order propagating changes, then do a
97.
▲
by
nikki93
6y ago
I think DoD can be ergonomic, actually, if you're doing it just for the architecture reasons vs. the optimizations reasons, to the point that you choose DoD due to them. At least I personally have found that eg. an ECS architecture can
98.
▲
by
nikki93
6y ago
For sure, I think you can mitigate it, but I would take that as being different from avoidance (simply because there are other languages / runtimes where there is clear actual avoidance). Regardless I think we have enough details in th
99.
▲
by
nikki93
6y ago
You might reduce it for sure, but you aren't going to avoid it entirely. The best is when it gets to a tracing JIT and all of the calls have a similar codepath. And the fact that you need to jump through hoops like this instead of just
100.
▲
by
nikki93
6y ago
There is some amount of overhead in the VM due to the dynamic nature of JavaScript values and the need for a GC that can't be avoided (even though VM implementations have had years of effort and optimization put in to address this). Yo
101.
▲
by
nikki93
6y ago
A certain genre of apps, especially eg. digital audio workstations, manage to do this and also have a sizeable userbase. Ableton Live is an example here. It seems especially sensible if your design does actually have a bunch of controls you
102.
▲
by
nikki93
6y ago
Maybe the user is like a person walking down the street and your app is your kid with girl scout cookies boxes it's trying to sell, and you're helping it out. :) And it's not about the money as much as the app growing up, or
103.
▲
by
nikki93
6y ago
Actually "C++ Crash Course: A Fast-Paced Introduction" by Josh Lospinoso seems to cover some good ground.
104.
▲
by
nikki93
6y ago
Once you try to run VSCode on a Chromebook, you realize how 'good' it is. :)
105.
▲
by
nikki93
6y ago
https://luafun.github.io/intro.html is the best I've found for performant stream-y transforms. But I tend to just believe in always writing for-loops because they are how computers actually work and IMO it's easie
106.
▲
by
nikki93
6y ago
Yeah, I definitely care about performance more in that tradeoff. In my experience when performance matters, these details about using such a null representation and what different representations lend themselves also tends to matter. vs. gl
107.
▲
by
nikki93
6y ago
For some people, using a computer is meant to be a pleasurable experience, and Vim / Emacs might let them build this up in ways that personally align with their tastes. I've spent years in Visual Studio (not Code -- the older one,
108.
▲
by
nikki93
6y ago
This is commonly called `function_traits`--for example: https://www.boost.org/doc/libs/1_43_0/libs/type_traits/doc/h...
109.
▲
by
nikki93
6y ago
Using registers to pass structs is an ABI thing and doesn't need LTO, it happens during compilation (see godbolt.org links on the rest of this thread).
110.
▲
by
nikki93
6y ago
If it's a prvalue there is no copying involved. Here's an example where one of the 'parameters' has an 'expensive' copy constructor but it isn't invoked at all: https://godbolt.org/z/9
111.
▲
by
nikki93
6y ago
Another approach is to use a `volatile` function pointer: https://www.godbolt.org/z/e6GM93 -- That way you get to keep other optimizations from `-O3` without inlining the function call itself.
112.
▲
by
nikki93
6y ago
Sure, so it doesn't have to do with inlining.
113.
▲
by
nikki93
6y ago
Six of the parameters use registers here. the `lea` is putting the sum of the first two into `eax`, then the rest accumulate more adds into `eax`. Only the last 3 parameters are reading from stack memory (the `dword ptr [*]` stuff). In any
114.
▲
by
nikki93
6y ago
https://godbolt.org/z/11931W Struct with multiple fields fitting into multiple registers.
115.
▲
by
nikki93
6y ago
https://godbolt.org/z/11931W Here's an example where it happens even when not inlining.
116.
▲
by
nikki93
6y ago
> Passing strings into a templates ... wouldn't work in C++ ... https://www.youtube.com/watch?v=QM3W36COnE4 Here's an example of parsing regular expressions in C++ at compile time. Code here: https://
117.
▲
by
nikki93
6y ago
Makes sense. I was just clarifying "It's not possible to build this in pure Lua": it is.
118.
▲
by
nikki93
6y ago
Have you tried lua-cjson, out of curiosity? They use a cjson.null (or something like that) value for nulls in JSON. But yeah agree with what you've said in general, if I had to do some API JSON manipulation Lua isn't what I'd
119.
▲
by
nikki93
6y ago
You can actually implement that sort of logic in pure Lua too using `...` in your parameter list and then using `select('#', ...)` in the function body. For example: > function f(...) print(select('#', ...)) end
120.
▲
by
nikki93
6y ago
Yeah I actually don't think Lua is great for those things, tbh. Lua is not a good tool for manipulating JSON--JavaScript is probably sensible for that (it is JavaScript's object format, after all). And yeah I don't think it&#
More ›