Live data from Hacker News

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

superblocks.com

41–50 of 66 posts

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

#41
post #18

Earlier quoted context omitted.

You're telling me you've never once pressed "TAB" to auto-fill the line or even several lines with Copilot? Because about half of the letters in my source code is now Copilot generated. The value added is that you don't send your source code to OpenAI and/or their parent org Microsoft.

Microsoft has owned GitHub since 2018.

I think the GP meant the value added by Superblocks?

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

#42

Earlier quoted context omitted.

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 not better then me. But I use it when I'm lazy, tired or at times drinking. And then it's really nice. At times it costs me too much time solving it's mistakes. But then it nails something perfectly and I'm impressed again.

I often work with new (to me) tech or build prototypes/PoCs, it's pretty great for that.

It's useful to recognize when a dialog is a dead-end, otherwise it's easy to enter a rabbit hole that the llm can't get out of. Best to poke at it from another angle and/or within a new dialog, then.

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

#43
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…

Forgive the long reply, but I'm going to go ahead and "press X to doubt," because I have been trying to use both ChatGPT and Copilot, and the results are abysmal apart from anything but "write me a linked list" or "give me some React boilerplate." If you have examples of it working for you, please share them. Here's a very salient example of it not working for me: I spent about 1-2 days figuring this out, so it's definitely non-trivial, but it's not something insane either. I'm working on a new project/startup idea and this is part of it (verbatim prompt I just used on chatGPT):

    hi, can you write me a function in rust that, if running on windows:

    1. figures out if the topmost window is a windows explorer window
    2. if it's a windows explorer window, it returns the path (as a string) that the windows explorer window is actively viewing
    3. if it's not a windows explorer window, it returns a blank string
This is a deceptively difficult task, as it requires all kinds of COM finagling, and ChatGPT gets it royally wrong:

    #[cfg(windows)]
    fn get_active_explorer_path() -> String {
        use std::ptr;
        use winapi::um::winuser::{EnumWindows, GetWindowTextW, IsWindowVisible};
        use winapi::shared::windef::HWND;
        use std::os::raw::c_int;
        use std::ffi::OsString;
        use std::os::windows::ffi::OsStringExt;

        let mut path = String::new();
        let mut active_explorer = None;

        unsafe extern "system" fn enum_windows_callback(hwnd: HWND, lparam: LPARAM) -> c_int {
            let active_explorer = &mut *(lparam as *mut Option);
            let mut buffer: [u16; 512] = [0; 512];
            if IsWindowVisible(hwnd) != 0 && GetWindowTextW(hwnd, buffer.as_mut_ptr(), 512) != 0 {
                let window_title = OsString::from_wide(&buffer[..]).to_string_lossy();
                if window_title == "File Explorer" {
                    *active_explorer = Some(hwnd);
                    return 0; // Stop enumeration
                }
            }
            1 // Continue enumeration
        }

        unsafe {
            EnumWindows(Some(enum_windows_callback), &mut active_explorer as *mut _ as LPARAM);
        }

        if let Some(hwnd) = active_explorer {
            let mut buffer: [u16; 512] = [0; 512];
            if GetWindowTextW(hwnd, buffer.as_mut_ptr(), 512) != 0 {
                let window_title = OsString::from_wide(&buffer[..]).to_string_lossy();
                if window_title == "File Explorer" {
                    let shell32 = winapi::um::shellapi::GetShellWindow();
                    if shell32 != hwnd {
                        let mut path_buffer: [u16; 512] = [0; 512];
                        if winapi::um::shellapi::SHGetPathFromIDListW(ptr::null_mut(), path_buffer.as_mut_ptr()) != 0 {
                            let path_str = OsString::from_wide(&path_buffer[..]).to_string_lossy();
                            path = path_str.into_owned();
                        }
                    }
                }
            }
        }

        path
    }
I'm actually on my Mac right now, and I don't even need to test it, because the first red flag is `"window_title == "File Explorer"`. File Explorer will change its window titlebar to the currently viewed folder (so the conditional will always fail). There's also other comical mistakes, including passing a null pointer to `SHGetPathFromIDListW`, using `GetShellWindow` which returns the desktop, and not taking into account that Explorer windows can have multiple tabs. Okay, let's see if we fare better on MacOS.

    #[cfg(target_os = "macos")]
    fn get_active_finder_path() -> String {
        use std::ptr;
        use objc::runtime::{Class, Object};
        use objc::{class, msg_send, sel, sel_impl};
        use objc_id::Id;

        let mut path = String::new();

        unsafe {
            let workspace: Id = msg_send![class!(NSWorkspace), sharedWorkspace];
            let front_window: Id = msg_send![workspace, frontmostApplication];
            let front_window_pid: u32 = msg_send![front_window, processIdentifier];
            let running_apps: Id = msg_send![workspace, runningApplications];
            let app_count: usize = msg_send![running_apps, count];
            for i in 0..app_count {
                let app: Id = msg_send![running_apps, objectAtIndex: i];
                let app_pid: u32 = msg_send![app, processIdentifier];
                if app_pid == front_window_pid {
                    let bundle_url: Id = msg_send![app, bundleURL];
                    let bundle_path: *const Object = msg_send![bundle_url, path];
                    let path_str: *const i8 = msg_send![bundle_path, UTF8String];
                    if !path_str.is_null() {
                        let c_str = std::ffi::CStr::from_ptr(path_str);
                        path = c_str.to_string_lossy().to_string();
                    }
                    break;
                }
            }
        }

        path
    }

    #[cfg(not(target_os = "macos"))]
    fn get_active_finder_path() -> String {
        String::new()
    }

    fn main() {
        let active_finder_path = get_active_finder_path();
        println!("Active Finder Path: {}", active_finder_path);
    }
