DEV Community

Cover image for Yet another programming language Unv
Kavindu Santhusa
Kavindu Santhusa

Posted on • Edited on

Yet another programming language Unv

if 'Unv is awesome!'
    print('Hello World!')
# keep editing for live results
Enter fullscreen mode Exit fullscreen mode

Above code looks like Python. But python requires : after if statement.

I am the creator of Unv. Here are some features of Unv

  • 🍬 Syntax sugar
    The syntax of Unv language is inspired by Python. So It's nearly similar to English. instead of too many brackets ot depends on whitespace.

  • 🌐 Universal
    Compilers convert Unv language to existing languages.(currently JavaScript, more coming soon). Use Unv for your web, mobile, desktop or IOT application.

  • 🤝 Friendly
    As Unv language is universal, It can import your favorite library.

To make it work first I had create a Unv to JavaScript compiler.

Card of Unv to JavaScript compiler

It was written with 30 lines of JavaScript.

Then created a site for Unv with docusaurus.

There is a playground for Unv.
Its powered by Codemirror mobile friendly code editor.

I need contributors for this project. If you can help me please contact me via ksengine.github@gmail.com or comment to this thread on Github.

Please give us a star If you like this project
Star me
Thanks.

Top comments (11)

Collapse
 
camillerkt profile image
Camille Rakotoarisoa • Edited

Hi Kavindu! Your work looks really good to me.
Like you, I've been passionate about programming since I was 11 years old and now I'm 1 year younger than you, so your work is even more inspiring.
However, I've been looking for a way to create my own programming language for several years now, but this time not in English. That's why I would like you to explain me how you did to create your programming language in JavaScript? Did you follow a tutorial or something? What is the logic behind it?
Otherwise, where can I contact you?
Thank you very much and good luck with your projects.

Collapse
 
ksengine profile image
Kavindu Santhusa

Hi Camille,

Thanks for your kind words.

I got this idea to create a programming language when I was younger than 10 years. It was similar to HTML.

Some programming languages are static and some of them are dynamic. static ones have unfriendly syntax. But they are easy to maintain. dynamic ones like python have friendly syntax. But they are somewhat buggy due to dynamic nature.

In my point of view, JavaScript is the most universal programming language because it can be used to develop web, mobile(react native...), desktop(electron...), IOT.
Unv combined this three features,

  • static
  • easy syntax
  • universal

Instead of creating own compiler or interpreter. Unv depends on existing programming languages. So it's universal.

Collapse
 
ksengine profile image
Kavindu Santhusa

This is how compiler works.

# input code
if 'Unv is awesome!'
    print('Hello World!')
# keep editing for live results
Enter fullscreen mode Exit fullscreen mode

First remove comments and handle strings

if 'Unv is awesome!'
    print('Hello World!')
Enter fullscreen mode Exit fullscreen mode

First slice the code by newlines

if 'Unv is awesome!'
Enter fullscreen mode Exit fullscreen mode
    print('Hello World!')
Enter fullscreen mode Exit fullscreen mode

Then convert the indention to brackets

if 'Unv is awesome!' {
    print('Hello World!')
}
Enter fullscreen mode Exit fullscreen mode

Then add parentheses when needed

if ('Unv is awesome!') {
    print('Hello World!')
}
Enter fullscreen mode Exit fullscreen mode

Then Its valid JavaScript

Thread Thread
 
ksengine profile image
Kavindu Santhusa

You can contact me via ksengine.github@gmail.com

Collapse
 
camillerkt profile image
Camille Rakotoarisoa

Great! But did you follow a particular tutorial to learn how to create this programming language?

Thread Thread
 
ksengine profile image
Kavindu Santhusa

I had read tons of tutorials. But no one helped me.

Thread Thread
 
camillerkt profile image
Camille Rakotoarisoa

Did you find them on the Internet?

Thread Thread
 
ksengine profile image
Kavindu Santhusa • Edited
Thread Thread
 
camillerkt profile image
Camille Rakotoarisoa

Okay, thank you very much !! Good luck with your projects ! :)

Thread Thread
 
ksengine profile image
Kavindu Santhusa

I am looking for contributors for this project. Can you join Unv organisation

Thread Thread
 
camillerkt profile image
Camille Rakotoarisoa

I'm really sorry but at the moment I don't have much time to contribute to projects. But I note the proposal! And thanks for this one