Skip to content

Sphere is a memory-manipulating, language with compact syntaxing. Its Runtime reads its own Binary Files (.sbf) for cross-architecture compatibility. The Runtime executable itself is separately available accross CPU architectures and mainly runs freestanding code unless absolutely necessary. (Also has its own OS ootb if there's none)

Notifications You must be signed in to change notification settings

NullifyDev/Sphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sphere

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 .sbfs).


THIS PROJECT IS UNDER ALPHA DEVELOPMENT

Any feature may change at any given point in time.




Examples

main(): int {
    hello: string = "Hello,"
    world: string = "World!"
    outln hello world 
    outln $"{hello}{world}"
}

<# Output:
Hello, World!
Hello,World!
#>

How to Compile

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>`

Identifier Prefixes

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

Learn more (coming soon)

Instructions

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

Sphere Execution File

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)

Learn more (coming soon)

Support

Any operating systems that support LLVM and clang will be immediately supported.

Platform Support

  • Freestanding
    • x86
    • arm
    • RISC-V

  • Windows
    • x86
    • arm
    • RISC-V

  • Linux
    • x86
    • arm
    • RISC-V

  • MacOS
    • x86
    • arm

  • Android
  • iOS

Indefinate Softawre

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)

About

Sphere is a memory-manipulating, language with compact syntaxing. Its Runtime reads its own Binary Files (.sbf) for cross-architecture compatibility. The Runtime executable itself is separately available accross CPU architectures and mainly runs freestanding code unless absolutely necessary. (Also has its own OS ootb if there's none)

Topics

Resources

Stars

Watchers

Forks