The Open John Language (oJl)
Version: betaV0.1 | Documentation: oJl Bible V0.1 EN-US
Written By: João Victor (John)
I.0 - Introduction
Hello dear reader,
I thank you in advance for reading this documentation! If you are here, it means you have decided to test JL, or simply get to know my project. This is a great reason for me to be happy. Thank you!
I.1 - What is oJl?
oJl (Open John Language) is a programming language developed with the purpose of being clear, simple, and accessible. Its syntax was designed to be close to a natural language, facilitating the reading and comprehension of the code, which makes it suitable for both beginners and experienced developers looking for productivity.
As its name suggests, oJl is an open-source project; feel free to modify and study in depth how the project works.
The main goal of oJl is to be intuitive and functional, without sacrificing efficiency. It is an experimental project in constant evolution, with the aim of offering a viable and friendly alternative in the programming language ecosystem.
I.2 - Why did I create oJl?
Programming languages are fundamental tools that allow us to communicate with machines since the 20th century. oJl was born from this purpose: to be welcoming, simple, and functional, allowing complex projects to be developed clearly and accessibly.
I cannot fail to acknowledge that the creation of oJl also arose from a personal motivation: the desire to build something that had its own identity and could be recognized. Even if it comes to be remembered as a “different” or even “strange” language, for me, the most important thing is that it carries personality and meaning.
I.3 - Language Goals
oJl was designed to have a general focus, capable of being used in different types of projects, from the simplest to more complex applications. Its proposal to be an open and flexible language allows anyone to adapt, expand, and create new versions according to their own needs and objectives.
P.0 - First Steps
P.1 - How to Install?
Installing JL is quick and simple. As JL was developed in Python, you need to have Python installed on your machine.
- Download the interpreter: Download the
ojlreader.pyfile. - Create your JL file: Create a file with the
.ojlextension (e.g.,my_code.ojl). - Execute your program: To run the file, just open the interpreter with Python, passing the file as an argument:
python3 ojlreader.py my_code.ojl
I also cannot ignore the fact that running programs written in oJl is a tedious process; I will start working on an IDE to make it easier to work with.
P.2 - System Requirements
- Any operating system capable of running Python 3.8 or higher.
- Text editor for creating
.ojlfiles. - Terminal or command prompt for running the programs.
P.3 - Your First Program
The classic “Hello, World!” in oJl.
1. Create the file hello.ojl.
2. Write the code:
say "Hello, World!";
3. Execute in the terminal:
python3 lexer.py hello.ojl
The say command is responsible for displaying messages, similar to print in other programming languages.
M.0 - The Manual
M.1 - Syntax
The syntax of oJl aims to be simple and understandable, resembling a conversation. The syntax of oJl has evolved over time to be more "clean" and less daunting.
Out of curiosity, I will show the evolution of the language's syntax. The project initially started with a somewhat strange syntax. Here is a simple old "Hello World":
when_tcs{ say = “Hello World” }
M.2 - The oJl Bible
M.2.1. Comments
Any text after an ! is a comment.
! This is a comment.
var name = "John"; ! This is also one.
M.2.2. Variables
Use var to declare and $ to use.
! Declaration
var message = "Hello, world!";
var age = 25;
! Usage
say $message;
M.2.3. The `say` Command (Output)
Used to print values to the screen.
say "This is a literal text.";
say $age;
M.2.4. The `calc` Command (Calculations)
Performs a mathematical operation and stores the result. The syntax is calc [expression] -> [destination_variable];.
var x = 10;
var y = 5;
var result = 0;
calc x + y -> result; ! result now holds 15
say $result;
M.2.5. Control Structures (The `if` Command)
Executes a block of code if a condition is true. All on a single line.
var score = 10;
if $score = 10 (say "Congratulations, maximum score!";);
M.2.6. Functions
Groups code for reuse. All on a single line.
! Definition
f greeting (say "Hello!";say "Welcome to OJL!";);
! Call
f greeting;
M.3 - Need help?
Found an error? Want to suggest something? Fill out the form: Tell us here.
F.0 - Final Considerations
We have reached the end of this documentation. I am happy to know that you have made it this far. I hope that this documentation, simple as it is, can be useful to you. Follow us on GitHub for more information.
Thank you! ;D
oJl is an open-source project created by João Victor.
Project GitHub Page |
My GitHub Profile
Note: This documentation was translated using Artificial Intelligence.