erg/doc/EN/dev_guide/terms.md
2022-09-04 12:56:25 +08:00

14 KiB
Raw Blame History

Glossary

symbol

!

A marker added to the end of an identifier to indicate that it is a procedure or variable type. Or the mutating operator.

[#](../syntax/00_basic.md/# comment)

$

%

&

(single quote)

()

*

+

,

->

.

/

:

::

;

<

<:

<<

<=

=

==

=>

>

>>

>=

?

@

[]

\

^

^^

_

``

{:}

{=}

|

||

~

A

[algebraic type]

[And]

[and]

[assert]

[attribute]

B

[Base]

[Bool]

C

[Class]

D

Deprecated

[distinct]

E

[enum type]

[Eq]

[Erg]

F

[for]

G

H

I

[if]

[import]

[in]

[Int]

J

K

L

let-polymorphism -> [rank 1 polymorphism]

[log]

M

[match]

N

[Nat]

Never

None

[Not]

[not]

O

[Option]

[Or]

[or]

[Ord]

P

panic

print!

[Python]

Q

R

ref

ref!

[Result]

[rootobj]

S

self

Self

side-effect

[Str]

T

Traits

[True]

[Type]

[type]

U

V

W

[while!]

X

Y

Z

A line

[Assertion]

To check (typically at runtime) whether a condition is true in code. This is done using the assert function, etc.

sum = !0
for! 0..10, i =>
    sum.add!i

assert sum == 55

Value Object

In Erg, equivalent to base object. It can be evaluated at compile time and has a trivial comparison method.

Attachment patch

A patch that gives the trait a standard implementation.

Ad hoc polymorphism -> No overloading

Polymorphism with so-called overloading.

Attribute -> [attribute]

The y part in the x.y identifier.

Arity

How many operands the operator takes.

Dependent type

A type whose argument is a value (idiomatically, not a type).

immutable -> [immutable]

Indicates that the target will not change. Variables in other languages are also immutable/mutable, but in Erg all variables are immutable.

arguments -> [arguments]

instance

An object created by a class. An element of class type.

[instant block](../syntax/00_basic.md#expression separator)

x =
    y = f(a)
    z = g(b,c)
    y+z

index

of the form x[i], or the i part thereof. We call x an Indexable object.

indent

Align text to the right by moving toward spaces. Indentation. Ergs represent blocks by indentation. This is called the offside rule.

Aliases

Alias.

error

Abnormal conditions defined in the specification.

  • [Error handling]

operator

An object that applies an operation to its operands. or a symbol denoting that object.

  • [operator binding strength]

Override

Overriding superclass methods in subclasses. In Erg you have to add Override decorator when overriding.

No overloading

Offside rule -> indent

[object]

  • Object-orientation

operand -> operand

operator -> operator

Ka line

kind

Types of so-called types.

[visibility]

The property of whether an identifier can be referenced externally (out of scope, or in another module or package).

[type]

An object that groups terms.

[Guard]

Encapsulation

Hiding implementation details.

[variable]

Must not be immutable.

  • [mutable object]
  • [variable]
  • [variable reference]
  • [variable array]
  • [variable arguments]

function

A subroutine with no side effects.

  • [Functional programming](../syntax/23_scope.md#Avoiding mutable stateFunctional programming)

base type

nominative

Distinguish by name rather than by symmetrical structure.

capture -> [closure]

[covariant]

In Erg, if T <: U then K(T) <: K(U) then K is said to be covariant.

[keyword arguments]

k in the form of function call f(k: v). You can specify actual arguments by formal argument name instead of by order.

empty set -> [{}]

section

Embedded

Erg standard APIs not implemented in .er files.

class

Structure/abstract data type with inheritance function. In Erg, it is a type to implement named subtyping and overriding. In Erg, modules are the responsibility of module objects, and types are the type object, while other languages may be responsible for modules and types.

[Closure]

[global variables]

[Clone]

inheritance

To define a class that is a superset of another class. The class that inherits is called the superclass, and the class that inherits is called the subclass. A subclass has all the functionality of its superclass.

high floor

[public variables]

[structural subtype]

back reference -> [back reference]

[copy]

comment

Collection

Colon -> [:]

constructor

container

Compiler

[compile-time computation](../syntax/04_function.md#compile-time function)

comma -> [,]

sa line

recursion

Refer to yourself.

  • recursive
  • [Recursive function](../syntax/04_function.md#Recursive function)

subscript -> [index]

subtyping polymorphism

Polymorphism with subtyping. Subtyping corresponds to set containment in types.

Subroutine

An object that modularizes processing. A generic term for functions, procedures, and methods in Erg.

reference

  • reference object
  • [Reference counting (RC)](../syntax/18_memory_management.md#memory management)
  • Reference equality -> side effect

[identifier](../syntax/02_variable.md/# assignment)

signature

  • type signature

dict

[natural number] -> [Nat]

Generics -> [Generic]

Generator

[projective type]

borrow -> reference

[shadowing](../syntax/02_name.md# variables)

To override a reference to a variable by defining a variable with the same name in an inner scope.

kind -> kind

Roughly the type of type.

[set] -> [set]

In Erg, it means a Set object.

Predicate

  • [predicate function]

A function that returns a bool type.

Conditional branch

[Ownership]

The concept of object uniqueness. If you have ownership of an object, you can take a mutable reference to it.

Boolean -> [Bool]

Singleton

An instance created from a class that can create only one instance. A design pattern that ensures that only one instance of a class is created.

[Symbol] -> Identifier

  • [symbolization]

[script](../syntax/00_basic.md# script)

A file containing an Erg program.

Scope

Units in variable management. An outer scope cannot refer to a variable that exists in an inner scope. Objects with a reference count of 0 are freed when the scope exits.

spread operator -> [expansion assignment]

slice

An object representing a subsequence of the array, generated in the form x[a..b].

control characters

[Integer] -> [Int]

A set of natural numbers plus negative numbers.

set

Semicolon -> [;]

Declaration

Explicitly type variables.

Full name

  • universal type -> polymorphic type
    • closed universal
    • Open Universal
  • universal function -> polycorrelation function
  • universal quantification

prefix operator

Operator applied in the form ∘x.

mutual recursion

subscript -> [index]

[attributes]

  • [attribute subtype]

Ta line

algebra

assignment

Multiple

  • [Multiple inheritance](../syntax/type/07_inheritance.md/#Prohibition of multiple inheritance)
  • Multiple assignment
  • Overload -> [No overloading]

Polymorphism

polymorphism -> [polymorphism]

duck typing

tuple

Single-phase

  • Single phase
  • Single-phase type
  • Single correlation coefficient

[Lazy initialization]

Extraction Assignment

Abstract syntax tree -> [AST]

Infix operator

The operator applied in the form x∘y.

constant

Immutable, compile-time evaluable algebra.

[definition]

Allocating an object corresponding to a variable.

Provided Attributes

Attributes available as API. Especially attributes auto-implemented by traits.

[Apply]

To pass an argument to a function object and get the evaluation result.

decorator

@deco
f x = ...

syntactic sugar, or deco. Roughly equal to _f x = ...; f = deco _f. deco itself is just a higher-order subroutine.

destructor

Method called when the object is destroyed.

procedure -> procedure

A subroutine that reads and writes mutable state. It is sometimes said that the execution result of a program can change depending on the order in which the procedures are called, but this is incorrect if we are talking about commutativity. For example, operators that are subtypes of functions are generally not commutative.

[default arguments](../syntax/04_function.md/#default arguments default-parameters)

A function that allows you to omit the specification of actual arguments at the time of calling by specifying default values for formal arguments.

Expand

  • [expansion operator]
  • [expansion assignment]

special format

An object that cannot be passed as an actual argument.

anonymous function -> anonymous function

A function object created by the anonymous function operator ->. Can be used without defining a name.

dot operator (.) -> [attribute reference]

Top

  • Top type -> [Structural Object]
  • Top class -> [Object]

trait

na line

Comprehension

Infix operator -> [Infix operator]

[namespace]

is a line

Array

[derived type](../syntax/type/variances.md/# user-defined type variations)

pattern (match)

package

hashmap -> dict

patch

public variables -> public variables

parameter -> argument

Parametric Polymorphism

contravariant

Compare

  • [comparison operator]
  • [comparable type]

private variable

standard

  • standard output
  • standard input
  • standard library

side effects

Code should/not read/write external mutable state.

complex number -> [Complex]

[Float] -> [Float]

private variables -> [private variables]

Boolean algebra -> [Bool]

procedure

arguments

Partial Typing -> [Subtyping]

[immutable]

In Erg, an object should never change its contents.

  • [immutable object]
  • [immutable type]
  • [immutable reference]

sieve type

[block]

Destructuring assignment

variable

bottom

  • bottom type -> [{}]
  • Bottom class -> [Never]

[Polymorphism]

ma line

~~ prefix operator ~~ -> prefix operator

marker type

anonymous function

mutable -> [mutable]

[move]

methods

Metacharacters

module

[String] -> [Str]

  • [String interpolation](../syntax/01_literal.md/#Str literal)

Return value

or line

phantom type

Request Attributes

[element]

[call]

Ra line

[Library]

lambda expression -> anonymous function

rank

literal

  • [literal identifier](../syntax/18_naming_rule.md/#literal identifier)

quantified

Layout

enum

record

  • [record type]
  • Record Polymorphism -> [Column Polymorphism]

[column polymorphism]

local variables

line

Wildcard