[ 🏛️ new / 🏖️ lounge ] [ 🔎 Search ] [ 🏠 Home ]

/lounge/ - Lounge

Ultimate Manchildren's Playpen
Name
Option
Subject
Comment
Flag
File
YouTube
Password (For file deletion.)


File: 1734317164856.webm 1.46 MB, 632x482, wrua.webm

 No.95403

what's some alternative method to employ sprite rotation without too much coding? like i can use objects to specific number 1 to 10 as sprite direction but then other object wont work as well like turning directions

 No.95407


 No.95409

>>95407 i said coding.

 No.95410

>>95409
Back to your containment thread schizosperg

 No.95411

>>95410
>sigh
why do you remain so convenient and ever,seeking of free child sex. did you fail to get one after all these? then i guess you need to, go to adress you keep pointing. doctor. your client needs better, whats it, customer service, before your, sugar pills. Fag.

 No.95412

>>95411
You have serious issues, holy shit. Keep spilling the beans, champ.

 No.95416

>>95412 You have serious issues, holy shit. Keep spilling the beans, champ.
> i mean, if you want a friendo, try being actually relatable.
> im not your 5$ punch pillow, bud.
AH FUCK YOU, YOU ARE TOO FUCKING DENSE. TRY GETTING REAL EDUCATION, FAGGOT.

 No.95420

>>95412
i mean i usually start chill but you all yhen had to, be completely hilarious so, seriously, dont wallow so much in your, uh oscars? HEH. try and not be a pdophile. it helps.

man warren sure is correct to be completely bored. or if you all pray, the quick sidesteps is all you all are. hope your gaza show is fun. you even had to come up with youtube...with the anglos

 No.95429

File: 1734365846755.png 125.19 KB, 776x1920, copilot.png

why can't you just use copilot, chatgpt or gemini for these newbie questions?

 No.95431

>>95416
>>95420
You're the one randomly mentioning kids. Fellate a shotgun you autistic nigger.

 No.95442

>>95429 i have, seen, THESE. nice screencap. its just not it. i just... dont wanna see... no wait the sprite is assigned. i use gif. these are obsolete to me. that one that i usually struggle is
where we use angle and ifs and they are just... kinda ugly
or just unoriginal.

and this part can go endless.

>>95431
and you randomly mention mental illness. that goes to children too.

 No.95443

>>95442
Wasn't random at all. You said "why do you remain so convenient and ever,seeking of free child sex". That's fucking unhinged. You need to get killed.

 No.95446

>>95443 it's just an expression, cunt. Now drop it or you can swallow a lot of bullets and defecate them.

 No.95447

>>95446
I am sure it's a popular expression in whatever baby-raping third-world shithole you're from. You should become a stain on the road, ESL faggot. Nothing of value would be lost.

 No.95448

>>95447
>stain
ohwhy hasnt that happened then? surely that would mean something in your self harm no lifers first world hobo community you post your shitty comment in. try better cuz its fucking hilarious. or just retarded.

 No.95449

>>95448
Praying it does soon enough, shitskin slum rat.

 No.95450

>>95449
see? this is why investments is overflowing. how else did slavery happen. surely you saw potential. or those without. no need to act angry, from the internet, you are just like the other guy. at least they named themsleves and its not white. or rrally, who would know what you are, anon. now stick it up or fuck off.

 No.95451

>>95450
You'd look good swinging from a lamppost by a noose made of your entrails, incoherent nonce cockroach.

 No.95452

>>95442
No clue what you're doing with "dx" and "dy". For rotation you need to keep track of the current angle, thrust, turning speed, maximum turning speed and decay. Then you have to apply trigonometric formulas to determine and modify your current angle.

 No.95453

have the direction of the sprite be a vector, multiply it by the rotation matrix when it turns. Apply a sprite to a specific direction or range of directions.

https://mathworld.wolfram.com/RotationMatrix.html

 No.95455

>>95452
He's not doing anything. It's chatgpt slop code.

 No.95464

