C-Slash (C/) is a tiny open-source programming language developed in C++. Codes in this repo are free to use and modify.
Download the "c-slash.exe" (Windows) or "c-slash" (Linux/Mac). (If the "c-slash" does not work, please download "c-slash.cpp" file and compile it by yourself.)
c-slash --info
The "main.csl" file can be found as an example in the repo.
c-slash <filename>.csl
(or)
./c-slash <filename>.csl
// This is a comment.
/* This is a comment
written in more than
just one line. */
output("Hello, World!");
The input() function accepts two arguments: variable name, and type (such as string, integer, float).
output("Enter a string:");
input(text, str);
output("Enter an integer:");
input(num, int);
output("Enter a float:");
input(float_num, float);
A variable can be any of four types: string, integer, float, and boolean.
String
var name = "Codejapoe";
Integer
var age = 16;
Float
var net_worth = 7500000.00;
Boolean
var is_under_18 = true;
Please do not forget to put "var" keyword to modify a value.
var age = 15; // assign
var age = 16; // modify
Addition:
var a = 3;
var b = 4;
var c = a + b + 3;
// 10
var a = 3;
var a = a + 1;
// 4
Subtraction:
var a = 1;
var b = a - 2;
// -1
Multiplication:
var a = 3;
var b = 4;
var c = a * b
// 12
Division:
var a = 10;
var b = 2;
var c = a / b
// 5
Variable:
var name = "Codejapoe";
output("Hello, I am ${name}.");
Expression:
var age = 16;
output("I'm turning ${age + 1}.");
>>> I'm turning 17.
Escape sequence:
output("\"Once upon a time, ...\"");
>>> "Once upon a time, ..."
output("\$1 = 3,400 MMK");
>>> $1 = 3,400 MMK
output("Hello, World!\\I am leaning C-Slash.");
>>> Hello, World!\I am leaning C-Slash.
Friendly Reminder: This function only works with output() function.
var text = "hello"
output("Data \"${text}\" has the type of ${type(text)}.");
>>> Data "hello" has the type of str.
- Works on Windows, Mac, and Linux
- Fast and easy to set up and run
- Works with or without semi-colon in multiple code-lines (Semi-colons must be used in a single code-line.)
I am not sure about the further development of this programming lanaguage. This is why I set this project as an open-source project. You may modify as you like and send the source code to my email address: [email protected]. You can further develope on if-else statement, loops, functions, and OOP. Anyone who updated this project will be defined as a contributor. Thank you kindly for supporting and if any error occurs, please fix it by yourself. Peace✌️
- Version: 0.1 (Beta)
- Type: Interpreted Programming Lanaguage
- Developer: Codejapoe
- Started on: 25/09/2023