Google Tries to Defend Its Web Environment Integrity as Critics Slam It as Dangerous
TehPers @ TehPers @beehaw.org Posts 0Comments 688Joined 2 yr. ago
I would definitely be concerned about the performance in this case, unless you can do some kind of AoT compilation of the scripts being executed (at least in production builds, development builds probably can't do that if you need hot reloading). Unfortunately the execution time budget is really tight if you want to get frequent updates and decent frame times (although if the system in question runs parallel to the rest of your systems, for example, then it might have more time to operate with).
That being said, with the interpreter pre-compiling those scripts, performance could still be really good. Sharing memory would become less relevant since your scripts would now operate on more than whatever's in your component storages and could now, in theory, work with variables local to the system, assuming you're meaning that the interpreter is called ad-hoc basically and isn't the entirety of the system.
This is all in theory of course, in practice you'd need to find an interpreter that supports pre-compiling (or at least pre-optimizing in some form) all the scripts you'll want to run if you want to maximize performance.
In this case, would the components be combined into a list? Basically you'd have a BubbleComponent[]
attached to the entity instead of just a BubbleComponent
? Maybe I'm misunderstanding what the system is, is click_handler
in the post a system, and if so, do systems only declare a single component of an entity as their input? From my experience, you often want to work with multiple components of the same entity in a system, for example:
-- Mark characters with 0 or less life as dead function mark_dead(character: BoundaryComponent) { with character as movement: MovementComponent { character.x += movement.velocity.x * delta_secs; character.y += movement.velocity.y * delta_secs; } } `
Would there be a simpler way to query these components in the system, and what if I wanted to query for both BoundaryComponent
and BubbleComponent
, what would that look like?
Yes. I vaguely remembered that some ECS can apparently do that. If not, you’d probably settle for a branch or an optional type instead.
I don't doubt this is possible, but I'm really curious how querying would work. On the other hand, a component which essentially is just a wrapper for BubbleComponent[]
is possible, but querying is straightforward since you'd just get the full list of BubbleComponent
s per iteration.
The boundary is supposed to BE the position. So some rendering system would have rendered the speech bubble in the middle of the boundary. Maybe I should have called the boundary area instead…
My idea behind using positions relative to the BoundaryComponent
is along the lines of having each new "bubble entity" hold a reference to the "boundary entity". Then you'd have a script which updates the transforms of the bubble entities to match that of the boundary entity:
function inherit_parent_boundaries( child: BoundaryComponent & ParentReferenceComponent, boundaries: Query ) { -- This updates the child's boundary to match its parent's boundary child.boundary = boundaries.get(child.parent).boundary; }
This would keep the bubbles as their own entities and avoid the need for a single entity to hold multiple of the same component, which I think would keep the ECS overall a lot simpler. This doesn't account for parents of parents or anything like that, but if boundaries
can be something like Query
, you can recurse up the chain until you've updated all the ancestors as well, and all the leaves of the tree will eventually be updated by this system.
function inherit_parent_boundaries( child: BoundaryComponent & ParentReferenceComponent, boundaries: Query ) { -- This updates the child's boundary and all its ancestors to match the boundary of the root of the ancestry tree for ( var cur = child, var parent = boundaries.get(cur.parent); parent != null; cur = parent, parent = boundaries.get(cur.parent) ) { cur.boundary = parent.boundary; } }
I do not consider programming in Rust scripting.
I don't think most people do to be honest, I was providing it as reference because it's a strongly typed ECS. One of the other challenges with scripts is they often don't have static type checkers since they're intended to be executed right away. mypy and TypeScript have helped tremendously with Python and JavaScript, but they're still extra steps that need to be executed before you can run your code.
an embedded interpreter seems kind of off the table.
An embedded interpreter can still be highly performant, assuming it has a decent JIT compiler. Sending data between the host and the interpreter would be a concern, but it might be possible to allow the script to share memory with the host and directly access the components (while holding locks on those components' storages). I tried experimenting with this a while back using WASI, but unfortunately the runtimes I played with (wasmer + wasmtime) weren't yet mature enough from my experience to be realistically useful, and I couldn't figure out how to get the modules to share memory with each other.
I know there are people playing around with scripting capabilities in bevy though, so I'm sure this will be possible at some point. The other challenge, of course, is having a scheduler that's flexible enough to handle dynamically added/removed systems, and systems which execute runtime-specified queries.
Edit: I should add that a large part of the performance of an ECS comes from the ability of an ECS runtime to parallelize the systems. If your interpreter can execute the systems in parallel, then you still get to keep that benefit as long as your scheduler knows which systems are safe to run in parallel.
For inspiration, I recommend looking at bevy. It does a great job with efficiently querying for components in a type-safe way. From their book, this is an example of what a system looks like:
rs
fn greet_people(query: Query<&Name, With>) { for name in &query { println!("hello {}!", name.0); } }
Name
and Person
are both components.
You might think that a scripting language for ECS-based systems is pointless. And in the majority of cases you would be right.
This comes as a surprise to me. I think scripting capabilities would be incredibly useful, especially if you can hot reload the scripts during development time. For core engine functionality, this might be less relevant, but for the gameplay itself it could be really nice.
You may wonder why the entity (usually some sort of ID) is part of its component. It wouldn't be too convenient if we had to query and pass around entities manually.
This one I'm curious about. How common is the case when you need to operate with the entity directly, and is it worth the cost of duplicating the entity ID onto each component? In bevy's case, you can query for the entity ID like you would a component using Entity
, which I've found to be easy enough to do.
tsfunction click_handler(boundary: BoundaryComponent) { -- This creates a new bubble component for the entity stored in boundary. boundary with new BubbleComponent("Hi at {boundary.x}, {boundary.y}!"); -- From here on we can use boundary with functions/methods/members -- registered for both components, because the type system knows. boundary.show_on_top(); }
Does this mean that each entity can have any number of components of a particular type in this implementation? Would each component also need its own ID to distinguish between two components of one type on the same entity?
Another option here is that instead of creating a BubbleComponent
that's part of the same entity as the BoundaryComponent
, it might make more sense to create a new entity that's at the same position as the BoundaryComponent
's entity, possibly using some kind of relative transformation to keep the bubble at the same position as the boundary.
The next example which seems to create two bubbles on the same entity is just as confusing to me. If I were to query for those bubbles, would I iterate over each of those bubbles in separate iterations, but all other components that are part of this query are the same? What about in situations where two or more component types have multiple instances per entity, like if one entity had two BubbleComponent
s and two BoundaryComponent
s? Would I iterate over the permutations of those entities, so (bubble 0, boundary 0)
, (bubble 0, boundary 1)
, (bubble 1, boundary 0)
, (bubble 1, boundary 1)
?
I like the ideas presented in the article otherwise. I vaguely remember TypeScript having some sort of reflection support that Angular took advantage of or something. I wonder if that can be used to create a scriptable ECS like proposed in this article?
@Gene_Probably_Better_Known_As_X
Permanently Deleted
Unless they've updated it since I last checked, it does not. I remember it being stuck on C# 7 or so, with limited C# 8 features. Or maybe it was C# 6 with limited C# 7 features. Either way, we're looking at C# 12 coming out sometime soon.
anyone who has an ounce of intelligence can easily parse this information in a few seconds regardless of its format.
1/4/2023
yyyy/mm/dd
makes the most sense in my opinion and is the order used in ISO 8601 and similar specs (though in the format yyyy-mm-dd
), but we already have enough culture-specific stuff that date formats are the least of our issues.
I'd even go further with Azure Functions and say that running them locally is really simple. Of all the issues I've had with them, running them locally was never an issue.
As someone who's worked a lot with Azure Functions, the experience for me in Visual Studio has always been:
- Create C# function app
- Write the code
- Hit F5
The Functions runtime can be ran locally as a standalone as well, and I was able to get Rust function apps working locally using a custom handler. There's also a vscode plugin to run them.
Things might be different for Lambdas/GCP's Functions?
It’s only invalid if it generated errors.
I understand this line of thinking, but unless they specify what "flavor" of JSON they accept, I think it's safe to assume they only accept what's in spec. What I find weird is that they immediately contradict the spec with their example by writing JavaScript. Should the content-type
then be application/javascript
? They can easily document the parameters outside the request body instead of adding comments.
Also, yes, I know I'm being pedantic, but if I'm applying for a job, it's a two way application. They need to give me reason to trust that they're worth working for. Making up rules along the way when referencing a commonly known spec doesn't give me much confidence.
Is it just me, or does their sample request use invalid JSON? The keys should be in quotes, comments aren't in spec (but commonly supported), and trailing commas are invalid as well (but commonly supported).
There are a few ways of finding which code is relevant, but one way is to use some sort of vector database to perform the search using embeddings generated from the Qs, As, and query.
Embeddings are essentially semantic representations of the text which can be compared to each other for similarity.
It depends. The base model, sure you can't really figure out what percentage of it came from which data source since there's just too many data sources and that information is lost along the way. They're likely not using the entirety of SO to generate answers though. Retraining LLMs is ungodly expensive, so they can't retrain it every time a new Q or A is created, and even retraining on a regular basis would be impractical.
Instead, without knowing exactly how they're doing it of course, my guess is they're pulling relevant Q&As from their database, then using those results to improve the response (for example by providing them as context). If you're interested, look into retrieval-augmented generation.
There's also an Indiana, Pennsylvania!
Also, US cities love to butcher names of other places. At least two of the cities I've either lived in or friends have lived in were like that.
That's fair. When I see a country name, the population of the country isn't really something that comes to my mind since I just figure it's a significant enough number of people (generally in the order of tens to hundreds of millions, except notably populous or small countries).
There's an article? I thought it was just a headline!
For context:
Peru—a country of over 34 million people—typically sees fewer than 20 suspected cases per month of Guillain-Barré Syndrome (pronounced ghee-yan bar-ray or abbreviated GBS). But, between June 10 and July 15, the country tallied 130 cases, including the four deaths, bringing the year's total to 231, the WHO reported Tuesday.
...
The cause of the outbreak is puzzling—even though this isn't Peru's first alarming GBS outbreak. In 2019, the country reported an unprecedented surge of nearly 700 cases between May and July, bringing the total to over 900. Before that, a large GBS outbreak was considered between 30 to 50 cases.
Researchers concluded that the culprit behind the extremely unusual 2019 outbreak was the intestinal pathogen, Campylobacter jejuni. The gut-dwelling bacteria is well-known as one of the most common causes of food poisoning and diarrheal cases in the world. But, less well-known, it's also one of the leading triggers for GBS.
(Bold text is from me)
Edit: I find it a bit funny that they have to introduce Peru as being a country. Is this not a widely known fact?
You have to build Rust from source
As someone who actually did out of interest at one point, you'd be surprised how easy this is to do. x.py
is a godsend.
For the rest of your comment, it was immediately invalidated when you said you use Arch. The reality is that more people use Ubuntu, so you should be using Ubuntu too. Don't use apt
? Figure it out yourself :P
You're right that this post is not about the US and is specifically about Hamburg, but many of the comments here seem to imply that this is a wider reaching sentiment. The reality is that many people can't afford to change their vehicle, either due to financial reasons (their SUV or other vehicle is old and not going to get much from an exchange) or due to their lack of time. Going after random people in one city in Germany is not going to have the effect that they're hoping for. It will cause outrage, which might be the goal, but the target will be the activists, not the car manufacturers.
Doesn't Google scrape websites? Isn't that the entire purpose of google.com? If that were illegal, then Google would be the biggest offender. The author should probably look where he's pointing his gun before firing it.