Copilot made this in less than a minute. Save test.html and script.js in the same directory, then open test.html with your browser.
There are two script.js versions.
I don't know which is more efficient because it's impossible to profile in Javascript but theoretically applying rotation matrix may be more efficient.
It also avoids using the built-in Math.cos() and Math.sin() functions using simplified, less precise implementations for efficiency.
Again can't vouch for that since there's no way to profile that, JavaScript sucks for game dev.

test.html
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Sprite Rotation Demo</title>
	<style>
		#canvas {
			border: 1px solid black;
		}
	</style>
</head>
<body>
	<div>
		<h1>Current Angle: <span id="angle">0</span>°</h1>
		<h2>Current Sprite: <span id="sprite">DOWN</span></h2>
	</div>
	<canvas id="canvas" width="500" height="500"></canvas>
	<script src="script.js"></script>
</body>
</html>


script.js (simple trigonometry version)
const Direction = Object.freeze({
	DOWN: 'DOWN',
	DOWN_LEFT: 'DOWN_LEFT',
	LEFT: 'LEFT',
	UP_LEFT: 'UP_LEFT',
	UP: 'UP',
	UP_RIGHT: 'UP_RIGHT',
	RIGHT: 'RIGHT',
	DOWN_RIGHT: 'DOWN_RIGHT'
});

const spriteDirections = [
	{ angle: 0, sprite: Direction.DOWN },
	{ angle: 45, sprite: Direction.DOWN_LEFT },
	{ angle: 90, sprite: Direction.LEFT },
	{ angle: 135, sprite: Direction.UP_LEFT },
	{ angle: 180, sprite: Direction.UP },
	{ angle: 225, sprite: Direction.UP_RIGHT },
	{ angle: 270, sprite: Direction.RIGHT },
	{ angle: 315, sprite: Direction.DOWN_RIGHT }
];

let cosLUT = [];
let sinLUT = [];
for (let i = 0; i < 360; i++) {
	cosLUT[i] = Math.cos(i * Math.PI / 180);
	sinLUT[i] = Math.sin(i * Math.PI / 180);
}

function fastCos(angle) {
	return cosLUT[Math.floor(angle) % 360];
}

function fastSin(angle) {
	return sinLUT[Math.floor(angle) % 360];
}

let currentAngle = 0;
let thrust = 1;
let turningSpeed = 0;
let maxTurningSpeed = 5;
let decay = 0.95;

document.addEventListener('keydown', (e) => {
	if (e.key === 'ArrowLeft') {
		turningSpeed = Math.max(turningSpeed - thrust, -maxTurningSpeed);
	}
	if (e.key === 'ArrowRight') {
		turningSpeed = Math.min(turningSpeed + thrust, maxTurningSpeed);
	}
});

function getSprite(angle) {
	for (let i = 0; i < spriteDirections.length; i++) {
		if (angle >= spriteDirections[i].angle && angle < spriteDirections[(i + 1) % spriteDirections.length].angle) {
			return spriteDirections[i].sprite;
		}
	}
	return Direction.DOWN;
}

function update() {
	currentAngle += turningSpeed;
	currentAngle = (currentAngle + 360) % 360;
	turningSpeed *= decay;

	document.getElementById('angle').textContent = Math.floor(currentAngle);
	document.getElementById('sprite').textContent = getSprite(currentAngle);

	draw();
	requestAnimationFrame(update);
}

function draw() {
	const canvas = document.getElementById('canvas');
	const ctx = canvas.getContext('2d');
	ctx.clearRect(0, 0, canvas.width, canvas.height);
	
	ctx.save();
	ctx.translate(canvas.width / 2, canvas.height / 2);
	ctx.rotate(currentAngle * Math.PI / 180);
	ctx.fillStyle = 'red';
	ctx.fillRect(-25, -25, 50, 50);
	ctx.restore();
}

update();


