Thread 105627954 - /g/ [Archived: 1070 hours ago]

Anonymous
6/18/2025, 7:19:14 AM No.105627954
130611478[1]
130611478[1]
md5: d6067304f734cfae74ce3a2f663a358b๐Ÿ”
>the size of Rust's helloworld program compiled in release mode is only 3MB
Can your language do better?
Replies: >>105627975 >>105628119 >>105628143 >>105628172 >>105628420 >>105629631 >>105629646 >>105630001 >>105630009 >>105630052 >>105630078 >>105630314 >>105630477 >>105631290
Anonymous
6/18/2025, 7:19:55 AM No.105627958
any programming lang can do better lol
Anonymous
6/18/2025, 7:23:11 AM No.105627975
>>105627954 (OP)
How much RAM did it take to compile it though and how many packages did it pull from the internet at compile time?
Anonymous
6/18/2025, 7:31:34 AM No.105628017
In Hare it's just 312K.
Replies: >>105628023
Anonymous
6/18/2025, 7:32:50 AM No.105628023
>>105628017
kill yourself Drew
Replies: >>105630053
Anonymous
6/18/2025, 7:44:26 AM No.105628102
1750225383267
1750225383267
md5: b2c2dedf3af491fc9d06a6b9660665c9๐Ÿ”
252 bytes, can't be bothered to do better
Anonymous
6/18/2025, 7:46:38 AM No.105628119
>>105627954 (OP)
>3MB
That's if you strip debugging symbols. Otherwise it's like 40MB.
Anonymous
6/18/2025, 7:50:59 AM No.105628143
958x545_27984B-13_poop-nq8
958x545_27984B-13_poop-nq8
md5: d1995c9ee99307ab3c7b063f13324974๐Ÿ”
>>105627954 (OP)
>3MB
Not too shanny. Can never be too safe. ;3

Haskell does it in less than 960K, but we all know how dangerous functional programming is.
Anonymous
6/18/2025, 7:57:48 AM No.105628172
1722970180326442
1722970180326442
md5: 4b33f0fabac94aaec3da84aeb8f3fc16๐Ÿ”
>>105627954 (OP)
kek
Below 1kb C++ btw
Replies: >>105628199 >>105628212
Anonymous
6/18/2025, 8:03:06 AM No.105628199
>>105628172
C++ is not safe.
Replies: >>105628271 >>105629992
Anonymous
6/18/2025, 8:05:12 AM No.105628212
482x324_11224B-10_poop-nq8
482x324_11224B-10_poop-nq8
md5: c3ffe4bab92e0a2bef4a45aadf45d068๐Ÿ”
>>105628172
Very nice. I was able to compress 1.1MB to just 225K after stripping.
Replies: >>105628260 >>105628990
Anonymous
6/18/2025, 8:11:55 AM No.105628260
>>105628212
>using upx instead of filesystem that compresses transparently.
Replies: >>105628273
Anonymous
6/18/2025, 8:13:39 AM No.105628271
>>105628199
But Rust isn't a systems language.

Might as well use Java or Lisp or BASIC.
Anonymous
6/18/2025, 8:13:42 AM No.105628273
>>105628260
>transparently
I enjoy maintaining the choice; it is _my_ system after all.
Replies: >>105628782
Anonymous
6/18/2025, 8:35:35 AM No.105628392
>MS-BASIC
10 PRINT "HELLO WORLD"
Tokenized this is only 19 bytes.
Replies: >>105628495
Anonymous
6/18/2025, 8:40:56 AM No.105628418
>only
>M
>only
Anonymous
6/18/2025, 8:41:04 AM No.105628420
>>105627954 (OP)
It's 137 kb you idiot
Replies: >>105628526
Anonymous
6/18/2025, 8:53:15 AM No.105628495
>>105628392
That's not a compiled executable.
Replies: >>105628516
Anonymous
6/18/2025, 8:56:31 AM No.105628516
>>105628495
MS BASIC fits in 4K ROM.
Replies: >>105628812
Anonymous
6/18/2025, 8:58:18 AM No.105628526
>>105628420
Source?
Anonymous
6/18/2025, 9:46:30 AM No.105628782
screenshot
screenshot
md5: 515669b070029c9b5682ba901262a354๐Ÿ”
>>105628273
>muh choice
Sure thing, luddite.
Anonymous
6/18/2025, 9:52:42 AM No.105628812
>>105628516
Who ask
Anonymous
6/18/2025, 10:21:49 AM No.105628990
upx
upx
md5: 3057dd66a17f0d95904d7ab7de0cc39c๐Ÿ”
>>105628212
Looks like a useful tool although it doesn't help much in this case.
Anonymous
6/18/2025, 10:26:55 AM No.105629020
file
file
md5: e4ded85b72dc1ca442b75ed7e1b89c38๐Ÿ”
best I could do lads
Replies: >>105629194
Anonymous
6/18/2025, 11:00:59 AM No.105629194
Screenshot_20250618_115849
Screenshot_20250618_115849
md5: e3e12e2371ae84b08996ec291a67910e๐Ÿ”
>>105629020
you niggers don't even try anymore
Anonymous
6/18/2025, 12:25:59 PM No.105629631
img-2025-06-18-12-25-46
img-2025-06-18-12-25-46
md5: eacaf8bd51c83457aaca484f9cbbf00a๐Ÿ”
>>105627954 (OP)
>cargo init
>cargo build --release
>its 427KiB

