elective-stereophonic
elective-stereophonic
Programming model singapore
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.12.1 Upgrade before block 2870000 is mandatory!

Author Topic: Programming model  (Read 4122 times)

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Programming model
« on: January 28, 2015, 01:42:56 pm »

A program is a set of entities that can spawn other entities, affect each other and decay according to the logic of the program.

An entity is an isolated unit of data and code called "state" and "behavior" correspondingly.

Entities affect each other by sending pieces of data called "effects".

Every effect is sent to one or several entities grouped together into a subset called "environment".

Entities join and leave environments in the result of their reactions to effects.

A program can communicate with the outer world and other programs running on the same computer by sending and receiving messages via data channels.

Jinn ensures that effects are delivered to every entity belonging to targeted environments even if a program is scattered amoung thousands physical devices, the same is not true for communications via channels.

Execution of a program is split into quanta. Entities define an order of effect processing only between different quanta, the order within a single quantum is not defined and depends on optimizations made by underlaying hardware that tries to minimize latency in interactions between entities hosted on different devices.
Logged

Jimmy2011

  • Sr. Member
  • ****
  • Karma: +24/-19
  • Offline Offline
  • Posts: 329
    • View Profile
Re: Programming model
« Reply #1 on: January 28, 2015, 02:41:59 pm »


I want to know how to write "Hello World" with Jinn.
Logged
NXT-LX5G-L63N-ST8S-9LVZY

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: Programming model
« Reply #2 on: January 28, 2015, 03:11:35 pm »


I want to know how to write "Hello World" with Jinn.

Something like this:

Code: [Select]
behavior {

     broadcast(123, "Hello World"); // "123" is a channel redirecting data to a monitor
}
Logged

blackyblack1

  • Hero Member
  • *****
  • Karma: +165/-82
  • Offline Offline
  • Posts: 1764
    • View Profile
Re: Programming model
« Reply #3 on: January 28, 2015, 03:17:39 pm »

Did you check erlang model for reference?
Logged

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: Programming model
« Reply #4 on: January 28, 2015, 03:18:47 pm »

Did you check erlang model for reference?

It's similar.
Logged

blackyblack1

  • Hero Member
  • *****
  • Karma: +165/-82
  • Offline Offline
  • Posts: 1764
    • View Profile
Re: Programming model
« Reply #5 on: January 28, 2015, 03:21:34 pm »

Did you check erlang model for reference?

It's similar.
This is why the question. You could use some paradigms from erlang like supervising trees or fail early. Also you could borrow the naming.
Logged

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: Programming model
« Reply #6 on: January 28, 2015, 03:34:32 pm »

This is why the question. You could use some paradigms from erlang like supervising trees or fail early. Also you could borrow the naming.

Erlang model is flawed according to practical examples. At some point it stops scalling. Unlike real world where all entities are peers.
Naming wasn't borrowed to distinguish these models.
Logged
 

elective-stereophonic
elective-stereophonic
assembly
assembly