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
    pistolero (p@fsebugoutzone.org)'s status on Tuesday, 18-Feb-2025 19:15:34 JST pistolero pistolero
    # I don't know if "deletion is meaningless in this context" should
    # return an error or not. I'm going to gamble and say that "fail
    # successfully" is the appropriate course of action but include the
    # alternative version as a hedge.
    @impl true
    def delete_file(_), do: :ok
    #def delete_file(_), do: {:error, "This is fine."}
    In conversation Tuesday, 18-Feb-2025 19:15:34 JST from fsebugoutzone.org permalink
    • ✙ dcc :pedomustdie: :phear_slackware: likes this.
    • Embed this notice
       (mint@ryona.agency)'s status on Tuesday, 18-Feb-2025 19:20:33 JST  
      in reply to
      @p Isn't "failing successfully" the whole point of Erlang/Elixir?
      In conversation Tuesday, 18-Feb-2025 19:20:33 JST permalink
      ✙ dcc :pedomustdie: :phear_slackware: and pistolero like this.
    • Embed this notice
       (mint@ryona.agency)'s status on Tuesday, 18-Feb-2025 19:21:40 JST  
      in reply to
      • 
      @p https://en.wikipedia.org/wiki/Erlang_(programming_language)?useskin=vector#"Let_it_crash"_coding_style
      In conversation Tuesday, 18-Feb-2025 19:21:40 JST permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: upload.wikimedia.org
        Erlang (programming language)
        Erlang ( UR-lang) is a general-purpose, concurrent, functional high-level programming language, and a garbage-collected runtime system. The term Erlang is used interchangeably with Erlang/OTP, or Open Telecom Platform (OTP), which consists of the Erlang runtime system, several ready-to-use components (OTP) mainly written in Erlang, and a set of design principles for Erlang programs. The Erlang runtime system is designed for systems with these traits: Distributed Fault-tolerant Soft real-time Highly available, non-stop applications Hot swapping, where code can be changed without stopping a system. The Erlang programming language has immutable data, pattern matching, and functional programming. The sequential subset of the Erlang language supports eager evaluation, single assignment, and dynamic typing. A normal Erlang application is built out of hundreds of small Erlang processes. It was originally proprietary software within Ericsson, developed by Joe Armstrong, Robert Virding, and Mike Williams...
      pistolero likes this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Tuesday, 18-Feb-2025 19:33:55 JST pistolero pistolero
      in reply to
      • 
      @mint I don't know about Elixir as a whole but there seems to be a lot of bullshit where, like, something is plucked from an implicit expected structure returned by one of the functions in a module, and you have to read the entire call stack because you can't just test it interactively because there are 20 lines of destructive context built up. I think there is a bug in one of the existing uploaders but I don't know if the bug is still there or if I'm reading it wrong.

      I don't think the way pattern-matching is used lends itself to code that is easier to read or write or debug or even spot the bugs in. I shit out all those MRFs and a lot of them have comments or commit messages indicating that the code is bad but I eventually just stopped making a note of that because it applies to all of them. Trying to write "good" code to fit into Pleroma has

      I say "the way pattern-matching is used" and I can't say for certain whether this has to do with the project or the APIs the project has to use or if every Elixir codebase looks like this. I pretty strongly suspect that this is the ecosystem/language's fault. Phoenix reeks of a design that was conceived by Rails fetishists, and Rails is one of the worst designs you can come up with.

      I want to conform to an interface, play nice with the internal tooling, and that's 95% of the effort. The other 5% of the effort is calling two upstream endpoints. I think these ratios are backwards.
      In conversation Tuesday, 18-Feb-2025 19:33:55 JST permalink
       and ✙ dcc :pedomustdie: :phear_slackware: like this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Tuesday, 18-Feb-2025 19:36:32 JST pistolero pistolero
      in reply to
      • 
      @mint That style you can't actually use in Phoenix: it just sends back a 5xx error for things that should be a 4xx. You're supposed to have a lot of these little processes, all of which fit on half a page, and when one of them breaks, it's handled upstream.
      In conversation Tuesday, 18-Feb-2025 19:36:32 JST permalink
       and ✙ dcc :pedomustdie: :phear_slackware: like this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Tuesday, 18-Feb-2025 20:03:45 JST pistolero pistolero
      in reply to
      • 
      @mint Like, I can't actually use this API as-is because it's for shipping JSON around and it silently discards other parameters if you upload a file and it only lets you upload one (so much for the "multi" part of "multipart"): https://git.freespeechextremist.com/gitweb/?p=fse;a=blob;f=lib/pleroma/http.ex;h=052597191fcc90d48641217f6002418462893031;hb=HEAD#l61 . So I have to take a step down and just talk to Tesla and build the multipart request myself if I'm trying to make something you can drop into Pleroma instead of something that requires changes to Pleroma; fine, I don't mind, this is called "programming", I can do that.

      Tesla returns `{:ok, {status: whatever}}` as long as the request succeeds, and then you handle the status being 200 or 201 or 401 or what-have-you. That's sensible, that's what you want, you want the client library to tell you that there was an error if the server couldn't be reached or if it responds with non-HTTP shit and that it was fine as long as the round-trip worked out and then 2xx vs. 4xx is application logic.

      But just eyeballing it, if the S3 library they're using works that way, there's a bug where if the upstream server behaves weirdly, Pleroma won't have a clue that this happened because it just assumes the server didn't return anything weird: https://git.freespeechextremist.com/gitweb/?p=fse;a=blob;f=lib/pleroma/uploaders/s3.ex;h=6dbef90856c2fba0f9f5bddc52d56743cef7c81d;hb=HEAD#l40 . A little lower, delete_file() checks status_code so it looks like ExAws.request/1 returns an object that has a status code in it, so it *looks* like the put_file code assumes it has succeeded in cases where it hasn't. But it's hard to tell, because https://hexdocs.pm/ex_aws_s3/ExAws.S3.html#put_object/4 doesn't seem to say.

      In a lot of cases, Elixir seems like it's fighting Erlang; it's forcing some infelicities in control flow that end up erasing the niceness you'd get from pattern-matching.
      In conversation Tuesday, 18-Feb-2025 20:03:45 JST permalink

      Attachments



      1. No result found on File_thumbnail lookup.
        ExAws.S3 — ExAws.S3 v2.5.6
       likes this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Tuesday, 18-Feb-2025 20:12:59 JST pistolero pistolero
      in reply to
      • 
      @mint The more I look at this, the more that I begin to think that Elixir is the product of a deranged mind and that the language's reach has exceeded its grasp.

      99% of the time that you start second-guessing the language, you're wrong and you just haven't bent your mind enough to see the language from its own perspective. It's like thinking there's a bug in the compiler when you're new to a language: the bug is almost certainly in your program, not in the compiler, and you don't understand the language well enough to have a mental model of the compiler. But when I think "No, Elixir's not terrible, you just need to think harder", I can't shake the memory of seeing ".DS_Store" come out of the zip file from the official distribution and the fact that they keep making minor releases of the language that are completely incompatible with previous versions and the entire deps thing is a goddamn fiasco and I think maybe I'm correct to second-guess the language/ecosystem when I have to hand off happy-path to another function and then handle a bunch of errors inline and then I look to see how other code handles these errors and it just pretends they didn't happen.
      In conversation Tuesday, 18-Feb-2025 20:12:59 JST permalink
       and ✙ dcc :pedomustdie: :phear_slackware: like this.
    • Embed this notice
      :blank: (i@declin.eu)'s status on Tuesday, 18-Feb-2025 21:05:55 JST :blank: :blank:
      in reply to
      • 
      @p @mint if there was a way to enforce good engineering, there might not have been a need to go past cobol

      would be funny if this exact issue was the reason a bunch of people are failing to upload their media and not knowing why
      In conversation Tuesday, 18-Feb-2025 21:05:55 JST permalink
      , :caleb: dcc ✙ and pistolero like this.
    • Embed this notice
       (mint@ryona.agency)'s status on Tuesday, 18-Feb-2025 21:07:29 JST  
      in reply to
      • :blank:
      @i @p https://github.com/azac/cobol-on-wheelchair
      https://github.com/askadian/CobolJsonParser
      Building blocks for cobolverse are there.
      In conversation Tuesday, 18-Feb-2025 21:07:29 JST permalink

      Attachments


      1. Domain not in remote thumbnail source whitelist: opengraph.githubassets.com
        GitHub - askadian/CobolJsonParser: A cobol code to Parse a JSON String
        A cobol code to Parse a JSON String. Contribute to askadian/CobolJsonParser development by creating an account on GitHub.
      iced depresso and pistolero like this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Tuesday, 18-Feb-2025 22:07:43 JST pistolero pistolero
      in reply to
      • 
      • :blank:
      @i @mint

      > if there was a way to enforce good engineering, there might not have been a need to go past cobol

      That's like saying that proper engineering could have gotten us skyscrapers out of balsa wood. A programming language doubles as "substrate for building" and "medium of thought"; it's way more than just good engineering discipline.

      > would be funny if this exact issue was the reason a bunch of people are failing to upload their media and not knowing why

      I should probably report it but I'd have to dig through the docs more and I'd also have to check to see if it's changed: it might have been completely rewritten by now. (I had to link to the FSE repo, because if it *has* been rewritten then no one would know what I was talking about.)
      In conversation Tuesday, 18-Feb-2025 22:07:43 JST permalink
       and :caleb: dcc ✙ like this.
    • Embed this notice
      受不了包 (shibao@misskey.bubbletea.dev)'s status on Tuesday, 18-Feb-2025 22:23:04 JST 受不了包 受不了包
      in reply to
      • 

      @p@fsebugoutzone.org @mint@ryona.agency are you really going to judge a language for a library for a proprietaty api that is too complicated so they have to make a giant library in the first place just to do relatively normal rest things with it and then some random fuckers who decide to in their off time (i assume) suck off this giant multinational conglomerate and make a library for them in your weird niche language for free?

      In conversation Tuesday, 18-Feb-2025 22:23:04 JST permalink
      pistolero likes this.
    • Embed this notice
      iced depresso (icedquinn@blob.cat)'s status on Tuesday, 18-Feb-2025 22:28:08 JST iced depresso iced depresso
      in reply to
      • 
      • 受不了包
      @shibao @mint @p honestly haven't the foggiest what everyone is raging about.
      In conversation Tuesday, 18-Feb-2025 22:28:08 JST permalink
      pistolero likes this.
    • Embed this notice
      THOT POLICE (s8n@posting.lolicon.rocks)'s status on Tuesday, 18-Feb-2025 23:10:23 JST THOT POLICE THOT POLICE
      in reply to
      • 
      • 受不了包
      @shibao @mint @p :p: is rarely correct but elixir is the product of derangement and it exists purely for the sake of being difficult
      In conversation Tuesday, 18-Feb-2025 23:10:23 JST permalink
    • Embed this notice
      :blank: (i@declin.eu)'s status on Tuesday, 18-Feb-2025 23:10:30 JST :blank: :blank:
      in reply to
      • 
      • iced depresso
      • 受不了包
      @icedquinn @p @shibao @mint someone wrote {:ok, _} instead of {:ok, %{status_code: 200}} 6 years ago in a pattern match
      In conversation Tuesday, 18-Feb-2025 23:10:30 JST permalink
      受不了包 likes this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Wednesday, 19-Feb-2025 14:27:49 JST pistolero pistolero
      in reply to
      • 
      • 受不了包
      @shibao @mint

      > are you really going to judge a language for a library for a proprietaty api that is too complicated

      No, I've used S3 libraries in other languages. The rest of the thread is has other thoughts about Elixir.

      If you wanna write this code, feel free; I'm not super eager to deal with more Elixir so I was gonna do some sysadmin shit I've been procrastinating about first.

      > and make a library for them in your weird niche language for free?

      I don't think any design should be immune to critique but as I am also currently writing library code in this weird niche language for free, I feel fine granting myself a license to complain.
      In conversation Wednesday, 19-Feb-2025 14:27:49 JST permalink
      受不了包 and :caleb: dcc ✙ like this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Wednesday, 19-Feb-2025 14:57:09 JST pistolero pistolero
      in reply to
      • 
      • :blank:
      @i @mint

      > is if err != nil { return nil, err } any better?

      Yes. Guard clauses are better than indeterminate levels of nesting. Anyone who has personally encountered "callback hell" can tell you this was true in chodejs (before it came up with one of the dumbest possible ways of doing CSP), same with anyone that had to deal with single-point-of-return languages after Dijkstra wrote that anyone that puts multiple returns in a single function has cooties.

      > what happens when you forget to copy paste it once, and no one notices for 6 years?

      If you're copying and pasting much, you're doing it wrong. At any rate, pointing out that Go has infelicities doesn't mean anything; any language has infelicities. But some languages are nice and you can write code that you are happy with, and some languages suck and the code looks ugly even if it was written by people that are fluent.

      To expand on your point about how we could all get by with COBOL, COBOL does that "ADD 1 TO X YIELDING Y" bullshit and that is verbose and ugly: it's not a matter of engineering discipline, the language is a pain in the ass, and full of boilerplate. All the engineering discipline in the world doesn't make COBOL a nicer language than, say, Forth or even FORTRAN.
      In conversation Wednesday, 19-Feb-2025 14:57:09 JST permalink
    • Embed this notice
      :blank: (i@declin.eu)'s status on Wednesday, 19-Feb-2025 14:57:10 JST :blank: :blank:
      in reply to
      • 
      @p @mint hasn't stopped people from building some

      is if err != nil { return nil, err } any better?

      what happens when you forget to copy paste it once, and no one notices for 6 years?
      In conversation Wednesday, 19-Feb-2025 14:57:10 JST permalink

      Attachments


      1. https://declin.eu/media/e2/d8/86/e2d886592673b557dcb94daaabba12f7783abd22ee585f5273b17737f1b631db.png
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Wednesday, 19-Feb-2025 15:02:08 JST pistolero pistolero
      in reply to
      • 
      • iced depresso
      • 受不了包
      • :blank:
      @i @icedquinn @mint @shibao That's not the thing that bugged me; the thing that bugged me was the spaghetti.
      In conversation Wednesday, 19-Feb-2025 15:02:08 JST permalink
    • Embed this notice
      イリエ (irie@fsebugoutzone.org)'s status on Wednesday, 19-Feb-2025 15:51:58 JST イリエ イリエ
      in reply to
      • 
      • :blank:
      @p @i @mint funny that you say that. I was reading some official lecture on programming recently (total noob here) and it mentioned that cobol is a verbose language, with an attached example
      DIVIDE B BY 7 GIVING A
      In conversation Wednesday, 19-Feb-2025 15:51:58 JST permalink
      pistolero likes this.
    • Embed this notice
      pistolero (p@fsebugoutzone.org)'s status on Wednesday, 19-Feb-2025 15:58:10 JST pistolero pistolero
      in reply to
      • 
      • :blank:
      • イリエ
      @irie @i @mint Yeah; part of the design was based on the premise that the symbols would be hard and that making it plain language would allow managers to understand the code. That experiment failed, obviously, but Ada had some success at making sense to non-technical people.

      > (total noob here)

      http://www.99-bottles-of-beer.net/ and its much larger cousin, RosettaCode (which has a very large number of programs in a very large number of languages, e.g., https://rosettacode.org/wiki/Largest_prime_factor ) are pretty good for getting a feel for how a thing looks in different languages.
      In conversation Wednesday, 19-Feb-2025 15:58:10 JST permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        99 Bottles of Beer | Start
        from 99 Bottles of Beer Team
        The song '99 bottles of beer' programmed in more than 600 different programming languages, from APL to BASIC, to Brainfuck, INTERCAL, FORTRAN, C++ or Java... This project is similiar to the Rosetta stone

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.