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
    Ekaitz Zarraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Thursday, 31-Jul-2025 02:47:01 JST Ekaitz Zarraga 👹 Ekaitz Zarraga 👹

    Maybe it's me and I'm an idiot and all, but checking for Nulls in #protobuf is just crazy.

    I have a Location (latitude, longitude) and if it has nulls it is considered Location (0,0) which I'm supposed to read as empty, but (0,0) is a real location in the planet.

    This is just absurd.

    In conversation about a month ago from mastodon.social permalink
    • Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
    • Embed this notice
      ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Thursday, 31-Jul-2025 02:47:01 JST ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      in reply to

      @ekaitz_zarraga Just like memory address 0 is a real location in the memory. But it's easy enough to reserve it so that there is no ambiguity. I think it's called the sentinel pattern.

      In conversation about a month ago permalink
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
    • Embed this notice
      Ekaitz Zarraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Thursday, 31-Jul-2025 02:48:45 JST Ekaitz Zarraga 👹 Ekaitz Zarraga 👹
      in reply to
      • ɗ𐐩ʃƕρʋ

      @deshipu yes but no. 0 is a valid address of the memory but in C, 0 is a memory address that you cannot actually use.
      Same happens here with timestamps, and with many other things.

      If it happens with these, it happens with ANY number, too.

      In conversation about a month ago permalink
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
    • Embed this notice
      ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Thursday, 31-Jul-2025 02:49:33 JST ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      in reply to

      @ekaitz_zarraga It's where the whole idea of null comes from (or at least what it was popularized by) -- I'm not saying it's a great idea, but it's workable. You have to remember that both C and Unix are the Worse Is Better kinds of software.

      In conversation about a month ago permalink
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
    • Embed this notice
      Ekaitz Zarraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Thursday, 31-Jul-2025 02:49:34 JST Ekaitz Zarraga 👹 Ekaitz Zarraga 👹
      in reply to
      • ɗ𐐩ʃƕρʋ

      @deshipu well, of course you can try, but cannot access, that's why you get the segfault.
      In the kernel, you surely can.

      In conversation about a month ago permalink
    • Embed this notice
      ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Thursday, 31-Jul-2025 02:49:34 JST ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      in reply to

      @ekaitz_zarraga so when was the last time you visited the north pole?

      In conversation about a month ago permalink
    • Embed this notice
      Ekaitz Zarraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Thursday, 31-Jul-2025 02:49:34 JST Ekaitz Zarraga 👹 Ekaitz Zarraga 👹
      in reply to
      • ɗ𐐩ʃƕρʋ

      @deshipu I doesn't have to be me...

      that's like saying any arbitrary value can be considered an error, because there are almost no chances for that to happen.

      The memory case is one of the reasons everybody complains about C. It's not a great argument, quite the contrary.

      In conversation about a month ago permalink
    • Embed this notice
      ɗ𐐩ʃƕρʋ (deshipu@fosstodon.org)'s status on Thursday, 31-Jul-2025 02:49:35 JST ɗ𐐩ʃƕρʋ ɗ𐐩ʃƕρʋ
      in reply to

      @ekaitz_zarraga Of course you can use address 0 in C on many platforms that have a C compiler. This is why you get a Segmentation Fault when you try to access a null pointer, not a more reasonable error like Null Pointer Exception or something. Because it is a valid address. And if your program is running on one of those platforms where you can freely access that address, it will not crash on null pointers, just continue on, with possibly disastrous effects.

      In conversation about a month ago permalink
    • Embed this notice
      Piggo :verified_horse: (piggo@piggo.space)'s status on Thursday, 31-Jul-2025 02:51:05 JST Piggo :verified_horse: Piggo :verified_horse:
      in reply to
      • ɗ𐐩ʃƕρʋ
      @ekaitz_zarraga @deshipu when I needed protobuf I actually ended up reinventing my own version because it seemed so ugly. Good instinct I guess
      In conversation about a month ago permalink
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
    • Embed this notice
      Ekaitz Zarraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Thursday, 31-Jul-2025 02:51:06 JST Ekaitz Zarraga 👹 Ekaitz Zarraga 👹
      in reply to
      • ɗ𐐩ʃƕρʋ

      @deshipu Yes, whatever but Protobuf was invented way after we all knew that was very bad.

      In conversation about a month ago permalink
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.

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.