• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python to Swift Transpiler

Peryton

A Python to Swift Transpiler

Peryton, named after the mythological deer that has the wings of a bird, is a Python to Swift Transpiler. It can accept native Python code, parse it, and translate that code to the equivalent code in swift. The major advantages of using Peryton are:

  • You can write IOS/OS X applications use Python.
  • You can make use of the Swift language without having to learn it's syntax, rules etc.
  • You can convert your favorite Python modules/documents to Swift code to use in your IOS/ OS X applications.

Compatability

Transpiling Python to Swift does raise a number of issues in the process. The first and foremost one, is the lack of type safe practices in Python, where you do not specify the type being passed into a function and the type being returned. Fortunately, Peryton handles this issue by type-testing the input of functions, as well as object attributes.

In Swift, you can declare variables and constants:

var t = 0

let thing = "Hello"

Where changing the let constant causes an error. Python does not have constants. However, one can theoretically infer from the structure of a function or program if a variable has the need for being protected. Peryton will be developed to do this through a process called Flow_Analysis, that determines the connections between functions, classes, objects and other parts of a program.

Equivalency

In Swift, there are times when using a specific element of the language is more efficient than it's equivalent element in Python. As a basic example:

class frogs(object):

fly_count = 7
length = "four"
  • Since this class only contains a set of variables, it would be better suited as a struct, not a class. Peryton will be developed to tell that difference in the process of writing Swift code.

  • See the peryton package for the transpiler code.

More Repositories

1

Oblivion

The language of Art
JavaScript
414
star
2

BernieScript

A fun programming language based on Bernie Sanders
TypeScript
45
star
3

Wind

The Flow-based Programming Language
C
18
star
4

pysimd

A Python SIMD C-Extension Module
C
11
star
5

Fire

The Reactive Programming Language
C
10
star
6

ContactDetective

A simple API for mining contact information from text and HTML
Ruby
10
star
7

stein

A natural language poetry engine
CoffeeScript
8
star
8

SquidWord

A language sotrage system for storing statements and questions in a trie-like JSON format
Python
7
star
9

Random-Word-Generator

A python program that generates random words of a specific length and starting letter. Uses an algorithm that only makes words based on English grammar rules. Useful for coming up with new names for businesses or apps.
HTML
7
star
10

warkii

A natural language generator for six word stories
Scala
6
star
11

PyCExtension

A template repo to learn and develop Python C Extensions
C
6
star
12

Pages

A story event writing engine
C++
6
star
13

corplet

A binary-corpus system for word tagging
Scala
5
star
14

Royalscript

A functional programming language that's Royal.
JavaScript
4
star
15

ncov2019-analyzer

High performance tools for analyzing coronavirus genome
C++
3
star
16

Farm_Compiler

The Compiler package for the Farm Programming language
HTML
3
star
17

money-machines

A blog about using cellular automata to model financial and investment markets.
CMake
3
star
18

CS70

A library of javascript, python and ruby objects and functions used to study concepts in Discrete Mathematics(Computer Science 70),
Python
2
star
19

Pike

Pike is a microprogramming language based on the use of high level operators and syntax, to streamline coding.
JavaScript
2
star
20

HammerHeadJS

An array based virtual machine written in NodeJS
JavaScript
2
star
21

Radon

A unique Lisp dialect
C++
1
star
22

apple

A dynamic, error free type for Rust
Rust
1
star
23

hash_browns

A fast, effecient, hashing library
Rust
1
star
24

Tagineer

A Part of Speech Tagging application written in Python.
Python
1
star
25

ca-finance-lang

A framework for advanced modeling of financial markets and investments
Rust
1
star
26

Pigeon

A streamable, fast interpreted programming language
Swift
1
star
27

sword

A fast, sharp, Python C extension for data mining.
C
1
star
28

jscomp

A node package for generating clean javascript code
TypeScript
1
star
29

MM7

An experimental model of currency trading
C
1
star
30

Smelt

A simple, fast CSV parsing library in C
C
1
star
31

the-oblivion-language

An unorthodox programming language.
1
star
32

SHA-256-Tree

A C implementation of the SHA 256 tree hash algorithm
C
1
star
33

CellsVM

A tiny virtual machine that uses a cell based approach
C
1
star
34

Cook

The Reaction based programming language
C
1
star
35

transjs

A Scala library for generating JavaScript
Scala
1
star
36

OblivionJS

A Typescript virtual interpreter.
JavaScript
1
star
37

hillaryscript

A programming language modeled after Hillary Clinton
JavaScript
1
star