git.haldean.org expel / f85e94c
s/expel/ubik Haldean Brown 6 years ago
30 changed file(s) with 56 addition(s) and 56 deletion(s). Raw diff Collapse all Expand all
22 Last updated: Mar 2016
33
44 To contribute to Expel, please send a patch generated using git
5 format-patch to expel@haldean.org. By sending the patches you agree to
5 format-patch to ubik@haldean.org. By sending the patches you agree to
66 license your patch to the Expel project under the terms of the GNU
77 Public License, version 2.
88
00 /*
1 * compile.h: expel compilation
1 * compile.h: ubik compilation
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * env.h: expel environment definitions
1 * env.h: ubik environment definitions
22 * Copyright (C) 2015, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * gen.h: expel bytecode generation
1 * gen.h: ubik bytecode generation
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * parse.h: expel language parser
1 * parse.h: ubik language parser
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * schedule.h: definitions for the expel scheduler
1 * schedule.h: definitions for the ubik scheduler
22 * Copyright (C) 2015, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * token.h: expel language tokenizer
1 * token.h: ubik language tokenizer
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * types.h: runtime type system for expel
1 * types.h: runtime type system for ubik
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * expel.h: minimal public API
1 * ubik.h: minimal public API
22 * Copyright (C) 2015, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
185185 struct xl_dagc_node *result;
186186 };
187187
188 /* Starts the expel runtime.
188 /* Starts the ubik runtime.
189189 *
190190 * Returns OK on success. */
191191 no_ignore xl_error
192192 xl_start();
193193
194 /* Stops the expel runtime.
194 /* Stops the ubik runtime.
195195 *
196196 * Returns OK on success. */
197197 no_ignore xl_error
221221 no_ignore xl_error
222222 xl_release(void *v);
223223
224 /* Loads an expel bytecode blob from a stream.
224 /* Loads an ubik bytecode blob from a stream.
225225 *
226226 * Returns OK on success, or a nonzero error word. */
227227 no_ignore xl_error
00 /*
1 * uri.h: expel content identifiers
1 * uri.h: ubik content identifiers
22 * Copyright (C) 2015, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
2222
2323 #include "ubik/ubik.h"
2424
25 /* Identifies values in the expel substrate */
25 /* Identifies values in the ubik substrate */
2626 struct xl_uri {
2727 xl_tag tag;
2828 xl_word hash;
00 /*
1 * compile.c: expel compilation
1 * compile.c: ubik compilation
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
4242 perror("could not open current directory");
4343 return xl_raise(ERR_UNEXPECTED_FAILURE, "getcwd");
4444 }
45 strcat(scratch_dir, "/expel-build");
45 strcat(scratch_dir, "/ubik-build");
4646 cenv->scratch_dir = scratch_dir;
4747
4848 include_dirs = getenv("EXPEL_INCLUDE");
00 /*
1 * env.c: expel environment definitions
1 * env.c: ubik environment definitions
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * error.c: error tracking for expel runtime
1 * error.c: error tracking for ubik runtime
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * gen.c: expel bytecode generation
1 * gen.c: ubik bytecode generation
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * grammar.y: expel language grammar
1 * grammar.y: ubik language grammar
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * load.c: load expel data from streams
1 * load.c: load ubik data from streams
22 * Copyright (C) 2015, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * parse.c: expel language parser
1 * parse.c: ubik language parser
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * rt.c: expel runtime
1 * rt.c: ubik runtime
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * save.c: save expel data to streams
1 * save.c: save ubik data to streams
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * stream.c: implementation of expel streams
1 * stream.c: implementation of ubik streams
22 * Copyright (C) 2015, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * token.l: expel language tokenizer
1 * token.l: ubik language tokenizer
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * types.h: runtime type system for expel
1 * types.h: runtime type system for ubik
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * uri.c: expel content identifiers
1 * uri.c: ubik content identifiers
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
1515 - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1616
1717 -------------------------------------------------------------------------------
18 - Every line in this file will become a constant in dist/include/expel/const.h
18 - Every line in this file will become a constant in dist/include/ubik/const.h
1919 - when the project is made. Lines that begin with - are ignored. The format is
2020 - " packed.NAME_OF_CONSTANT"; the packed value must be 8 characters long.
2121
33 finish
44 endif
55
6 syntax match expelBind ":"
7 syntax match expelBind "\."
8 syntax match expelBind "!="
9 highlight link expelBind Delimiter
6 syntax match ubikBind ":"
7 syntax match ubikBind "\."
8 syntax match ubikBind "!="
9 highlight link ubikBind Delimiter
1010
11 syntax match expelSubbind "\^"
12 syntax match expelSubbind "="
13 syntax match expelSubbind "=>"
14 syntax match expelSubbind "/>"
15 syntax match expelSubbind "->"
16 syntax match expelSubbind "\\"
17 highlight link expelSubbind Keyword
11 syntax match ubikSubbind "\^"
12 syntax match ubikSubbind "="
13 syntax match ubikSubbind "=>"
14 syntax match ubikSubbind "/>"
15 syntax match ubikSubbind "->"
16 syntax match ubikSubbind "\\"
17 highlight link ubikSubbind Keyword
1818
19 syntax region expelString start=/"/ skip=/\\"/ end=/"/ oneline
20 highlight default link expelString String
19 syntax region ubikString start=/"/ skip=/\\"/ end=/"/ oneline
20 highlight default link ubikString String
2121
22 syntax region expelComment start=/#/ end=/\n/ oneline
23 highlight default link expelComment Comment
22 syntax region ubikComment start=/#/ end=/\n/ oneline
23 highlight default link ubikComment Comment
2424
25 syntax match expelNumber "\v<\d+>"
26 syntax match expelNumber "\v<\d+\.\d+>"
27 highlight default link expelNumber Number
25 syntax match ubikNumber "\v<\d+>"
26 syntax match ubikNumber "\v<\d+\.\d+>"
27 highlight default link ubikNumber Number
2828
2929 setlocal shiftwidth=4
3030 setlocal tabstop=4
3131
32 let b:current_syntax = "expel"
32 let b:current_syntax = "ubik"
0 # expel hello world, with a function call for kicks
0 # ubik hello world, with a function call for kicks
11
22 : add-two-numbers
33 = uadd 2 64
4141 #define run_single(test) int main() { \
4242 xl_error err = xl_start(); \
4343 if (err != OK) { \
44 printf("couldn't start expel: %s\n", xl_error_explain(err)); \
44 printf("couldn't start ubik: %s\n", xl_error_explain(err)); \
4545 return 1; \
4646 } \
4747 init(); run(test); \
4848 err = xl_teardown(); \
4949 if (err != OK) { \
50 printf("couldn't close expel: %s\n", xl_error_explain(err)); \
50 printf("couldn't close ubik: %s\n", xl_error_explain(err)); \
5151 return 1; \
5252 } \
5353 finish(); }
00 /*
1 * expeli.c: expel interpreter
1 * ubiki.c: ubik interpreter
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
00 /*
1 * expelc.c: expel compiler
1 * ubikc.c: ubik compiler
22 * Copyright (C) 2016, Haldean Brown
33 *
44 * This program is free software; you can redistribute it and/or modify
4242 void
4343 usage()
4444 {
45 printf("expelc compiles expel source code to bytecode\n");
46 printf("usage: expelc SOURCE OUT\n");
45 printf("ubikc compiles ubik source code to bytecode\n");
46 printf("usage: ubikc SOURCE OUT\n");
4747 }
4848
4949 int
6969 }
7070
7171 err = xl_start();
72 CHECK_ERR("couldn't start expel");
72 CHECK_ERR("couldn't start ubik");
7373
7474 err = xl_stream_rfile(&stream, fname);
7575 CHECK_ERR("couldn't open file");