Live data from Hacker News

Show HN: Superblocks AI – AI coding assistant for internal apps

superblocks.com

61–66 of 66 posts

Re: Show HN: Superblocks AI – AI coding assistant for internal apps

#61
post #16

This is neat, but, as with all projects in this vein, I fail to see the real value add. We've had ML-powered code generation for several years now (Copilot released publicly in late 2021), and apart from a cute novelty, there's no real use case I've found. ( Maybe except for generating tests, but when dealing with a novel code base, the models really can't figure out dependency injection, mocks, weird edge cases I'd…

I feel like I live in an alternate universe to this comment. Every engineer I know (devops, software, hell even datascience) is using GPT-4 or Copilot (especially Copilot with the new chat interface) and people, myself included, use it every day. Refactor this code for me, add a function that does X, why is Y failing, align this code with a different coding pattern, I cobbled together this React app, clean it up and…

It’s normal. Early adopters always feel this way. It happened with home PCs, internet connections, the iPod, smartphones.

They will talk down to you about it until the wave rolls over them. It’s a tradition as old as mainframe engineers mocking PDP-11 hackers.

This one will be particularly rough for the late adopters, since one of the effects of ML code generation is compression of experience level.

Re: Show HN: Superblocks AI – AI coding assistant for internal apps

#62

Earlier quoted context omitted.

My tool aider lets you ask GPT questions about a git repo, as well as letting you ask gpt to edit the code. Here's an example of exploring and then modifying an open source js repo: https://aider.chat/examples/2048-game.html Here's an article about how it does that: https://aider.chat/docs/ctags.html I think bloop is also good for searching and Q&A against code. I'm not sure if it will let you edit/modify the code th…

Your tool looks very impressive. Have you ever tried how well it works with Android app repos?

Aider seems pretty comfortable working with android apps. Here's a conversation I just had with it:

> what's a simple, popular open source android app?

One simple and popular open source Android app is "Minimal ToDo". It's a simple task management app with a clean, minimalistic user interface. The source code is available on GitHub and it's a great project for beginners who want to understand the structure and functioning of an Android app.

> clone command to clone minimal todo?

To clone the Minimal ToDo app from GitHub, you can use the following command:

  ```bash
  git clone https://github.com/avjinder/Minimal-Todo.git
  ```
This will create a local copy of the Minimal ToDo repository on your machine.

> tell me about the overall structure of this codebase

This codebase appears to be for an Android application, specifically a to-do list app. The structure is typical of an Android project, with Java source files, XML layout files, and resource files.

1. Java Source Files: These are located in the `app/src/main/java/com/example/avjindersinghsekhon/minimaltodo` directory. The package structure suggests that the app is divided into several modules such as `About`, `AddToDo`, `Analytics`, `AppDefault`, `Main`, `Reminder`, `Settings`, and `Utility`. Each module contains classes related to its functionality.

2. XML Layout Files: These are located in the `app/src/main/res/layout` directory. They define the user interface for different activities and fragments in the app.

3. Resource Files: These include drawable resources (images, icons), values (strings, dimensions, colors), and menu definitions. They are located in the `app/src/main/res` directory.

4. Gradle Files: The `build.gradle` files specify the build configuration for the app. There are typically two such files in an Android project: one for the project and one for the app module.

5. Test Files: These are located in the `app/src/androidTest/java/com/example/avjindersinghsekhon/minimaltodo` directory. They contain tests for the application's functionality.

6. Manifest File: The `AndroidManifest.xml` file in the `app/src/main` directory declares the app's components to the Android system and specifies permissions and other app requirements.

7. Properties and Configuration Files: Files like `gradle.properties` and `.travis.yml` are used for configuration of the build system and continuous integration services.

8. Other Files: The `google-services.json` file is typically used for configuring services from Google Firebase. The `.idea` directory contains configuration files for the IntelliJ IDEA IDE.

Re: Show HN: Superblocks AI – AI coding assistant for internal apps

#63
post #53

Earlier quoted context omitted.

