[ruby-core:74288] Re: Type systems for Ruby

From: Rob Blanco <ml@...>
Date: 2016-03-13 20:04:00 UTC
List: ruby-core #74288
On 03/13/2016 02:14 AM, Martin J. Dst wrote:
>> Judging from the wiki, the main open question seems to be just what kind
>> of type system to aim for, and here two groups of approaches are
>> apparent: on the one hand, soft typing has been as far as I know the
>> focus of attention in the community; on the other, gradual typing, which
>> is where recent research and implementation concentrate.
>
> Can you please quickly explain (or provide pointers) to "soft typing"
> and "gradual typing"? At first sight, the terms sound quite similar.

By gradual typing I mean basically the ability to add optional type 
annotations to variables, so parts of a program can be checked at 
compile-time. Wikipedia has a good short introduction: 
https://en.wikipedia.org/wiki/Gradual_typing

Soft typing doesn't make any syntactic changes and instead performs a 
sort of best-effort type inference at runtime. This was directly the 
approach of the RubyConf 2014 opening keynote, as summarized here: 
https://www.omniref.com/blog/2014/11/17/matz-at-rubyconf-2014-will-ruby-3-dot-0-be-statically-typed/

I don't consider both camps mutually exclusive, although most efforts to 
retrofit types in dynamic languages nowadays follow gradual typing. I 
can provide more detailed descriptions and references if needed.

Rob

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread