It encodes a Node JS server only with text files!

What if we could code a web server without writing a single line of JavaScript, TypeScript, or any other programming language? Just plain English (or French) instructions in simple text files?

It sounds crazy, but that’s exactly what a slightly mad developer achieved with Node.js and OpenAI!

His project, named Node-in-English, consists of source files that are .txt files containing detailed commands in English within the text. A Node.js build script then “compiles” these files to automatically generate the server code and deploy it. This technology relies on the use of natural language to define the actions and behaviors of a web server, and the script uses OpenAI’s API to interpret these textual instructions and generate the necessary code to create the server’s endpoints. Each build consumes approximately 4000 tokens from OpenAI.

Obviously, we can’t just ask, “build me a server”… The instructions must be precise enough to guide the language model towards the expected result. This implies some understanding of the underlying libraries and frameworks, and the author admits that the experience of coding in natural language is more frustrating compared to a real programming language because the amount of text and the number of attempts required to obtain a precise result are much greater.

But the idea was more to show what is possible for people who cannot, do not want to, or dare not venture into traditional development. Sort of a gentle entry into development, so to speak. The author mainly wanted to see if it was possible to build a server without writing any code and to understand to what extent technical skills were necessary to create a functional web server.

The generated server, accessible at https://nie.avoguard.com/, offers several basic endpoints:

  • / : an HTML homepage listing the different routes
  • /list : returns the list of endpoints in JSON format (or sometimes a JSON array, depending on the author’s mood of the day)
  • /quote : displays a random quote from a list generated during the build
  • /ping : responds with “pong”, which is always reassuring
  • /about : returns a short description of the server, or a 404 error
  • /contact : returns contact information, or a 404 error
  • DELETE and POST endpoints also sometimes appear randomly depending on the compilations.

That’s the whole charm (and the scary part) of it… Despite providing the same instructions as input, you’re never certain what you’ll get in the end.

Now, from a technical point of view, the .txt files in the text-src directory are combined in the order defined in the /index.js script, which is the only piece of code written by a human. The author plans to improve his system to allow for defining more complex and reliable routes, and there’s even a small documentation for those who want to try compiling it themselves.

So, is coding in French or English the future of web development? Maybe one day, but for now, we’re still on a rather experimental project, with a Proof of Concept that’s both fun and, above all, instructive at the prompt level.

So who knows, maybe in a few years, the job of a developer will consist of filling out .txt files rather than spitting out obscure lines of code. Sort of a new generation no-code, in a way…

Mohamed SAKHRI
Mohamed SAKHRI

I'm the creator and editor-in-chief of Tech To Geek. Through this little blog, I share with you my passion for technology. I specialize in various operating systems such as Windows, Linux, macOS, and Android, focusing on providing practical and valuable guides.

Articles: 1273

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *