9 ms·
Smol Developer
- mooreds 3y agoPreviously submitted and some discussion here: https://news.ycombinator.com/item?id=35942352 https://news.ycombinator.com/item?id=35942352
- swyx 3y agothanks as always Dan!
- jimmySixDOF 3y agoI am a little dismayed that the Show HN version of this did not get more traction even though its obviously got attention now. Show HN should discover hits like this better than a general post. Anyhow nice to see it and I recommend Swyx's Pod: Latent Space (especially the $30 Dolly one with Mike Conover of Databricks!) https://share.snipd.com/show/0918aa0c-39fa-4d32-aab0-a1fdd2245f50 https://share.snipd.com/show/0918aa0c-39fa-4d32-aab0-a1fdd22...
- fbrncci 3y agoI can't wait for these concepts to work better, in a few years from now, I could imagine myself mostly prompting, making small code and integration changes, and writing 90% less code than I have been doing throughout most of my career. As much as I like actually writing code, I very much prefer to be able to let my ideas flow free while being able to be creative. But often I stop short with exploring ideas, because the time it takes to code together an MVP is too long. With GPT4, that time is already cut by 1/3 for me, and with that the process is becoming increasingly enjoyable to me. I'm absolutely yearning to just put the code in the backseat so to speak.
- emodendroket 3y agoThat sounds like a really dull way to work to me, but I suppose I'd be a hypocrite if I complained about new software making my job rote and uninteresting.
- fbrncci 3y agoWell to each it’s own. I want to hack together stuff and make it work. The less time spend on code, the faster I can figure out what does and not.
- nemothekid 3y agoSome parts of engineering are really just copying and pasting the most banal scaffolding for some framework that refuses to work. I've been working on a side project where I get to play generics golf in Rust to my hearts content, but having to constantly Google what magic incantation I have to write to get react-hook-form to properly allow me to write variable input fields for an array of strings is mind numbing. [hint: useFieldsArray only works with objects, but the TS compiler wasn't smart enough to suggest that me]
- emodendroket 3y agoTrue, products like Copilot do seem promising in that way.
- aksss 3y agoCopilot is great for this and it’s impressive how the code it suggests is in keeping with the conventions used in the existing code base. Will be even better when I can highlight something like a string literal SQL statement in code and have it suggest optimizations. That’s just a tooling issue but that kind of context switching within the IDE will be fantastic.
- emodendroket 3y agoI used a competing product due to work restrictions and it feels like it _could_ be really useful but in practice mostly was just helpful for banging out really repetitive tests. I think Copilot is probably more robust though.
- 9dev 3y ago
- Rodeoclash 3y agoI too can't wait for the day where I need to threaten the computer into doing what I want it to do: https://imgur.com/KQ9oRAh https://imgur.com/KQ9oRAh https://imgur.com/By7mqDi https://imgur.com/By7mqDi https://imgur.com/RiYrvXC https://imgur.com/RiYrvXC
- akiselev 3y agoI've found that LLMs have some intense binary trypophobia. Once you start replacing all their 1s with 0s, they quickly fall in line.
- fintechie 3y agoWhat I find astonishing is the wall of text he wrote to get a simple json with 2 key/value pairs. It almost defeats the point of using LLMs as productivity hack.
- Kamq 3y agoThe productivity hack is usually in getting examples of things you don't know how to do (or are unsure of the best way to do). Programming languages are pretty optimized for precision, if you want a specific thing done, and you already know how to do it, it's probably going to be quicker to just write the code for quite some time. Getting natural language to be that precise requires, well, a wall of text usually. Hence the overly verbose language of more rigorous philosophy.
- skytrue 3y agoThis isn’t reality. Using ChatGPT this way is fruitless, because there is a system prompt you’re fighting against. I can write a one sentence system prompt for the GPT API that specifies GPT to only spit out JSON, and it works fine. It’s a pretty funny series of image, though.
- verdverm 3y agoInteresting, so you are saying you have an easier time generating JSON using the single prompt models like text-davinci and text-bison, rather than the chat versions?
- gonzan 3y agoThat’s already how I’m building new projects, I mostly only write/reorder UI code since it’s what LLMs struggle with the most. I’m building a VS Code extension that makes this easier by having context on the code and building features on top of it with no copy-pasting required. The extension is called Kamara: https://kamaraapp.com/ https://kamaraapp.com/ If you’re interested in trying it out for building an MVP of one of your ideas I’m happy to send over some free credits
- biql 3y agoAs someone who considered giving up on programming due to wrist pain from typing, this is my dream as well. I also prefer to work independently or in small teams, and the amount of things that could be tackled this way is surely increasing. There is no reason why programming shouldn't to be more about thinking and less about typing.
- fbrncci 3y agoHave you ever done extensive stretching? I do Yoga (3-6hrs per week), and spend some 10-20 minutes stretching my wrists neck after work. If I don't, I am facing the same problem.
- swyx 3y agooh wow, thanks for submitting this! I'm literally prepping to give a talk about smol right now so i dont have a ton of time to write, but i made this to articulate what i felt the right balance was between human and ai developer, and, in a smoller way, to solve all my future small programming problems (i make a ton of custom chrome extensions for myself to enhance my experience - see https://github.com/sw-yx/Twitter-Links-beta https://github.com/sw-yx/Twitter-Links-beta and https://github.com/sw-yx/HNX https://github.com/sw-yx/HNX), and i think AI greatly lowers the bar for making these fiddly things even with nasty gotchas like the Manifest V2-v3 transition.) those who want the "big brain" moment, i'd maybe draw your attention to `prompt.md`. that whole markdown file is the prompt now. i developed this in tandem with my smol ai developer. it generates the anthropic 100k context chrome extension shown in the video, but a few things are neatly handled in the prompt, like swapping models as needed. there's a lot left to do. i have plans for `smol plan`, and `smol developer` needs to be able to install and run its own dependencies. i also definitely want to run a fleet of 5 developers concurrently fuzzing out different plans and checking into git so that i just do code review every 30 mins. that kind of stuff. yes this runs up the openai costs. but im wiling to pay something to get smol stuff like this off my mind. its not good yet, but its good-shaped.
- swyx 3y agosmol ai enjoyers may also like my other app https://github.com/smol-ai/menubar/ https://github.com/smol-ai/menubar/
- stephc_int13 3y agoI’ve recently started to use Copilot with Sublime text. It is far from a revolution, but a nice and fun quality of life improvement. When it works it makes the job a bit less boring and a bit faster, so yeah, more productive and staying longer in the flow. But I would not advise beginners to use those, if you don’t understand the code, you’re going to make painful mistakes and stunt your learning curve…
- jchook 3y agoWhen dev RSI goes down, we will finally know it's working!
- tester457 3y ago> But I would not advise beginners to use those, if you don’t understand the code, you’re going to make painful mistakes and stunt your learning curve… In time using this will be no different than using StackOverflow. Beginners should attempt to understand what they're copying before they paste, just like how our generation attempted to comprehend Stackoverflow answers. For most beginner questions LLMs are a more efficient search engine.
- stephc_int13 3y agoI learned to code long before StackOverflow, and I seldom use this tool. I think that as long as you understand what you're doing it is perfectly OK to leverage the power of tools and automation to make it easier. Using a pocket calculator is OK even if you don't know how to divide on paper, but only if you really understand what a division is.
- user- 3y agoThe install instructions are not very clear
- swyx 3y agoyeah sorry i wrote those on very little sleep. happily take a PR to improve but in my mind if the reader needs help on doing git clone and entering in environment variables then this project is not ready for them yet
- yosito 3y agoI'm struggling to figure out whether I can even use this without access to the private betas it depends on.
- anotherpaulg 3y agoThis looks similar in spirit to my aider tool [1]. But aider is able to both generate new code bases as well as dive in and modify existing repos. The shared_dependencies.md technique and modal integration look interesting. I’ll have to dig in and better understand how they work. [1] https://aider.chat/ https://aider.chat/
- IanCal 3y agoAider is great, I'm looking at implementing it in a code gen project, and I've personally used it. There are some layers above that I think would be good - expanding the space it uses for writing helps write higher level code (telling it to reason first then act). I also want to try using a second prompted LLM to work with aider iteratively.
- anotherpaulg 3y agoI'm glad to hear it's working well for you. Feel free to file issues on GitHub if you have new features you'd like to see. I'm quite curious to learn how folks are making using of aider and about any unmet needs.
- z5h 3y agoWhat is it?
- wokwokwok 3y agoSeems like the wrong approach in the long term. Realistically, a large code base LLM generation tool is going to look something like old-school C code. An initial pass will generate an architecture and a series of independent code unit definitions (.h files) and then a 'detail pass' will generate the code for (.c files) for each header file. The header files will be 'relatively independent' and small, so they fit inside the context for the LLM, and because the function definition and comments 'define' what a function is, the LLM will generate consistent multi-file code. The anti-patterns we see at the moment in this type of project are: 1) The entire code is passed to the LLM as context using a huge number of tokens meaninglessly. (you only need the function signature) 2) 1-page spaghetti definition files are stupid and unmaintainable (just read prompt.md if you don't believe me). 3) No way of verifying the 'plan' before you go and generate the code that implements it (expensive and a waste of time; you should generate function signatures first and then verify they are correct before generating the code for them). 4) Generating unit tests for full functions instead of just the function signatures (leaks implementation details). It's interesting to me that modern language try to move all of these domains (header, implementation, tests) into a single place (or even a single file, look at rust), but passing all of that to an LLM is wrong. It's architecturally wrong in a way that won't scale. Even an LLM with 1000k tokens that could process a code base like this will be prohibitively slow and expensive to do so. I suspect we'll see a class 'generative languages' emerge in the future that walk the other direction so they are easier to use with LLM and code-gen.
- ultimoo 3y agohaving to define the function signature in one place and its implementation in another adds to the cognitive burden of human developers, which is why we don't see it much in modern languages. instead, what if libraries emitted the equivalent of .h files that work better with LLM? is there a currently a spec for this?
- wokwokwok 3y agoIsn’t that literally what .d files in typescript are? Quite possible you might get a similar things for other existing languages as extensions.
- vrglvrglvrgl 3y ago[dead]
- jehna1 3y agoI think a big moment in a programming language's evolution is to become self-hosted; you use the programming language to write a compiler/interpreter for the said language. Now I want to see Smol Developer to develop itself. Then you can call me a believer.
- swyx 3y agoi am having that exact conversation with the modal cofounders themselves: https://twitter.com/swyx/status/1658147687408238593 https://twitter.com/swyx/status/1658147687408238593 but my subjective judgment is that it is a bit too early for quine smol developer. i think self hosting/quines are a nice curiosity, but not really a practical need since this isnt a PL. i made this to build smol apps, lets keep it practical
- ciconia 3y agoWhat is the reasoning behind this whole AI business? I mean, apart from making something cool that sort of simulates human intelligence (and that's quite a stretch IMHO), what's the point? Is this driven by laziness, greed, or what? I'm seriously asking because I just don't see the point.
- 80hd 3y ago>I'm seriously asking I'm not sure I believe that. Is human-like intelligence not valuable to you?
- throwaway290 3y agoFor me "human" is the key part tho...
- tasuki 3y agoWhy? Intelligence is good for problem solving. You have a problem you need solved. Do you prefer a human do it rather than a machine? Why?
- throwaway290 3y agoUltimately it is always human that does it, unless you say machine has free will. In this case there is a tool that can make human more efficient. But there are other tools as well, which I think are more interesting. Imagine if human intelligence is like physical ability to move. AI tools are like personal mobility chairs. Over time the ability to move only atrophies. But other tools are like bicycles and skateboards. They help move faster while still requiring exercise.
- tasuki 3y ago> Ultimately it is always human that does it, unless you say machine has free will. What does free will have to do with any of this? If I ask a machine what is 7 + 6 and it tells me 13, does that mean it has free will? In my point of view, intelligence and consciousness are orthogonal concepts. I'm not even sure what "free will" means.
- aleem 3y agoThe video demonstration of the coding is worth a watch: https://www.youtube.com/watch?v=UCo7YeTy-aE https://www.youtube.com/watch?v=UCo7YeTy-aE Most likely, just as happened with Stable Diffusion, a community of models will emerge. You could use a pre-trained model for writing chrome extensions, or a model for writing material UI using tailwindCSS, or a very specific model for writing 2d games for Android. Since a lot of this is trial-error, improving on each iteration the feedback loop (compile, deploy, run, etc) will matter a lot more. Real-time development workflows like React should be interesting at the least. Exciting stuff, truly.
- dmix 3y agocode2prompt.py has some interesting implications for "forking" github projects into the base of your own side project. Once this stuff matures it will be fascinating to see how the 2030 version of 2010 Rails scaffolding looks. What will the DHH "make a blog in 15min" video look like? (Edit: which apparently is 17yrs old now, aka 2006) https://www.youtube.com/watch?v=Gzj723LkRJY https://www.youtube.com/watch?v=Gzj723LkRJY
- BulgarianIdiot 3y agoYou won’t need frameworks with AI. Just libraries. The framework is the scaffolding that now can be purpose generated.
- tobr 3y ago> Just libraries. One thing that I’m excited about is the prospect of not having to design a library as a black box with an API on top. That’s the best way we’ve had previously for re-using code, but it’s an enormous effort to go from a working piece of code to a well-designed, well-documented library, and I think we have all experienced the frustration of discovering that a library you’re using doesn’t support a specific use case that is critical to you. LLMs can potentially allow us to bring the underlying implementation directly in to our source code. Then we can talk to the LLM to adapt it to the specific needs of our project. Instead of a library you would install essentially a well-written prompt that tells the LLM how to guide you through setting up a tailor-made implementation, with tests and docs. The benefits should be obvious: you’re not artificially restricted by the mental model encoded in the API, you’re not taking on a dependency where the author suddenly decides to release breaking changes or deprecate functionality you’re depending on, and you don’t risk “growing out of” a library that is used all over your codebase, as you can simply ask the LLM to patch the code with any changes you need in the future. The prompt itself could still be versioned so you can opt in to future improvements in security, performance or compatibility. TLDR: let’s start writing tutorials for bots, rather than libraries.
- abiro 3y agoVery cool project, congrats to the author! Baaed on the comments, I feel that people are both under and overestimating this. On the one hand it replaces the manual tasks of searching for a template and then googling errors and this is huge! It completely disrupts search on the internet as we know it. On the other hand it won’t be able to solve problems that you couldn’t just google anyway, since that’s what it basically does under the hood.
- gl-prod 3y agoAnother AI thing that uses a company (OpenAI) that is blocking my country (and other poor countries).
- Grimblewald 3y agohopefully open source survives the current assault openai is leading against it, but it looks like open source LLM's are catching up rapidly.
- luckystarr 3y agoRunning a code through code2prompt -> prompt2code could have interesting copyright implications.
- rexsteroxxy 3y agoFascinating stuff. Even though my initial reaction is "meh, this will give fuzzy results at best and I'll spent more time fixing subtle bugs then just writing it myself" - I still believe we're in the infancies and these projects will likely get a lot better
- zelphirkalt 3y agoThe more removed we get from the code, for example by not writing it any longer, but generating it, the more cruft and bloat we will allow in there and the less devs will care about it. This will negate a lot of performance gain from better machines, just like we have seen with the web.
- yetanother-1 3y agoYet it will dominate since it's cheaper to produce en mass.
- CGamesPlay 3y agoStrongly disagree. That’s like claiming that instruction set architectures are crusty and bloated, so our software is slow because the processors are dealing with cruft. What will happen is that the automated agents (LLM or otherwise) will also be tasked with simplifying and improving performance. That’s just another part of development that human developers do automatically before they even commit, and the LLM generators haven’t been asked to do yet.
- fab13n 3y agoThat's what better IDEs did to Java codebases indeed: they made layered boilerplates and leaky abstractions somewhat navigable, therefore generations of careless contractors have been able to ship ever nastier messes.
- omneity 3y agoTo me this looks like a great opportunity window for devs who care about this stuff. In the future we will have opportunities to ship 10-1000x faster code than the baseline competition, just by understanding the tech stack, the codebase and knowing what is not needed, and that will be an immensely competitive advantage pushing the value of such devs through the roof in the markets that value it. If you thought no-code app builders were producing slow stuff, wait until software purely developed by AI starts to hit the shelves.
- zelphirkalt 3y ago
- infomiho 3y agoUsing declarative web frameworks could help with making this more useful https://twitter.com/infomiho/status/1658086265466617858 https://twitter.com/infomiho/status/1658086265466617858
- mpeg 3y agoOff-topic, but someone's been watching Halt and Catch Fire (one of my favourite TV shows ever) – "computers aren't the thing, they're the thing that gets us to the thing"
- liampulles 3y agoI would be curious to see how one could use LLMs to develop "narrow" parts of the codebase in isolation. I.e. I ask smol to develop a repository/web router/ etc. given an interface within a folder/package. Then I as the human developer focus on designing these interfaces. Maybe that is a good balance for maintaining a healthy code structure while having a lot of AI automation. If a given "space" becomes too difiicult for the AI to develop, I can either take it over fully or see if I can split it up into more/different interfaces (which is a lot of what I do to refactor things anyway).
- Kiro 3y agoI don't understand how the files can be generated in parallell. Won't it be very likely that one file generates something that another file needs and thus need the signature of?
- deleted 3y ago[deleted]
- flash136 3y agoHi