[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1707860893850095.png (388 KB, 934x1000)
388 KB
388 KB PNG
What are you working on, /g/?

Previous thread: >>107494927
>>
died again edition
>>
Every proc macro crate is slightly not what I need but close enough that I try to force it to work but end up getting frustrated and writing it from scratch anyway.
>>
File: unsafe.png (56 KB, 524x370)
56 KB
56 KB PNG
I finally solved a memory corruption problem I struggled with last few days
>>
Gonna try to learn the ins and out emscripten with sdl over the next few days.
>>
i've probably relearned regex 5 times in my life at this point
every time i have a need for it i go learn it i spend a day or two practicing, then i never need it for anything else for like a year or two and then forget all of it, then i eventually run into a problem that i would like to use regex for, rinse and repeat.
>>
>>107543565
... what's there to learn? doesn't it stick in your head like basic multiplication? It's so small....
>>
>>107543577
not really..maybe i just dont spend enough time using it after learning
>>
>>107543565
How can you be a programmer and only need to find something in a text no more than once per year?
>>
>>107543664
learn the basics thoroughly, look the rest up when you need it (how to know when to look it up? guesswork!)
>>
>>107543803
Maybe he is a shader programmer.
>>
Why do I have to import stupid libraries for some lines of code but not for others. Who tf wrotes these stupid rules.
>>
>>107543880
Are you trying to beat the record of the most retarded post one can make?
>>
anyone know how to fix this python script?

https://pastebin.com/dDEQ9Rpn
https://files.catbox.moe/tumhit.zip
>>
gentlemen of DPT,
do you have a preferred twitch streamer/programming content creator you like to watch? I like Tsoding and LaurieWired a lot.
>>
>>107544201
I found this one by accident one day but I've never really watched it.
https://www.youtube.com/playlist?list=PL980gcR1LE3L_RdprUI2GkbyZPY998lLT
>>
>>107544252
sheafification of /g/
>>
>>107544269
Was meant for >>107544201
>>
>>107542891
You know what, uefi is niggerware. I'm done with that shit. Should've never went with it.
>>
>>107544252
>https://www.youtube.com/playlist?list=PL980gcR1LE3L_RdprUI2GkbyZPY998lLT
nice pick, I really like sphaerophoria. his WM playlist is p good as well [https://www.youtube.com/watch?v=TPw73HPEZA0&list=PL980gcR1LE3LIo4XuxUi7x616jUdf5o7H]
>>
Langdev, functions edition
>>
File: file.png (9 KB, 289x186)
9 KB
9 KB PNG
>>107544730
I'm at the stage where I should compiled basic expression to bytecode. But the code generator needs to make decision based on types (need to insert zero-extending and sign-extending instructions for example) and I'm procrastinating on some aspects of the design of the type system.

Wether to have union types like in C if the sum types are going to allow you to choose the exact data represention.
Structs vs tuples, what syntax should they have. Wether (value, value) constructs a tuple or is a comma expression.
Wehter to have anonymous sum types like in Hare.
Should arrays, structs, union and/or sum types be copied when assigned to, or passed by values when making a function call by default? Knowing that you will have the possibility to take and pass references.
>>
File: 2025-12-13_23-09-51.png (263 KB, 1916x1016)
263 KB
263 KB PNG
I am not the author, but some of you may appreciate this 4chan client for emacs.
https://pastebin.com/e0ML0U8s
>>
Learning Rust for work reasons. What seems to be the point of assigning types to variables when the defaults seem good as is? When would I use an f32 over just using defaults? The Rust book says f64 is about as fast as f32 on modern computers but more precise so that's why it's the default. Is there a time I'd purposely use f32s, perhaps when I need hyper optimizations and less precision such as certain gaming examples?
>>
>>107545862
32-bit hardware, or if you want to trade the precision to save 50% memory
>>
>>107545935
When's a good time to do that? I'd like to follow good principles. Or if it doesn't matter much I'll just use defaults. Thanks for response btw, not used to getting answers on /g/
>>
>>107545862
PCSX2 used to use 32 bit floats for emulating on co-processor the PS2 has. I don't know if it's still the case though.
https://forums.pcsx2.net/Thread-blog-Whats-clamping-And-why-do-we-need-it
>>
>>107545943
Use whatever, until it does matter.
>>
>>107545862
>The Rust book says f64 is about as fast as f32 on modern computers
Totally dishonest statement. Floating point instructions are fast but that's not what makes a program fast. You can store half as many doubles in CPU cache as you can floats. It takes twice as long to load a binary file from disk if it's doubles instead of float. You have to upload twice as much data to your GPU if it's double instead of float. What the FUCK is "about as fast". Why do you need extra precision for double in most cases? Does it matter that you are off by 0.00000000123145322346? Isn't that more of an edge case than "hyper optimizations"? This pisses me off immensely.
>>
File: file.png (69 KB, 1163x547)
69 KB
69 KB PNG
>>107546105
Hey I didn't write the book, Steve Klabnik and Carol Nichols did.
>>
hello /g/entlemen, please review my Hello world in C. It's my first time programming, so please be gentle.

#include <stdint.h>

typedef uint64_t u64;

#define STRINGIFY(...) #__VA_ARGS__

void syscall3(u64 op_code, u64 arg1, u64 arg2, u64 arg3)
{
asm(STRINGIFY(mov rax, %[opcode];
mov rdi, %[arg1];
mov rsi, %[arg2];
mov rdx, %[arg3];
syscall;)
:
: [opcode] "r"(op_code), [arg1] "r"(arg1), [arg2] "r"(arg2),
[arg3] "r"(arg3)
: "rax", "rdi", "rsi", "rdx");
}

int main(void)
{
static const char buffer[] = "Hello, world!\n";
syscall3(1, 1, (u64)buffer, sizeof(buffer) - 1);
return 0;
}

__attribute__((naked)) void _start(void)
{
asm(STRINGIFY(
mov rbp, 0;
call main;
mov rdi, rax;
mov rax, 60;
syscall;)
);
}
>>
>>107546159
please note I compiled this with:
cc -O3 -fno-stack-protector -masm=intel -nolibc -nostdlib -o necessary dothenecessary.c
>>
>>107544297
Never mind. I'm going to push through. I can already jump to kernel. It's just that the information like the framebuffer ptr + size, etc is not being properly mapped. Seems like I have to explicitly map the framebuffer despite it being in the general address range I already mapped. Weird.
And currently I'm modifying the existing page table at CR3 but in examples I've referenced, looks like the better way is to setup a proper kernel page table and switch to it into immediately jump to kernel entry address.
>>
>>107545862
Because it doesn't matter. Your floating point registers are 80 bits anyway.
It only makes an impact if you have many floats, and if you have many floats you are probably storing them in typed structs or at least pass them somewhere else that is typed. Few temporary variables stored on stack or even optimized away completely make virtually no difference.(your stack is already cached anyway)
>>
>>107547314
Based. I just won't assign shit then.
>>
>>107547324
Expressions without side effects get optimized away too.
>>
>>107547351
Good to know. I'll keep that in mind moving forward. Thanks.
>>
>>107546125
no wonder rust is bad
>>
>>107546159
I don't know where to start, it just sucks.
>>
What's a good project idea to learn REST api?
>>
>>107548263
Webapp
>>
>>107548263
I really enjoyed Brad Traversy's Node.js API masterclass which used mongo, express, and node on Udemy. It really covers most of the fundamentals and he's a really good teacher. I made my own frontend in Alpine but he provides one for you in react so you don't have to know frontend web dev.

Just know when he gets to pagination, doing pages the way he did isn't efficient and infinite scroll is the modern way to do it.
>>
>>107548426
>mongo
ngmi
>>
>>107548625
Shut up gaywad. He asked for a resource and I gave him one.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.