WASM code; i.e. foo().bar; This should at least produce an error until
the underlying issue is fixed.
+ [ ] Every type should have a unique id assigned to it. This would make it
+ easier to talk about types in a concrete way (for polymorphism and such),
+ and would prepare the compiler to output type information into data section.
+
API Expansion:
There are many different places where the standard API for WASI and JS
backends could be improved. Here are some of the target areas.
CompileAction action;
u32 verbose_output : 1;
+ u32 fun_output : 1;
bh_arr(const char *) included_folders;
bh_arr(const char *) files;
else if (!strcmp(argv[i], "--verbose") || !strcmp(argv[i], "-V")) {
options.verbose_output = 1;
}
+ else if (!strcmp(argv[i], "--fun") || !strcmp(argv[i], "-F")) {
+ options.fun_output = 1;
+ }
else if (!strcmp(argv[i], "-I")) {
bh_arr_push(options.included_folders, argv[++i]);
}
return changed;
}
+// Just having fun with some visual output - brendanfh 2020/12/14
+static void output_dummy_progress_bar(CompilerState* compiler_state) {
+ EntityHeap* eh = &compiler_state->prog_info.entities;
+
+ const i32 WIDTH = 80;
+
+ printf("\e[2;1H");
+ for (i32 i = 0; i < Entity_State_Count - 1; i++) {
+ printf("%20s (%4d) | ", entity_state_strings[i], eh->state_count[i]);
+
+ for (i32 c = 0; c < WIDTH; c++) {
+ if (c < eh->state_count[i] * 5 / WIDTH)
+ printf("\xe2\x96\x88");
+ else
+ printf(" ");
+ }
+ printf("\n");
+ }
+}
static i32 onyx_compile(CompilerState* compiler_state) {
u64 start_time = bh_time_curr();
semstate.program = &compiler_state->prog_info;
}
+ if (compiler_state->options->fun_output)
+ printf("\e[2J");
+
while (!bh_arr_is_empty(compiler_state->prog_info.entities.entities)) {
+ if (compiler_state->options->fun_output) {
+ output_dummy_progress_bar(compiler_state);
+
+ // Slowing things down for the effect
+ usleep(500);
+ }
+
Entity ent = entity_heap_top(&compiler_state->prog_info.entities);
entity_heap_remove_top(&compiler_state->prog_info.entities);
b32 changed = process_entity(compiler_state, &ent);
}
void entity_heap_remove_top(EntityHeap* entities) {
+ entities->state_count[entities->entities[0].state]--;
+
entities->entities[0] = entities->entities[bh_arr_length(entities->entities) - 1];
bh_arr_pop(entities->entities);
eh_shift_down(entities, 0);