script.js (rotation matrix version)
const Direction = Object.freeze({
	DOWN: 'DOWN',
	DOWN_LEFT: 'DOWN_LEFT',
	LEFT: 'LEFT',
	UP_LEFT: 'UP_LEFT',
	UP: 'UP',
	UP_RIGHT: 'UP_RIGHT',
	RIGHT: 'RIGHT',
	DOWN_RIGHT: 'DOWN_RIGHT'
});

const spriteDirections = [
	{ angle: 0, sprite: Direction.DOWN },
	{ angle: 45, sprite: Direction.DOWN_LEFT },
	{ angle: 90, sprite: Direction.LEFT },
	{ angle: 135, sprite: Direction.UP_LEFT },
	{ angle: 180, sprite: Direction.UP },
	{ angle: 225, sprite: Direction.UP_RIGHT },
	{ angle: 270, sprite: Direction.RIGHT },
	{ angle: 315, sprite: Direction.DOWN_RIGHT }
];

let cosLUT = [];
let sinLUT = [];
for (let i = 0; i < 360; i++) {
	cosLUT[i] = Math.cos(i * Math.PI / 180);
	sinLUT[i] = Math.sin(i * Math.PI / 180);
}

function fastCos(angle) {
	return cosLUT[Math.floor(angle) % 360];
}

function fastSin(angle) {
	return sinLUT[Math.floor(angle) % 360];
}

function rotatePoint(x, y, angle) {
	const cosTheta = fastCos(angle);
	const sinTheta = fastSin(angle);

	const xNew = x * cosTheta - y * sinTheta;
	const yNew = x * sinTheta + y * cosTheta;

	return { x: xNew, y: yNew };
}

let currentAngle = 0;
let thrust = 1;
let turningSpeed = 0;
let maxTurningSpeed = 5;
let decay = 0.95;

document.addEventListener('keydown', (e) => {
	if (e.key === 'ArrowLeft') {
		turningSpeed = Math.max(turningSpeed - thrust, -maxTurningSpeed);
	}
	if (e.key === 'ArrowRight') {
		turningSpeed = Math.min(turningSpeed + thrust, maxTurningSpeed);
	}
});

function getSprite(angle) {
	for (let i = 0; i < spriteDirections.length; i++) {
		if (angle >= spriteDirections[i].angle && angle < spriteDirections[(i + 1) % spriteDirections.length].angle) {
			return spriteDirections[i].sprite;
		}
	}
	return Direction.DOWN;
}

function update() {
	currentAngle += turningSpeed;
	currentAngle = (currentAngle + 360) % 360;
	turningSpeed *= decay;

	document.getElementById('angle').textContent = Math.floor(currentAngle);
	document.getElementById('sprite').textContent = getSprite(currentAngle);

	draw();
	requestAnimationFrame(update);
}

function draw() {
	const canvas = document.getElementById('canvas');
	const ctx = canvas.getContext('2d');
	ctx.clearRect(0, 0, canvas.width, canvas.height);
	
	ctx.save();
	ctx.translate(canvas.width / 2, canvas.height / 2);
	
	// Correctly apply the rotation around the center
	ctx.rotate(currentAngle * Math.PI / 180);
	
	ctx.fillStyle = 'red';
	ctx.fillRect(-25, -25, 50, 50);
	ctx.restore();
}

update();

 No.95477

>>95451 yea, you look like a lampost. please squash yourself dirt, reginald fleA-son the fifteenth.

>>95453 tsk, ok i kinda solve the matrix... but i dont know what's or how to "apply". like, sure its angle. but i dont wanna. i use alot of triggers and events.

>>95452 fuck i dont, wanna. the limit for me is. plus, minus, multiplies? no wait, division. i got the einstein-bug, cuz he's legal or something.


>>95464 I only do tululoo. like triggers, objects and shit. i dont even use "onmouse" or "onkeys". lel

 No.95480

>>95477
Choke on your teeth, nigger.

 No.95487

>>95480
i havent even gone out for the suns.

 No.95488


 No.95493

