Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laura-C

The Programming Language for all Natural Languages

The concept

Laura-C explores the fact that as a general rule programming languages are built in English. Even though English is the most known language and it is taken as a standard all over the world. Programming Languages (PL) shouldn't only be attached to one Natural Language (NL). People should be able to choose to write code in their own languages. Starting from the basic commands, conditions and types in a language all the way to freely naming their variables, programmers and specially people who are learning shouldn't have to learn learning English to be able to write powerful working code.

Programming Languages shouldn't only be attached to one Natural Language.

From this idea is born Laura-C. A PL that connects NLs with a shared syntax but different wording depending on the chosen NL.

People who are learning shouldn't have to learn English to be able to write powerful working code

ALGOL 68

ALGOL 68 (short for Algorithmic Language 1968) started with the same concept. To internationalize Programming Languages making it available in several Natural Languages. But it didn't survive.

The bet is that the adaptation of a living popular language such as C can be the key to improving the learning process and making the learning curve shorter for non-english speakers who want to learn how to program.

Supported Natural Languages

Laura-C wants to embrace all natural languages, it's open-source principle allows people to develop modules to their own languages by changing the lexer and adding the specific tokens.

Currently supported Languages

  • English (eng) 🇺🇸 / 🇬🇧
  • Japanese (jpn) 🇯🇵
  • German (deu) 🇩🇪
  • Portuguese (pt-br)

Language Structure

Disclaimer and Proper Credits

This solution is an expansion in concept and lexer functionalities from the the project: Toy-C-Compiler-using-Flex-Bison-LLVM made by @sandeep007734. The principle was to increment the code by adding an innovative feature to the language.

Lexer & Parser (Compiling)

Flex and Bison play the role of Lexer and Parser respectively in this solution.

Flex

The .l files inside the /lang folder contain the different Flex files to identify the Tokens while reading the code. every different Natural Languages has a specific Flex file as the thing that changes between them is simply the tokens parsing part. Every word association with a Token serves as base for the parsing part of compilation.

Same tokens have different words associated with them. Some examples of it are:

  • if, wenn, se, もし (TOKEN_IF)
  • do, mach, faz, 行う (TOKEN_DO)

Bison

The .y file along with node.h, contain the Bison part of the solution. This is responsible for associating the Token sequence with the generation of the AST (Abstract syntax tree). Which will be responsible for the program structure and organization. The tree is created with the goal of while being evaluated execute the described commands. That serves as base for the execution using LLVM.

LLVM (Executing)

Finally, the codegen files are responsible for the generation of code for LLVM. Using its library to provide a proper syntax to the execution of the generated files.

Running Laura-C Code (.lc)

To run Laura-C code, use the Makefile wrapper available in the project repo and run the code to compile the right lexer and run the code using LLVM.

To do so run:

make test lang=<selected_natural_language_code> file=<source_code_file_in_laura_c>

some example code is available in the "lang-tests" folder.

Also, run:

make clean

to clean the generated files.

natural_language_code are available in the supported Languages next to the language name.

Why Laura-C?

Laura (Given-name)

This PL takes the given-name Laura along with its variations depending on the NL because this name has a global presence. When it comes to pronunciation and universality, Laura is one of the most broadly used names across several different NLs. Representing then in itself the many Natural languages contemplated by Laura-C Programming Language.

C

This PL takes C on it's name because it is actually based on C programming. All syntax and functionalities are based on C programming. This is because the familiarity of people with this programming language can make it easier to find documentation and to ask someone with C experience. As well as importing libraries from previously developed C.

Next-Step

  • Implement all missing functionalities of C Programming
  • Enable import libraries from C Programming code
  • Easy cross NL translation script

Reference

About

The Programming Language for all Natural Languages

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages