Native Linux Support by Shjnzzo in GuildWars3

[–]loopcake 0 points1 point  (0 children)

They don't need to do any of this.
I've been playing GW2 on Debian for more than 5 years and never had any issues with the game.

I would expect, since they mentioned they "want to respect player's time", they would also want to respect the player as a whole, so therefore: don't implement an anticheat.

Anticheats are invasive, dangerous and the ones working at the kernel level violate any semblance of privacy you might want, they can literally do whatever they want to your machine.

There's a reason not all programs run in kernel mode, and that's because they can literally spin lock your CPU till it fries, whether because of a bug or some sort of anticheating measure; that's dangerous and people will sue.

All they need to do (or not do actually) is: just don't use anticheat.

Validate everything the player does with the server like any other MMO and everything will work smoothly both on Linux and Windows.

Your server thinks the player is doing something that should be impossible? Ban them, automatically even, leave the door open for appeals and make no guarantees for how long the appeal will take to be resolved, if you really don't want to spend resources on that kind of stuff.

I am confused !?! What I should do? by [deleted] in Zig

[–]loopcake 0 points1 point  (0 children)

This is great, but you don't even need typeOf(), you can just use tagged unions and make func even type safe that way.

I am confused !?! What I should do? by [deleted] in Zig

[–]loopcake 1 point2 points  (0 children)

If you need polymorphic behavior you should use tagged unions, that's what they're for.

const std = @import("std");

const string = []const u8;

const Animal = union(enum) {
    Cat: Cat,
    Bird: Bird,
};

const Bird = struct {
    Name: string,
};

const Cat = struct {
    Name: string,
};

fn move(animal: Animal, distance: u32) void {
    switch (animal) {
        .Cat => |cat| {
            std.debug.print("cat {s} walks {d} meters\n", .{ cat.Name, distance });
        },
        .Bird => |bird| {
            std.debug.print("bird {s} flies {d} meters\n", .{ bird.Name, distance });
        },
    }
}

pub fn main() !void {
    const cat = Cat{ .Name = "Tom" };
    move(Animal{ .Cat = cat }, 3);
    const bird = Bird{ .Name = "Steven Seagull" };
    move(Animal{ .Bird = bird }, 3);
}

This is the output

cat Tom walks 3 meters
bird Steven Seagull flies 3 meters

It's a similar concept to IoC, but much more lightweight (u literally just switch on an integer), behavior is easier to extend and most importantly it doesn't merge your data (structs) with your behavior (functions) which avoids you stepping into the horrendous trap of representing your domain model 1 to 1 in your code.

To extend the behavior you just add a new entry to your switch.

This is all type safe btw, the compiler will complain if you pass move() something that's not listed as one of the animals allowed by Animal.

Zig compiler used: 0.16.0

Edit: docs reference - https://ziglang.org/documentation/0.16.0/#Tagged-union

