• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 14 years ago
  • Updated almost 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Erlang in the web browser
erljs - Run Erlang in JavaScript

This projects allows you to run Erlang code directly
in the webbrowser!

If you do not know what Erlang is, please read:
 http://www.erlang.org/ - Erlang programming language home page
 http://en.wikipedia.org/wiki/Erlang_(programming_language)

In short, it is functional language designed for fault-tolerant
and concurrant systems. Because of its design it also fits
nicely as language of choice for modern dynamic web pages.


You will find examples in examples/ directory.

Some motivation can be find in STATUS



Status

Currently we have pretty good implementation of some
basic stuffs. Some modules seems to be fully functional.

What is working:

- data types: atom, integer, float, tuple, list.
  - to do: funs make_fun2
- arithmetic
- pattern matching and tests
- tuple operations
- list operations
- calling functions, from the same and other modules, with and without fqn,
- funs
- lists comprehension (without bitstring generators),
- tail recursion
- spawning processes, and message passing, scheduler,
- exceptions, stack trace for exceptions (not yet fully correct).

Differences:
 - messages are passed using references
 - scheduler is designed for small number of processes, so do not run more than 200 processes
 - integer arithmetic is limited to 2^53
   - i have simple biginteger.js library, but i would want to make overhead for small integers small,
   - i also want to remove from it some unneded parts for us.
   - after overflow
 - operations on floats and intergers can be intermixed.
   - for example one can `F rem 10`, even when F is float.
 - float exceptions aren't checked and thrown
   - JS have floating point exceptions disabled, but Erlang have them enabled, emulation will be slow.
   - so it is possible to have NaN, +-Inf, or underfloat in variables.
   - possible solution: add erljs:check_nan(X) test a variable.
 - erlang:now/0 have 1ms real resolution, in some cases about 15ms (Windows XP).
   (erljs will use 1us resolution timer in Chrome started with --enable-benchmkaring,
    it is however only accurate for measuring relative times)


Both Erlang and JS are dynamically typed languages. Unfortunettelly JS is weakly typed,
but Erlang is strongly typed. This means that we need to perform some additional
checks in JS to be sure that types are correct. There is also problem
with boxing/unboxing on JS side, but this should work automatically.
Most important problem is that JavaScript doesn't have arbitrar sized integers,
and the fact that JS doesn't have separate integer and float types.

Currently bignums and integers are really floats! On some
operations we know will result in floats but we want integer
we perform rounding/truncation, but this can be buggy for
sufficientyl big numbers.

Todo:
 - bit strings,
 - tracing,
 - phash,
 - cleanup,
 - dynamic module loading.
 - lots of other small things, see TODO file
 

Tested mainly in Opera 10.52 on Linux. Some tests in Chrome and Epiphany also.

Should also work in Rhino (Mozilla's JS engine written in Java). Usefull
for unittesting, etc.

http://www.erlang.se/~bjorn/beam_file_format.html

More Repositories

1

fnirsi-usb-power-data-logger

Driver / Data logger for FNIRSI FNB48, FNIRSI C1 and FNIRSI FNB58 USB Power meter
Python
144
star
2

ex11

Joe Armstrong implementation of X11 protocol for Erlang
Erlang
24
star
3

ral

Random Access Lists for Erlang (based on Sparse Skew Binary Numbers)
Erlang
21
star
4

to_unicode

Convert any character set into unicode and UTF-8 using pure Erlang
Erlang
8
star
5

eircd

High-performance distributed IRC server
Erlang
8
star
6

cords

Cord (rope) implementation for D programming language, with rich high performance string processing library
D
7
star
7

multimonitor

A convinient command line utility to log system and process metrics.
D
7
star
8

dmt

D Indentation Syntax just like Python
D
6
star
9

erlyjs

Fork of Roberto Saccon's ErlyJs (just copied from hassy to not lost this)
Erlang
5
star
10

erozja

Simple RSS feed client with GUI, and RSS aggregator webserver with own feeds and web interface.
Erlang
5
star
11

denes

Simple DNS server and framework in Erlang
Erlang
5
star
12

srp_php

Simple implementation of Secure Remote Password protocol in PHP and Javascript
PHP
4
star
13

wielok

Advanced readers-writers locking for Erlang
Erlang
4
star
14

gen_tcp_server

Erlang behaviour for TCP servers, similar to gen_server.
Erlang
4
star
15

fabric

Simple transparent Erlang messaging network proxy
Erlang
4
star
16

d-demangle-cpp

D language symbol demangler for C++
C++
4
star
17

elf-opcode-stats

Count statistics of opcodes and register / arguments in ELF binaries
Python
3
star
18

mpi_d

MPI interface for D programming langauge
D
3
star
19

transpozycja

Simple transposition of array function for Erlang
Erlang
2
star
20

common_collection

A simple and ugly wrapper, to easly switch to different collections (orddict, gb_trees, dict, rbdict, etc) in Erlang
Erlang
2
star
21

lru

Simple and memory efficient LRU Cache implementation for D programming language
D
2
star
22

lazy_lists

Simple (but working) lazy lists implementation for Erlang
Erlang
2
star
23

echo

PHP-like echo for D programing language with variable expansions in the string
D
2
star
24

bbtree

Binary search trees of bounded balance for Erlang - with rich API.
Erlang
2
star
25

iterators_2

Advanced real iterators/generators for D programing language
D
2
star
26

ressit

RSS to reddit uploader
Python
2
star
27

kolumny

Column-based spreadsheet for command line. Advanced multifile procesing and plotting.
Python
2
star
28

epbb

Erlang Parallel Building Blocks
Erlang
2
star
29

wx_erlang_parametrized

Simple wrapper for wxWidgets for Erlang, which uses parametrized modules.
Erlang
2
star
30

espdy

Erlang implementation of SPDY protocol server and client.
1
star
31

btree

Simple elegant on-disk B-tree implementation for Erlang.
1
star
32

krakow_mpk

Parsowanie rozkΕ‚adΓ³w jazdy komunikacji miejskiej w Krakowie
Python
1
star
33

skiplist

(highly scalable) skiplist implementation for D programming language (multiple variants)
1
star
34

wbdiff

Advanced diff utility
Python
1
star
35

paluszki

2-3 tree and finger tree implementation for Erlang programming language
1
star
36

distributed_sort

Distributed (merge)sort in Erlang for sorting data and files on multiple nodes
1
star
37

kuleczki

Robust and fast elasstic balls collision simulation in JavaScript
JavaScript
1
star
38

symbolic_execution

Symbolic execution library for D programming language code
D
1
star
39

wrt

Real-time raytracing engine in D
D
1
star
40

BI_c

Portable, simple Big Integer library in C
C
1
star
41

onpd

Numerical and symbolic computation framework for D
1
star
42

iterators_1

Simple Pyhon-style iterators for D programming language
D
1
star
43

simplememcache

Simple memory cache available using UDP, add/get queries, compression support, multithreaded
1
star