Stanza: A New Optionally-Typed General Purpose Language from UC Berkeley
We're happy to announce the first public release of the Stanza programming language! Stanza is a new optionally-typed general purpose programming language from the University of California, Berkeley. It was designed to help programmers tackle the complexity of architecting large programs and significantly increase the productivity of application programmers across the entire software development life cycle. You can check out the website here:
http://www.lbstanza.org
Here are three really cool things about Stanza:
1. It is both statically and dynamically typed. If you give no type annotations, Stanza behaves like a scripting language. The more type annotations you give, the more errors Stanza will catch upfront.
2. It has a class-less object system. We believe in both object oriented programming and functional programming, and designed Stanza's object system to seamlessly incorporate both styles.
3. It has a really powerful coroutine system called targetable coroutines. It's a general control flow construct that can be used for fine control over concurrency, and is useful for things like video games and webservers.
We've already been using Stanza internally for about two years now. Using Stanza, we've designed a hardware language called FIRRTL, designed a teaching language called Feeny for teaching a graduate course on virtual machines, wrote a tool for automatically generating circuit boards for robotics, and (as upstanding computer scientists) wrote the entire Stanza compiler in Stanza itself.
Now, Stanza is stable and mature enough for us to feel confident to share it with everyone. We hope you'll check it out!
- The Stanza Team
78 comments
[ 2.9 ms ] story [ 136 ms ] threadpatricksli, if you want to post your text as a comment, we can swap the URL later.
Edit: holy mother of god the philosophy page is so scarily close to my thoughts, very happy to see this happen, I kept them in my head you have implemented it!
don't use tabs. Stanza won't let you. We don't like tabs.
e.g.
http://lbstanza.org/chapter2.html#anchor6[0] http://lbstanza.org/chapter4.html#anchor52
There are just some theoretical hurdles to solve in order to detect them properly in the presence of parametric types. That's been recently solved (though not by us) so we'll be implementing their solution soon.
Plus it's fully self-hosting, too; the sign of a properly grown up language.
Show us your benchmarks.
edit: This was in reference to FIRRTL's FAQ[1] which mentions the 10 tape outs, and such. Do you guys have open-source netlists or whatnot?
[1] http://www.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-9....
I'm still excited to see it being a feature of a brand new language, and everything else about this language seems very exciting to me!
[0] http://www.typescriptlang.org/
Our approaches differ though. Stanza believes fundamentally in nominal typing as opposed to structural typing, and also views types as contracts on its behaviour rather than on its structure.
Only time will tell which approach is the best one. But we are very happy with how our design choices have panned out.
Shen allows you to turn the type checker on or off:
(tc +)
(tc -)
You can leave your type signatures in the code when you turn them off, and when tc is on you only need a type in the top level of your function.
It has a fully functional Prolog engine built in, and it supports optional lazy evaluation too.
Great talk by Aditya Siram Sept 2014 Strange Loop talk introducing Shen [2]. Shen has been ported to many languages, since it only requires porting the 46 primitive instruction set, called Klambda. Shen has been ported to CL (SBCL), Ruby, JavaScript, Haskell and even Emacs Lisp.
[1] http://shenlanguage.org/ [2] https://www.youtube.com/watch?v=lMcRBdSdO_U
[1] http://opendylan.org/
Now is the time to bring many of its contributions into the light again.
Maybe you meant "Du Fu's Stanza"? Correct me if I'm wrong, but as far as I know, Li Bai is renowned particularly for his mastery of unregulated old-style (gushi 古詩) forms instead... Du Fu, on the other hand, was an indisputable master of regulated verse.
On my browser (Chrome on Ubuntu), it shows as a non-monotyped font which is much harder to parse.
Google Go's story was that they wanted a lowest-common-denominator language for use by their mixed-skill-level development pool. C was written so that some games could be ported to minicomputer... And so on.
I mostly write software that is end-user-facing and interactive, with requirements that aren't known at the beginning of the project. Software that my mother would use, is how I typically describe them. e.g. Word processors, games, calendars, photo albums, spreadsheets, maps, movie players, etc.
And what I saw repeatedly, for all of my projects, was that progress comes a lot faster in the beginning than near the end. Eventually, I pinpointed the problem to one of software architecture. It is easy to see the required architecture for the start of a project, and making progress is easy. As you pile on demands and features, you realize that the architecture that you started off with is wrong, and progress slows. This is especially true if the requirements of your program are not known in advance. I expect people that mostly program well-known and stable algorithms don't have as much difficulty with this. E.g. numerical linear algebra, schedulers, image filters, etc. That is not what I write.
Once you realize that your architecture is wrong, you have two choices. You can either plow ahead with a sub-optimal architecture, and take a small but continual productivity hit. Or you can try to refactor and correct the architecture, and take a large one-time productivity hit. Neither approach is satisfactory. Small continual productivity hits eventually add up to the point that forward progress is seriously impeded. Refactoring also costs a lot of time, and eventually the cost of refactoring becomes too great to be worth it, and you're stuck with the last good enough architecture that existed.
So Stanza was designed to make it possible for me to : 1. Experiment easily without specifying upfront the class inheritance tree in the program. 2. Delay committing to a specific architecture for as long as possible. 3. Refactor the underlying architecture of a program through small local changes.
And for the programs that I write, I sincerely believe that I succeeded. I've been programming exclusively in Stanza for about three years now, and I haven't yet ran into the dreaded "refactor-or-abort" situations that arise often in Java/C++ programming. Radical changes to the underlying architecture of a program are possible by applying a series of small staged local changes. And the optional type system allows me to get a lot of features working without having to commit to an architecture, so that when I finally sit down to properly design the architecture it is much more likely to be correct.
So my ultimate goal with Stanza is to help you achieve a linear rate of progress across the project timeline. You should feel as productive near the end of the project as you did in the beginning of the project.