DEV Community

Ingi
Ingi

Posted on • Updated on

Diving into Plang: A Straightforward Guide for Programmers

Starting with a new programming language always has its set of challenges and excitements. Today, I'm walking you through the early steps of Plang, a language that has a unique approach and natural language syntax. Let's keep the fluff aside and dive into how you can get your hands dirty with Plang.

Getting the Groundwork Done

Before anything, you need Plang on your machine. It's straightforward, regardless of your OS. Check out the Installation Guide, get it set up, and hop back here.

Setting Up Your Workspace

Next up, the IDE. I went with Visual Studio Code, adding the Plang extension to smooth out the journey. For setting this up, the IDE Setup Guide is your go-to resource. It's a breeze, really.

Your First "Hello plang world"

Here's where the rubber meets the road. We're crafting a simple "Hello plang world" app. Keep in mind, coding in Plang incurs a minor cost—about $0.01 to $0.08 per line due to the LLM usage. But it's a price for efficiency. You can trim this down using OpenAI directly, or stick with the Plang service to back the project.

The Steps:

  1. Craft a New Home: Start by making a new folder. Call it HelloWorld. The path is your choice, just keep it accessible.
  2. Begin Your Story: Inside HelloWorld, create a file named Start.goal.
  3. Pen Down Your Code: Here's the magic line.
   Start
   - write out 'Hello plang world'
Enter fullscreen mode Exit fullscreen mode
  1. Seal the Deal: Save your Start.goal.
  2. Bring It to Life: Hit F5 in VS Code or use the terminal with plang exec.

First Run and Costs:

When you run it the first time, you'll be nudged to top up your Plang account. A $5 start is sensible if you're just tasting the waters. After the refill, hit plang exec again.

The Finale:

Execute, and "Hello plang world" graces your screen. You've just stepped into Plang.

Moving Forward

Pat on the back for making it this far! If you're itching for more, why not delve into creating a Todo app next? It'll be a neat excursion into database interactions and connecting with LLM services. Here's where to head next: Create a Todo app.

Reflections

Dipping your toes into Plang might feel different at first, especially with the cost per line aspect. But it's an intriguing journey. The simplicity and the natural language syntax have a charm, and it's worth exploring further.

Got thoughts or hit a snag? I'm all ears. Let's make this journey collaborative.

To learn more about Plang, checkout our (Github repo)[https://github.com/PLangHQ]

Top comments (4)

Collapse
 
lnahrf profile image
Lev Nahar

It's an interesting concept, although paying to run will make this a no-go for 99,9% of developers, so I am having a hard time thinking how this will ever take off (not disputing all the hard work that probably went into this).

Please correct me if I am wrong, but essentially, it's a mechanism more than a programming language or a compiler (it does not compile, arguably transpile). It seems like the flow of development is GPT-4 (which is a third-party API) receiving some natural language instructions with pre-defined rules on how to process said instructions. How are you handling data privacy? What if I write some Plang "code" with sensitive keys, how is this being handled?

The only thing that truly bothers me is the use of GPT-4 and not a locally run, open-source, private LLM. This is essentially just plugging OpenAI's API into a whitepaper about an arbitrary programming language that does not exist.

Would love it if you could clarify my concerns.

Collapse
 
ingigauti profile image
Ingi

You are pretty much right on the flow you described.

  1. The builder takes each step(starts with -) that you write.
  2. Ask the LLM what modules fit with statement (28 modules now)
  3. Ask the LLM what methods fits the step
  4. Get response and validates it
  5. Write the execution instructions down to .pr file
  6. The runtime read .pr file and executes.

For example this step

  • read file.txt into %content%

would be assigned the FileModule and the method ReadTextFile

Regarding sensitive keys, the language handles this, for example %Settings.OpenAIKey% will get OpenAIKey key. If key doesn't exist, the plang language simply asks you for it, so no config files needed. The simplicity of handling sensitive keys hopefully prevents mistakes of inserting keys into code.

I decided to not go into making a local LLM since gpt4 solves it and I could focus on the plang language. I do though believe that it wont be to difficult to build a local llm since for each app that is built, there is more training data and it's very structural. But you never know until you get there. 1-2 years, we will most def be on local LLM, I would think.

It is uphill battle getting programmer to pay for building code, of course this is only at build time, the runtime is no cost. My light in the tunnel is that people are using RAG, Devin and other tools and paying for that.

Collapse
 
sethcalebweeks profile image
Caleb Weeks

Wow! This short post has a ton of work behind it... I skimmed the paper, but honestly didn't get very far. I am curious to see how LLMs change the programming world, but I'm not entirely sure if this particular approach is the way forward. Something that handles business logic well would certainly be helpful, though.

Collapse
 
ingigauti profile image
Ingi • Edited

The paper is heavy stuff. I am working on breaking it down, trying to making it more readable and posting in individual posts.

In talks I've done I call it: Programing 3.0 - Theory. Theory because it describes how we take our abstracts though into code. Only the future can tell if this is the approach.

I think that making LLM create code for operational language is not the right approach. LLM is analog and operational languages are binary, and getting them to work in current setup is I believe, unrealistic. It is easier in plang because plang is analog