home.social

#racket — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #racket, aggregated by home.social.

  1. pyffi - Use Python from Racket

    The library pyffi makes it possible to use Python libraries from Racket.
    a Racket program can call Python function and invoke Python methods

    pyffi-team.github.io/pyffi/

    For examples with comments, see: github.com/pyffi-team/pyffi/tr

    #Racket #python

  2. " This is the sequence: tikanga #Māori called "mumbo jumbo" → #complaint filed → #BSA asserts #jurisdiction#government #kills the BSA.

    That is not a #policy timeline. That is a #protection #racket."

    themaorigreenlantern.maori.nz/

    "Founded and operated by Ivor Jones — tohunga mau rākau wairua, kaitiaki of Māori communities, and holder of a Bachelor of Social Sciences (Psychology) from the University of Waikato — The Māori Green Lantern is not a commentary platform. It is a systematic accountability operation. "

    "The BSA, established under the Broadcasting Act 1989, was Aotearoa's only legislated broadcast standards body with the power to receive complaints, investigate breaches of accuracy, fairness, and balance, and penalise broadcasters, as documented in the BSA's own jurisdiction ruling. It emerged from the post-Rogernomics deregulation era — explicitly because unregulated broadcasting produced harm. That history is being deliberately erased."

    "In 2024, BSA research found that 79% of Māori, 85% of Pacific Peoples, 76% of Asian New Zealanders, and 75% of Muslims feel exposure to offensive or discriminatory content is a problem in New Zealand broadcasting"

    "Imagine you live in a neighbourhood where a pack of dogs — some feral, some pretending to be pets — have been digging under the fence, biting children, fouling the water.

    "For decades, the neighbourhood employed a kurī — a watchdog, te mana whanonga kaipāho — trained to hear the difference between barking and biting, between debate and dehumanisation.

    "Then, one afternoon, the landlord — Paul Goldsmith, Media and Communications Minister — walks out with a press release and a pat on the back for the feral dogs, and shoots the kurī.

    "Not because the kurī was failing. Because the kurī bit back."

  3. oof so as far as I can tell Racket has no way to get a field from an object based on a variable. like in Python you can do this:

    class SomeClass:
        def __init__(self):
            self.foo = 666
    
    obj = SomeClass()
    field_name = "foo"
    getattr(obj, field_name) # -> 666
    

    but as far as I can tell #Racket literally will not let you do that T_T the field name basically has to be known at compile time or it won’t work. that is actually terrible because I’m trying to make a (get) form that is able to drill down into data structures given a list of keys:

    (get some-data '(2 4 hash-key obj-field))
    

    but I think it’s literally impossible for me to make it work with objects

  4. RE: mastodon.social/@touaregtweet/

    La France n'est plus une démocratie depuis l'élection de Macron et, comme toute tyrannie, elle est basée sur une mafia crapuleuse donc #corruption, #chantage, #racket, #crimes et #prostitution.

    Pleurer aujourd'hui pour que son activité de prostitution soit examinée arrve "un rien" trop tard.

    La proposition du sinistre de la justice d'enterrer les viols en 24 heures démontre que, d'une part il est lui-même coutumier du fait, d'autre part que c'est bien une des activités piliers des mafias crapuleuses qu'il cherche à "étatiser" à présent.

    En fait, le réseau de protitution bourgeois d'Epstein a gangrené depuis longtemps toute la classe politique française depuis les années Mitterrand au moins. L'affaire Jack Lang démontre clairement que les cadres du PS en sont des acteurs traditionnels.

    #france #epsteinfiles #Epstein #mafia

  5. RE: mastodon.social/@touaregtweet/

    La France n'est plus une démocratie depuis l'élection de Macron et, comme toute tyrannie, elle est basée sur une mafia crapuleuse donc #corruption, #chantage, #racket, #crimes et #prostitution.

    Pleurer aujourd'hui pour que son activité de prostitution soit examinée arrve "un rien" trop tard.

    La proposition du sinistre de la justice d'enterrer les viols en 24 heures démontre que, d'une part il est lui-même coutumier du fait, d'autre part que c'est bien une des activités piliers des mafias crapuleuses qu'il cherche à "étatiser" à présent.

    En fait, le réseau de protitution bourgeois d'Epstein a gangrené depuis longtemps toute la classe politique française depuis les années Mitterrand au moins. L'affaire Jack Lang démontre clairement que les cadres du PS en sont des acteurs traditionnels.

    #france #epsteinfiles #Epstein #mafia

  6. RE: mastodon.social/@touaregtweet/

    La France n'est plus une démocratie depuis l'élection de Macron et, comme toute tyrannie, elle est basée sur une mafia crapuleuse donc #corruption, #chantage, #racket, #crimes et #prostitution.

    Pleurer aujourd'hui pour que son activité de prostitution soit examinée arrve "un rien" trop tard.

    La proposition du sinistre de la justice d'enterrer les viols en 24 heures démontre que, d'une part il est lui-même coutumier du fait, d'autre part que c'est bien une des activités piliers des mafias crapuleuses qu'il cherche à "étatiser" à présent.

    En fait, le réseau de protitution bourgeois d'Epstein a gangrené depuis longtemps toute la classe politique française depuis les années Mitterrand au moins. L'affaire Jack Lang démontre clairement que les cadres du PS en sont des acteurs traditionnels.

    #france #epsteinfiles #Epstein #mafia

  7. RE: mastodon.social/@touaregtweet/

    La France n'est plus une démocratie depuis l'élection de Macron et, comme toute tyrannie, elle est basée sur une mafia crapuleuse donc #corruption, #chantage, #racket, #crimes et #prostitution.

    Pleurer aujourd'hui pour que son activité de prostitution soit examinée arrve "un rien" trop tard.

    La proposition du sinistre de la justice d'enterrer les viols en 24 heures démontre que, d'une part il est lui-même coutumier du fait, d'autre part que c'est bien une des activités piliers des mafias crapuleuses qu'il cherche à "étatiser" à présent.

    En fait, le réseau de protitution bourgeois d'Epstein a gangrené depuis longtemps toute la classe politique française depuis les années Mitterrand au moins. L'affaire Jack Lang démontre clairement que les cadres du PS en sont des acteurs traditionnels.

    #france #epsteinfiles #Epstein #mafia

  8. RE: mastodon.social/@touaregtweet/

    La France n'est plus une démocratie depuis l'élection de Macron et, comme toute tyrannie, elle est basée sur une mafia crapuleuse donc #corruption, #chantage, #racket, #crimes et #prostitution.

    Pleurer aujourd'hui pour que son activité de prostitution soit examinée arrve "un rien" trop tard.

    La proposition du sinistre de la justice d'enterrer les viols en 24 heures démontre que, d'une part il est lui-même coutumier du fait, d'autre part que c'est bien une des activités piliers des mafias crapuleuses qu'il cherche à "étatiser" à présent.

    En fait, le réseau de protitution bourgeois d'Epstein a gangrené depuis longtemps toute la classe politique française depuis les années Mitterrand au moins. L'affaire Jack Lang démontre clairement que les cadres du PS en sont des acteurs traditionnels.

    #france #epsteinfiles #Epstein #mafia

  9. I’ve decided that I want to give #Racket another chance, and see if I can work out solutions to the problems that I ran into when trying to use it. it’s definitely the #Lisp that feels most practical to me out of everything that I’ve tried, and I still love the contract system and its specific take on threading macros

    I remember that the error tracebacks were often missing important info, so I want to wait until that happens and see if I can figure out what the specific problem is/was

    I was also trying to get some kind of static function signature checking, to make sure I was calling things right, but I’ve decided that I’m okay with relying on runtime errors (from contract violations) instead, as long as I can read the error tracebacks easily enough

    another problem that I ran into while using it is that it feels clumsy and awkward to work with complex data structures

    with Python I’m used to being able to nest objects pretty much arbitrarily deep, and have my LSP autocomplete all of the fields/methods at each step so I know exactly what type of data I have, and what I can do with it. with Racket that isn’t really the case - I need to flip through my source code in another split to remember what data I have at each step and how to transform it. I don’t think there’s a solution for this - I think I’ll just have to deal with this unfortunately

    another aspect of Racket handling complex data structures clumsily is just that the syntax for drilling into a data structure is pretty noisy and long:

    (~> some-data-structure
      (get-field foo _)
      (hash-ref "some-key")
      (list-ref 0)
      some-struct$-field)
    

    compare that to most other languages, which would let you just write:

    some_data_structure.foo["some-key"][0].field
    

    this problem gets so much worse when you need to actually mutate the data, and even worse than that when it’s immutable. here’s a real function that I wrote in Racket: (it’s for a really basic clicker game)

    (define/contract (game-state$-buy-autoclicker state ac-name)
      (-> game-state$? string? game-state$?)
      (define-struct-lenses game-state$)
      (define-struct-lenses ac-slot$)
      (define &ac
        (lens-compose (&hash-ref ac-name) &game-state$-autoclickers))
      (define ac-cost
        (~> (&ac state)
            ac-slot$-cost))
      (printf "buying autoclicker ~a for cost ~a\n" (&ac state) ac-cost)
      (define &ac-num-owned
        (lens-compose &ac-slot$-num-owned &ac))
      (define new-state
        (~> state
            (game-state$-clicks-update (-= ac-cost))
            (lens-update &ac-num-owned _ (+= 1))))
      (if (negative? (game-state$-clicks state))
          (error "not enough clicks to buy this autoclicker")
          new-state))
    

    pretty much all it’s doing is this:

    class GameState:
        def buy_autoclicker(self, ac_name):
            ac = self.autoclickers[ac_name]
            cost = ac.get_cost()
            print(f"buying autoclicker {ac} for cost {cost}")
    
            if cost > self.clicks:
                raise Exception("not enough clicks to buy this autoclicker")
    
            ac.num_owned += 1
            self.clicks -= cost
    

    but the combination of nested data and immutability make it a huge mess in Racket

    I’m definitely open to suggestions for how I can make this type of code shorter and easier to read, but for the moment here’s what I’m going to try:

    I’m going to stop using structs completely in favor of classes, because classes are a great way to have mutability (which fixes the immutability problem) which is neatly contained in a way that can be easily unit-tested, and the syntax and semantics for dealing with classes are often shorter, simpler, and more consistent too

    I’m also going to see if I can make a series of general-purpose “get/set/update the data in this nested data structure” forms:

    (get-in some-data '(0 3 field-name "some-key"))
    ; returns some_data[0][3].field_name["some-key"]
    (set-in some-data '(0 3 field-name "some-key") "new-value")
    ; returns a version of some_data with the specific data changed
    
    ; etc.:
    (set!-in some-data '(0 3 field-name "some-key") "new-value")
    (update-in some-data '(0 3 field-name "some-key") (+= 1))
    (update!-in some-data '(0 3 field-name "some-key") (+= 1))
    

    that way, my very first example would look like this instead:

    (get-in some-data-structure '(foo "some-key" 0 field))
    

    and I could refactor my function into a method that looks like this:

    (define (buy-autoclicker ac-name)
      (define ac (hash-ref autoclickers ac-name))
      (define cost (send ac get-cost))
      (printf "buying autoclicker ~a for cost ~a\n" ac cost)
      (when (> cost clicks)
          (error "not enough clicks to buy this autoclicker"))
      (set! clicks (- clicks cost))
      (update-field! num-owned ac add1))
    

    that’s dramatically shorter and nicer

  10. Phase 2 took a step forward. Someone else fixed a threading issue and that made everything pass on the HEAD of the git repository for #Chez #scheme on my #haikuos build box. So I've just submitted the PR to the upstream project to re-establish Haiku support in Chez. Let's see how that goes.

    Reminder, the #haikuports version of Chez Scheme is already available.

    I've done a bit of experimenting getting #racket to build, but I'm not there yet. #Akku looks promising too.

  11. Phase 2 took a step forward. Someone else fixed a threading issue and that made everything pass on the HEAD of the git repository for #Chez #scheme on my #haikuos build box. So I've just submitted the PR to the upstream project to re-establish Haiku support in Chez. Let's see how that goes.

    Reminder, the #haikuports version of Chez Scheme is already available.

    I've done a bit of experimenting getting #racket to build, but I'm not there yet. #Akku looks promising too.

  12. Phase 2 took a step forward. Someone else fixed a threading issue and that made everything pass on the HEAD of the git repository for #Chez #scheme on my #haikuos build box. So I've just submitted the PR to the upstream project to re-establish Haiku support in Chez. Let's see how that goes.

    Reminder, the #haikuports version of Chez Scheme is already available.

    I've done a bit of experimenting getting #racket to build, but I'm not there yet. #Akku looks promising too.

  13. Phase 2 took a step forward. Someone else fixed a threading issue and that made everything pass on the HEAD of the git repository for #Chez #scheme on my #haikuos build box. So I've just submitted the PR to the upstream project to re-establish Haiku support in Chez. Let's see how that goes.

    Reminder, the #haikuports version of Chez Scheme is already available.

    I've done a bit of experimenting getting #racket to build, but I'm not there yet. #Akku looks promising too.

  14. Phase 2 took a step forward. Someone else fixed a threading issue and that made everything pass on the HEAD of the git repository for #Chez #scheme on my #haikuos build box. So I've just submitted the PR to the upstream project to re-establish Haiku support in Chez. Let's see how that goes.

    Reminder, the #haikuports version of Chez Scheme is already available.

    I've done a bit of experimenting getting #racket to build, but I'm not there yet. #Akku looks promising too.

  15. Next steps:
    - Work on getting the new machine types into the upstream #Chez #Scheme project.
    - Take this work and use it to get #Racket building on top of Chez for #HaikuOS

  16. Well, I had to learn more that I was expecting (particularly about how tests work in the #chez #scheme code), but I've just submitted the PR on the #haikuports
    repository. If that port gets accepted I'll have a go at getting the new #haiku machine types for Chez added to the upstream project.

    I might then move towards getting #racket up and running on #Haiku on the basis of the Chez port. #haikuos

  17. Well, I had to learn more that I was expecting (particularly about how tests work in the #chez #scheme code), but I've just submitted the PR on the #haikuports
    repository. If that port gets accepted I'll have a go at getting the new #haiku machine types for Chez added to the upstream project.

    I might then move towards getting #racket up and running on #Haiku on the basis of the Chez port. #haikuos

  18. Well, I had to learn more that I was expecting (particularly about how tests work in the #chez #scheme code), but I've just submitted the PR on the #haikuports
    repository. If that port gets accepted I'll have a go at getting the new #haiku machine types for Chez added to the upstream project.

    I might then move towards getting #racket up and running on #Haiku on the basis of the Chez port. #haikuos

  19. Well, I had to learn more that I was expecting (particularly about how tests work in the #chez #scheme code), but I've just submitted the PR on the #haikuports
    repository. If that port gets accepted I'll have a go at getting the new #haiku machine types for Chez added to the upstream project.

    I might then move towards getting #racket up and running on #Haiku on the basis of the Chez port. #haikuos

  20. Well, I had to learn more that I was expecting (particularly about how tests work in the #chez #scheme code), but I've just submitted the PR on the #haikuports
    repository. If that port gets accepted I'll have a go at getting the new #haiku machine types for Chez added to the upstream project.

    I might then move towards getting #racket up and running on #Haiku on the basis of the Chez port. #haikuos