Skip to content

Latest commit

 

History

History
95 lines (95 loc) · 4.92 KB

features.md

File metadata and controls

95 lines (95 loc) · 4.92 KB

Programming Language Features

Good

AST Library

  • Go ast
    • API is really complex

Compile-Time Code Generation

  • Go generate
    • Compiles from strings -- AST or hybrid would be nicer
    • Or some inline generation syntax?

Runtime Code Generation

  • C libtcc
    • Compiles from strings -- AST or hybrid would be nicer
    • Or some inline generation syntax?

Reflection

Struct Tags

Decorators

Automatic Object-Level Concurrency Isolation

Reference Counting

Channels

Inclusive and Exclusive Range

Select

Hidden Event Loop Singleton

  • libuv
    • Efficient (epoll on Linux, kqueue on Darwin/BSD)
    • Timeouts (min heap)
    • File descriptors
    • Signals (signalfd on Linux)
    • Processes (pidfd on Linux)

Async Semaphore / Mutex

Async Sleep

Every Value Can Hold An Error

  • C++ ErrorOr<>
  • Should propagate up automatically
    • Attempt to operate on an error value returns immediately with the same error

Composable Errors

List Comprehensions

Type Inference In All Directions

  • Function arguments (bidirectional)
  • Return types (bidirectional)

Trailing Closure Syntax

Automatic Parallelization

Protocols

Mid-Block Optional Unwrapping

if Optional Unwrapping

Any Type

Automatic Named Tuple Types

Argument Name Overloading

Transparent Context / Task Local Variables

Bad

Explicit async/await

Explicit try

  • Should be automatic like JavaScript
  • Swift try

Explicit range

Explicit context

Getters & Setters