mirror of
https://github.com/urbit/shrub.git
synced 2024-12-28 22:54:15 +03:00
Some renamings and cleanups.
This commit is contained in:
parent
dbe046620a
commit
a7215257ac
4
Makefile
4
Makefile
@ -55,7 +55,7 @@ else
|
||||
LIBS=-lssl -lcrypto -lgmp -lncurses -lsigsegv $(OSLIBS)
|
||||
endif
|
||||
|
||||
INCLUDE=include
|
||||
INCLUDE=i
|
||||
MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN) -D U3_LIB=\"$(LIB)\"
|
||||
|
||||
# NOTFORCHECKIN - restore -O3
|
||||
@ -337,7 +337,7 @@ $(LIBANACHRONISM):
|
||||
$(CRE2_OFILES): outside/cre2/src/src/cre2.cpp outside/cre2/src/src/cre2.h $(LIBRE2)
|
||||
$(CXX) $(CXXFLAGS) -c $< $(LIBRE2) -o $@
|
||||
|
||||
$(V_OFILES): include/v/vere.h
|
||||
$(V_OFILES): i/v/vere.h
|
||||
|
||||
$(BIN)/vere: $(LIBCRE) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM)
|
||||
mkdir -p $(BIN)
|
||||
|
@ -38,11 +38,9 @@
|
||||
/** c: the c3 layer, C portability and definitions.
|
||||
**/
|
||||
# include "c/portable.h"
|
||||
# include "c/tune.h"
|
||||
# include "c/types.h"
|
||||
# include "c/defs.h"
|
||||
# include "c/motes.h"
|
||||
# include "c/comd.h"
|
||||
|
||||
/** miscellaneous definitions and data structures.
|
||||
**/
|
60
i/c/c3.md
Normal file
60
i/c/c3.md
Normal file
@ -0,0 +1,60 @@
|
||||
# u3: noun processing in C.
|
||||
|
||||
`u3` is the C library that makes Urbit work. If it wasn't called
|
||||
`u3`, it might be called `libnoun` - it's a library for making
|
||||
and storing nouns.
|
||||
|
||||
What's a noun? A noun is either a cell or an atom. A cell is an
|
||||
ordered pair of any two nouns. An atom is an unsigned integer of
|
||||
any size.
|
||||
|
||||
To the C programmer, this is not a terribly complicated data
|
||||
structure, so why do you need a library for it?
|
||||
|
||||
One: nouns have a well-defined computation kernel, Nock, whose
|
||||
spec fits on a page and gzips to 340 bytes. But the only
|
||||
arithmetic operation in Nock is increment. So it's nontrivial
|
||||
to compute both efficiently and correctly.
|
||||
|
||||
Two: `u3` is designed to support "permanent computing," ie, a
|
||||
single-level store which is transparently checkpointed. This
|
||||
implies a specialized memory-management model.
|
||||
|
||||
Does `u3` depend on the higher levels of Urbit, Arvo and Hoon?
|
||||
Yes and no. It expects you to load something shaped like an Arvo
|
||||
kernel, and use it as an event-processing function. But you
|
||||
don't need to use this feature if you don't want, and your kernel
|
||||
can be anything you want.
|
||||
|
||||
|
||||
## u3: l
|
||||
|
||||
The best way to introduce `u3` is with a simple map of the Urbit
|
||||
build directory - folding things we don't care about right now:
|
||||
|
||||
g/ u3 implementation
|
||||
g/a.c allocation
|
||||
g/e.c persistence
|
||||
g/h.c hashtables
|
||||
g/i.c noun construction
|
||||
g/j.c jet control
|
||||
g/m.c master state
|
||||
g/n.c nock execution
|
||||
g/r.c noun access, error returns
|
||||
g/t.c tracing/profiling
|
||||
g/v.c arvo kernel
|
||||
g/x.c noun access, error crashes
|
||||
g/z.c memoization/caching
|
||||
i/ all includes
|
||||
i/v Urbit systems headers
|
||||
i/g u3 headers (matching filenames)
|
||||
i/c c3 headers
|
||||
i/c/
|
||||
v/ Urbit systems code
|
||||
|
||||
outside/ all external bundled code
|
||||
|
||||
# C3: C in the Urbit environment
|
||||
|
||||
Urbit has two distinct - but easily confused - contexts where
|
||||
we program in C. Logically, Urbit is a pure noun processing
|
@ -1,22 +0,0 @@
|
||||
/* include/comd.h
|
||||
**
|
||||
** This file is in the public domain.
|
||||
*/
|
||||
/** Functions.
|
||||
**/
|
||||
/* c3_comd_init():
|
||||
**
|
||||
** Initialize the readline console. Return the history filename.
|
||||
*/
|
||||
c3_c* // produce
|
||||
c3_comd_init(void);
|
||||
|
||||
/* c3_comd_line():
|
||||
**
|
||||
** Read a line from the console, saving to history file `fel`.
|
||||
**
|
||||
** Returns 0 iff the console has exited.
|
||||
*/
|
||||
c3_c* // produce
|
||||
c3_comd_line(const c3_c *fel_c,
|
||||
const c3_c *prm_c); // retain
|
Loading…
Reference in New Issue
Block a user