>>95488
Capeshit is for faggots.

 No.95511

>>95493
well. its only batman and i superman i guess. and shazam. thor and vision. anyway its a terribly bad image. like AI. also final fantasy is in cape. so does dragonquest and dtagonball. i dont watch any of those either.

 No.95512

>>95511
>also final fantasy is in cape. so does dragonquest and dtagonball.
Only a fucking retard like you would consider any of those capeshit. The only one that's remotely close is Dragon Ball.

 No.95513

P.S. capeshit means your soyboy superhero comic book shit, not if the character is literally wearing a cape. Hulk is 100% capeshit. ESL retard.

 No.95514

>>95512
Dragon Ball isn't capeshit, it's Wuxia. Chinese martial arts media. Toriyama was a big fan of kung fu movies and he visited hong kong where he got the idea.

 No.95515

HDV stop feeding these word salad spewing retards attention, you're only attracting more of them.

DO NOT FEED THE WILDLIFE.

 No.95516

>>95514
I didn't say it is. Consult the ESL retard from Babyfuckistan for bringing it up in the first place. I only say it's remotely similar because it has constant power level asspull bullshit, death doesn't matter bullshit, etc. (not original Dragon Ball so much as DBZ onward).

 No.95517

>>95516
Why would I want to talk to the ESL retard about anything? He can't even string one solitary sentence together. He's literally a drooling idiot.

People like him destroyed this community, along with those who tolerated their presence.

 No.95518

>>95517
You don't have to, obviously. Just saying I didn't say Dragon Ball is capeshit. I think this website has mostly been spared from the ESL blight. As far as I know, this is the same, weird ESL monkey who has been asking about art tips for years then mostly rejecting them across multiple boards. It's always been a strange faggot, but now I kinda hope it has a miserable death.

 No.95521

File: 1734491354825.jpg 73.28 KB, 495x495, d75.jpg

>>95518
Mhm, I think there's a person on /ic/ who might be the same guy.

https://boards.4chan.org/ic/thread/7219817

This dude. Well, maybe it's a different schizo, I can't tell one set of schizo squiggles from another tbh.

>It's always been a strange faggot, but now I kinda hope it has a miserable death.

I'm so damn sick of these schizos man. I just want to talk about normal shit without feeling like I'm in a zoo. It's not just here either, a lot of other platforms I use have just been inundated with gibbering lunatics.

 No.95522

>>95512 what? it's nihongo. so it's battle royale. also shaman king. also bleach. like, almost a whole arc.
i am agreeing but you are gay nigger.
>>95514 wuxia has no cape. it's gay but not cape.
well, newer ones have more range in fashion
>>95516 fine argument as it kinda kiss ass and done
>>95517 WHAT? and your shitty ass thread group sex porn who got you all groveling at each other kept it? you have Too much imagination on the idea of community. if you want some penis flicking mood, wait for christmas, or lebarans where you start trading saliva today and bang heads tommorow. it's why it's it. or just watch sitcoms where everyone is funny and abandon the gravity of the situation in any realistic setup. as in, go back to facebook, maybe. or friendster.

>>95518 I said, "could you get into details" but you gone planet of apes once i said that. you blow, asswad. take it easy, i didnt ask you "how to draw circle with chalk"
>miserable
>death
and take degree on basic anatomy or just post mortem elementaries, dipshit.
>>95521 cant load the pictures. i dont care. find my thread where its the same shit word by word. then come back and kiss my butt, back being a sperging loonatic.


meanwhile i need windows that floats and rotates cuz webcam just dont cut it...but i guess bill gates didnt do apple and steve jobs didnt program paint even though he arts and only went to quote beatles like its cute and intelligent or even mildly gay so it all fits in, that you are all supposed to stand on podiums and tell everyone to "SUCK IT, IM RICH AND ACCEPT MY COP OUT QUOTES FROM MOVIES I DONT EVEN KNOW EXISTS ON YOUTUBE". and by everyone i mean chairs and tired comittee. as in nurses.