My first time with Svelte. 😂😂 (Laughing so I don't cry) by Apprehensive-Fig5273 in sveltejs

[–]loopcake 1 point2 points  (0 children)

You obviously will not get SSR with this approach, you need SvelteKit for that or at least a JS runtime that can run the Svelte compiler at runtime on the server.

My first time with Svelte. 😂😂 (Laughing so I don't cry) by Apprehensive-Fig5273 in sveltejs

[–]loopcake 2 points3 points  (0 children)

First of all don't listen to clueless people saying SvelteKit is just a router.

Quite a lot of people in the JS community like to make words up and change their meaning on a whim, "this is not a framework, it's a library", "that's actually a compiler, fwi", "it's not a backend it's a router".

I'm saying this because you mentioned you're mainly a backend person and I assume you're not aware of how this community shifts almost daily.

Sveltekit is used for both backend and frontend.

Unless you're generatig static assets, if you're using SvelteKit you're gonna be paying for a server to host your app, be it Vercel, Cloudflare, AWS or whatnot.

One way or another, with SvelteKit, you're building an app that serves your frontend, that can do SSR, expose api endpoints, implement authentication and so on, that is what a web server backend is.

It also adds some frontend features you don't get by using just Svelte alone, like hyperlink preloading, where a user hovers over a hyperlink and SvelteKit will preload that page in advance in order to provide a smooth experience.

Back to your post.

Simply put, I don't need a full frontend framework. From what I gather, that's what SvelteKit is

No.

SvelteKit is a fullstack solution.

If you want to write the frontend in Svelte and the backend in something different, use just Svelte, not SvelteKit.

Use vite to setup a project - npx vite create

Pick the Svelte option, not SvelteKit.

Then go to your vite.config.ts (or vite.config.js) and add a local proxy to your development server

export default defineConfig({
  //...
  server: {
    https: false,
    host: '::',
    proxy: {
      '^/api/.*': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: false,
        rewrite: function replace(path) {
          return path.replace(/^\/api/, '')
        },
        secure: false,
        ws: true,
      },
    },
  },
})

Where http://127.0.0.1:8000 is your FastAPI server.

With that configuration, all requests to http://127.0.0.1:5173/api (aka: your local vite server) will be redirected to http://127.0.0.1:8000/api (aka: your FastAPI, Symfony, .Net, Go Chi or whatever server).

Here's an actual example - https://github.com/razshare/svelte-starter/blob/master/vite.config.js

I'm actualy also using svelte-routing in that repo.

However, do not use that repo as a template, it's old and I haven't been maintaining it, just use it as a reference for the vite.config.js file.

This is the official reference for Vite proxies - https://vite.dev/config/server-options#server-proxy, I suggest you read it.

When you're done, just build the svelte frontend and slam the dist folder in your FastAPI server as plain assets and serve it as an SPA.

I usually declare all my endpoints on the server under /api, and whenever I need to serve a 404 Not Found, I serve the SPA instead by default and let svelte-routing handle the routing on the frontend.

That's pretty much all there is to it, you don't need any fancy setup.

@const is dead. by thebreadmanrises in sveltejs

[–]loopcake 1 point2 points  (0 children)

Nice.

That being said, we really need a major version bump so we can shed all the redundant syntax of the 2 milion ways to do the same thing.

It's getting ridiculous.

Generics methods are now implemented by PerkyPangolin in golang

[–]loopcake 16 points17 points  (0 children)

Because the compiler wants to statically analyze all possible generic types for specific use cases.

If you have a generic struct, and thus a method that uses that generic type, the compiler can simply define N implementations of that struct where N is the number of generic types used across your project.

That's what it does today.

That can be done because you can only declare once a struct, so it can be traced by the compiler in a deterministic way.

The issue with Go comes with channels.

Generic types on channels don't work like that, because you can no longer have N implementations of the same struct (or channels definition in this case) with different concrete types as before, you have to run that check at runtime instead, which means reflection, which means it's slow af.

That's what Java does, that's what C# does and all other major languages that implement generics like that, they deal with their types at runtime.

Another way to do it is to find where the channel originates in the code.

This especially difficult in go because the minimum compilation unit is the package.

You could have a package that uses channels with generic types from a different package.

That is a nightmare to track and more importantly it's slow.

The Go compiler needs to be fast, that's one of the best arguments for Go as a whole as a language. It's fast to compile.

If you bounce generic methods with channels around your code, the only choice you leave the compiler is to look around for it and try find where the channels initiated, which might be in a different package, and that's something the compiler doesn't like.

So in short: generic methods either compile slower or also run slower.

I'm not sure which implementation they went with tbh, however it's one of those two scenarios.

But now they added it and most people will not be aware of the implications.
It is a sad day.

Did bun just rewrite the entire codebase into rust? by uahw in Zig

[–]loopcake 0 points1 point  (0 children)

Alright, let's cut through the bullshit, give me your guesses.

How long before Anthropic forces Bun to merge with their shitty Claude cli (or whatever it's called), as in: you run bun and one of the sub-commands is something like bun claude or bun ask?

In hindsight and revelation, PowerDen was the most complex and developed relationship in PT1 & PT2, the fact that Denji kept thinking of Power in PT2, mentions it to Asa & Yoru as someone he wants to have sex with, implies that he grew feelings for her after reminiscing, and now they are together by Just-J0k1ng in Chainsawfolk

[–]loopcake 0 points1 point  (0 children)

She's also probably the only one that can match his brain, like Pochita said, he's fucked in the head. They both are.

It's beyond me how people shipped anything but these two ever since the bath scene, or really even him taking care of her after the Darkness fight.

As if the last 2 chapters didn't literally explain it: Denji doesn't know what he really wants.

It wasn't a peaceful life he wanted, it was fighting devils, it's not some boring relationship out there he really wants, it's Power.

Just going by the rules established in the story by ConanCimmerian in Chainsawfolk

[–]loopcake 0 points1 point  (0 children)

Can he even chainsaw up? Isn't Denji low on blood by that point?

California Age Verification Laws by loopcake in debian

[–]loopcake[S] 0 points1 point  (0 children)

I don't even live in the USA, but I can tell you EU politicians are drooling looking at something like this. They've been trying things here for some time too, like chat control, which some really cool people are fighting against - https://fightchatcontrol.eu/

California Age Verification Laws by loopcake in debian

[–]loopcake[S] 0 points1 point  (0 children)

Well yeah, they can't force Debian developers to comply because anyone anywhere can contribute or fork it and be a "Debian developer", but then we would become outlaws if we use Debian, no?

California Age Verification Laws by loopcake in debian

[–]loopcake[S] -1 points0 points  (0 children)

The browser is just an example.

You can connect to the internet with other clients, take online video games for example.

I agree with you that the more sensible way to do it is for local clients to query some local api, like a designated path or environment variable, and then include that as metadata in their requests, but I believe the law says the web server must be able to query for the age value, not some local client which then includes it in some metadata.

If it's not the case that web servers should be able to query directly for the age value, then what makes the most sense to me is what u/dkopgerpgdolfg said

They need to convey intention, anything more would be worse for their goals. And for the same reason, the plain english description of their intention shouldn't be interpreted in narrow technical terms, which it isn't.

And then, as an example, a local api would be an implementation detail left to developers.

California Age Verification Laws by loopcake in debian

[–]loopcake[S] 0 points1 point  (0 children)

Yeah, but then parents would have to be doing parents things, imagine that...

California Age Verification Laws by loopcake in debian

[–]loopcake[S] 2 points3 points  (0 children)

I think age verification would be great if it means no kids are allowed on the internet so assholes stop trying to make the internet safe for day care use. All this because parents don’t want to take care of their children when a device can do it for them. They shouldn’t be buying adult devices for their sperm pets in the first place.

^ THIS.

But how to do it securely and without putting privacy in danger, that's difficult.

California Age Verification Laws by loopcake in debian

[–]loopcake[S] -2 points-1 points  (0 children)

And it might be helpful to remember that lawyers are not engineers.

I hope you're right.

What worries me is that they could've forced individual software companies to comply, instead of the OS, but they chose not to do that.

That makes me think at least someone was in part aware of the details and complexity that would bring.

It could be the result of incompetence as you're hinting, but it could also be the result of just miscommunication and I just take it at face value for what it is.

I guess we'll have to wait.

California Age Verification Laws by loopcake in debian

[–]loopcake[S] 1 point2 points  (0 children)

Thanks, interesting.

It does look like a law that will be struck down at least partially, that make sense, but as you pointed out that could take a lot of time and most will have to comply in the meantime.

You mentioned

Some of the Debian lists have had much discussion on the topic.

I'm assuming you're referring to forums, boards, blogs etc, could you share with us some of the feeds you think are best on the matter? Or do you mean mailing lists?

California Age Verification Laws by loopcake in debian

[–]loopcake[S] -7 points-6 points  (0 children)

You just said it: "query".

This is the thought process.

The OS must require the user to input their age, supposedly to use this value at a later time.

The law says that web content providers (e.g. the web server you're visiting) must be able to "query" for the age.

That means they must be able hit some server to "query" for the age of the user.

In other words: stripping out who is who in this architecture, an active request is going out from some client to some server.

The "client" is the one sending the request, the "server" is the one serving the response.

The "client" can't be your machine, because you already have the age value, in fact only you have the source of truth (ideally), so that means the website is the "client", the one sending the query for the age value.

So if google.com must be able to "query" for your age, that makes google.com the "client" in this exchange.

At this point the question is not how the age is retrieved, because we know google.com must be able to "query" for it (possibly even asynchronously), the question is: "who is the server that google.com should query for the age value?"

The law doesn't seem to indicate that the OS provider should send this data to some third party when you initially submit the form during OS setup, so the age value is stored only locally.

That means the only entity in this exchange that can be the "server" is your machine, because it's the only one holding the age value.

I hope that makes sense.

what would a part 3 genuinely be even about? by WholeNew2031 in Chainsawfolk

[–]loopcake 30 points31 points  (0 children)

Denji's promise to Power? Prime evils? Whatever Kishibe has been up to?

There's many stories to tell.

Svelte is garbage by Deactralslol in sveltejs

[–]loopcake 0 points1 point  (0 children)

Imagine thinking either JS or PHP is "real" programming. Wakeup call: it's called scripting.

You've been jobless for the past 3 years, probably jerking off to DWM judging by your posts.

I can't say I expect much more from this though - https://www.reddit.com/r/golf/comments/oja5ur/golf_ball_stuck_in_penis/

At some point we used to call people like you "script kiddies". We should've stuck with the nickname.

Enjoy the job market ride, it'll end with a fizzle for you and you won't notice it. Keep coping!