invalidusernamelol [he/him]

  • 2 Posts
  • 51 Comments
Joined 4 years ago
cake
Cake day: July 30th, 2020

help-circle



  • I still think in development environments, limited LLM systems can be used in tandem with other systems like linters and OG snippets to help maintain style and simplify boilerplate.

    I use Co-Pilot at work because I do development on the side and need something to help me bash out simple scripts really fast that use our apis. The codebase we have is big enough now (50,000 ish lines and hundreds of files) so it tends to pick up primarily on the context of the codebase. It does still fallback to the general context pretty often though and that’s a fucking pain.

    Having the benefits of an LLM trained on your own code and examples without the drawbacks of it occasionally just injecting random bullshit from its training data would be great.





  • Even better is to create a decorator and just wrap the offending functions:

    def shut_up(func):
        def call(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                print(f"shit's fucked, but I'll be quiet about it")
                return
        return call
    
    @shut_up
    def add(x: int, y: int):
        print(x + y)
    
    add(1, 2)
    add(-1, 2)
    add(1, "2")
    
    >>> 3
    >>> 1
    >>> "shit's fucked, but I'll be quiet about it"
    

    Or if you want to attempt to salvage it:

    def shut_up(func):
        def call(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                try:
                    return func(*map(int, args), **kwargs)
                except Exception as e:
                    print(f"shit's really fucked, I even tried to fix it for you")
                    return None
        return call
    

  • You just have to do it manually in Python or rely on systems like mypy to get ‘static’ checking.

    It can be useful to rely on duck typing though if you don’t want to have to re-implement or inherit from an existing base class to use a higer order function.

    If the function is written in a way where all it needs is specific methods or parameters from its input objects, you can really save on interface bloat.

    But if someone is used to writing statically typed code and has to deal with that it can create a lot of confusion and I always end up writing a ton of override signatures either in my code or in a .pyi sidecar so whoever is using it can still get some form of feedback that what they’re doing is okay. Or at the very least putting that information in the docstring so people can read the docs as they’re using the function.



  • It’s funny how Python spent the past like 6 years developing the type hinting system (which is a massive improvement from no typing don’t get me wrong) only to start re-introducing duck typing again with the Protocols.

    The one thing I’ll always love about it is the ability to override builtins and do dumb things like call ‘sum(cats)’ where cats is a list of cat objects and have it like print out meow to the terminal for each cat in the list.

    Shit like that makes it perfect for internal tools.


  • Plaintext and a simple kanban board are all you need.

    I’ve been using one called Planka and it’s great. Incredibly minimal and all important info is documented elsewhere so it can just be used for organization.

    Love using a basic SQL database for data warehousing (we need it for billing purposes and SQL records give us a lot more freedom to set up visualizations and data dashboards).

    All day to day communication is either in person, over chats, or though plaintext files and comments left in project directories.







  • The only thing that might save it is the size of the screens (mentioned in the article). The problem with most Western fully touchscreen “infotainment” systems is that they use tiny screens with laggy interfaces. Because the automakers don’t know how to make this stuff and contract out to the lowest bidder like they always have with stereo equipment, only now that stereo is also integral to the car’s operation.

    If the car and the interface are designed from the ground up to be readable and responsive, I think there is a way to pull it off (again as mentioned in the article). Having physical interfaces for basic operations related to safety and things that are messed with frequently (volume, shifting, AC, lights, signals, wipers) is a must though because a 2d interface can’t fully take advantage of our 3d spatial awareness.