snac.bsd.cafe is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Site description
This is the snac instance of the BSD Cafe
Admin email
stefano@bsd.cafe
Admin account
@stesnac@snac.bsd.cafe

Search results for tag #c

Jonathan Lamothe »
@me@social.jlamothe.net

I am in urgent job search mode, so I'm gonna throw this out here and see if anything comes of it.

I am a , fluent in both and . I have experience with several programming languages. My strongest proficiency is with and . I also have a reasonable grasp of , , , , , system administration, scripting, , , some (common, scheme, and emacs), and probably several others I've forgotten to mention.

I am not necessarily looking for something in tech. I just need something stable. I have done everything from software development, to customer support, to factory work, though my current circumstances make in-person work more difficult than remote work. I have been regarded as a hard worker in every job I have ever held.

    Brett Sheffield (he/him) »
    @dentangle@chaos.social

    If a tree falls in the forest and you enable -fsanitize=undefined not only does the tree make no sound but it never actually fell.

      Hans Hübner »
      @hanshuebner@mastodon.social

      @SDF Wow, I have very fond memories of this machine as it was the first instance of netmbx, our public access Unix system that was later running on a Xenix box. It had a couple of dialin modems connected to it and polled tub aka db0tui6 using UUCP

      netmbx
      Altos 68000; Unix SysIII
      netmbx Berlin
      Ralf Moritz †
      mor...@netmbx.uucp
      +49 30 87 81 24
      Woerther Str. 36, D-1000 Berlin 20, W. Germany
      52 31 N / 13 24 E city

      mor...@netmbx.uucp; 870530
      #
      netmbx tub(DAILY)

        🗳

        Profoundly Nerdy »
        @profoundlynerdy@bitbang.social

        Yes or No: is a fad language and will continue to evolve and out live it.

        Yes:6
        No:25
        I Don't Know:6
        Dude! I'm a Ruby guy:2
          Max boosted

          Gehtso »
          @Gehtso@social.tchncs.de

          Schleswig-Holstein kürzt Schulunterricht – aber nicht in Religion

          wenn der Glaube an unsichtbare magische Wesen wichtiger ist als der Unterricht in sozialwissenschaftlichen Fächern dann sieht man gleich wo die Prioritäten der C-Partei liegen.

          hpd.de/artikel/schleswig-holst

          -Partei

            cgnarne boosted

            thedæmon »
            @thedaemon@hj.9fs.net

            I'm just going to leave this here.

            Change my mind Meme Format "Memory Safety is a skill issue"

            Alt...Change my mind Meme Format "Memory Safety is a skill issue"

              loganer »
              @loganer@mastodon.social

              if I malloc a block of memory, can I tell the computer that a section of this block is read only (temprarily).

              I want the program to segfault if this section of code is written to without first marking it writable.

                ACCUConf »
                @ACCUConf@mastodon.social

                ACCU 2025 SESSION ANNOUNCEMENT: C23 for uninitiated—modern C idioms for expressive, safe, and performant code by Dawid Zalewski

                accuconference.org/2025/sessio

                Register now at accuconference.org/booking/

                  ax6761 boosted

                  Jason Bowen 🇺🇦 »
                  @jbowen@mast.hpc.social

                  I'm trying to compile CPython with the mold(1) linker, but so far I haven't been able to get the build system to pick it up. Can anyone point me in the direction of building CPython with mold(1).

                  This isn't for any purpose other than playing around/learning.

                  If anyone is willing, I'd appreciate a boost for visibility :)

                    amen zwa, esq. »
                    @AmenZwa@mathstodon.xyz

                    Syntactically, and are proximate. But they are a world apart, when it comes to the design philosophy.

                    In terms of language design, C++ took C's blocky syntax and blazing speed, but that is all. The underlying philosophy of C++ is "be all that it can be to all programmers at all times, in the most efficient and most complicated ways imaginable".

                    In stark contrast, C's philosophy is "be steady, small, simple, and succinct, so that programmers can shoot themselves in the foot in the most efficient and effective ways they can imagine".

                      Eelco Mulder :mastodon: »
                      @voorstad@mastodon.nl

                      "Als je Instagram zat bent...."

                      Mooie aanrader om naar te gaan.

                      (Uit C'T 04-2025)

                      @ct_Magazin (de NL variant zit niet op de Fediverse)

                      't

                        Jack William Bell »
                        @jackwilliambell@rustedneuron.com

                        Doing terrible things with the pre-processor.

                        And, yes, he takes it to the point he is demonstrating how the pre-processor actually is Turing Complete – including a form of recursion, despite the fact the pre-processor explicitly *does not* support recursion.

                        > Cursed fire or define black magic. ssloy.github.io/strange/cursed

                          Diane Bruce »
                          @DianeBruce@bsd.network

                          Yes 'C' kinda sucks but I am not sure I'd go this far.

                          theregister.com/2025/02/18/c_o

                            the roamer boosted

                            the roamer »
                            @the_roamer@mastodonapp.uk

                            @emocoder

                            "So easy to learn and so hard to master."

                            Lovely and apt comment on C the language.

                            Also: the definition of "worthwhile".

                              Tommi 🤯 »
                              @tommi@pan.rent

                              Happy I Love Free Software Day! 💕

                              Unfortunately, this year I could not join nor organize any in-person celebration, BUT of course I want to share my gratitude to the many, countless services I don’t merely use, but actually depend on.

                              Last year, I decided to focus only on , because it would have been crazy to list all the projects I use and I love.

                              This time, even if I will most certainly forget someone, I am challenging myself to mention all the my life is powered by.

                              Without further ado, THANK YOU to:

                              • @yunohost, for powering Nebuchadnezzar
                              • @fedora, for running my beloved laptop
                              • @frameworkcomputer, for designing and building repairable, -friendly and truly open hardware
                              • @gnome and @GTK, for being just gorgeous
                              • @calyxos (thus @LineageOS), for powering my
                              • , for making me directly download apps on my phone, and @fdroidorg for distributing them
                              • , for proxying the download of apps I am doomed to get from Google Play
                              • @element, for developing , even though the new proprietary Synapse Pro is VERY PROBLEMATIC AND DISAPPOINTING
                              • , for being the most beautiful and awesome client ever
                              • @signalapp, for keeping me connected with the people I love
                              • @Mastodon, for also maintaining a feature-packed experimental fork (), that is what Pan runs
                              • and , for being the most beautiful and awesome clients ever
                              • , for still remaining the best possible choice, despite ’s governance messiness
                              • @openstreetmap, for allowing us to find the right path, both literally and metaphorically!
                              • @organicmaps, for being the simplest, cleanest, yet feature-rich client and navigation app
                              • @protonvpn, for making me browse safely from/to anywhere in the planet and @protonprivacy , for hosting my email, despite the latest alarming political statements…
                              • @libreoffice, for allowing me to draft documents with ease, the last of which was my
                              • , for preventing me from making embarassing spelling mistakes
                              • @photoprism, for safely storing and indexing all my photographic memories, on Aby, and for providing stellar and friendly support too!
                              • , for moderating the very likely risk of ending up completely broke, since it forces me to manage my finances consciously and coherently
                              • @readeck, for storing and sorting ALL my varied and overwhelming inputs
                              • @nextcloud, for storing and synchronizing my data, for its , its , and all its awesome apps
                              • , for preventing my friends and family members from going crazy, by allowing me to remotely connect to their devices and directly address the issues they have
                              • , for sending out my newsletter
                              • @eleventy, for powering all the websites I maintain, above all the virtual representation of my mind, and for being the only reason why I resist and try to continue learning
                              • @forgejo, for giving us a chance to truly control and collectively develop the sources of our software, but most importantly @Codeberg, for RESISTING, RESISTING, RESISTING, despite the hatred and attacks nazi assholes throw at them
                              • @musicbrainz for keeping music knowledge open and free, and @ListenBrainz for scrobbling the crazy music I listen to
                              • The @fsfe, for promoting this celebration and fighting the good fight!

                              Lastly, but most importantly, the biggest thank you goes to all the free software libraries and dependencies the above mentioned are made of/built with, including , , , , and all community-maintained programming languages.

                              I am super sorry if I forgot someone!

                                horia boosted

                                Lobsters » 🤖
                                @lobsters@mastodon.social

                                Peter Drake »
                                @peterdrake@mstdn.social

                                bleepingcomputer.com/news/secu

                                <<According to Google's security advisory, this vulnerability is caused by an out-of-bounds write weakness in the USB Video Class (UVC) driver, which allows "physical escalation of privilege with no additional execution privileges needed" on unpatched devices.>>

                                1) So this was written in C?

                                2) Google is still allowed to use the word "privilege"?

                                  Nils Goroll 🕊️:varnishcache: »
                                  @slink@fosstodon.org

                                  : "ptype /o" reports holes in structures (missed packing opportunities)

                                  (gdb) ptype /o struct req