at this point your personality has probably splitted and you are on a level where you cant remember your homework just to look mildly convincing with your "life experience" because theres just, really, NO MORE OIL DOWN THERE, even if mohammed your favorite pardo pal-do-feels says "THERES ALWAYS OIL WHEN THERRES W(O)ILLHAMMED ALI"

 No.95523

>>95522
picture to leverage arguments for simpletons

 No.95525

>>95410
>>95521
you could always just [-] the thread instead of bullying HDV's friend, it exists for a reason

 No.95526

>>95525
I refuse, schizo enabler!

 No.95527

>>95521
Maybe it's the same poster, but what I meant was that I saw a poster asking the same and similar shit on small boards for years. I don't read 4chan much. For a long time, there was some ESL retard asking how to make money off of animation while asking how to git gud at it on various boards, so that's what I am wondering if this is the same. Sadly, I don't have any screenshots to back myself up, but I'm just not the type of person who does that sort of thing.
>>95525
On the flipside, why are you defending some ESL pedophile nigger?

 No.95529

>>95527
>but what I meant was that I saw a poster asking the same and similar shit on small boards for years.

I see. I haven't noticed this but I don't really pay attention to small imageboards anymore, other than this one (mostly for nostalgia in this case).

I wonder if other schizos are streaming in from alt-chans as well. Sometimes I wonder where they spawn from. I know dog is from krautchan but who the fuck knows with people like avid. I think if I had seen someone so massively, flamboyantly gay on old 4chon I would have noticed.

 No.95541

>>95527
I don't think it's this particular /ic/ guy, but yes I know this character from both /ic/ and [redacted art board] where he was making lots of threads asking how to draw a motorcycle. Don't worry, I won't let it get much worse than it already has, I was just feeling generous for nostalgia's sake-but we deserve some modicum of peace in our retirement home don't we? heh

 No.95561

>>95527
>>95541
>modicum
>peace
>git gud
maybe use google translate to reinterpret my sentence see if you can, use multiply on it and see how much letters a match.
and as for expecting modicum of peace. if schizophrenia doesnt get you all, per science or properness in whatever moohammed moo witness you gay for, you should have quitted your tracing art job long time ago so you can engage in this, these, sultry board activity more selfishly. but i guess you just like the dumb way since you are all dumb and simple in the head for actually complicated problems with clear cut path already.

 No.95563

File: 1734566704484.gif 2.96 MB, 320x180, u r brown.gif

>>95561
Learn English.

 No.95575

File: 1734569419228.mp4 504.72 KB, 412x232, ezgif-4-d350c0e174.mp4

>>95563
FIXED

 No.95676


 No.95677

File: 1734676843441.png 225.42 KB, 509x342, BROWN_(2).png

>>95676
Can't really call others dumb when you can't even form a coherent sentence in the primary language of the board, turd-world monkey.

 No.95688

>>95677
retard zogwhale is mad their shitpost didn't get a more detailed reply

if you left the house you'd not care about your online reputation so much

 No.95697

File: 1734700498645.png 771.89 KB, 1024x599, alt-zog.png

>>95688
>retard zogwhale is mad their shitpost didn't get a more detailed reply
>if you left the house you'd not care about your online reputation so much
>t.

 No.95699

>>95677 i just yawned man.
>>95688 how do you know i have a house? hahahahah piss off

 No.95700

>>95688
also you do not have"moredetailed" or whatever its bullshit. you dont know shit. you are on 4chon. you should just kill yourself by complexity alone. then again you sounded like you just swallowed a rat poo

 No.95714

>>95677
man I love spongebob square pants

 No.95717

>>95700
>you should just kill yourself by complexity alone

shut the fuck up man

 No.95741

>>95717
you should. kill. yourself. according. to chatgpt.

 No.95756

>>95741
I'm not going to commit suicide spergoid, youre overestimating grossly your influence on me

 No.95777

