Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/green726/swo
SWO Wants Options | SWO Is A Compiled Language
https://github.com/green726/swo
compiler language llvm programming programming-language
Last synced: about 1 month ago
JSON representation
SWO Wants Options | SWO Is A Compiled Language
- Host: GitHub
- URL: https://github.com/green726/swo
- Owner: green726
- Created: 2022-04-14T00:43:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-12T04:42:08.000Z (9 months ago)
- Last Synced: 2024-11-14T10:41:33.784Z (3 months ago)
- Topics: compiler, language, llvm, programming, programming-language
- Language: C#
- Homepage:
- Size: 205 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SWO
# About:
ℹ️ SWO is a general purpose low-level compiled programming language. The language is designed to be as customizable / configurable as possible through the use of a simple Toml file.
### Philosophy:
- Be (easily) customizable without requiring users to write code
- Maintain decent speed/performance in the compiler
- Maintain speed in the language
- Have a good FFI (Foreign Function Interface) / Interoperability with C (and maybe C++)### Why?
Why does SWO exist? I created SWO as a fun project to learn about compilers.
### How?
SWO is written in C# and uses a custom built parser. SWO uses the LLVMSharp C# LLVM bindings to translate the SWO code into LLVM Intermediary Representation (IR). This is then compiled (by LLVM) to native executables and/or binaries on a vareity of platforms. LLVM is used by various major languages including (but not limited to) C, C++, Rust, Haskell, Julia, Swift.
### A quick peek:
```c
int @fibRec(int n) {
if (n == 1) {
return n
}
if (n == 0) {
return n
}
return fibRec(n - 1) + fibRec(n - 2)
}@main() {
printf("%d", fibRec(4))
}
```