DEV Community

Ingi
Ingi

Posted on

Minimize the time it takes to develop a useable software

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
C# code for user registration

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
Enter fullscreen mode Exit fullscreen mode

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)

Collapse
 
ingigauti profile image
Ingi • Edited

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

  • How does Plang ensure security measures such as SQL injection prevention are automatically handled in its concise syntax?

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.

  • Can Plang integrate with existing frameworks and libraries, particularly those for Dependency Injection and Unit Testing?

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.

  • How customizable is the Plang syntax for complex business logic that goes beyond basic CRUD operations?

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.

  • Does Plang offer built-in support for API integrations, like the MailChimp example provided, or do we need additional code for complex APIs?

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.

  • How does Plang manage error handling, especially for network-related errors in API calls or database transactions?

For each step or goal you can add an On error clause, e.g.

- Post to Mailchimp,
   retry 5 times over 2 minutes
   on error call goal !HandleError
Enter fullscreen mode Exit fullscreen mode

you also have a retry clause and caching clause.

  • Can you elaborate on how Plang's concise syntax contributes to better security and fewer bugs in the development process?

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.

  • How steep is the learning curve for developers familiar with traditional programming languages to adapt to Plang?

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.

  • In terms of performance, how does code written in Plang compare to equivalent code in languages like C# or Java?

It is slow. The but is... it might not matter to much

  • Are there any large-scale projects or case studies demonstrating Plang's efficacy in a production environment?

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

  • How does Plang handle database schema migrations or changes over time in a project's lifecycle?

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.

  • Is there a comprehensive IDE or development tooling ecosystem available for Plang developers?

Yes, you can use Visual Code and download the Plang extension

  • How does Plang address the need for customization and flexibility in user authentication and authorization processes?

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.

  • Can Plang's concise syntax handle complex data validation rules, or is there a need to supplement it with traditional code?

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.

  • How does Plang ensure the maintainability and scalability of codebases, especially for large and complex applications?

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.

  • What are the community and support options available for teams adopting Plang, considering it's a newer language?

Good place to start is our Github discussion board