no but seriously, stop using Turbo C. installing mingw64 or w64-devkit might be a pain on Windows but it's well worth it to work with an actively maintained C/++ toolchain instead of an abandoned program that doesn't conform to standard C from 1874 only used by pajeet teachers to churn degrees for H1B slaves. it's a pain but well worth it in the long run anon c:
>Rust is just as unbloated as C if you strip out stdlib, use zero third party packages and wrap all system calls in assembly
You know what? Fine. But no real Rust project is like that
It's true, just like most real-world C projects use libc and third-party libs, real-world Rust projects use the Rust standard library and third-party libs. The point is that the language isn't inherently "bloated", as opposed to languages with runtime like Go or Nim.
>It's true, just like most real-world C projects use libc and third-party libs
Very few of them. Try compiling a gtk app in rust and you will see that gtk-rs depends on at least 50 other packages. Rust (or cargo really) is the node js of systems languages >t. 2gb node_modules folder
>100% Rust >is actually x86 assembly
I'm so tired of people blatantly lying. Like it would even be okay if he said 90% Rust. Saying something is purely written in a portable language usually implies it's portable. Writing it in a platform specific assembly seems to defeat a major point of using the language in the first place. Why even use Rust at this point and not just a normal assembler, what are you gaining.
Inline assembly is a part of the language tho, the same goes to inline assembly in C/C++. > Saying something is purely written in a portable language usually implies it's portable
No it's not, most code isn't portable between OSes, for example.
>No it's not, most code isn't portable between OSes, for example.
Most of the Rust projects I've used are written by people using Linux and not even thinking about other systems yet they build and work just fine on systems that don't even have official builds of rustc.
>pointers are too hard!!!!!
They're not easier in unsafe Rust
What is easier is avoiding undefined behavior that makes the compiler fuck up your entire program
>theres no undefined behavior in rust
i hope youre meming
3 weeks ago
Anonymous
No? For example when you're using normal libs that are written by humans not by monkeys, results and options practically forcing you to check for every possible outcome. You can ignore it but only explicitly. So yeah, unless you're dumb for some reason, it's hard to get UB. Not impossible but I can't quickly tell how to get it without prewarnings.
3 weeks ago
Anonymous
I said: >easier to avoid
You read it as: >there is none
Now go back to kindergarten and learn to read
That's not the reason. I am using rust because I am making an image editor and I don't want to install trilliion gorillion packages to get most common formats (including webp) supported. Even then, I would have made it in C++
>Because UNIX itself is written in C, it's more efficient to use C libraries (even with ffi) as opposed to asm for syscalls.
No it's not, C is compiled before use to machine code, and the OS doesn't care which language the machine code is compiled from. You can get the same machine code from C or from Rust, there are nothing C-specific.
>rust is just as good/better!, see! >unsafe code, every time
anon, you can't promote your language on the grounds of safety when all your examples of it working well are when you turn the safety off
really, the fact that you can turn it off really just defeats the purpose, i mean, if you can turn it off, how are you supposed to know if something made using rust actually safe or not? it makes "made using rust" meaningless, you shot yourself in the foot
Actually I've been writing some asm by hand recently and I'm struck at how inefficient my asm feels. I can't interleave computation paths to ease data dependency, I must be missing the most efficient op compositions, I can't keep all the MMX/SSE/AVX ops in my mind to use them where it's appropriate, can't inline a function in every call place with const propagation and path elimination. After a decade of looking at -O3-generated asm to spot missed optimization opportunities I can't imagine a human being being able to produce a more efficient asm code than a compiler. I was the case back in the 80s and 90s, when the CPUs were simple and the compiler were dumb, but it's not the case anymore.
So compilers are more efficient than humans at asm
How does a human make a compiler good at something the human is not?
How do you make a 100% compiler
Modern computers are not really designed for humans to work with directly. For example instruction orders, instruction cache, etc effect performance and the way to do that efficiently us to do algorithms in your head. It's better to let a computer do that. That's how it works with cpus. The cpus themselves are designed for how they are most commonly used.
>#![no_std]
That also means you can't really use third party libraries either. That's why rust us a meme. The only way to make it minimal is to not use rust. Zig doesn't have this problem and both use llvm. Even C can use the standard library without sacrificing size (if you use musl).
>Invent a shitty language >Market that language as ~~*"memory """safe""""*~~ >Make the memory """safe""" features so limiting and circuitous so that nobody uses them and instead writes everything in unsafe blocks >Become so obsessed with gender and CoCs that your entire development team "forgets" to check for memory leaks >Create a language "standard" which isn't a real standard at all, just a feature freeze for the singular reference implementation in the world >Formalize the memory leaks in the ~~*"memory """safe""""*~~ language singular reference implementation >Never create a formal language standard >Never create a memory model
How the hell has the technology industry allowed this cartoonishly horrible language to proliferate itself? There has to be some kind of CIA or at least NGO cooperation at play here.
To be fair, I never saw shit like on that screenshot in real programs. Usually on some sort of embedded which is rare for Rust.
What is notable tho is that you can create easy memory leaks with shit like boxes without using unsafe. But you can do shit like that only deliberately.
To be fair I made a videogame for some embedded system as a school project and using C with -ffreestanding and -nostdlib the executables become incredibly small
damn
that's huge
here's snake written in C++17, that doesn't even require an operating system as is 5x smaller
https://github.com/adam10603/mbr_snake
> no ELF header
> no terminfo setup
> no escape codes to color output
Ofc it's smaller.
> uses printf
That's 20kb minimum.
>what is dynamic linking
cope
Something that isn't specific to C? You can dynamically load libraries in rust too
>mbr
that is a totally different thing retard
>500 lines
lmao
https://basedbin.fly.dev/p/2JxFmi.c
>system("cls");
i was hoping you guys would enjoy that
no but seriously, stop using Turbo C. installing mingw64 or w64-devkit might be a pain on Windows but it's well worth it to work with an actively maintained C/++ toolchain instead of an abandoned program that doesn't conform to standard C from 1874 only used by pajeet teachers to churn degrees for H1B slaves. it's a pain but well worth it in the long run anon c:
not my code
i just found the most garbage pajeet C tutorial implementation of snake online and pasted it
>#include <conio.h>
>system("cls");
do not redeem the code sir you are bhenchod bloody bastard sir
Unsurprisingly it uses assembly to wrap linux system calls and then uses that. C can also do it, nothing special here
That's the point, Rust is as (un)bloated as C.
>Rust is just as unbloated as C if you strip out stdlib, use zero third party packages and wrap all system calls in assembly
You know what? Fine. But no real Rust project is like that
It's true, just like most real-world C projects use libc and third-party libs, real-world Rust projects use the Rust standard library and third-party libs. The point is that the language isn't inherently "bloated", as opposed to languages with runtime like Go or Nim.
>It's true, just like most real-world C projects use libc and third-party libs
Very few of them. Try compiling a gtk app in rust and you will see that gtk-rs depends on at least 50 other packages. Rust (or cargo really) is the node js of systems languages
>t. 2gb node_modules folder
Bloat has been a meaningless buzzword for 2 decades
Meditate on your path in life
good mroning sir!
>mroning
*facepalm*
>100% Rust
>is actually x86 assembly
I'm so tired of people blatantly lying. Like it would even be okay if he said 90% Rust. Saying something is purely written in a portable language usually implies it's portable. Writing it in a platform specific assembly seems to defeat a major point of using the language in the first place. Why even use Rust at this point and not just a normal assembler, what are you gaining.
Inline assembly is a part of the language tho, the same goes to inline assembly in C/C++.
> Saying something is purely written in a portable language usually implies it's portable
No it's not, most code isn't portable between OSes, for example.
>No it's not, most code isn't portable between OSes, for example.
Most of the Rust projects I've used are written by people using Linux and not even thinking about other systems yet they build and work just fine on systems that don't even have official builds of rustc.
It is not majority assembly, but assembly is the glue which makes it possible
Because UNIX itself is written in C, it's more efficient to use C libraries (even with ffi) as opposed to asm for syscalls.
I'm sure the rustlets can call fork() and exec() syscalls from asm :^)
The binary size would be so small too!
Why not write it in C then? This makes no sense.
Because C is super unsafe!!!!! And pointers are too hard!!!!!
>pointers are too hard!!!!!
They're not easier in unsafe Rust
What is easier is avoiding undefined behavior that makes the compiler fuck up your entire program
>theres no undefined behavior in rust
i hope youre meming
No? For example when you're using normal libs that are written by humans not by monkeys, results and options practically forcing you to check for every possible outcome. You can ignore it but only explicitly. So yeah, unless you're dumb for some reason, it's hard to get UB. Not impossible but I can't quickly tell how to get it without prewarnings.
I said:
>easier to avoid
You read it as:
>there is none
Now go back to kindergarten and learn to read
Nigga, your whole main function is marked unsafe. It's a dumb gimmick script. Does it even need pointers?
That's not the reason. I am using rust because I am making an image editor and I don't want to install trilliion gorillion packages to get most common formats (including webp) supported. Even then, I would have made it in C++
>Because UNIX itself is written in C, it's more efficient to use C libraries (even with ffi) as opposed to asm for syscalls.
No it's not, C is compiled before use to machine code, and the OS doesn't care which language the machine code is compiled from. You can get the same machine code from C or from Rust, there are nothing C-specific.
Just what I have always needed. This changes everything.
>unsafe
Or, as I call it, "C-tier safe".
>rust is just as good/better!, see!
>unsafe code, every time
anon, you can't promote your language on the grounds of safety when all your examples of it working well are when you turn the safety off
really, the fact that you can turn it off really just defeats the purpose, i mean, if you can turn it off, how are you supposed to know if something made using rust actually safe or not? it makes "made using rust" meaningless, you shot yourself in the foot
Rust safety is just like gun safety. It only works when you turn it off.
Yeah it's better to have no safety on a gun and keep it loaded with a finger on the trigger and the barrel pointed towards someone's face at all times
this is what rustfags actually believe
>rustfags
there is only one person who makes another rust thread every day
how much do they pay him
An HRT injection per day.
Unsafe has been a meaningless buzzword for 2 weeks
Meditate on your path in life
Wrong board
>2760 bytes
ive written snake in js smaller than that
Yeah, and it only needs Chrome to run, which is 4Gb in RAM and 200Mb on disk.
Which you have open right now anyway.
wrong i dont use chrome
You naggers, if you want zero bloat why not FUCKING WRITE IN ASM
What if I want near-asm level of bloat with all the comfort of a modern high-level language?
Comfort is bloat
USE ASM
Actually I've been writing some asm by hand recently and I'm struck at how inefficient my asm feels. I can't interleave computation paths to ease data dependency, I must be missing the most efficient op compositions, I can't keep all the MMX/SSE/AVX ops in my mind to use them where it's appropriate, can't inline a function in every call place with const propagation and path elimination. After a decade of looking at -O3-generated asm to spot missed optimization opportunities I can't imagine a human being being able to produce a more efficient asm code than a compiler. I was the case back in the 80s and 90s, when the CPUs were simple and the compiler were dumb, but it's not the case anymore.
So compilers are more efficient than humans at asm
How does a human make a compiler good at something the human is not?
How do you make a 100% compiler
*100% efficient compiler
I forgot a word
Decades of hard work by multiple geniuses using mathematically proved optimizations
How does one guy make his own compiler from scratch and how efficient can it be?
Look at Drew Devault's QBE and Hare. It can calculate primes in about 70% speed of -O3 gcc
>Drew Devault's QBE
In all seriousness, he's not a moron, etc. etc., however, he did not create QBE
nevermind then
And these are both written in asm, correct?
Modern computers are not really designed for humans to work with directly. For example instruction orders, instruction cache, etc effect performance and the way to do that efficiently us to do algorithms in your head. It's better to let a computer do that. That's how it works with cpus. The cpus themselves are designed for how they are most commonly used.
You optimize everything once and you don't need to do that anymore.
If you're coding in ASM you'll forget about something or won't be able to do so.
Compiler can't forget, once you give it ability to apply some sort of optimisations it'll apply it each time.
To someone with no programming background like me, OoOE is complicated and speculative execution is magic.
That's literally why you use forth
Forth is inherently slow, the stack machine abstraction prevents it from generating optimal machine code for modern register-based CPUs.
>modern register-based CPUs
Von Neumann architectures are going to be obsolete, the stack will return
>#![no_std]
That also means you can't really use third party libraries either. That's why rust us a meme. The only way to make it minimal is to not use rust. Zig doesn't have this problem and both use llvm. Even C can use the standard library without sacrificing size (if you use musl).
>A shitty snake game ripoff is enough to make "cniles" go on suicide watch.
Try harder. Then rope.
Wtf...
> extern "C"
We won C bros
>Invent a shitty language
>Market that language as ~~*"memory """safe""""*~~
>Make the memory """safe""" features so limiting and circuitous so that nobody uses them and instead writes everything in unsafe blocks
>Become so obsessed with gender and CoCs that your entire development team "forgets" to check for memory leaks
>Create a language "standard" which isn't a real standard at all, just a feature freeze for the singular reference implementation in the world
>Formalize the memory leaks in the ~~*"memory """safe""""*~~ language singular reference implementation
>Never create a formal language standard
>Never create a memory model
How the hell has the technology industry allowed this cartoonishly horrible language to proliferate itself? There has to be some kind of CIA or at least NGO cooperation at play here.
To be fair, I never saw shit like on that screenshot in real programs. Usually on some sort of embedded which is rare for Rust.
What is notable tho is that you can create easy memory leaks with shit like boxes without using unsafe. But you can do shit like that only deliberately.
>https://en.wikipedia.org/wiki/Elite_(video_game)
32 kilobytes, 40 years ago.
To be fair I made a videogame for some embedded system as a school project and using C with -ffreestanding and -nostdlib the executables become incredibly small