GithubHelp home page GithubHelp logo

spython's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.