octo-warning-robot's Introduction
Object Oriented Programming Language Imagine objects as literally little demons carrying out computational tasks and sending messages to each other. Each demon will wait for a message, carry out a program to produce a response, and repeat. There are two kinds of demons, ones that can magically evaluate an expression via a special set of laws, and ones that interact with the outside world for the purposes of I/O and timekeeping. The first kind's behavior is completely defined as an application of some case expression to whatever message it happens to get. The second kind of demon cannot be defined as an expression and has generally undefined behavior. Each demon has a private, infinitely big notebook to write values in and read them later if necessary. During the course of a computation he might send a message to another object, perhaps waiting for a response before continuing. He can also self-destruct or cancel another demon's computation in progress via an asynchronous signal. This is the true form of "object oriented programming." :) expressions: symbol symbol number 1234 cons (a b c) case case{1 -> a; 2 -> b} variable $x apply [$f x] case(x){x -> y; y -> x} math [+ $x 1] letrec letrec($x){$x = $y; $y = 3} do do{$a = [$f x]; $b = [$g $a]; [$g $b]} send send{name, value} request request{name, value} request{name, value, $error-handler} load load{field, default} store store{field, value} halt halt{value} error error{value} throw throw{name, value} new new{name, $message-handler} objects: * independent concurrent processes * internal mutable storage * global identifier * handles messages fifo, one at a time * sends messages to other objects, perhaps waiting for response * can be asynchronously signaled to cancel the current operation * system objects represent real world i/o and time data: symbol non-numeric general value number that is to say integers tuple a vector of other values closure a transformation from values to values math: Numbers have several binary arithmetic operations built in. + - * / % ^ do what you would expect. Division by zero causes an error. Also # compares non closure values, returning either GT LT or EQ.
octo-warning-robot's People
octo-warning-robot's Issues
tables
web front end
to connect to an interactive interpreter
to connect to a persistent server
to connect to a code editor
to connect to a normal website programmed in the persistent server
Repl, runner, persistent server
repl program lets the user type expressions on the command line and evaluate them
runner loads the program from a file and evaluates the one expression it should contain
the persistent server allows users to connect and run code to interact with objects that already exist from previous sessions.
libraries
add an opcode with which runs code in the context of a library
with(library-name){code}
with(library-name, prefix){code}
add an opcode which installs / defines a library
lib(library-name){
$x = e1
$y = e2
}
where the body of the library is recursive
doing lib more than once with the same lib name will union with replacement the exiting library
make the repl program load libraries from files specified on the command line before going to the prompt
make the runner program load libraries from files specified on the command line before executing the code
make the persistent server save and restore libraries that it has loaded, and make the libraries editable
library scope
the body of libraries installed is object-specific and inheritable.
when an object does lib the library is installed or updated for that object
when an object does new, the new object inherits all the libraries
when a new object does lib, it does not affect the creating objects libraries
block unblock
make opcodes to block and unblock asynchronous exceptions as in concurrent haskell
make a benchmark to help improve strictness
octo-warning-robot is a strict language
therefore we probabaly should tell the haskell implementation the appropriate times to be strict when evaluating code
to make sure were doing stuff that matters, we need a benchmark to see how long it takes to do some complex operation on data
byte vectors
stdout, sockets, files, etc all rely on the concept of a byte vector
a list of numbers like
(255 (127 (0 ( 140 ()))))
will take up way too much memory by default in a haskell implementation
(note, make an issue about strictness in the haskell implementation)
(note, make an issue about list operation benchmark)
also this representation of byte vectors would be really inefficient when operating on the end of the list
on the other hand the number of primitive operations on byte vectors is large and this would ruin the simplicity of the design.
the meaning of symbols
first, symbols are supposed to be an abstract value that is simply different from all other symbols. it does not necessarily mean text.
however we cant use some text symbols right now because of syntactic restrictions. you cant use brackets or parentheses, and you cant start with a number.
second, we use symbols to make the code easier to read and to describe error situations. so maybe we need to think of symbols as readable text
in this case, we need to be able to use all the characters in there, even brackets and numbers
add a syntax feature to allow any character in symbols. this means double quotes around it with backslash double quote used to indicate literal double quotes.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.