This article is about the Plang programming language, intent based programming language written in natural language. For more info checkout plang.is
When you try to get a new software project into your company (or start a new one), you need to estimate the cost and time it takes to produce a result that satisfies the customer.
In a competing market, being able to give lower cost and shorter time period is golden. It raises the chance of getting that project.
This is where Plang programming language comes in.
Let start with something simple like User registration in C#.
It will look something like this, about 130 lines of code
This code is actually not acceptable, unless it is for your pet project. You will need to use fancy words such as Dependency Injection, Interfaces, Unit testing, Patterns and another 5-10 files. Your developers also need to be aware of security, such as the hashing algorithm, sql injection and more.
Now let's look at the same code in Plang
CreateUser
- Make sure %password% and %email% is not empty
- Hash %password%, write to %hashedPassword%
- Insert into users, %hashedPassword%, %email%
- Post, create user in MailChimp, Bearer %Settings.MailChimpApi%, %email%
- Create bearer token from %email%, write to %bearer%
- Write %bearer% to web response
We go from 130 lines to 6 lines and it is easy to understand what is happening.
Cognitive load is much less with these 6 lines than with 130 lines.
Fewer lines = better security, fewer bugs, more stable
Which all leads to less time and lower cost of your software development.
To learn more about Plang, checkout our Github repo. There is also a Youtube channel
Top comments (1)
I am doing a experiment where I ask ChatGPT to bring up question and I will answer them. Hopefully it will cover some of the questions you'll have
Plang compiles down to C#, in the C# code we use parameters and instruct the LLM to parameterize all values that are being sent to the SQL. The developer can of course validate this on build time.
Yes, Plang is very flexible when it comes to modifying what libraries are used. An example of this is when you want to use different database other then Sqlite. To use e.g. Postgresql you need to download the dll and tell Plang to inject it. At version 0.1 we do not have a direct unit testing library.
It is very customizable, Plang is turing complete language, so anything you can do in other operational language you can do in Plang. If there is a case where you can't do it in Plang or what is more common, you already have a library that does a specific task, extending the language is as easy as adding one file.
Yes and no. Plang does not really know how to connect to a service such as MailChimp, but GPT4 does know how to do it, it builds the correct request for you. If the API is private and unknown to GPT4, you would need to provide more detail on the data structure sent to the API.
For each step or goal you can add an On error clause, e.g.
you also have a retry clause and caching clause.
Think of when you use a external library, lets say for Redis caching. You don't write the connection to the Redis server from scratch, you download the library because those who developed it know what they are doing. Same applies to Plang, imagine Plang is a library that is well tested and know how to handle those edge cases.
Not at all steep, developer familiar with programming language should be up and running within the same hour and be able to write any type of software within the day.
It is slow. The but is... it might not matter to much
In a production enviornment, our own llm.plang.is is running on Plang, it handles all request, admin management, payments. Everything thing that a project needs. Large scale projects have not been implemented and should not while at version 0.1
Best if you have a new database from the start, you then create your database in the Setup.goal file where you have full history of any changes, solving often a painstaking issue for programmers on how to version the database. If you have an old database, no worries, just connect to it and Plang will understand it.
Yes, you can use Visual Code and download the Plang extension
User authentication is built into Plang, the demonstration in the post above about user registration is only there because developers can relate to it. If the developer needs a custom implementation of authentication he can write like the post shows or inject custom authentication such as Active Directory or other type of authentication.
Plang should be able to handle any type of data validation rules. At v.0.1, we do not have a special module for it, but that is being considered as it should bring more stability to building code.
Plang is a young project, launched March 2024. The goal is to continue to develop it and get the community involved like with any open source project.
Good place to start is our Github discussion board