All Projects → Spydr06 → CSpydr

Spydr06 / CSpydr

Licence: MIT License
A static typed low-level compiled programming language inspired by Rust and C

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to CSpydr

Onyx
UNIX-like operating system written in C and C++
Stars: ✭ 52 (+205.88%)
Mutual labels:  unix, x86-64, low-level
Asm
Assembly Tutorial for DOS
Stars: ✭ 125 (+635.29%)
Mutual labels:  x86-64, low-level
colocat
Fegeya Colocat, Colorized 'cat' implementation. Written in C++17.
Stars: ✭ 14 (-17.65%)
Mutual labels:  syntax, unix
bf256
Brainfuck compiler under 256 bytes in size.
Stars: ✭ 21 (+23.53%)
Mutual labels:  unix, x86-64
AiliceOS
AiliceOS: Build an x86_64 and UEFI OS using Rust
Stars: ✭ 59 (+247.06%)
Mutual labels:  unix, x86-64
systems-programming-cheat-sheet
Cheat sheet for x86-64 Unix systems programming
Stars: ✭ 328 (+1829.41%)
Mutual labels:  unix, x86-64
Distormx
The ultimate hooking library
Stars: ✭ 146 (+758.82%)
Mutual labels:  x86-64, low-level
stdgems
Ruby's default & bundled gems: The new standard library
Stars: ✭ 94 (+452.94%)
Mutual labels:  stdlib, standard-library
compiler
My first attempt to create a compiler
Stars: ✭ 16 (-5.88%)
Mutual labels:  compilation, compiler-construction
salt
The compilation target that functional programmers always wanted.
Stars: ✭ 62 (+264.71%)
Mutual labels:  low-level, compilation
FOMOSv2-CL
FOMOS stands for: Free, Open source, Mobile, Operating, System.
Stars: ✭ 24 (+41.18%)
Mutual labels:  x86-64
gosh
A primitive shell written in go.
Stars: ✭ 37 (+117.65%)
Mutual labels:  unix
ClipboardText
Universal clipboard text support for PowerShell, notably also in PowerShell Core (cross-platform) and Windows PowerShell v2-v4
Stars: ✭ 37 (+117.65%)
Mutual labels:  unix
kirai
String formatting library for Java, Android, Web and Unix Terminal
Stars: ✭ 69 (+305.88%)
Mutual labels:  unix
fasm
flat assembler 1 - reconstructed source history
Stars: ✭ 187 (+1000%)
Mutual labels:  x86-64
awesome-internals
A curated list of awesome resources and learning materials in the field of X internals
Stars: ✭ 78 (+358.82%)
Mutual labels:  compiler-construction
x11-cr
X11 bindings for Crystal language.
Stars: ✭ 32 (+88.24%)
Mutual labels:  unix
dotfiles
🏡 .files, including zsh, tmux, vim, and git. Also macOS setup. Good stuff.
Stars: ✭ 30 (+76.47%)
Mutual labels:  unix
cult
CPU Ultimate Latency Test.
Stars: ✭ 67 (+294.12%)
Mutual labels:  x86-64
python-zpar
A python wrapper around the ZPar parser for English.
Stars: ✭ 49 (+188.24%)
Mutual labels:  syntax

The CSpydr Programming Language

CSpydr is a low-level, static typed, compiled programming language inspired by Rust and C. This repository contains cspc (the CSpydr Programming Language Compiler), as well as CSpydr's Standard Libraray, some code examples and unit tests.

Current Status

Made with Stars Forks License Issues Build

A list of all the features, that are/will be implemented.

cspc Compiler features:
  • Assembly compiler (only missing: va_lists, returnign of large structs) (only x86_64-linux platform)
  • LLVM codegen target (maybe even WASM?)
  • move to an intermediate bytecode compiler
  • C transpiler (deprecated)
  • lexing tokens
  • macro and import preprocessor
  • parsing an AST
  • validating the code
  • type evaluator
  • type checking (1/2 done)
  • scope validation
  • CLI and error handling
  • memory management
CSpydr Language features:
  • primitive data types i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 f80 bool char void
  • pointers and arrays & []
  • custom data types struct union enum {} (tuples)
  • control statements if match for while loop ret break continue noop
  • different loop types: for, while and loop
  • expressions
  • extern functions and globals
  • type-related keywords sizeof typeof alignof len
  • file imports
  • macros and macro-overloading
  • default macros __version__ __system__ __architecture__ __time__ __compile_type__ __main_file__ __file__ __line__ __func__
  • namespaces, functions, globals, typedefs
  • inline asm code blocks
  • lambda expressions (not asynchronous)
  • templates in fuctions and structs
  • va lists
  • functions as struct members
CSpydr Standard library features
  • basic c17 libc-header implementation
  • glfw and OpenGL/GLU header files
  • from-the-ground custom written stdlib based on linux syscalls (in progress)
  • control- and safety-structs and -functions (like in Rust) (in progress)

Building | Installation

Currently, CSpydr is only available for Linux. Once a first major release is in sight I will create an AUR repository for Arch Linux, but at the moment Installation is done via CMake. To build CSpydr on your computer enter these following commands in a terminal

git clone https://github.com/spydr06/cspydr.git --recursive
cd ./cspydr
cmake .
make

To install CSpydr with all of it's components (cspc - The CSpydr Compiler and the CSpydr Standard Library), enter this command (with root privileges):

sudo make install

Usage

To compile a CSpydr program use the following command:

cspc build <your file>

To directly run a program use this command:

cspc run <your file>

To launch a special debug shell, start your program using the debug action:
(not finished yet!)

cspc debug <your file>

Get help using this command:

cspc --help

The CSpydr Syntax

A simple hello-world program:

import "io.csp";

fn main(): i32
{
    std::io::puts("Hello, World!");
    <- 0;
}

Running this program is as easy as entering the following command:

cspc run hello-world.csp

Examples

For more examples, please refer to the examples/ directory in this repository.

(I will write a proper documentation in the future!)

Editor support

CSpydr currently only supports Visual Studio Code, since thats the code editor I personally use for developing. I will add support for other editors later on.

Check out the Visual Studio Code extension here.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update the unit tests as appropriate.

License

CSpydr is licensed under the MIT License

Resources | Reference | Inspiration

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].