under development

What is Ziphon?

Ziphon is a high level programming language that focuses on fine grained code reuse. It is implicitely statically typed. Our philosophy is that the key to productivity is to enable the painless creation and use of small libraries.

Example code

All of these are runnable code. Go ahead!

# The classic example
print('Hello, World!')

That was straightforward. Let's do something more involved:

# Printing each line of a file that starts with ">"
@io (file)
file('test.txt').lines().each {|line|
    line.startsWith('>').then {
        print(line)
    }
}

If this is the first time you see Ziphon, you gotta be asking what that is about. The @io (file) says to import file from the io module. Then we construct a file, get its lines, and iterate over them. Ziphon has no keywords. Instead, each is a method that takes a function and calls it on each element. Function literals are written like this: {|argument1, argument2| ... }; this is a function that takes two arguments and does something (the ...) with them. The function we provide to each takes just one argument though. Inside the function body, we use Ziphon's equivalent of an if-statement. line.startsWith('>') might return either True or False. We use the then method, which calls the function we provide if we got True back. This time, we need no arguments, so we simply leave the vertical bars out of the function literal. The body of the function simply prints out the line to the screen. Phew - what a mouthful! Make sure you understand these three examples though, because when you do, you're ready to sky dive into the code! If that's what you prefer, anyway.

# Summing a list of squared even integers
list := [i * i | i: [1, 2, 3, 4, 5], i % 2 == 0]
print(sum(list))

Wierd, isn't it? That blob in [...] on line 2 is a list comprehension. It is not at all complicated though: it multiplies i by itself to square it; it does so for every i in the list of integers from 1 to 5; and it filters out all those i that are divisible by two (ie. those which are even). To the left of the comprehension we find list :=, which is a definition: we define list to be the result of the list comprehension. The last line simply calls sum on the list and prints out the result.

You can try Ziphon in your browser, or you can go ahead and install it locally. If you'd like to read more, head on over to the documentation section.

News

Duis vel urna et lorem pellentesque suscipit. Suspendisse nec neque lacus, vitae dapibus diam. Donec vitae nibh id metus pretium vulputate nec eu nibh. Praesent id nunc quam. Fusce dictum eleifend dapibus. Sed sit amet fermentum augue. Etiam elementum scelerisque mauris, ac laoreet mauris hendrerit id. Maecenas vitae sapien aliquet elit adipiscing sagittis in in lectus. Ut lacus risus, ullamcorper id condimentum eu, sollicitudin nec purus. Proin quis quam nibh. Nulla sapien tellus, tempor at feugiat a, mattis ac nibh. Vivamus id sem tortor. Mauris tincidunt arcu quis velit tempus bibendum. Ut porttitor, sem vitae hendrerit congue, risus nisl rutrum tortor, at lacinia purus lorem vel lorem. Nulla adipiscing leo at enim posuere consequat. Curabitur felis metus, sagittis ac mattis pharetra, euismod at augue. Curabitur dolor neque, scelerisque a lacinia pretium, feugiat ac nisl.

Donec a ligula id purus placerat aliquam quis at nisl. Ut fermentum, urna et volutpat fermentum, risus lacus laoreet augue, vel cursus dolor dui cursus justo. Aliquam ut elit est. Curabitur mattis, augue eu mattis pellentesque, purus risus ultrices erat, nec pharetra nulla erat nec quam. Morbi a metus ligula. Integer pellentesque ultrices semper. Suspendisse laoreet semper ligula non placerat. Suspendisse potenti. Sed vulputate hendrerit quam, eget sollicitudin libero accumsan posuere. Duis vitae mauris sed mi cursus pellentesque. Donec ultricies viverra diam, sit amet porta ante imperdiet sit amet. Cras vitae nunc nisl. Curabitur adipiscing auctor massa ac eleifend. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Aliquam nec lorem eu urna condimentum bibendum. Pellentesque id ullamcorper felis. Nunc a nisl nec lacus eleifend adipiscing quis nec augue. Aliquam sem sapien, vulputate pretium fringilla eget, rhoncus eget est. Curabitur a leo vitae odio sodales tristique. Sed imperdiet augue non metus ornare quis consectetur diam porttitor. Donec porta interdum enim a dignissim. In a nisl at eros cursus facilisis. Sed bibendum iaculis nibh et hendrerit. Nulla luctus bibendum dignissim. Nullam rhoncus rhoncus lacus, quis pellentesque quam condimentum in. Nunc vitae diam nibh, eget ullamcorper tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam suscipit pharetra lorem, vitae molestie eros luctus sollicitudin.