/* offset      |    size */  type = struct req {
/*      0      |       4 */    unsigned int magic;
/* XXX  4-byte hole      */
/*      8      |       8 */    body_status_t req_body_status;
/*     16      |       8 */    stream_close_t doclose;
/*     24      |       4 */    unsigned int restarts;
/*     28      |       4 */    unsigned int max_restarts;
/*     32      |       4 */    unsigned int esi_level;
/* XXX  4-byte hole      */
/*     40      |       8 */    const struct req_step *req_step;

                                  Alt...(gdb) ptype /o struct req /* offset | size */ type = struct req { /* 0 | 4 */ unsigned int magic; /* XXX 4-byte hole */ /* 8 | 8 */ body_status_t req_body_status; /* 16 | 8 */ stream_close_t doclose; /* 24 | 4 */ unsigned int restarts; /* 28 | 4 */ unsigned int max_restarts; /* 32 | 4 */ unsigned int esi_level; /* XXX 4-byte hole */ /* 40 | 8 */ const struct req_step *req_step;

                                    Jack William Bell »
                                    @jackwilliambell@rustedneuron.com

                                    Want to use that nice new shiny syntax, but need to target earlier version compilers? The 'United Library' has you covered.

                                    > github.com/alobley/United-Libr

                                      Diane Bruce »
                                      @DianeBruce@bsd.network

                                      I still own a copy of the first edition of C++ by Stroustrup.

                                      It makes a fine doorstop.

                                      ++

                                        Solène :flan_hacker: boosted

                                        Diane Bruce »
                                        @DianeBruce@bsd.network

                                        Beware of only looking at the number of years someone has been coding. I've seen kids produce really decent code and older coders produce really lousy code.

                                          Diane Bruce »
                                          @DianeBruce@bsd.network

                                          cpp the C pre-processor is a pile of manure that has been in the Sun stinking to high heaven. I've written macro processors and none of them have been as bad. Rip most of it out of a modernish 'C' keeping only the Manifests. If you must have macros one can do a lot better.

                                            AodeRelay boosted

                                            Diane Bruce »
                                            @DianeBruce@bsd.network

                                            I still see code written today that looks like it was meant to run on a VAX.

                                              Diane Bruce »
                                              @DianeBruce@bsd.network

                                              Improved error catching compilers are not a panacea for lousy programmers. They *should* be additional tools for the good programmers. Unfortunately this is often not the case nowadays.

                                                AodeRelay boosted

                                                Diane Bruce »
                                                @DianeBruce@bsd.network

                                                COBOL was developed to allow accountants to write code. It turns out accountants are lousy programmers. Still we try with modern languages to allow lousy programmers to produce somewhat acceptable code . This also is not always successful.

                                                  🗳

                                                  rk: could be an enum »
                                                  @rk@mastodon.well.com

                                                  Fun C question of the day.

                                                  typedef struct foo { char *s;} foo;

                                                  int
                                                  main(void)
                                                  {
                                                  foo f;
                                                  memset(&f, 0, sizeof(f));

                                                  }

                                                  Does f.s == NULL?

                                                  Yes:13
                                                  Yes, but…:27
                                                  No:8
                                                  You should rewrite this in Rust:19

                                                    Jack Leightcap »
                                                    @jleigh@recurse.social

                                                    Hey all! I'm due for an (re-)introduction: I'm Jack, an engineer in the NYC area from a firmware & cybersecurity background, currently working in something like hardware-software co-design.

                                                    Technical work is often with , and in all-too-rare moments stuff like and

                                                    I've never been much for social media, usually preferring to keep interests local: a better-detailed to follow as I figure this out 🙂

                                                      gyptazy boosted

                                                      gyptazy »
                                                      @gyptazy@mastodon.gyptazy.com

                                                      Just a few days ago, I lunched my new relay service for the and I'm really happy to see that there're already many ones connected to - more than 50 instances in just a few days!

                                                      But what makes me even really happy is to see, that my service [2] also gets linked in the release notes of [1] / - and I can recommend the usage of relay services (it doesn't matter which one!) to everyone. It provides more content from connected instances to you, but also brings your posts - from your local instance - up to other ones within the federated network where it can get much easier distributed around other instances.

                                                      is the perfect way to host an own fediverse instance. Using the protocol allows you to connect to all other instances. With the integrated API, you can also use most of your usual clients or web clients. Snac is light, fast, does not require any database and follows the KISS way - which the most of us BSD people are living. With relay services, it's the perfect match for singe-user instances and @grunfink is always open for ideas and to help! It does not always need to be , etc!

                                                      And if you're using any other software, you may still benefit by using relay services. And if you're still looking for a guide, howto setup snac2 on , my howto [3] might help you out.

                                                      [1]: codeberg.org/grunfink/snac2
                                                      [2]: fedi-relay.gyptazy.com
                                                      [3]: gyptazy.com/install-snac2-on-f

                                                        Nils Goroll 🕊️:varnishcache: »
                                                        @slink@fosstodon.org

                                                        can anyone recommend good implementations in with a proper license or ?

                                                          matthew - retroedge.tech »
                                                          @matthew@social.retroedge.tech

                                                          Hasn’t it ever bothered you that UNIX, an operating system born with C, has a shell with a pascal-like syntax?

                                                          – rc23 README

                                                          https://codeberg.org/rc23/rc23

                                                          #unix #c

                                                            argv minus one »
                                                            @argv_minus_one@mastodon.sdf.org

                                                            @whitequark @mcc

                                                            : goes through hell to design an entirely new instruction set architecture and calls it

                                                            Everyone: “We'll just take the ++ , thanks. We're going with for everything else. Toodles.”

                                                              Shamar boosted

                                                              Paolo Amoroso »
                                                              @amoroso@fosstodon.org

                                                              A book about writing a toy operating system for RISC-V in 1000 lines of C.

                                                              operating-system-in-1000-lines

                                                                screwlisp boosted

                                                                Alfred M. Szmidt »
                                                                @amszmidt@mastodon.social

                                                                @ksaj (dogs-age pi (0 1))

                                                                (29.707963267948966d0 0.4166666865348816d0)

                                                                @praetor

                                                                  screwlisp »
                                                                  @screwtape@mastodon.sdf.org

                                                                  @pizzapal @pkw
                                                                  I guess you're doomed to be a polylang. Sorry to hear about the virus!
                                                                  Discrete fourier transforms are defined by
                                                                  (defun naieve-dft (l &key (sgn -1) &aux (len (length l)))
                                                                  "consing naieve dft of list. Computes all twiddle factors. :sgn +1 for inverse."
                                                                  (loop
                                                                  :for k :below len
                                                                  :collecting
                                                                  (loop :for n :below len
                                                                  :for w := (twiddle k n len :sgn sgn)
                                                                  :sum
                                                                  (* (nth n l) w))))
                                                                  twiddles=(exp (* (0 1) sgn pi 2 k n (/ len)))
                                                                  But this turns out to be overdefined

                                                                    SpaceLifeForm »
                                                                    @SpaceLifeForm@infosec.exchange

                                                                    @stefano

                                                                    Old habits die hard.

                                                                    If you were coding C long ago, and you wanted to port your code to a different platform that had it's own toolchain, then you would avoid new features.

                                                                    You pretty much had to unless you were cross-compiling.

                                                                      Eugene :emacs: :freebsd: »
                                                                      @evgandr@mas.to

                                                                      (setq gdb-many-windows t) in on the big monitor is brilliant!

                                                                      Multiwindow GDB session in Emacs

                                                                      Alt...Multiwindow GDB session in Emacs

                                                                        ax6761 »
                                                                        @ax6761@freeradical.zone

                                                                        ... To [Copilot] key do nothing at all via , in "neuter-copilot.ahk" file ...

                                                                        AutoHotkey v2.0

                                                                        InstallKeybdHook

                                                                        ; Does not disable [Copilot] key.
                                                                        ;::Return

                                                                        ; Scancode does not work.
                                                                        ;SC0x000100003100::Return

                                                                        ; Works: Does nothing.
                                                                        #<+F23::Return

                                                                        ; Send [Ctrl]? Does not work: "Ctrl+R" does not reload the Firefox tab.
                                                                        ;#<+F23::^

                                                                          ax6761 »
                                                                          @ax6761@freeradical.zone

                                                                          @sundew @aphyr Blame that on & programming language makers continuing to use, expose the underlying foundation; see "(3)" & friends man.freebsd.org/cgi/man.cgi?qu -- search for "External declaration" (could not quote fields of "tm" structure with comments due to the character limit of the server).

                                                                          In this respect, "time.struct_time", 9-element tuple, docs.python.org/3/library/time has better structure (year is not based around 0 for you to add 1900 to it as it does in fucking ; etc)

                                                                            Ivan boosted

                                                                            Kat Marchán 🐈 »
                                                                            @zkat@toot.cat

                                                                            I am absolutely overjoyed to announce the release of 2.0.0!! kdl.dev

                                                                            It's a significant overhaul of the language to make it SO MUCH NICER in so many ways.

                                                                            This is the culmination of over 3 years of work (4 if you count from before 1.0.0), by SCORES of contributors.

                                                                            github.com/kdl-org/kdl/release

                                                                            I want to give huge thanks to everyone who supported all of us through this, who jumped in and had some really amazing discussions weighing all sorts of interesting trade-offs.

                                                                            The end result is absolutely not something any one person could've reasonably come up with.

                                                                            I hope y'all enjoy it <3

                                                                            As part of this release, several implementations have already launched with full support for v2.0.0, so you can try it now!

                                                                            👉 github.com/kdl-org/kdl-rs
                                                                            👉 / / github.com/tjol/ckdl
                                                                            👉 github.com/IceDragon200/kuddle
                                                                            👉 / github.com/bgotink/kdl
                                                                            👉 github.com/tabatkins/kdlpy

                                                                            KDL is already used in all sorts of projects, and by various folks as a DSL for their own small hobby things: github.com/kdl-org/kdl?tab=rea

                                                                            There are around 8k .kdl files out on GitHub, which is a lot considering it's usually a config language!

                                                                            I fully expect this to be the last version of KDL ever released. We really really tried, but I don't think there's anything we can reasonably improve on.

                                                                            From here on out, the language is in the (stable!) hands of the ecosystem.

                                                                            Also, we're hoping to have GitHub syntax highlighting support soon!

                                                                            (Boosts welcome!!)

                                                                            syntax-highlighted zellij config ported to 2.0.0 format.

// This config is just like `zellij.kdl`, except it shows what it would look
// like if modifiers were done using `+` instead of spaces (thus needing to be
// quoted).
keybinds {
    normal {
        // uncomment this and adjust key if using copy_on_select=#false
        /- bind Alt+c { Copy }
    }
    locked {
        bind Ctrl+g { SwitchToMode Normal }
    }
    resize {
        bind Ctrl+n { SwitchToMode Normal }
        bind h Left { Resize Left }
        bind j Down { Resize Down }
        bind k Up { Resize Up }
        bind l Right { Resize Right }
        bind "=" + { Resize Increase }
        bind - { Resize Decrease }
    }
    pane {
        bind Ctrl+p { SwitchToMode Normal }

                                                                            Alt...syntax-highlighted zellij config ported to 2.0.0 format. // This config is just like `zellij.kdl`, except it shows what it would look // like if modifiers were done using `+` instead of spaces (thus needing to be // quoted). keybinds { normal { // uncomment this and adjust key if using copy_on_select=#false /- bind Alt+c { Copy } } locked { bind Ctrl+g { SwitchToMode Normal } } resize { bind Ctrl+n { SwitchToMode Normal } bind h Left { Resize Left } bind j Down { Resize Down } bind k Up { Resize Up } bind l Right { Resize Right } bind "=" + { Resize Increase } bind - { Resize Decrease } } pane { bind Ctrl+p { SwitchToMode Normal }

                                                                            a section of a syntax-highlighted example KDL document based on a GitHub Actions yaml configuration, ported to KDL 2.0.0.

    steps {
      step uses="actions/checkout@v1"
      step "Install Rust" uses="actions-rs/toolchain@v1" {
        profile minimal
        toolchain "${{ matrix.rust }}"
        components clippy
        override #true
      }
      step Clippy { run cargo clippy --all -- -D warnings }
      step "Run tests" { run cargo test --all --verbose }
      step "Other Stuff" run="""
        echo foo
        echo bar
        echo baz
        """
    }

                                                                            Alt...a section of a syntax-highlighted example KDL document based on a GitHub Actions yaml configuration, ported to KDL 2.0.0. steps { step uses="actions/checkout@v1" step "Install Rust" uses="actions-rs/toolchain@v1" { profile minimal toolchain "${{ matrix.rust }}" components clippy override #true } step Clippy { run cargo clippy --all -- -D warnings } step "Run tests" { run cargo test --all --verbose } step "Other Stuff" run=""" echo foo echo bar echo baz """ }

                                                                              Jonas Kruckenberg :tauri: »
                                                                              @unsafe@m.webtoo.ls

                                                                              okay mastodon, enlighten me:

                                                                              I’m building out my virtual memory alloc right now and it appears all other production kernels use some sort of *intrusive tree* for that. Why is that?

                                                                              My thinking is: I already have a kernel heap thats “wired” aka directly allocated and mapped. And all virtmem impls I could find call out to *some* “backing allocator” anyways to allocate new tree nodes.

                                                                              So if they aren’t fully allocation free anyway, why don’t I just use a sorted growable vec of entries allocated from the kernel heap?
                                                                              What’s the advantage of intrusive data structures here that im missing?

                                                                                2 ★ 0 ↺

                                                                                zirias (on snac) »
                                                                                @zirias@snac.bsd.cafe

                                                                                I always had the idea in mind to one day code something in for the . There's offering a decent compiler. I always ended up with using again. That's because on that platform, it is the only way to have "full control": The OS only offers a machine code ABI (jump to routines, pass stuff in registers) and misses lots of things, so you need to program the hardware directly. Of course, I still use an assembler instead of hacking the bytes of the machine code directly.

                                                                                Any Unix and similar OS comes with a C compiler, and even other systems offer a C API, so for a "modern" environment, that's the natural language to use for that "full control". And remember, C is your "portable assembler". 😏

                                                                                In a nutshell, if you take "from scratch" literally, it would mean to somehow hack bytes into the machine's memory. That doesn't make much sense. I understand it as "use a simple programming language and avoid these huge frameworks and similar doing deep magical stuff for you".

                                                                                CC: @modev@snac.bsd.cafe

                                                                                  ltning »
                                                                                  @ltning@pleroma.anduin.net

                                                                                  Just found this sealed #floppy disk in my copy of "ZEN of Code Optimization" from ... 1994! And it even covers Pentium programming!
                                                                                  A whopping 300 kilobytes of #assembly, #C and #C++ code. How much of this would still be useful today? Should I (re-)read the book?

                                                                                  Will be uploading to archive.org..I'll post the link once it's up there.
                                                                                  #retrocomputing

                                                                                  Front cover of the book. "The ultimate guide to writing software that pushes PCs to the limit", "Presents tips and techniques for writing optimized PC software", "Provides the amazing Zen timer", "Includes C/C++ and assembly code", "Offers unique insight on 386, 486, and Pentium programming"

                                                                                  Alt...Front cover of the book. "The ultimate guide to writing software that pushes PCs to the limit", "Presents tips and techniques for writing optimized PC software", "Provides the amazing Zen timer", "Includes C/C++ and assembly code", "Offers unique insight on 386, 486, and Pentium programming"

                                                                                  The floppy disk label.

                                                                                  Alt...The floppy disk label.

                                                                                    Back to top - More...