When comparing Scheme vs Pony, the Slant community recommends Scheme for most people. In the question“What are the best (productivity-enhancing, well-designed, and concise, rather than just popular or time-tested) programming languages?” Scheme is ranked 4th while Pony is ranked 25th. The most important reason people chose Scheme is:
Scheme syntax is extremely regular and easy to pick up. A *formal* specification of the syntax fits onto just a few pages; it can be introduced informally in a paragraph or two. Students are not distracted by remembering how to write if statements or loops or even operator precedence because every syntactic follows the same pattern. Ultimately, everything looks something like this: (func a b c) This includes not only user-defined functions but even control flow: (if cond then-clause else-clause) or even primitive operations like `define` and `set`: (define foo 10) (set! foo 11) This means that nothing really has special syntactic treatment in the language. There are essentially no weird edge-cases to memorize, and different concepts are given a more equal weight in the language. (Unlike Algol-like languages which tend to given undue weight to loops and assignment statements, for example.)
Ranked in these QuestionsQuestion Ranking
Pro Simple syntax
Scheme syntax is extremely regular and easy to pick up. A formal specification of the syntax fits onto just a few pages; it can be introduced informally in a paragraph or two. Students are not distracted by remembering how to write if statements or loops or even operator precedence because every syntactic follows the same pattern.
Ultimately, everything looks something like this:
(func a b c)
This includes not only user-defined functions but even control flow:
(if cond then-clause else-clause)
or even primitive operations like
(define foo 10) (set! foo 11)
This means that nothing really has special syntactic treatment in the language. There are essentially no weird edge-cases to memorize, and different concepts are given a more equal weight in the language. (Unlike Algol-like languages which tend to given undue weight to loops and assignment statements, for example.)
Pro No Magic - it's clear how everything works
Scheme has far less built into the language itself, helping students see that things like OOP are not magical: they are just patterns for organizing code. Everything in Scheme is built up from a very small set of primitives which compose in a natural and intuitive fashion.
Having a language that does not accord many things special status helps keep students open minded. This will help students later go between different languages and paradigms from procedural to object-oriented to functional.
Pro Great at teaching fundamental programming ideas
Scheme teaches the important, fundamental ideas immediately without the distraction of unnecessary syntax or language features.
Pro Great, well known textbooks
There is a set of very strong textbooks introducing CS and programming using Scheme. These books are available for free online.
The most famous example--and one of the most famous CS books full stop--is Structure and Interpretation of Computer Programs usually known as SICP. This book introduces fundamental ideas in computer science and covers an incredible amount of material quickly and clearly without requiring any prior knowledge.
However, some people find SICP a bit challenging as a first text. Happily, there are other more introductory texts as well. Simply Scheme is a book designed to be read before SICP, easing beginners into the language as well as CS and programming in general. How to Design Programs is another text used in introductory college courses.
Pro Robust metaprogramming
The quotation functionality of Lisp allow for extremely powerful, yet syntactically straightforward metaprogramming via macros. This is more powerful than the C preprocessor while being less involved than something like Template Haskell or F# quotations.
Using macros to properly decompose a problem domain teaches new developers good habits, improving composibility and reliability when tackling large programs. Scheme metaprogramming also serves as a gentle introduction to domain specific languages.
Unlike most languages, Scheme actually accords both functional programming and imperative programming roughly equal status. Many other languages like Python and Java are staunchly imperative while SML and Haskell are primarily functional; Scheme is a nice middle ground.
Additionally, since Scheme syntax is extremely flexible, it can easily be re-purposed for teaching non-deterministic and logic programming. There is no need to learn a new language like Prolog when the same ideas can easily be expressed with Scheme syntax.
This gives students a good perspective on different ways to think about and organize programs, which makes it much easier to move forward to other languages and technologies.
Pro Concurrency model based on actors
The unique type system allows the compiler to automatically schedule actors on threads, giving you reliable concurrency for free.
Because of its capabilities secure type system, provided you don't use the C FFI, references will never be stale, race conditions are effectively impossible, deadlocks don't happen because locks and mutexes are never needed, and processes never crash because all exceptions must be handled. (Barring compiler bugs or external memory corruption, of course.) Pony programs can still lock up due to infinite loops, like any Turing-complete language.
Pro Trivially simple C FFI
Calling low-level C functions is as simple as
use "lib:clibrary" and
@c_function_name[return_type](parameter:type). Linking C to Pony libraries is just as easy, as the Pony compiler will generate appropriate header files.
Pro High performance
Compiles to native code, and features an intelligent garbage collector that takes advantage of the actor architecture to get essentially free garbage collection.
Con Little Job Market
There are little to none jobs searching for a Scheme programmer. The ones that exist are more related to Research in Maths or Artificial Intelligence.
Con Fragmented ecosystem
Scheme is an IEEE standard, not an implementation. Unfortunately, the standard is too minimal and practical implementations have diverged--they had to expand on the standard to get anything done, but did so in incompatible ways.
The later de facto standard R6RS tried to correct this, but lost Scheme's minimalist elegance in the process. The newer R7RS standard takes the best of both worlds with an elegant minimalist core and a practical standard library.
Con Very different semantics from mainstream programming languages
Con All exceptions must be caught
The compiler enforces this, so code is littered with
Con Limited documentation
As Pony is such a new language, documentation is relatively light, and tutorials are few and far-between.
Con Few libraries
Con Limited tooling
There's no IDE. Debuggers are fairly basic. Pony is too young to have much of an ecosystem.
Con Garbage collector can't run until you yield
A long-running behavior can leak memory because the garbage collector has no chance to run.
Con Divide by zero is allowed
And instead of some sensible result like NaN or Inf, the answer is zero! Most languages would just raise an exception (and Pony used to do this), but since the compiler enforces the rule that "all exceptions must be caught" the proliferation of
trys was determined to be too burdensome on the programmer. This makes the whole design of the exception system questionable.
Con Unstable API
Pony is not ready for production. It has yet to release version 1.0, and there are frequent breaking changes.
Con Difficult learning curve
The type system uses a capabilities-oriented approach to reference semantics, which can be difficult to wrap your head around at first. The lack of more common object-oriented features and the preference for simplicity over familiarity can make it difficult for new users to model their program design.