Where’s Wyvern?

September 8, 2014

Blog | Technology | Where’s Wyvern?
Where’s Wyvern?

A couple of weeks ago, Heather Waters graciously tagged me threw me under the bus in her Release the Wyvern post. She asked if I could check out the much-hyped language to determine exactly what it brings to the development table. Armed with a trusty cup of Joe and promises of a paid day off, I set out to learn more.

My quest seemed futile, as I ended up repeatedly finding the same information about “Carnegie Mellon University”, a “team of researches”, and the “polyglot language.” As far as I can tell, the Wyvern may be  in some kind of hibernation. Alternatively, (conspiracy theory alert!) perhaps the NSA has put a “hush-hush” on the whole shebang. In fact, the GitHub repository hasn’t had a meaningful commit to the master branch in over a month.

It’s possible that the team is working hard (or hardly working, as ‘tis the season for vacations) and has simply not made their latest discoveries public knowledge. But for an “open source”, ambitious, and (hopefully) useful project that was claimed to be ready for early adopters – where is everyone? Is there really no interest in the webosphere for the programming equivalent of a Ring of Power?

One Language to rule them all, One Language to find them,

One Language to bring them all and in the abstractedness bind them

In the Land of Coders where the Binaries lie. — J.R.R. Tolkien (sort of)

In looking at one of the code blocks pulled from the  specification rationale page, we can make some broad assumptions. Note that the sample below differs slightly from the examples residing in the GitHub source, likely a simple evolution of the language over time. 


class StackImpl
   implements Stack
   class implements StackFactory

   var list : Link?

   meth top() = list.data

   meth push(element)
       list = Link(element, list)

   meth pop()
       val result = list.data
       list = list.next
       result

   class meth make() = new StackImpl

   class meth makeWithFirst(firstElement)
       new StackImpl
           list = Link(firstElement, null)

 

class Link
   val data : Int
   val next : Link?

   class meth make(d:Int, n:Link?) = new Link(data=d, next=n)

// a package-level method (method of the package object, if we have one)
meth stackClient()
   val s = StackImpl.Stack()
   s.push(5)
   print(s.top)
   val addOne : Int -> Int = fn(x:Int) => x+1
   print(addOne(s.pop()))

 

 

Note that you’ll see  a Stack implemented as a one way Linked List. There are  Top, Push and Pop methods, an inner variable ‘list’ of type Link keeping a data element and the next link in the set, and finally an example showing how to leverage the Stack’s features.

Putting aside the obvious, the first thing I notice are line delimiters. I’m in the camp where a newline is not adequate indication of statement separation, and based on the above, newlines are the de facto separation.

Other notable syntax features:

  • Typed anonymous expressions

       val addOne : Int -> Int = fn(x:Int) => x+1)

    • Took me a few moments to decipher, but it reads as a function with an Int parameter returning an Int (Int -> Int).
  • Nullable types

       var list : Link?
       ...
       val next : Link?
  • OO Patterns

    class StackImpl
       implements Stack
       class implements StackFactory
  • Return values (implicit..?)

    meth pop()
           val result = list.data
           list = list.next
           result
  • Properties?

    meth top() = list.data

 

I’m sure the proposed syntax has many other subtle goodies, but let’s leave it at that.

At this time, details are sparse. Perhaps the project died shortly after release, or maybe they’re all hard at work. Time will tell if Wyvern will one day top the TIOBE Index among the ranks of power-houses such as C, Java, and Python co-existing in the Top 10. If you’re an independent developer or part of a startup considering being an early adopter for Wyvern, let us know @GeekHive! We’d love to get some more insight on whether the language will one day soar.

Phil Azzi, Developer, GeekHive

Phil Azzi

Technical Lead
Tags
  • Development
  • News

Recent Work

Check out what else we've been working on