Skip to content

GioseaxMC/swami

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

117 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swami

Quick, ignorant setup

linux:

curl https://raw.githubusercontent.com/gioseaxmc/swami/main/install.py | sudo python

windows:

curl https://raw.githubusercontent.com/gioseaxmc/swami/main/install.py | python

Desc

A low level, compiled language written in python

Goals

  • Convenient
  • Statically typed
  • Turing Completeness (see examples/09_rule_110.sw)
  • Self Hosted
  • Natively compiled

Dependencies

  • Clang's LLVM
  • Any C target (such as mingw32 or msvc)

How to use

File: main.sw

include { "stdlib.sw" }

func int main() {
    printf("Hello World!\n");
}

Run:

$ python swami.py main.sw -o main
$ main

Hello World!

Simple cat implementation: cat.sw

include {
    "stdlib.sw",
    "files.sw",
}

func int main(int argc, ptr ptr char argv) {
  
  for(i=1, i<argc, i++, {
    
    contents = read_file(argv[i]).contents;
    printf("%s\n", contents);

  });
  
  return 0;
}

Run:

$ python swami.py cat.sw -o cat
$ cat main.sw

include { "stdlib.sw" }

func int main() {
    printf("Hello World!\n");
}

About

Compiled programming language in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages