Merge branch 'test' of github.com:urbit/urbit into test

This commit is contained in:
Galen Wolfe-Pauly 2015-09-29 17:18:25 -07:00
commit 21d2344a1c
11 changed files with 365 additions and 220 deletions

View File

@ -148,9 +148,12 @@ J_B_OFILES=\
jets/b/lent.o \
jets/b/levy.o \
jets/b/lien.o \
jets/b/murn.o \
jets/b/need.o \
jets/b/reap.o \
jets/b/reel.o \
jets/b/roll.o \
jets/b/skid.o \
jets/b/skim.o \
jets/b/skip.o \
jets/b/scag.o \
@ -324,9 +327,6 @@ V_OFILES=\
MAIN_FILE =\
vere/main.o
MEME_FILE =\
tests/test.o
VERE_OFILES=\
$(CRE2_OFILES) \
$(OUT_OFILES) \
@ -334,12 +334,6 @@ VERE_OFILES=\
$(MAIN_FILE) \
$(V_OFILES)
MEME_OFILES=\
$(CRE2_OFILES) \
$(OUT_OFILES) \
$(BASE_OFILES) \
$(MEME_FILE)
VERE_DFILES=$(VERE_OFILES:%.o=.d/%.d)
-include $(VERE_DFILES)
@ -385,7 +379,6 @@ all: urbit
@echo "# Set custom configuration here, please!" > ".make.conf"
urbit: $(BIN)/urbit
meme: $(BIN)/meme
$(LIBUV_MAKEFILE) $(LIBUV_MAKEFILE2):
cd outside/libuv_0.11 ; sh autogen.sh ; ./configure --disable-dtrace
@ -442,10 +435,6 @@ $(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIB
@$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT)
endif
$(BIN)/meme: $(LIBCRE) $(LIBCOMMONMARK) $(MEME_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) $(LIBSOFTFLOAT)
mkdir -p $(BIN)
$(CLD) $(CLDOSFLAGS) -o $(BIN)/meme $(MEME_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT)
tags:
ctags -R -f .tags --exclude=root

View File