>>95756
your acting has been terrible and you didnt get oscar or emy in accordance so i might as well be your grandparents who ve lived with you since you placed that soda can under their brakes.

 No.95779

>>95777
wordsalad

 No.95819

https://zzzchan.xyz/b/thread/229358.html
Found the monkey pedophile's crossposting spam lol

 No.95820

>>95779 try google translate to Plebenese. it passes.
>>95819 this is the third time now. you should give up yourself...to your dad i mean. cuz he's a police. right? yea that sounds wrong. why are you only wrong, retarded, or just completely undetailed.

 No.95821

>>95688
>>95700

HA!, i got it! SO YOU ADMIT YOU DIDNT DETAIL SHIT! HAH! moron! now detail it then if you actually Detail! HAH! EAT THAT, Sauron!

 No.95822

>>95820
Even an autistic nigger understands English better than you do. That's hilarious. Love the fact posters from multiple websites shit on your stupidity.

 No.95826

>>95819
Never even heard of zzzchan before.

 No.95827

>>95826
If you're a different person from the ESL scribble-monkey ITT, then don't worry about it.

 No.95831

File: 1734755332544.png 747.09 KB, 1024x724, fren_autonomous_zone.png

>>95827
They actually have quite a few posts surprisingly.

 No.95841

>>95822 you dont even consider nigger other than autistic.
>shit
clearly you didnt got to a toilet so maybe slim down alot, demeo.
>hilarious
oh stop it, retardo

 No.95845

>>95822
>love
of course. given little protofolio of magnifence actually influencing correctness in anything related here, i d say it is easier for you to just project somewhat retarded fantasy of another's complications despite your lack of a proper detailed, functioning brain, and then have at it that you somehow exacted success upon yourself. i mean, these are just insults. thereve been no details written in it either. please swallow the largest cock theres ever been so maybe your brain will squash a little more and give yourself more room to actually think in the fluid since your solid material has no purpose either.

 No.95848

>>95841
>>95845
>blablabla
You clearly didn't pay attention in Indonesian sharia faggot class, so I'm not going to waste my time deciphering your retarded brown scribbles. Learn English or kill yourself, preferably the latter.

 No.95858

>>95848
Whats a sharia? Are you some, uh, dates? Kurma? Bad valentine? That explains a lot.
This is boring. Please hug a c4 maybe. It's my only suggestion.

 No.95861

>>95858
>incoherent monkey shrieking
Your country should be bombed to dust and a parking lot should be paved above a mass grave with your remains in it.

 No.95863

>>95861
it's really not that deep, why are so invested and subsequently angered this much by posts here?

 No.95865

>>95863
It's not normal to casually mention fucking kids in a White nation. I'm sure that comes as a shock to a shitskin pedophile like you. You should be tortured to death.

 No.95889

>>95865
where was that brought up?

 No.95892

>>95889
Here: >>95411
Wasn't even originally responding to me, just thought it sounded deranged as sin.

 No.95894

>>95892
I see, that poster seems to have mental health problems, or is trolling, either way, is wouldnt respond, lest it spur on more posts of the same nature, people crave attention after all

 No.95895

and I understand the irony of my post bringing attention to it

 No.96236

File: 1735189937639.png 153.51 KB, 600x2291, rust-language-design.png

This is why I can only really tolerate C and maybe Python from a "recreational" standpoint due to their simple designs. PHP, Javascript and SQL when I'm forced to (work, business shit, vichan shit, etc. ex. https://sushigirl.us/yakuza/res/1198.html ).

Unsurprisingly Fredrick is a big fan of Rust. Guess masochism is one of his many weird fetishes:

https://x.com/fr_brennan/status/1839298997028286869
https://x.com/fr_brennan/status/1572214562211897346
https://x.com/fr_brennan/status/1567949307822882816
https://x.com/fr_brennan/status/1480879645704740872

