Today we launched Superblocks AI and are excited to hear feedback from the HN community!
Superblocks AI combines the power of the Superblocks drag-and-drop App Builder with robust AI code generation, code optimization, code explanation, mock data generation, and API call generation across SQL, Python, JavaScript, JSON and HTML.
We built Superblocks AI with the intention to streamline some of the repetitive and often confusing aspects of building internal tools, here’s a brief overview:
Generate Code: LLMs like ChatGPT have quickly become a critical part of developers' lives and we wanted to bring that experience natively into our product. The response is streamed for the best UX, similar to Chat-GPT, and can be modified before use.
Explain Code: Understanding someone else’s code for large internal engineering teams is often a challenge. Highlight code and Superblocks AI offers an explanation that you then have the ability to add as a comment.
Edit Code: You can make alterations to code by highlighting it and choosing prompts like optimize performance, enhance readability, or something custom. We've added an inline code diff view for easy verification of changes.
Generate API Calls: You often want to make an API call but need to spend 30 minutes looking up the documentation and crafting the correct call in Postman. We provided a way for you to give a prompt, and Superblocks AI will generate REST and GraphQL queries for APIs like Stripe, Salesforce, your favorite SaaS provider, and more.
Generate Mock Data: This enables faster UI development by generating mock data for components like tables, charts, grids etc., which can be especially handy during prototyping.
I'd love to hear feedback from the HN community on how you think this feature should evolve over the next few months!
This might be a bit contrarian, but I don't really think there's product market fit here, at least for engineers. And if given in the hands of non-engineers, you'll need to have an engineer at least look over the code anyway. I haven't seen or heard of anyone that seriously uses ChatGPT to generate code and uses it in prod (apart from engagement-farming Twitter posts).
> Understanding someone else’s code for large internal engineering teams is often a challenge
Without proper context, this will fail miserably. Have you ever seen a corporate codebase before? It can be the definition of "wtf?" even for a seasoned developer that's been working there for years.
This AI-generated code trend reminds me of the "no-code" fad of the past decade.
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%.
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.
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.
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<HWND>);
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<Object> = msg_send![class!(NSWorkspace), sharedWorkspace];
let front_window: Id<Object> = msg_send![workspace, frontmostApplication];
let front_window_pid: u32 = msg_send![front_window, processIdentifier];
let running_apps: Id<Object> = msg_send![workspace, runningApplications];
let app_count: usize = msg_send![running_apps, count];
for i in 0..app_count {
let app: Id<Object> = msg_send![running_apps, objectAtIndex: i];
let app_pid: u32 = msg_send![app, processIdentifier];
if app_pid == front_window_pid {
let bundle_url: Id<Object> = 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.
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, and has been awesome at wholesale refactoring modules to fulfil a new purpose. E.g. today I wanted help reconciling between runtime and persistent LRU cache stuff. And it understood what I wanted and assisted. After a few nudges it gave me a refactored module with comments and a few tests. It's like having a very capable junior dev in one's pocket :P
Ps. Trust me: it's not long before we have ai coding bots that grab open tickets and hammer together PRs with full testing suites. 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 for some interesting discussion and links to projects in development (and in the comments there's a link to a Discord server that was set up for further discussion): https://news.ycombinator.com/item?id=36422730
I would agree with this in general. The main goal here is to optimize the "editor experience". When I personally code, I'll have ChatGPT pulled up on the side in case I need to reference it for speed. Some examples of how I might use it are:
- add some tests for me to review - take an existing piece of code and modify it in some way - help me think of ways in which I can write some code if I'm lazy that day.
This would generate code that after I iterate on it would need to be reviewed which speaks to your point, "you'll need to have an engineer at least look over the code anyway" which I agree with.
The main goal is to have it there as a resource to pair program with rather than trusting it without review/input.
The value added is that you don't send your source code to OpenAI and/or their parent org Microsoft.
However, for me, what I was hoping it was/ one thing I'm still looking for: Feed in my whole repo to the GPT-4 API, train on it, and ask questions about the code base/ particular functions. Has anyone seen that?
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 though.
about.sourcegraph.com
I presume you bought the domain name from them in that case.
ZIRP Hustle is real.
In terms of ChatGPT, Superblocks's goal is to develop a simple visual interface for creators to integrate AI into their workflow to build applications quickly. The platform makes it easy to verify, deploy, and monitor your changes, which would be difficult to do with just a chat interface.
Assisting in the creation of single purpose functions is, in my experience, by far the most reliable use case for LLMs in regard to code creation at this point in time, yet is something I haven't seen many companies really lean into. In fact, the only other example I know of is Cloudflares Workers Workshop [0], which I have been waiting for since May.
What I especially like about the implementation showcased in your demo videos though was the visual component. Some subtle animations, effective use of diff, methods being editable before pasting, it all felt very cohesive and thought through, which is something I can't say about every company utilizing OpenAIs APIs. Seems more like something that can serve a real value add for users, rather than just jumping on LLMs because it's the hot thing this summer.
Really hope more people are experimenting with the "visual implementation" of LLMs, using animations and graphs to communicate LLM outputs has a lot of unused potential currently.
[0] https://blog.cloudflare.com/introducing-cursor-the-ai-assist...
I've been focused on similar concepts with my open source AI coding tool. My tool is a command line GPT chat tool. You can ask it to write or edit code in any git repo. It displays live diffs as the AI edits stream in and automatically integrates them into your source files. I think this is similar to what your article is describing?
Folks might want to check out `aider` if they want to do the style of AI coding you're showing, but on their own git repos.
As with all low-code / no-code solutions, you can't please all the people all the time. But I felt the design choice in this particular case was overly rigid and with little justification.
With that being said, there may be ways to accomplish what you're looking for with the current state of our Workflows feature so feel free to send me a DM on Twitter or Linkedin.
The fact that it's even willing to write a function which removes PII from a string is nonsense. No such function is possible.
And the comment for filterUsersTable is incredibly long, tedious, and unhelpful.
How does the SQL thing work? How does it know what my schema is? That's nowhere on screen.
The only believable example is the Salesforce one which anyone could do.
This is good feedback. I think having an ability to adjust verbosity is valuable. A comment version should maybe be more concise than the actual explanation.
> How does the SQL thing work? How does it know what my schema is? That's nowhere on screen.
When you configure integrations with Superblocks, we query your integrations metadata which we use to give the best answers here.
Budibase. https://github.com/Budibase/budibase
Appsmith. https://github.com/appsmithorg
Tooljet https://github.com/ToolJet/ToolJet
And more (I'm sure others will comment)