and that's without any special optimizations.
Replies: >>105629668 >>105630210
Anonymous
6/18/2025, 12:29:45 PM No.105629646
>>105627954 (OP)
C# AOT can literally do better
Anonymous
6/18/2025, 12:34:15 PM No.105629668
img-2025-06-18-12-33-55
img-2025-06-18-12-33-55
md5: c1415574587e2f4e7b718c87b4ee4900๐Ÿ”
>>105629631
and just a few more options added and its at 45.6KiB
Replies: >>105629680
Anonymous
6/18/2025, 12:36:30 PM No.105629680
>>105629668
>45.6KiB to print a message to the console
lmao
Replies: >>105629689
Anonymous
6/18/2025, 12:36:51 PM No.105629683
Why is the Rust syntax so god awful
If youโ€™re going to make a better language and supposedly something to replace C and C++ why are you saying use this with worse syntax

Itโ€™s like the language designers forgot you read and write it
I thought the idea was great then I saw the syntax and thought it was some sort of joke

Yeah thanks but no thanks fix that and maybe people will care
Just look at it and tell me you want to sit there writing and reading it for a job all day


All these tech people are cunts now
Replies: >>105629700
Anonymous
6/18/2025, 12:37:50 PM No.105629689
>>105629680
not really. this includes the standard lib you can go much lower by going no_std.
how about you do better with less effort?
Replies: >>105629905
Anonymous
6/18/2025, 12:40:06 PM No.105629700
>>105629683
Your complaint is common with people who never spend any time trying to understand a new language. Can you point to something specific and how you would solve it in a better way?
Replies: >>105629747
Anonymous
6/18/2025, 12:43:32 PM No.105629730
644f8c8a-190a-4a4a-8e18-599a99cdcd8b
644f8c8a-190a-4a4a-8e18-599a99cdcd8b
md5: 7eb57c2f4162fe52f461fd13ad471651๐Ÿ”
Memory Safety >>>>> Executable filesize

This is the one small dogma that morons just cannot stomach
>also
It is fucking 2025, I can buy a 500GB SSD for dirt cheap
Replies: >>105629844
Anonymous
6/18/2025, 12:47:21 PM No.105629747
>>105629700
I have had to learn things extremely quickly for work in the past from languages and frameworks and etc etc etc

Itโ€™s not a me problem
All you have to do is look at it and idgaf if you canโ€™t figure out how to express a concept without using shit syntax
Usually language designers focus on that stuff so donโ€™t push it on other peoples backs

Show any graybeard this shit they will laugh I am sure
But they already pulled the eject handle and are retired so whelp guess youโ€™re fucked
Replies: >>105629774
Anonymous
6/18/2025, 12:50:32 PM No.105629774
>>105629747
... ye thought so.
When so many people have no problem with this and you got filtered, it is definitely a you problem. Especially seeing how can't point to something you would improve with your vibe based opinion.
Anonymous
6/18/2025, 12:55:56 PM No.105629804
1750244144
1750244144
md5: 7a2eb39a34cef106febf6b0338297499๐Ÿ”
In Hare, the size of such executable is 250KB, and that also includes the runtime, since Hare produces static executables (zero ldd dependencies) and does not use glibc
I think that this is pretty good!
Replies: >>105630090 >>105630320
Anonymous
6/18/2025, 1:05:45 PM No.105629844
>>105629730
>what are embedded systems with 4mb flash storage
Replies: >>105629851
Anonymous
6/18/2025, 1:06:35 PM No.105629851
>>105629844
For embedded systems you don't use the stdlib nor do you use runtime. In that case, Rust's executables are just as large as C's, which is a couple of bytes.
Anonymous
6/18/2025, 1:17:14 PM No.105629905
>>105629689
$ musl-gcc -static -nostdlib -Wl,-z,noseparate-code -xc - -lc <<!
#include <unistd.h>
void
_start(void) {
static const char s[] = "Hello, World!\n";
write(1, s, (sizeof s)-1);
_exit(0);
}
!
$ ls -l a.out
-rwxr-xr-x 1 anon anon 1928 Jun 18 14:15 a.out
$ ./a.out
Hello, World!
$
Replies: >>105629909 >>105629983
Anonymous
6/18/2025, 1:18:18 PM No.105629909
>>105629905
That is surprisingly large for what is effectively just a data section and two INT instructions. Strip it further.
Replies: >>105630040
Anonymous
6/18/2025, 1:30:51 PM No.105629983
img-2025-06-18-13-30-49
img-2025-06-18-13-30-49
md5: 92f84d19b1501135dd32b6ef025f77fe๐Ÿ”
>>105629905
got the rust version to 4kB. there's probably more one can do but i'm not interested in this bait thread anymore, clearly the OP was just being retarded with a debug build.
Replies: >>105630040
Anonymous
6/18/2025, 1:32:14 PM No.105629992
>>105628199
Isn't rust also not safe?
Anonymous
6/18/2025, 1:33:21 PM No.105630001
>>105627954 (OP)
>another retarded thread about hello world tier programming
Just fuck off.
Replies: >>105630176 >>105630435
Anonymous
6/18/2025, 1:35:04 PM No.105630009
>>105627954 (OP)
We were briefly considering using Rust for our performance critical worker services. However, it turned out the binary was a few MEGABYTES in size. Oh no. Oh my god, no. So we went for C with Musl instead. All the developers stood up and applauded for dozens of minutes.

