0.18.0 • Published 11 months ago

@otpjs/core v0.18.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Open Telecom Platform on JS

Build Status Coverage Status

This project makes heavy use of ES6 features and as such requires NodeJS v16

This is an endeavor to replicate the Open Telecom Platform in NodeJS. This implementation tries to bridge the gap between the two languages by implementing what is essentially the Erlang Standard Library: OTP.

Conventions

Symbols

We use ES6 symbols to effectively replicate the behavior of atoms in Erlang.

Distinguish atoms/symbols from other terms by using snake_case.

Variables

ES6 and Erlang differ fundamentally with respect to mutability. We can mitigate the impact of these differences by adopting programming practices that eschew mutability. If we make shallow copies when modifying values instead of modifying a reference value, we can enjoy the benefits of immutability.

Erlang takes immutability a step further, not allowing you to rebind a variable in a single scope. We can use let to accommodate such usage in ES6, however, we will still prefer const when it makes sense.

Pattern Matching

We now provide pattern matching functionality in @otpjs/matching.

Functions

Export functions with names written in camelCase.

Prefix internal versions of functions with an underscore (e.g., _privateMethod()).

Object-Oriented Programming

OOP is orthoganal to the idioms expressed in these libraries, which makes it a potent tool when used appropriately. As such, blending of the idioms in this library with an object-oriented approach is actively encouraged, and future changes to behaviors may introduce object-oriented actors as an alternative to the pure functional API currently provided.

Processes

Lifecycle

As in Erlang, every process has a unique identifier associated with it, as well as message queues.

In ES6, we treat Promise chains as process threads with an accompanying Context object (typically written as ctx). As long as you continue returning promises, your Context remains alive and able to send and receive signals. Once your Promise resolves or rejects, your Context dies and can no longer send or receive signals.

Roadmap

Long term goals include but are not limited to:

  • Full replication of the OTP core process patterns
    • Finish
      • proc_lib
      • gen_server
      • supervisor
    • Develop
      • gen_fsm
      • gen_event
      • gen_rpc
  • Functional net kernel
  • zmq transport
    • network discovery
    • inproc communication for multi-threaded communication via node's cluster module and/or related modules
  • erlang distribution protocol transport
  • pure wss transport (socket.io transport exists as a reference implementation)
  • babel plugin for extended syntax support
    • ! operator
    • case statements
    • function clauses
0.17.8

11 months ago

0.18.0

11 months ago

0.17.3

1 year ago

0.17.4

1 year ago

0.17.5

1 year ago

0.17.6

1 year ago

0.17.7

1 year ago

0.17.0

1 year ago

0.17.1

1 year ago

0.15.4

1 year ago

0.15.5

1 year ago

0.15.6

1 year ago

0.15.7

1 year ago

0.15.3

1 year ago

0.16.0

1 year ago

0.15.0

2 years ago

0.15.1

2 years ago

0.13.3

2 years ago

0.13.4

2 years ago

0.13.5

2 years ago

0.14.0

2 years ago

0.14.2

2 years ago

0.13.0

2 years ago

0.13.1

2 years ago

0.13.2

2 years ago

0.12.1

2 years ago

0.12.2

2 years ago

0.12.3

2 years ago

0.12.5

2 years ago

0.12.6

2 years ago

0.12.0

2 years ago

0.11.0

2 years ago

0.11.1

2 years ago

0.11.2

2 years ago

0.10.0

2 years ago

0.10.0-beta.21

2 years ago

0.10.0-beta.20

2 years ago

0.10.0-beta.2

2 years ago

0.10.0-beta.0

2 years ago

0.10.0-beta.1

2 years ago

0.10.0-beta.4

2 years ago

0.10.0-beta.5

2 years ago

0.10.0-beta.15

2 years ago

0.10.0-beta.18

2 years ago

0.10.0-beta.12

2 years ago

0.10.0-beta.11

2 years ago

0.10.0-beta.13

2 years ago

0.10.0-beta.19

2 years ago

0.10.0-beta.10

2 years ago

0.9.12

2 years ago

0.9.14

2 years ago

0.9.10

2 years ago

0.9.11

2 years ago

0.9.8

3 years ago

0.9.7

3 years ago

0.9.9

2 years ago

0.9.0

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.6

3 years ago

0.9.5

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.11

3 years ago

0.7.10

3 years ago

0.7.9

3 years ago

0.7.6

3 years ago

0.7.8

3 years ago

0.7.7

3 years ago

0.7.5

3 years ago

0.7.2

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.10

3 years ago

0.5.9

3 years ago

0.5.12

3 years ago

0.5.13

3 years ago

0.5.8

3 years ago

0.5.5

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.11

3 years ago

0.4.12

3 years ago

0.5.0

3 years ago

0.4.7

3 years ago

0.4.5

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.1

3 years ago