Skip to content

rinslow/pyglish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyglish

codebeat badge Build status

Pyglish is a free and open-source programming language developed and maintained by d-kiss. It is a verbose syntactical superset of Python, and adds english-like syntax to the language.

Have a look at this python code:

This code snippet is a generator for prime numbers

def primes():
    x = 1
    while True:
        was_divided = False
        x += 1
        for y in xrange(2, x):
            if x % y == 0:
                was_divided = True
        
        if not was_divided:
            yield x

This is how we do it

def primes():
    for every prime x:
        yield x

And if you call this cheating...

def primes():
    yield every natural x if there is no y from 2 to x where x is divided by y

or, if you prefer:

def primes():
    yield x for every number x from 1 to inifinity if there is no number y from 2 to x  where x divides y

Some of Pyglish's important features as we keep in mind are

  • 100% full backwards compatability with python.
  • Easy to use and intuitive.
  • Very elagant syntax
  • Strong tests for easy refactoring

Supports:

  • Unittests
  • Comparisons
  • Loops

Future Support:

  • Unittests
  • Comparisons
  • Loops
  • Conditions
  • Exit codes
  • Strong typing
  • File I/O
  • Socket I/O
  • Threading
  • Waits (Explicit, Conditions, Implicit)
  • Math
  • Logging
  • Dates
  • Strangle
  • Abstract classing
  • Interfaces
  • Equation Return value
  • Switch-case
  • Elegant Hex Usage
  • Event-based programming
  • Monoikers
  • Then-Success-Failure angular-like promise
  • Pyglish ignore
  • Recursive walking through directories

Usage

Loops

Pyglish Python Equivalent
until password is equal to '123': while password != '123':
as long as user.is_connected(): while user.is_connected():
10 times: print "Hello" for _ in xrange(10): print "Hello"
for each user in group: print user.age for user in group: print user.age
for every user in group: print user.name for user in group: print user.name
foreach user in group: print user.address for user in group: print user.address

Comparisons

Pyglish Python Equivalent
if a is equal to b: if a == b:
if a is not equal to b: if a != b:
if a is greater than or equal to b: if a >= b:
if a is greater than or equal to b: if a > b:
if a is less than or equal to b: if a <= b:
if a is less than b: if a < b:
if a is between b and c: if b <= a <= c:

Unit Testing

Pyglish Python Equivalent
assert that user.is_connected() self.assertTrue(user.is_connected())
user.name should be "Dan" assert user.name == "Dan"
user.name should not be "Daniel" assert user.name != "Daniel"
assert that sock.connect raises socket.error self.assertRaises(sock.connect, socket.error)
assert raises NotImplementedError: a = AbstractClass() with self.assertRaises(NotImplementedError): a = AbstractClass()
name should be equal to get_admin_name() assert name == get_admin_name()
connection should be CLOSED assert connection is CLOSED
file_content should not be equal to "Pyglish v1.2" assert file_content != "Pyglish v1.2"
user_number should be greater than or equal to 6 assert user_number >= 6

About

English-like python language

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages