Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple example of an Erlang NIF for creating mutable variables
C Erlang
branch: R13B04

This branch is 2 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Makefile
README
wat.c
wat.erl

README

wat is an example of how to use the Erlang native implemented
functions.

Since nif's already decrease the reliability of the erlang VM, why
not push the boundaries a bit further and create a mutable data
store?


USAGE

Erlang R13B03 (erts-5.7.4) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
1> wat:init(1024).
ok
2> wat:get(20).
0
3> wat:set(20,5).
5
4> wat:get(20).  
5
5> wat:add(20,10).
15
6> wat:get(20).   
15
7> wat:init(10).
ok
8> wat:get(20). 
{error,out_of_bounds}
9> 

Something went wrong with that request. Please try again.