Skip to content

RichardSCS/spython

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S-Python

A statically-typed Python compiler

S-Python is an educational tool that introduces the concepts of static typing and compiling to young learners within the Python programming language.

Contents

Examples

def gcd(int a, int b)->int:
	int t = a
	while b != 0:
		t = a
		a = b
		b = t % b
	return a
print(gcd(1234342213, 334232))

Installation

Install Docker on whatever operating system, see Get Docker for more information.

For PLT2024 graders, you may load the docker image by:

docker load -i spython-docker.tar

or build the docker image may take a minute or two:

docker build -t spython .

for Linux/Mac users, run it to enter the container when the image is ready:

docker run -v $PWD:/plt2024 -it spython

for Windows users:

docker run -v %cd%:/plt2024 -it spython

Test and Run

You can get the latest S-Python from https://github.com/LeslieChn/spython.git

Install the compiler by running the following:

make

Compile the file by running the following:

./spython source.spy [-o output]

Or use the following to install the compiler, compile and run the test files in one shot:

make test

You can clean up the folder by running the following:

make clean

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • OCaml 97.5%
  • Shell 2.1%
  • Other 0.4%