Thanks for including this example. It helps me understand what you mean. ChatGPT is not really equipped to do this level of code design because there are too many steps for it to handle at once. It can handle your instructions if it could first write a detailed design spec, then write code and unit tests, then run them, read the compiler output, and iteratively make changes. IOW, this would require a purpose-built so…

> ChatGPT is not really equipped to do this level of code design because there are too many steps for it to handle at once There's no code design going on here. My solution was literally just going through like 100 StackOverflow answers & Microsoft's god-awful documentation to get the 50 lines of code that does what I need it to do. In fact, this is precisely what I'd hope ChatGPT would be good for. Most of my final…

I've added the statement "let's think through the problem step by step" after your instructions. Here's GPT-4's answer. I don't know Rust so let me know if this is a better answer:

---

Sure, let's break down the problem:

1. Identify the topmost window: We can use the `winapi` crate in Rust to interact with the Windows API. The function `GetForegroundWindow` can be used to get a handle to the topmost window.

2. Check if the window is a Windows Explorer window: We can use the `GetClassNameW` function to get the class name of the window. If the window is a Windows Explorer window, the class name should be `CabinetWClass`.

3. Get the path of the active folder in the Windows Explorer window: This is a bit more complex. We can use the `SHGetPathFromIDListW` function from the Shell API to get the path from an item ID list. However, getting the item ID list for the active folder in a Windows Explorer window is not straightforward. We might need to use COM interfaces like `IShellWindows` to get the `IWebBrowserApp` for the window, and then use `IWebBrowserApp::LocationURL` to get the URL of the active folder.

4. Return the path as a string or a blank string: This is straightforward. We just need to convert the path to a string and return it, or return a blank string if the window is not a Windows Explorer window.

Here is a skeleton of the function in Rust:

  ```rust
  extern crate winapi;

  use std::ptr;
  use std::ffi::OsString;
  use std::os::windows::ffi::OsStringExt;
  use winapi::um::winuser::{GetForegroundWindow, 
  GetClassNameW};
  use winapi::um::shellapi::SHGetPathFromIDListW;
  use winapi::shared::minwindef::MAX_PATH;

  fn get_active_folder_path() -> String {
      // Get the topmost window
      let hwnd = unsafe { GetForegroundWindow() };

      // Get the class name of the window
      let mut class_name = vec![0u16; MAX_PATH + 1];
      unsafe {
          GetClassNameW(hwnd, class_name.as_mut_ptr(), class_name.len() as i32);
      }

    // Convert the class name to a string
    let class_name = OsString::from_wide(&class_name)
          .to_string_lossy()
          .into_owned();

      // Check if the window is a Windows Explorer window
      if class_name.starts_with("CabinetWClass") {
          // TODO: Get the item ID list for the active folder in the Windows Explorer window
          // TODO: Use SHGetPathFromIDListW to get the path from the item ID list
          // TODO: Convert the path to a string and return it
      }

      // If the window is not a Windows Explorer window, return a blank string
      "".to_string()
  }
  ```
Please note that this is a skeleton of the function and it's not complete. The part to get the item ID list for the active folder in a Windows Explorer window and get the path from the item ID list is complex and requires using COM interfaces, which is not straightforward in Rust. You might need to use a crate like `winrt` to interact with COM interfaces in Rust.

---

Re: Show HN: Superblocks AI – AI coding assistant for internal apps

#64
post #36

Earlier quoted context omitted.

Ever heard of Cody by Sourcegraph? about.sourcegraph.com

Does it do well? How does it get around the context window limits?

It uses Claude from anthropic which has a 100k context window. It typically stuffs the 15 most relevant files into the prompt to spit out the output. It’s shockingly fast.

I really like it for figuring out how something in my code base is done, like figuring out where exactly rate limits happen and what service we use to track them.

Re: Show HN: Superblocks AI – AI coding assistant for internal apps

#65
post #36

Earlier quoted context omitted.

Does it do well? How does it get around the context window limits?

It uses Claude from anthropic which has a 100k context window. It typically stuffs the 15 most relevant files into the prompt to spit out the output. It’s shockingly fast. I really like it for figuring out how something in my code base is done, like figuring out where exactly rate limits happen and what service we use to track them.

Will check it out - thank you!
Post reply on HN