It's not just that Fred's a bad programmer, the average Rust code by Rust evangelists does look like that. Unreadable slop that only the author could vaguely remember why he wrote it that way. Rust is possibly even worse than "functional languages" (e.g. Lisp, Scheme, Haskell). Ron "Chodemonkey" Watkins is a Haskell zealot who desperately tried to get his 8chan team -- including Fredrick Brennan, Joshua Moon, and his dad's "NT Technology" small assortment developers of japs and filipinos -- to migrate away from PHP to Haskell. Of course, that didn't work out. The story of Josh groaning over Ron constantly trying to push him to migrate to Haskell for working on vichan/infinity stuff is pretty funny. Ironically Josh has in recent years been trying to rewrite the Kiwifarms backend in Rust away from PHP ( https://kiwifarms.st/threads/state-of-the-union-2022.109328/ ). Unsurprisingly there's been little progress. He still doesn't realize that PHP is actually fine. His long-held practice of relying on web frameworks and third-party libraries (which he really doesn't need as they ultimately only bloat up the software like crazy, drive up server costs and make development/maintenance itself a bigger pain) and his insistence on slow, shitty object-oriented programming (instead of "old-school" procedural programming) are the bottlenecks. I'm guessing he still foolishly subscribes to the belief that "modern is better," assuming that because object-oriented design is considered modern, it must be superior to procedural programming.

 No.96265

>>96236
dont care

 No.96358

>>96236
V cool but not wht I'm looking for since it s not tululoo

 No.96359

>>96236
I feel like I haven't heard of Haskell, Lisp or any of that sh*t since the late 90s/early 2000s. Are they still even in use anymore? Feels like Python and Rust have taken everything over-and I have never heard anything positive about the latter tbh

 No.96421

>>96359
Haskell and functional programming in general still have thier cadre of obsessive fanboys. Usually people really into math.

For all intents and purposes they're toy languages.

 No.96424

>>96359
>Feels like Python and Rust have taken everything over-and I have never heard anything positive about the latter tbh

Rust is popular because certain kinds of people find memory management in C++ scary. From what I understand from a rather brief dive into it years ago rust is essentially C++ with a whole bunch of you-can't-do-that's built in for "memory safety" and a garbage collector constantly running to ensure that every program written in the language runs like absolute crap (much like java). A soy language if there ever was one.

The kind of people who enjoy it are the same kind of people who constantly tell you it's very very important to download security updates for your computer, but can't explain why.

 No.96553

>>96424
>rust is essentially C++ with a whole bunch of you-can't-do-that's built in for "memory safety" and a garbage collector constantly running to ensure that every program written in the language runs like absolute crap (much like java).
Rust does not have a garbage collector, its runtime performance is equal to C and C++.

I'd actually be happy if companies switched to Rust away from JavaScript (Node/Electron), which is what they're using now and turning everything into complete shit. It's the reason why basic applications today take at least hundreds of MBs of RAM and load more slowly instead of a few MBs that their equivalents in the late 90s and 2000s took. They're not going to switch to Rust though, because Rust lacks an established GUI software framework to Node and Electron, corporations do not like to take such risks. The Rust faggots are instead too busy antagonizing C and C++ developers, telling them that they must all be replaced, that all their programs they worked hard on are "unsafe" and therefore they must all be "re-written in Rust" (which would have absolutely no perceivable benefit to the users of these programs unlike the slow shitty bloated Node/Electron apps).

The problem with Rust and C++ is their compilation times. Rust has something called "monomorphization of generics", and C++ has something called "templatization of generics." These fundamental features alone cause compilation of Rust or C++ source code to take several times longer to compile than equivalent C source code. And this has been getting exponentially worse for every single new C++ version released (e.g. C++98, C++11, C++17, C++ 23, etc.), specifically their standard libraries, that compilers have to support. If you're an employee of a corporation than yeah you probably wouldn't give a shit because your employer is paying to you sit around twiddle your thumbs while you wait for your C++ source code to compile. This is terrible for productivity. Rust is apparently even worse than C++ with this. This is why I don't use C++ for personal projects, I'm not going to buy the latest i9-12900K or whatever every time just so C++ compilation is barely tolerable. Did you know that compilation of the "Chromium" web browser (written in C++) is frequently used as a CPU benchmark in CPU reviews, because it takes several hours to compile that pile of shit? Whereas the Linux kernel (written in C) takes at most half an hour with the same CPUs? To date Chromium has about 35M lines of code whereas Linux has about 30M lines of code.

The problem with Rust alone is it encourages the programmer to be "clever" with their solutions. This feature is called the "expressiveness" of the language, and that is NOT a good thing in practice, and I will die on that hill no matter how much those academic and math dweebs over at YCombinator, Reddit, lainchan.org and so on jerk off over it. Programmers, especially by "clever" academics and poindexters, have a tendency to produce source code as being byzantine puzzles instead of legible blueprints of a program.

Here's an example C++ code demonstrating a common multithreading situation where you try to safely increase a shared counter by two threads, using a lock to ensure they don't interfere with each other, and then printing the final count.

#include <iostream>
#include <memory>
#include <thread>
#include <mutex>

void increment(std::shared_ptr<int> counter, std::shared_ptr<std::mutex> mtx)
{
	for (int i = 0; i < 1000; ++i) {
		std::lock_guard<std::mutex> lock(*mtx);
		(*counter)++;
	}
}

int main()
{
	auto counter = std::make_shared<int>(0);
	auto mtx = std::make_shared<std::mutex>();

	std::thread t1(increment, counter, mtx);
	std::thread t2(increment, counter, mtx);
	t1.join();
	t2.join();

	std::cout << *counter << std::endl; // No data race
}


now here is the equivalent rust version that is touted by "rustaceans":

use std::sync::{Arc, Mutex};
use std::thread;

fn main() {
	let counter = Arc::new(Mutex::new(0));

	let handles: Vec<_> = (0..2).map(|_| {
		let counter = Arc::clone(&counter);
		thread::spawn(move || {
			for _ in 0..1000 {
				let mut num = counter.lock().unwrap();
				*num += 1;
			}
		})
	}).collect();

	for handle in handles {
		handle.join().unwrap();
	}

	println!("{}", *counter.lock().unwrap()); // No data race
}


Even if you don't know anything about synchronization in multithreading, which is done to prevent data races or deadlocks, I would argue the C++ code is far more legible as you can read it line by line and parse what each line does (especially if you ask Copilot or Chatgpt to help you out) more quickly than the Rust code. To me, the C++ code is straightforward procedural code where one line usually only does one thing, whereas the Rust code is written by a know-it-all dweeb who should be punched in the fucking face for thinking he's clever by using a functional style with map functions, iterators and closures all crammed into a few lines, which might look fancy and more "mathematician-like", but is a major pain in the ass to parse and debug.

>>96359
>Feels like Python and Rust have taken everything over
Rust has only taken over social media discussions by evangelists (as well as Github Issues sections of C/C++ open source projects pestering maintainers and contributors telling them they should rewrite their C/C++ projects in Rust), but there are still hardly any jobs for it, because again, there is no real "NodeJS" or "Electron" GUI framework competitor for Rust. Rust is still just for console-centric stuff. There is a GUI framework called "Tauri" for Rust that is touted to be an Electron competitor, but it is not given enough attention by the stupid Rust zealots, which it desperately needs if these Rust zealots actually want Rust to take over the industry. No, they'd rather start drama and police others over gender pronouns. The C programming culture has less of that political correctness bullshit, it's mostly older guys and electrical engineers who still prefer to use C.

 No.96949

those are abit too much code.

also how to make reflection/inversion(of line(form)) more correctly to its base

 No.96951

>>96949
Why is everything you post upside down?

 No.96953

>>96951
He's posting from the southern hemisphere I think.



[Return] [Catalog] [Top][Post a Reply]
Delete Post [ ]