@ -1,11 +1,15 @@
urbit
=====
urbit is a new programming and execution environment designed from
scratch.
Urbit is a new computing environment designed from scratch.
At present urbit is under heavy development. If you're interested in
keeping in touch or following the project you can:
At present urbit is under heavy development. It's not useful for
any external purpose. Documentation is completely inadequate.
Anyone can use the interpreter, of course, but the network is
invitation-only.
If you're interested in keeping in touch or following the project
you can:
- Enter your email address at [urbit.org](http://urbit.org).
- Subscribe to the
@ -14,22 +18,19 @@ keeping in touch or following the project you can:
- Follow [@urbit_](https://twitter.com/urbit\_) on Twitter.
- Get in touch with us via email, <urbit@urbit.org>
All of the source code is distributed under the MIT license, but is for
all intents and purposes in the public domain.
All of the source code is distributed under the MIT license.
Pacakges
Packages
--------
#### Ubuntu or Debian
Third-party pacakge files are maintained at https://github.com/yebyen/urbit-deb. Urbit is only supported on Jessie onward.
Third-party package files are maintained at https://github.com/yebyen/urbit-deb. Urbit is only supported on Jessie onward.
#### OS X - Homebrew
brew install --HEAD homebrew/head-only/urbit
If this succeeds, proceed to the [Run section](#run). Otherwise, the build must be done manually:
Dependencies
------------
urbit depends on:
@ -95,27 +96,29 @@ Just run `make`:
(On FreeBSD, use `gmake` instead.)
Run <a id="run"/>
Run (with a network invitation)
---
Inside of the `urbit` directory run
If you have a planet named `~fintud-macrep` and a ticket
`~fortyv-tombyt-tabsen-sonres`, run
bin/urbit -c pier
bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres
where `pier` is a directory that does not exist.
Your pier (all Urbit state, log and checkpoint) will be in
`./fintud-macrep`. To restart Urbit:
All your state (an append-only log and a memory checkpoint) will live in
this directory. The name of your pier doesn't matter and is not visible
internally.
bin/urbit fintud-macrep
Begin
-----
Run (without a network invitation)
---
To begin a 32-bit planet use
Run
:?begin
bin/urbit -c mypier
which will guide you through the setup process.
Urbit will create a comet in `mypier`. To restart:
bin/urbit mypier
Basics
------
@ -137,6 +140,8 @@ turned it off.
Talk
----
If you're on the network, you can use its most basic application, `talk`.
If `talk` is not running, start it with `*talk` from the task manager.
Use `^x` to switch to the `talk` prompt and then run
@ -145,16 +150,12 @@ Use `^x` to switch to the `talk` prompt and then run
to join the `urbit-meta` channel. People in there are helpful.
There are four main `talk` commands:
There are three main `talk` commands:
;join ~urbit-name/channel
`;join` subscribes your main feed to a remote channel.
;create channel %name 'description'
`;create` creates a channel on your urbit.
;<number>
`;<number>` activates a previous message number, like a URL that got
@ -168,7 +169,7 @@ for a private message.
Filesystem Sync
---------------
Our filesystem, `%clay` does not automatically sync to unix. If you want
Our filesystem, `%clay`, does not automatically sync to unix. If you want
to get files in and out of urbit, you'll need to setup a mount point.
Since each mount point is always watching for changes you may also want
to unmount from time to time.
@ -199,7 +200,7 @@ your urbit and:
where pier is the name of your pier.
While the network is still young from time to time we reboot the entire
thing. We call this a 'continuity breach' since we're breaking the
universe. We call this a 'continuity breach' since we're breaking the
continuity of our crypto.
When this happens you'll need to back up your data and start a fresh

View File

@ -25,9 +25,12 @@
u3_noun u3qb_lent(u3_noun);
u3_noun u3qb_levy(u3_noun, u3_noun);
u3_noun u3qb_lien(u3_noun, u3_noun);
u3_noun u3qb_murn(u3_noun, u3_noun);
u3_noun u3qb_need(u3_noun);
u3_noun u3qb_reap(u3_atom, u3_noun);
u3_noun u3qb_reel(u3_noun, u3_noun);
u3_noun u3qb_roll(u3_noun, u3_noun);
u3_noun u3qb_skid(u3_noun, u3_noun);
u3_noun u3qb_skim(u3_noun, u3_noun);
u3_noun u3qb_skip(u3_noun, u3_noun);
u3_noun u3qb_scag(u3_atom, u3_noun);

View File

@ -24,9 +24,12 @@
u3_noun u3wb_lent(u3_noun);
u3_noun u3wb_levy(u3_noun);
u3_noun u3wb_lien(u3_noun);
u3_noun u3wb_murn(u3_noun);
u3_noun u3wb_need(u3_noun);
u3_noun u3wb_reap(u3_noun);
u3_noun u3wb_reel(u3_noun);
u3_noun u3wb_roll(u3_noun);
u3_noun u3wb_skid(u3_noun);
u3_noun u3wb_skim(u3_noun);
u3_noun u3wb_skip(u3_noun);
u3_noun u3wb_scag(u3_noun);

46
jets/b/murn.c Normal file
View File

@ -0,0 +1,46 @@
/* j/2/murn.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qb_murn(u3_noun a, u3_noun b)
{
if ( 0 == a ) {
return a;
}
else if ( c3n == u3du(a) ) {
return u3m_bail(c3__exit);
}
else {
u3_noun one = u3n_slam_on(u3k(b), u3k(u3h(a)));
u3_noun two = u3qb_murn(u3t(a), b);
u3_noun nex;
switch ( u3ud(one) ) {
case c3y: u3z(one);
return two;
case c3n: nex = u3nc(u3k(u3t(one)), two);
u3z(one);
return nex;
default: u3z(one);
u3z(two);
return u3_none;
}
}
}
u3_noun
u3wb_murn(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qb_murn(a, b);
}
}

41
jets/b/reap.c Normal file
View File

@ -0,0 +1,41 @@
/* j/2/reap.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qb_reap(u3_atom a,
u3_noun b)
{
if ( !_(u3a_is_cat(a)) ) {
return u3m_bail(c3__fail);
}
else {
u3_noun acc = u3_nul;
c3_w i_w = a;
while ( i_w ) {
acc = u3nc(b, acc);
i_w--;
}
return acc;
}
}
u3_noun
u3wb_reap(u3_noun cor)
{
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) )
{
return u3m_bail(c3__exit);
} else {
return u3qb_reap(a, b);
}
}

44
jets/b/skid.c Normal file
View File

@ -0,0 +1,44 @@
/* j/2/skid.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qb_skid(u3_noun a,
u3_noun b)
{
if ( 0 == a ) {
return u3nc(u3_nul, u3_nul);
}
else if ( c3n == u3du(a) ) {
return u3m_bail(c3__exit);
} else {
u3_noun acc = u3qb_skid(u3t(a), b);
u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a)));
switch ( hoz ) {
case c3y: acc = u3nc(u3nc(u3k(u3h(a)), u3h(acc)), u3t(acc));
break;
case c3n: acc = u3nc(u3h(acc), u3nc(u3k(u3h(a)), u3t(acc)));
break;
default: u3z(hoz);
return u3m_bail(c3__exit);
}
u3z(hoz);
return acc;
}
}
u3_noun
u3wb_skid(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qb_skid(a, b);
}
}

View File

@ -21,9 +21,12 @@ static u3j_harm _mood__hoon_flop_a[] = {{".2", u3wb_flop, c3y}, {}};
static u3j_harm _mood__hoon_lent_a[] = {{".2", u3wb_lent, c3y}, {}};
static u3j_harm _mood__hoon_levy_a[] = {{".2", u3wb_levy, c3y}, {}};
static u3j_harm _mood__hoon_lien_a[] = {{".2", u3wb_lien, c3y}, {}};
static u3j_harm _mood__hoon_murn_a[] = {{".2", u3wb_murn, c3y}, {}};
static u3j_harm _mood__hoon_need_a[] = {{".2", u3wb_need, c3y}, {}};
static u3j_harm _mood__hoon_reap_a[] = {{".2", u3wb_reap, c3y}, {}};
static u3j_harm _mood__hoon_reel_a[] = {{".2", u3wb_reel, c3y}, {}};
static u3j_harm _mood__hoon_roll_a[] = {{".2", u3wb_roll, c3y}, {}};
static u3j_harm _mood__hoon_skid_a[] = {{".2", u3wb_skid, c3y}, {}};
static u3j_harm _mood__hoon_skim_a[] = {{".2", u3wb_skim, c3y}, {}};
static u3j_harm _mood__hoon_skip_a[] = {{".2", u3wb_skip, c3y}, {}};
static u3j_harm _mood__hoon_scag_a[] = {{".2", u3wb_scag, c3y}, {}};
@ -451,9 +454,12 @@ static u3j_core _mood__hoon_d[] =
{ "lent", _mood__hoon_lent_a },
{ "levy", _mood__hoon_levy_a },
{ "lien", _mood__hoon_lien_a },
{ "murn", _mood__hoon_murn_a },
{ "need", _mood__hoon_need_a },
{ "reap", _mood__hoon_reap_a },
{ "reel", _mood__hoon_reel_a },
{ "roll", _mood__hoon_roll_a },
{ "skid", _mood__hoon_skid_a },
{ "skim", _mood__hoon_skim_a },
{ "skip", _mood__hoon_skip_a },
{ "scag", _mood__hoon_scag_a },

View File

@ -133,212 +133,212 @@ _n_nock_on(u3_noun bus, u3_noun fol)
u3a_lose(fol);
return u3i_cell(poz, riv);
}
else switch ( hib ) {
default: return u3m_bail(c3__exit);
else {
static void* lut[] = {
&&l0, &&l1, &&l2, &&l3, &&l4, &&l5,
&&l6, &&l7, &&l8, &&l9, &&l10, &&l11
};
case 0: {
if ( c3n == u3r_ud(gal) ) {
return u3m_bail(c3__exit);
}
else {
u3_noun pro = u3k(u3at(gal, bus));
u3a_lose(bus); u3a_lose(fol);
return pro;
}
if(hib > 11) {
return u3m_bail(c3__exit);
}
c3_assert(!"not reached");
case 1: {
u3_noun pro = u3k(gal);
goto *lut[hib];
{
l0: {
if ( c3n == u3r_ud(gal) ) {
return u3m_bail(c3__exit);
}
else {
u3_noun pro = u3k(u3at(gal, bus));
u3a_lose(bus); u3a_lose(fol);
return pro;
}
c3_assert(!"not reached");
u3a_lose(bus); u3a_lose(fol);
return pro;
}
}
case 2: {
u3_noun nex = _n_nock_on(u3k(bus), u3k(u3t(gal)));
u3_noun seb = _n_nock_on(bus, u3k(u3h(gal)));
l1: {
u3_noun pro = u3k(gal);
u3a_lose(fol);
bus = seb;
fol = nex;
continue;
}
c3_assert(!"not reached");
u3a_lose(bus); u3a_lose(fol);
return pro;
}
case 3: {
u3_noun gof, pro;
l2: {
u3_noun nex = _n_nock_on(u3k(bus), u3k(u3t(gal)));
u3_noun seb = _n_nock_on(bus, u3k(u3h(gal)));
gof = _n_nock_on(bus, u3k(gal));
pro = u3r_du(gof);
u3a_lose(fol);
bus = seb;
fol = nex;
continue;
}
u3a_lose(gof); u3a_lose(fol);
return pro;
}
c3_assert(!"not reached");
l3: {
u3_noun gof, pro;
case 4: {
u3_noun gof, pro;
gof = _n_nock_on(bus, u3k(gal));
pro = u3r_du(gof);
gof = _n_nock_on(bus, u3k(gal));
pro = u3i_vint(gof);
u3a_lose(gof); u3a_lose(fol);
return pro;
}
u3a_lose(fol);
return pro;
}
c3_assert(!"not reached");
l4: {
u3_noun gof, pro;
case 5: {
u3_noun wim = _n_nock_on(bus, u3k(gal));
u3_noun pro = u3r_sing(u3h(wim), u3t(wim));
gof = _n_nock_on(bus, u3k(gal));
pro = u3i_vint(gof);
u3a_lose(wim); u3a_lose(fol);
return pro;
}
c3_assert(!"not reached");
u3a_lose(fol);
return pro;
}
case 6: {
u3_noun b_gal, c_gal, d_gal;
l5: {
u3_noun wim = _n_nock_on(bus, u3k(gal));
u3_noun pro = u3r_sing(u3h(wim), u3t(wim));
u3x_trel(gal, &b_gal, &c_gal, &d_gal);
{
u3_noun tys = _n_nock_on(u3k(bus), u3k(b_gal));
u3_noun nex;
u3a_lose(wim); u3a_lose(fol);
return pro;
}
if ( 0 == tys ) {
nex = u3k(c_gal);
} else if ( 1 == tys ) {
nex = u3k(d_gal);
} else return u3m_bail(c3__exit);
l6: {
u3_noun b_gal, c_gal, d_gal;
u3a_lose(fol);
fol = nex;
continue;
}
}
c3_assert(!"not reached");
u3x_trel(gal, &b_gal, &c_gal, &d_gal);
{
u3_noun tys = _n_nock_on(u3k(bus), u3k(b_gal));
u3_noun nex;
case 7: {
u3_noun b_gal, c_gal;
if ( 0 == tys ) {
nex = u3k(c_gal);
} else if ( 1 == tys ) {
nex = u3k(d_gal);
} else return u3m_bail(c3__exit);
u3x_cell(gal, &b_gal, &c_gal);
{
u3_noun bod = _n_nock_on(bus, u3k(b_gal));
u3_noun nex = u3k(c_gal);
u3a_lose(fol);
fol = nex;
continue;
}
}
u3a_lose(fol);
bus = bod;
fol = nex;
continue;
}
}
c3_assert(!"not reached");
l7: {
u3_noun b_gal, c_gal;
case 8: {
u3_noun b_gal, c_gal;
u3x_cell(gal, &b_gal, &c_gal);
{
u3_noun bod = _n_nock_on(bus, u3k(b_gal));
u3_noun nex = u3k(c_gal);
u3x_cell(gal, &b_gal, &c_gal);
{
u3_noun heb = _n_nock_on(u3k(bus), u3k(b_gal));
u3_noun bod = u3nc(heb, bus);
u3_noun nex = u3k(c_gal);
u3a_lose(fol);
bus = bod;
fol = nex;
continue;
}
}
u3a_lose(fol);
bus = bod;
fol = nex;
continue;
}
}
c3_assert(!"not reached");
l8: {
u3_noun b_gal, c_gal;
case 9: {
u3_noun b_gal, c_gal;
u3x_cell(gal, &b_gal, &c_gal);
{
u3_noun heb = _n_nock_on(u3k(bus), u3k(b_gal));
u3_noun bod = u3nc(heb, bus);
u3_noun nex = u3k(c_gal);
u3x_cell(gal, &b_gal, &c_gal);
{
u3_noun seb = _n_nock_on(bus, u3k(c_gal));
u3_noun pro;
u3a_lose(fol);
bus = bod;
fol = nex;
continue;
}
}
l9: {
u3_noun b_gal, c_gal;
u3x_cell(gal, &b_gal, &c_gal);
{
u3_noun seb = _n_nock_on(bus, u3k(c_gal));
u3_noun pro;
u3t_off(noc_o);
pro = u3j_kick(seb, b_gal);
u3t_on(noc_o);
u3t_off(noc_o);
pro = u3j_kick(seb, b_gal);
u3t_on(noc_o);
if ( u3_none != pro ) {
u3a_lose(fol);
return pro;
}
else {
if ( c3n == u3r_ud(b_gal) ) {
return u3m_bail(c3__exit);
}
else {
u3_noun nex = u3k(u3at(b_gal, seb));
if ( u3_none != pro ) {
u3a_lose(fol);
return pro;
}
else {
if ( c3n == u3r_ud(b_gal) ) {
return u3m_bail(c3__exit);
}
else {
u3_noun nex = u3k(u3at(b_gal, seb));
u3a_lose(fol);
bus = seb;
fol = nex;
continue;
}
}
}
u3a_lose(fol);
bus = seb;
fol = nex;
continue;
}
}
}
}
l10: {
u3_noun p_gal, q_gal;
u3x_cell(gal, &p_gal, &q_gal);
{
u3_noun zep, hod, nex;
if ( c3y == u3r_du(p_gal) ) {
u3_noun b_gal = u3h(p_gal);
u3_noun c_gal = u3t(p_gal);
u3_noun d_gal = q_gal;
zep = u3k(b_gal);
hod = _n_nock_on(u3k(bus), u3k(c_gal));
nex = u3k(d_gal);
}
else {
u3_noun b_gal = p_gal;
u3_noun c_gal = q_gal;
zep = u3k(b_gal);
hod = u3_nul;
nex = u3k(c_gal);
}
u3a_lose(fol);
return _n_hint(zep, hod, bus, nex);
}
}
l11: {
u3_noun gof = _n_nock_on(bus, u3k(gal));
u3_noun val;
u3t_off(noc_o);
val = u3m_soft_esc(u3k(gof));
u3t_on(noc_o);
if ( !_(u3du(val)) ) {
u3m_bail(u3nt(1, gof, 0));
}
else {
u3_noun pro;
u3z(gof);
u3z(fol);
pro = u3k(u3t(val));
u3z(val);
return pro;
}
}
}
c3_assert(!"not reached");
case 10: {
u3_noun p_gal, q_gal;
u3x_cell(gal, &p_gal, &q_gal);
{
u3_noun zep, hod, nex;
if ( c3y == u3r_du(p_gal) ) {
u3_noun b_gal = u3h(p_gal);
u3_noun c_gal = u3t(p_gal);
u3_noun d_gal = q_gal;
zep = u3k(b_gal);
hod = _n_nock_on(u3k(bus), u3k(c_gal));
nex = u3k(d_gal);
}
else {
u3_noun b_gal = p_gal;
u3_noun c_gal = q_gal;
zep = u3k(b_gal);
hod = u3_nul;
nex = u3k(c_gal);
}
u3a_lose(fol);
return _n_hint(zep, hod, bus, nex);
}
}
case 11: {
u3_noun gof = _n_nock_on(bus, u3k(gal));
u3_noun val;
u3t_off(noc_o);
val = u3m_soft_esc(u3k(gof));
u3t_on(noc_o);
if ( !_(u3du(val)) ) {
u3m_bail(u3nt(1, gof, 0));
}
else {
u3_noun pro;
u3z(gof);
u3z(fol);
pro = u3k(u3t(val));
u3z(val);
return pro;
}
}
c3_assert(!"not reached");
}
}
}

View File

@ -163,6 +163,13 @@ _main_getopt(c3_i argc, c3_c** argv)
return c3n;
}
if ( u3_Host.ops_u.tic_c == 0 && u3_Host.ops_u.who_c != 0 ) {
c3_c tic_c[29];
printf("your ticket: ~");
scanf("%28s",tic_c);
u3_Host.ops_u.tic_c = _main_presig(tic_c);
}
if ( c3y == u3_Host.ops_u.bat ) {
u3_Host.ops_u.dem = c3y;
u3_Host.ops_u.nuu = c3y;

View File

@ -359,7 +359,10 @@ _unix_scan_mount_point(u3_umon* mon_u)
else {
if ( '.' != out_u->d_name[len_w]
|| '\0' == out_u->d_name[len_w + 1]
|| '~' == out_u->d_name[strlen(out_u->d_name) - 1] ) {
|| '~' == out_u->d_name[strlen(out_u->d_name) - 1]
|| ('#' == out_u->d_name[0] &&
'#' == out_u->d_name[strlen(out_u->d_name) - 1])
) {
free(pax_c);
continue;
}
@ -895,6 +898,8 @@ _unix_update_dir(u3_udir* dir_u)
if ( !S_ISDIR(buf_u.st_mode) ) {
if ( !strchr(out_u->d_name,'.')
|| '~' == out_u->d_name[strlen(out_u->d_name) - 1]
|| ('#' == out_u->d_name[0] &&
'#' == out_u->d_name[strlen(out_u->d_name) - 1])
) {
free(pax_c);
continue;