The tech lead's name? Albert Einstein.
Anonymous
6/18/2025, 1:40:07 PM No.105630040
>>105629909
np
$ musl-gcc -static -nostdlib -fcf-protection=none -fno-asynchronous-unwind-tables -Wl,-z,noseparate-code -Wl,-z,nosectionheader -xc - -lc <<!
#include <unistd.h>
void
_start(void) {
static const char s[] = "Hello, World!\n";
write(1, s, (sizeof s)-1);
_exit(0);
}
!
$ ls -l a.out
-rwxr-xr-x 1 anon anon 487 Jun 18 14:30 a.out
$ ./a.out
Hello, World!
$

>>105629983
better luck next time
Anonymous
6/18/2025, 1:42:07 PM No.105630052
>>105627954 (OP)
i dont know and dont care
but im not using rust
hehe
Anonymous
6/18/2025, 1:42:33 PM No.105630053
>>105628023
Speak when spoken to you fucking goy.
Anonymous
6/18/2025, 1:47:00 PM No.105630078
golang
golang
md5: d0a8f2589e415dcdf7f604dfc4136947๐Ÿ”
>>105627954 (OP)
Go, with a runtime, does it in 2.2mb
Replies: >>105630162
Anonymous
6/18/2025, 1:48:41 PM No.105630090
>>105629804
How do you know if it doesn't optimize everything aside of the print statement away since all values are known at compile time?
Replies: >>105630113
Anonymous
6/18/2025, 1:53:01 PM No.105630113
>>105630090
Because it uses QBE which is 30% worse at optimizing than LLVM
Anonymous
6/18/2025, 2:03:16 PM No.105630162
>>105630078
Oh, 5.5 times the size of the rust version is smaller than i expected for go.
Replies: >>105630178
Anonymous
6/18/2025, 2:06:05 PM No.105630176
>>105630001
>about hello world tier programming
No, dumby, it is about languages, their compilers and the cruft they include in your program.
Anonymous
6/18/2025, 2:06:27 PM No.105630178
>>105630162
3 / 5.5 = 2.2
Replies: >>105630210
Anonymous
6/18/2025, 2:10:06 PM No.105630210
>>105630178
wait a second
ghci> 3 / 5.5
0.5454545454545454
I think they meant this: >>105629631
ghci> 5.5 * 0.427
2.3485
Anonymous
6/18/2025, 2:26:44 PM No.105630314
>>105627954 (OP)
These threads always end with rust trannies accepting defeat. Sad
Anonymous
6/18/2025, 2:27:17 PM No.105630320
beefnort
beefnort
md5: 3f767ddc6a4830b9697ab095ceb75ee9๐Ÿ”
>>105629804
Have to go through a few hoops to make this work, but 19kb.
Anonymous
6/18/2025, 2:41:55 PM No.105630435
>>105630001
True, lets see some actual usecases
>At only 20 KB, Tinba is much smaller than any other known Trojan
This is a fully functional man in the browser trojan built from the Zeus malware which was mostly C and C++
Anonymous
6/18/2025, 2:46:57 PM No.105630477
poop
poop
md5: 291bd3adab6aa596d2c286958dadcad3๐Ÿ”
>>105627954 (OP)
Microsoft wins again.
184KB and it even has an icon.
Anonymous
6/18/2025, 4:40:55 PM No.105631290
>>105627954 (OP)
>Can your language do better?
Yes
https://github.com/johnthagen/min-sized-rust