N things Scala should steal from other languages

Chris Birchall

Methodology

  1. Write down some ideas
  2. Crowdsource more ideas on Twitter
  3. Turn them into slides

GOTO keyword

Description:

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Cheeky control structure

php, BASIC

0/5

0/5

SAMPLE

SAMPLE

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Better type inference

(credit: Julien Truffaut)

Haskell, ML

4/5

3/5

@ List(1,2,3).foldLeft(Nil){ (xs, x) => x::xs }
type mismatch;
 found   : List[Int]
 required: scala.collection.immutable.Nil.type

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Row types

(credit: Mark Eibes)

PureScript

2/5

1/5

Unordered, labelled collection of types.

Can be used for extensible effects.

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Typed holes

Agda, Haskell, Idris

5/5 (Done!)

0/5

Leave deliberate 'holes' in your program, for interactive type-driven development

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Dependent types

Idris

1/5

0/5

Types can depend on values

e.g. "List of Ints with size 4"

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Linear/affine/quant types

Idris 2, Linear Haskell, ATS, Rust

1/5

0/5

Can't use a value more than once, must use a value at least once, etc.

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Reference capabilities

Pony

1/5

0/5

Safe sharing of mutable state

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Fast compiler

Java, Go

3/5

2/5

Nobody ever needing to embed that xkcd comic in their slides again

(credit: Channing Walton)

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Tail-call optimisation

F#

2/5

0/5

Stack-safety without sacrificing heap.

Requires a JVM change.

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Coroutines

Go, Lua, Kotlin, ES6 (generators)

5/5 (Done!)

0/5

Lightweight threads with user-defined suspension points

(credit: Maksim Aleshko)

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Type providers

F#, Idris

3/5

0/5

Generating new types based on external input, e.g. a schema file

(credit: Jan Schulte)

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Hoogle

Haskell

3/5 (would be nice if Scaladex had an API...)

0/5

Search for functions by name or type signature

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

Deriving

Haskell

3/5

5/5 (see Martin's keynote!)

Automatic derivation of type class instances

(credit: Martin Lechner)

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

WebAssembly

Rust

4/5

0/5

The future of the web!

Description:

 

Relevant langs:

Likelihood:

Fixed in Dotty:

Relevant links:

First-class purity

Haskell, PureScript, Eff

4/5

3/5

Pure/impure separation enforced by the type system.

Effect system built in to the language.

N things Scala should steal from other languages

By Chris Birchall

N things Scala should steal from other languages

  • 3,496