Sphere is a compact language designed for both software and Operating System Development via direct Raw-Memory-Manipulation
The language syntax is designed to balance readability and writability by minimizing the amount of characters required to write while maintaining the self-explanatory nature of the code and namings.
This language mainly uses freestanding C/C++ code for its Runtime. The runtime executable is very CPU Architecture specific. Therefore, the runtime executable is [going to be] available across mutliple architectures such as x86, arm and RISC-V.
Sphere-written software [will] compile(s) into Sphere Binary Files (or .sbf
s).
Any feature may change at any given point in time.
main(): int {
hello: string = "Hello,"
world: string = "World!"
outln hello world
outln $"{hello}{world}"
}
<# Output:
Hello, World!
Hello,World!
#>
This project is written with the latest .Net release So install that before continuing. Not sure if you have it? check by doing dotnet --version
.
- Git Clone this repo with the `-b prototype` argument and head into the cloned project.
- do `dotnet restore` to get all the possible dependencies installed
- do `dotnet ppublish --self-contained` and wait for it to finish
- now run your new executable by running `<exeNameWithoutDotExe> <SphereFile>`
Handle | Description |
---|---|
$<object> |
Gets the information of the specified object |
@<object> |
Gets or sets the address of the specified object. |
<object> |
Gets or sets the value of the object |
Instructions and Arguments | Description |
---|---|
mov <object> <int> |
Move the object by signed number of addresses |
incr <int> |
Increment current address by the given amount |
decr <int> |
Decrement current address by the given amount |
<identifier>(): <DataType> {} |
Function with name as string with one argument |
out <arsg> |
Print all arguments before EOL without line break. |
outln <args> |
Print all arguments before EOL with line break. |
if <Condition> { <instructions> } |
Executes Instructions when condition returns true |
elif <Condition> { <instructions> } |
Executes Instructions when condition returns true when primary condition is not met |
else if <Condition> { <instructions> } |
Executes Instructions when condition returns true when primary condition is not met |
else { <instructions> } |
Executes Instructions when none of the Conditions were met |
for <start> <end> <identifier?> {} |
Iterates from start value to the end value while iterator is less than or equal to end . Optional: Identifier |
entry <FileID/FileName>
[dependency]
./deps/path/to/file.sbf
./deps/path/to/directory
./deps/path/to/directory/*
./deps/path/to/directory/*/.../
./deps/path/to/directory/...*/
./deps/path/to/directory/sub.../
[blacklist]
Syntax | Description |
---|---|
./* |
All files and folders |
./*/.../ |
All files, folders and subdirectories (default depth: 1) |
./...*/ |
recursive subdirectory traversal - * can be any number for max depth (default: unlimited) |
./sub...*/ |
recursive subdirectory traversal under sub folder (max depth is * - default: unlimited) |
./*...*/ |
Recursively all files, folders and subdirectories at any depth (max depth is * - default: unlimited) |
Any operating systems that support LLVM and clang
will be immediately supported.
- Freestanding
- x86
- arm
- RISC-V
- Windows
- x86
- arm
- RISC-V
- Linux
- x86
- arm
- RISC-V
- MacOS
- x86
- arm
- Android
- iOS
Here are some of the software that are under consideration of development using Sphere as the language
- Petroglyph IDE
- Boulder Package Manager
- RollOS
- Asciigine (Console/Terminal based Game Engine with Ascii graphics)