anti-idpol action

I am working on fedi software that is hoping to allow Kodi, Plex and Popcorn Time get rid of IMDb/TMDB dependency. Dm me if you’re skilled in SvelteKit and/or Go, especially the Fiber framework, or machine learning with Rust and willing to contribute.

  • 0 Posts
  • 84 Comments
Joined 1 year ago
cake
Cake day: September 10th, 2023

help-circle
  • In Clojure, -> is used for inserting the piped argument at the head position in the arguments of whatever it is passed to, while ->> is used for inserting it at the tail. This approach is great for working with immutable data in a series of approachable transformations, which I believe is one reason why so many Domain-Specific Languages for generative programming are written in that language, aside from its interactive REPL. Additionally, there is no need to worry about excessive copying, as this is generally well optimized.

    This can be particularly useful with HoneySQL, which is more of a DSL for SQL rather than a typical ORM tool. For example:

    (defn apply-filters [query filters]
    "applies WHERE clauses to a query"
      (reduce (fn [q [column value]]
                (helpers/where q [:= column value]))
              query
              filters))
    
    (defn build-dynamic-query [{:keys [table columns filters sort-by limit]}]
      (-> {}
          (helpers/select columns)
          (helpers/from table)
          (apply-filters filters)
          (helpers/order-by sort-by)
          (helpers/limit limit)
          sql/format))
    
    ;; Result - a super readable function call that resembles a natural language 
    (build-dynamic-query 
      {:table :products 
       :columns [:id :name :price] 
       :filters {:category "electronics" :in-stock true}
       :sort-by [:price :desc]
       :limit 20})
    







  • also Huawei laptops. Jfc what a trashy counterfeit of a MacBook and if you get an AMD one, better also get a good cooling stand. The keyboard is terrible and costs a fuckton to replace and generally the repairability is like with macs, the USB ports are built in a way that just begs for either them or your peripherals to be broken, they might overheat while charging, they ship bloatware and the speakers are ridiculously quiet. My friend’s mom bought her one contrary to my advice to get a second-hand thinkpad or just any other business-line laptop and it she had to return the first shipment because the screen got bent during shipment.

    MIUI… don’t even get me fucking started on this garbage. It literally removes numerous features from vanilla android, presumably to relocate some performance budget to the bloat they add.



  • premature optimization is a root of all evil.

    also when those morons decide to do ‘microservices’ but end up creating glorified SOA with one messy DB where half the tables are not even used by anything, updates in place are the standard and there is nothing like one team per service, but instead everyone is expected to navigate millions of lines of spaghetti code with poor documentation, barely any reuse and inconsistencies all across the board with this oh too-fucking-common entity service anti-pattern.

    and so much fucking coupling that you better start deploying your dev cluster just right after waking up so it maybe is up and running by the time your daily is over.

    Fun fact, I used to work at a company where a lot of projects use Elixir and a bulk share of my coworkers have been outspoken critics of microservices precisely because OTP manages to power fault tolerant and scalable systems but not by insane levels of complexity like kubernetes does but by CoC that rarely gets in your way.


  • I only use vscodium for things that are not that well supported by neovim, in my case it’s only Scala basically, but I guess I’m just to lazy to properly configure metals. I use Sway as my desktop and I don’t want to go into configuring DPI just for vscodium or switch to gnome to not ruin my vision even further when using it. This is what I like about terminal-based editors - the whole Ui scales with a single key combination. Speaking of which I also consider the combinations provided by many Neovim “distributions” (and my workflow ;p) way more ergonomic than emacs-y finger gymnastics of vscode and the likes, since I just hit the space twice and type a command alias without moving my fingers from where they should be on the keyboard instead of memorizing gazillion combinations working little by little towards giving me a carpal tunnel.









  • Clojure. Although it’s currently the most popular lisp but the ecosystem is not super lively and sometimes you need to rely on Java interop. This also severely limits the platform flexibility, if more things were written in pure Clojure or targeting BEAM or CLR it’d be nice. But luckily at least unless a library you use doesn’t rely on Java interop, the language is designed in a way that really reduces the bit rot.

    Fun thing about it is that despite the S-expressions which you love to appreciate - I mean, it usually looks better than }) at the end of a Promise / closure in js or super deep nesting which you’d easily resolve using a thread last macro in Clojure. Therefore I’m also really excited that the pipe operator is finally coming to JS soon. Just add colored delimiters to your IDE. The virtual lack of syntax makes it quite easy to pick up.

    With lisp semantics and minimal syntax that resemble the lambda calculus very closely, dynamic typing is rarely an issue (you can still specify types optionally), not to mention that pure functions are super easy to reliably test. Also, many things like DOM, nested data structures, b-trees (to a degree) or ASTs are actually structured like an S-expression tree, making Clojure good for such applications. All of this allows for clean code that does not feel like an assortment of free functions but is usually very loosely coupled yet everything seems to fit really neatly together like a coherent tree.
    In general LISPs, as the name implies, are a superb tool for studying algorithms and DS in a way that allows you to focus on the problem itself more than the implementation, unlike in imperative languages where going into every little step in what feels like almost operating at individual CPU instructions at times can feel overwhelming and confuse the hell out of you.

    Realizing the open-closed principle with Clojure comes pretty naturally since you’d more likely use function composition or write new transformations than modify the existing functionality.
    Since functions are the primary unit of abstraction, dependency inversion is also trivial to adhere to.
    Also protocols, which are somewhat more powerful than interfaces in some OO languages. They offer multi-method dynamic dispatch, retroactive polymorphism (extending types defined outside the current codebase), are independent from class hierarchy and are generally somewhat more succinct as virtually everything in that language.

    First-class support for STM and immutability also make it good for concurrency like most functional PLs and make it a bit more intuitive than the actor model of Elixir/Akka.
    Some Clojure frameworks do as well in certain benchmarks as those written in Rust.
    Also compared to some other lisp dialects, the “primary” data structure is not a singly-linked list.

    It’s goto data representation format, EDN is also a really nice thing.
    And you have a REPL and get to choose what should be compiled AOT and what JIT. It’s most popular build tool, Leiningen is quite neat and in my experience has been a little bit faster in terms of dependency retrieval than Mix used by Elixir.

    It can also transpile to js or dart. It generally is a quite flexible and extensible language where the said extensibility does not really make you feel the levels of inconsistency comparable only with PHP a couple years ago before they’ve decided to get it’s shit together as much as possible as can be the case with Haskell codebases that rely on a large number of language extensions.

    And lastly, first-class documentation support but that should be a standard (looking at you JS and everything that still uses Doxygen)

    Tbh Clojure’s greatest Achilles’ foot is the baggage of JVM with it’s lengthy stack traces, startup time, lack of tail call optimization, different paradigm and backwards compatibility issues. So if the question was which runtime you wish was more popular, I’d pick BEAM. But in it’s current state, whilst BEAM is more suited for functional programming, Clojerl doesn’t allow you to do much more than the standard library since many libraries wrap java, like web frameworks for example.
    But on the other hand, JVM integration might make it easier for teams using Java or Scala to adopt Clojure.

    Also it might not do the best job of handling bugs gracefully. This is good in the sense of giving you those almost Rust-like levels of strictness but without the lengthy compilation time but if you are looking for a way to move fast and tolerate some breakage, Elixir could be a better pick.
    Also currying is not automatic and you have to use partial or macros.
    But speaking of macros, they are almost as neat as in Rust and much more intuitive than in C or Scala.