Skip to content

Fython is a functional language that aim for combine the best of Python and Elixir

Notifications You must be signed in to change notification settings

joaovitorsilvestre/fython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fython

Fython is a dynamic, functional programming language heavily inspired by Python an Elixir. It was build on top of Elixir and runs on Erlang’s VM.

The language borrow a lot of ideas from Python and apply them in the world of functional programming.

Examples of code

Hello World

def run():
    print('hello world')

> run()
hello world

Fibonacci

def fib(a, _, 0):
    a

def fib(a, b, n):
    fib(b, a + b, n-1)

> fib(10)
55

Reversed list with indexes

def run(my_list):
    my_list
        |> Elixir.Enum.reverse() # we can call Elixir modules inside fython
        |> enumerate()
        |> map(lambda item: print(item))

> run(['foo', 'bar'])
(0, 'foo')
(1, 'bar')

About

Fython is a functional language that aim for combine the best of Python and Elixir

Resources

Stars

Watchers

Forks

Packages