GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Sunday, 16-Mar-2025 21:01:38 JST 翠星石 翠星石
    • EdBoatConnoisseur
    • T man :sex: :puffgiga: :puffpowerroll:
    • Pawlicker
    @theorytoe @PurpCat @EdBoatConnoisseur Hello world is so short that any compiler optimizations for speed or size should have no difference (which is true for gcc)

    printf() with a static string does not need to be debugged and can be understanded easily even from objdump, thus there should be no debug information in the binary unless it was specifically requested.
    In conversation about 2 months ago from freesoftwareextremist.com permalink
    • Embed this notice
      翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Sunday, 16-Mar-2025 21:51:18 JST 翠星石 翠星石
      in reply to
      • EdBoatConnoisseur
      • T man :sex: :puffgiga: :puffpowerroll:
      • Pawlicker
      • reimu
      @reimu @theorytoe @EdBoatConnoisseur @PurpCat What on earth is that satanic programming language?

      Imagine writing C software, except with >9000 extra steps and such complexity that you are bound to make many mistakes and cause many vulnerabilities, that would be either trivial to avoid (just use printf(), or difficult but possible to avoid with careful programming.

      The line noise syntax is ridiculous and seemingly intentionally next to impossible to parse.


      It's still larger than a size-unoptimized C binary after all that...
      In conversation about 2 months ago permalink
    • Embed this notice
      reimu@mk.fumo.pictures's status on Sunday, 16-Mar-2025 21:51:22 JST reimu reimu
      in reply to
      • EdBoatConnoisseur
      • T man :sex: :puffgiga: :puffpowerroll:
      • Pawlicker

      @Suiseiseki@freesoftwareextremist.com @theorytoe@ak.kyaruc.moe @PurpCat@clubcyberia.co @EdBoatConnoisseur@poa.st The problem with the rust compiler is by default it embeds the entire rust standard library into the binary (without optimizing).

      You can disable it with #![no_std] and use libc directly.

      this is the hello world program with libc:#![no_std] #![no_main] use core::ffi::CStr; #[no_mangle] pub extern fn main(_argc: i32, _argv: *const *const core::ffi::c_char) -> i32 { unsafe{libc::printf(CStr::from_bytes_with_nul_unchecked("hello world\n\0".as_bytes()).as_ptr());} 0 } #[cfg(not(test))] #[panic_handler] fn panic(_:&core::panic::PanicInfo)->! { loop{} }
      and add this to cargo.toml[dependencies] libc="*" [profile.dev] panic="abort" opt-level=3
      and add this in .cargo/config.toml[build] rustflags = ["-C", "link-args=-lc"]
      after stripping the binary it is 16K

      After removing the rust standard library you can check the binary if it contains the panic function. If it does that means the program may crash. If it doesn't then it cannot crash. (except in unsafe code). This feature can make rust code safe, but almost no one uses it.

      In conversation about 2 months ago permalink
    • Embed this notice
      翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Monday, 17-Mar-2025 09:34:42 JST 翠星石 翠星石
      in reply to
      • EdBoatConnoisseur
      • T man :sex: :puffgiga: :puffpowerroll:
      • Pawlicker
      • reimu
      @reimu @theorytoe @EdBoatConnoisseur @PurpCat Under half a MiB in size is not something that causes issues really.

      There's a problem if the binary is >1MiB in size.
      In conversation about 2 months ago permalink
    • Embed this notice
      reimu@mk.fumo.pictures's status on Monday, 17-Mar-2025 09:34:43 JST reimu reimu
      in reply to
      • EdBoatConnoisseur
      • T man :sex: :puffgiga: :puffpowerroll:
      • Pawlicker

      @EdBoatConnoisseur@poa.st @theorytoe@ak.kyaruc.moe @Suiseiseki@freesoftwareextremist.com @PurpCat@clubcyberia.co GNU ada has the same problem.
      with Ada.Text_IO; procedure HelloWorld is begin Ada.Text_IO.Put_Line ("Hello, World!"); end HelloWorld;
      The binary size is 428K for me.
      I checked the assembly and it contains a lot of unnecessary stuff.

      But I haven't found any workaround for ada.

      In conversation about 2 months ago permalink
    • Embed this notice
      EdBoatConnoisseur (edboatconnoisseur@poa.st)'s status on Monday, 17-Mar-2025 09:34:44 JST EdBoatConnoisseur EdBoatConnoisseur
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      • Pawlicker
      • reimu

      @reimu @theorytoe @Suiseiseki @PurpCat in other words rust is deeply stupid by default statically adding unneeded stuf.

      In conversation about 2 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.