Doesn't look like it: this is what I got, which doesn't even compile. I'm not as familiar with MacOS systems programming, so I'm not even sure what's wrong with it, frankly. My solution involved using osascript on MacOS (which is the first Google hit, though I'll have to port it, as some folks may not have it on their systems).

So what is ML code generation useful for? Apart from helping on the Nth CRUD app someone's building, I just don't see it.

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

#44
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…

Copilot shines with a number of things and isn't very good at a number of other things. Whether you get value out of Copilot says more, I think, about the kind of work you do on a day-to-day basis than it does about the utility of Copilot.

Copilot/GPT is excellent at writing lots of new lines of code. It's also really good at getting you started in code/frameworks that you don't really understand.

However, Copilot/GPT is not nearly as good at troubleshooting problems in existing code. If your job involves lots of bug fixing or tweaks to existing features, Copilot and GPT are next to useless.

I've noticed that if my work falls into the first category, Copilot often speeds me up something like 30% to 40%. If my work falls into the second category, it's 0%.

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

#45
post #43

Earlier quoted context omitted.

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…

Forgive the long reply, but I'm going to go ahead and "press X to doubt," because I have been trying to use both ChatGPT and Copilot, and the results are abysmal apart from anything but "write me a linked list" or "give me some React boilerplate." If you have examples of it working for you, please share them. Here's a very salient example of it not working for me: I spent about 1-2 days figuring this out, so it's def…

When I have use cases similar to this one (similar in complexity), I'll pair program with it. If the code fails, I'll tell it what error I got and ask it to refactor. If the explanation it gives with the code shows it didn't understand the question, I'll guide it along the correct track.

It's not perfect at "zero-shot" answers but from my experience is very good when you work with it conversationally.

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

#46
post #43

Earlier quoted context omitted.

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…

Forgive the long reply, but I'm going to go ahead and "press X to doubt," because I have been trying to use both ChatGPT and Copilot, and the results are abysmal apart from anything but "write me a linked list" or "give me some React boilerplate." If you have examples of it working for you, please share them. Here's a very salient example of it not working for me: I spent about 1-2 days figuring this out, so it's def…

I get a lot of mileage out of GPT, so let me see if I can explain. I wouldn't ask GPT/Copilot to do what you asked. After using them for a while you start to get an intuitive sense of what's easy and what's hard for them to do, and your specific example is indeed too difficult to get GPT to do properly. They have the biggest utility for me for stuff that I would ask a junior programmer to do - like a new grad.

The real value proposition of GPT isn't that it can solve really hard problems. The value proposition is that it's about as capable as a junior engineer, except it can write code much faster than any junior engineer, so it can speed you along on the boilerplate-y parts of coding that otherwise would be a lot of manual effort. It's especially useful for things that feel "easy" but which I don't have the relevant domain expertise. For instance, the other day I needed to write a fairly trivial shell script to parse some JSON files. I never write shell scripts and I always forget the syntax, but GPT wrote it correctly on the first try. That probably saved me 20-30 minutes of googling for how to do things like read files, etc in shell scripts.

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

#47
post #40

Earlier quoted context omitted.

> I haven't seen or heard of anyone that seriously uses ChatGPT to generate code and uses it in prod I have. And I'm sure others have too. I dare say there are many who probably _shouldn't_ be using it because of privacy/IP concerns and so you won't hear about them. > cute novelty [...] I thought the same not so long ago. But gpt4 for me was a game changer. It's helped me debug and fix some legitimately complex code,…

> I imagine it's already happening. Not quite, that I know of, but some of us are working on it :) I have a feeling that while the glorious future you describe can probably be realized using LLMs as a foundational technology, the software engineering effort needed to get there is on par with other AI moonshot projects e.g. autonomous vehicles. If you or others reading this are interested in this topic, see this post…

Can you not please? I enjoy coding and I don’t want to have to change careers again. Can you just automate something else like Congress or the people running the Taco Bell drive through?

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

#48
post #44

Earlier quoted context omitted.

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…

Copilot shines with a number of things and isn't very good at a number of other things. Whether you get value out of Copilot says more, I think, about the kind of work you do on a day-to-day basis than it does about the utility of Copilot. Copilot/GPT is excellent at writing lots of new lines of code. It's also really good at getting you started in code/frameworks that you don't really understand. However, Copilot/GP…

How about this? Taking a dense obtusely written ML algorithm with a ton of mathematical notation, plug it into GPT4, and get torch code? Cuz I do that often.

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

#49
post #48
post #44

Earlier quoted context omitted.

Copilot shines with a number of things and isn't very good at a number of other things. Whether you get value out of Copilot says more, I think, about the kind of work you do on a day-to-day basis than it does about the utility of Copilot. Copilot/GPT is excellent at writing lots of new lines of code. It's also really good at getting you started in code/frameworks that you don't really understand. However, Copilot/GP…

How about this? Taking a dense obtusely written ML algorithm with a ton of mathematical notation, plug it into GPT4, and get torch code? Cuz I do that often.

That falls pretty clearly into the first bucket the parent listed, "Help write lots of code"

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

#50
post #43

Earlier quoted context omitted.

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…

Forgive the long reply, but I'm going to go ahead and "press X to doubt," because I have been trying to use both ChatGPT and Copilot, and the results are abysmal apart from anything but "write me a linked list" or "give me some React boilerplate." If you have examples of it working for you, please share them. Here's a very salient example of it not working for me: I spent about 1-2 days figuring this out, so it's def…

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 solution which uses ChatGPT's underlying engine to take your list of requirements and turn them into built and tested code.

Post reply on HN