diff --git a/.dockerignore b/.dockerignore index 54e9753f..78530dec 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,7 +3,7 @@ **/docs **/*.ll **/*.ir -**/cider +**/ace **/*.o **/logs lib # Gets mounted using -v in docker-run.sh diff --git a/.gitignore b/.gitignore index 1f4db42a..230181fd 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,8 @@ a.out test.c test env -cider -!cider.* +ace +!ace.* logs *.llir *.log @@ -35,7 +35,7 @@ rt_gc *.ll *.html *.pyc -!**/*.cider +!**/*.ace *.zx CMakeCache.txt CMakeFiles/ diff --git a/CMakeLists.txt b/CMakeLists.txt index f8b741ab..86a2a2ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.4.3) -project(Cider) +project(Ace) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -38,7 +38,7 @@ endif() option(DEBUG "Build a Debug build" OFF) if(DEBUG) message("Compiling in Debug mode...") - add_definitions(-DCIDER_DEBUG) + add_definitions(-DACE_DEBUG) add_compile_options(-std=c++17 -g -O0 -Wall -Werror ${option_flags}) else() message("Compiling in Release mode...") @@ -47,7 +47,7 @@ endif() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread -std=c++17 -Wl,-rpath,${LLVM_INSTALL_PREFIX}/lib") -add_executable(cider +add_executable(ace src/ast.cpp src/builtins.cpp src/class_predicate.cpp @@ -98,6 +98,6 @@ add_executable(cider message(STATUS "Using dynamic link options -L${LLVM_LIBRARY_DIR} -lLLVM") -target_link_libraries(cider -L${LLVM_LIBRARY_DIR} -lLLVM) +target_link_libraries(ace -L${LLVM_LIBRARY_DIR} -lLLVM) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 28149c3a..2b180a02 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,8 +1,8 @@ -# Development of Cider +# Development of Ace ## Machine setup -So far all development of Cider has taken place on MacOS and Linux. The most +So far all development of Ace has taken place on MacOS and Linux. The most well-supported path is to develop on MacOS at the moment. However, all tests in GitHub Actions are running in a Docker debian:latest container. Consult [Dockerfile](Dockerfile) for more info on that test setup. @@ -21,7 +21,7 @@ You will need Docker for the supported Linux test path. #### Plugins * If you use vim, take a look at - [vim-cider](https://github.com/ciderlang/vim-cider). + [vim-ace](https://github.com/acelang/vim-ace). ## Development workflow diff --git a/Dockerfile b/Dockerfile index 7955fc8e..a268105e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN echo "nmap ; :" >> /root/.vimrc RUN echo "imap jk " >> /root/.vimrc RUN echo "imap kj " >> /root/.vimrc -ADD . /opt/cider -WORKDIR /opt/cider +ADD . /opt/ace +WORKDIR /opt/ace CMD bash diff --git a/LICENSE b/LICENSE index 8b93eafb..0c085b1d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Cider Programming Language +Ace Programming Language MIT License diff --git a/Makefile b/Makefile index a80490e6..408ebc2d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PN = cider +PN = ace # TODO: ifeq ($(OS),Windows_NT) UNAME_S := $(shell uname -s) @@ -13,7 +13,7 @@ BUILD_DIR ?= $(HOME)/var/$(PN) SRCDIR = $(shell pwd) LLVM_DIR ?= $(shell $(LLVM_CONFIG) --cmakedir) prefix ?= /usr/local -BUILT_BINARY = $(BUILD_DIR)/cider +BUILT_BINARY = $(BUILD_DIR)/ace MAKEFLAGS=--no-print-directory # Installation-related directories @@ -24,19 +24,19 @@ stdlibdir = $(sharedir)/lib runtimedir = $(sharedir)/runtime man1dir ?= $(DESTDIR)/$(prefix)/share/man/man1 manfile = $(man1dir)/$(PN).1 -test_destdir ?= $(HOME)/var/cider-test +test_destdir ?= $(HOME)/var/ace-test .PHONY: release release: - make DEBUG= cider + make DEBUG= ace .PHONY: debug debug: - make DEBUG=1 cider + make DEBUG=1 ace -.PHONY: cider -cider: - -@echo "Building Cider..." +.PHONY: ace +ace: + -@echo "Building Ace..." # make clean make install @@ -45,7 +45,7 @@ uninstall: -rm -rf $(sharedir) -rm $(bindir)/$(PN) -rm $(manfile) - -rm $(bindir)/cider-tags + -rm $(bindir)/ace-tags .PHONY: $(BUILT_BINARY) $(BUILT_BINARY): $(BUILD_DIR)/Makefile @@ -62,12 +62,12 @@ $(BUILD_DIR)/Makefile: $(LLVM_DIR)/LLVMConfig.cmake CMakeLists.txt (cd $(BUILD_DIR) && LLVM_DIR="$(LLVM_DIR)" cmake $(SRCDIR) -DDEBUG=ON -G 'Unix Makefiles') \ fi -CIDER_LIBS=$(shell cd lib && find *.cider) +ACE_LIBS=$(shell cd lib && find *.ace) RUNTIME_C_FILES=$(shell find runtime -regex '.*\.c$$') .PHONY: install -install: $(BUILT_BINARY) $(addprefix $(SRCDIR)/lib/,$(CIDER_LIBS)) $(RUNTIME_C_FILES) $(SRCDIR)/$(PN).1 cider-tags - -echo "Installing Cider to ${DESTDIR}..." +install: $(BUILT_BINARY) $(addprefix $(SRCDIR)/lib/,$(ACE_LIBS)) $(RUNTIME_C_FILES) $(SRCDIR)/$(PN).1 ace-tags + -echo "Installing Ace to ${DESTDIR}..." -echo "Making sure that various installation dirs exist..." mkdir -p $(bindir) -rm -rf $(stdlibdir) @@ -78,11 +78,11 @@ install: $(BUILT_BINARY) $(addprefix $(SRCDIR)/lib/,$(CIDER_LIBS)) $(RUNTIME_C_F mkdir -p $(runtimedir) -echo "Copying compiler binary from $(BUILT_BINARY) to $(bindir)..." cp $(BUILT_BINARY) $(bindir) - cp ./cider-tags $(bindir) + cp ./ace-tags $(bindir) for f in $(RUNTIME_C_FILES); do cp "$$f" "$(runtimedir)"; done - cp $(addprefix $(SRCDIR)/lib/,$(CIDER_LIBS)) $(stdlibdir) + cp $(addprefix $(SRCDIR)/lib/,$(ACE_LIBS)) $(stdlibdir) cp $(SRCDIR)/$(PN).1 $(man1dir) - -test -x ./cider-link-to-src && CIDER_ROOT=$(sharedir) ./cider-link-to-src + -test -x ./ace-link-to-src && ACE_ROOT=$(sharedir) ./ace-link-to-src .PHONY: clean clean: @@ -95,12 +95,12 @@ install-test: .PHONY: test test: - -@echo "Running Tests for Cider..." + -@echo "Running Tests for Ace..." make $(BUILT_BINARY) $(BUILT_BINARY) unit-test make install-test - @echo "CIDER_ROOT=$(test_destdir)/$(prefix)/share/$(PN)" - @CIDER_ROOT="$(test_destdir)/$(prefix)/share/$(PN)" \ + @echo "ACE_ROOT=$(test_destdir)/$(prefix)/share/$(PN)" + @ACE_ROOT="$(test_destdir)/$(prefix)/share/$(PN)" \ "$(SRCDIR)/tests/run-tests.sh" \ "$(test_destdir)/$(prefix)/bin" \ "$(SRCDIR)" diff --git a/README.md b/README.md index f41aa6cb..4d2dff92 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,45 @@ -# Cider Language +# Ace Language -[![Tests](https://github.com/ciderlang/cider/workflows/Tests/badge.svg)](https://github.com/ciderlang/cider/actions?query=workflow%3ATests) +[![Tests](https://github.com/acelang/ace/workflows/Tests/badge.svg)](https://github.com/acelang/ace/actions?query=workflow%3ATests) ## Fundamentals -Cider resembles a combination of Haskell and C, with garbage collection, eager +Ace resembles a combination of Haskell and C, with garbage collection, eager evaluation, static type-checking, purity and impurity (when you want it), extensible infix operators, type-classes to allow ad-hoc polymorphism, `with` control-flow semantics for bracketing resource usage, pattern-matching, and type inference. ## Quick Start -To play with Cider in Docker, try this. +To play with Ace in Docker, try this. ``` -git clone https://github.com/ciderlang/cider.git -cd cider +git clone https://github.com/acelang/ace.git +cd ace # Get a docker image set up ready to run a build (assumes Docker is running). ./docker-build.sh && ./docker-run.sh bash # The prior command should open up a bash prompt within a new docker container. -# Build and install Cider inside this container. +# Build and install Ace inside this container. make install -# The prior command should have installed Cider to /usr/local. Set up the -# $CIDER_ROOT environment variable. -export CIDER_ROOT="/usr/local/share/cider" +# The prior command should have installed Ace to /usr/local. Set up the +# $ACE_ROOT environment variable. +export ACE_ROOT="/usr/local/share/ace" # Build and run a simple test program cd -echo 'fn main() { print("Hello world.") }' > hello_world.cider -cider hello_world +echo 'fn main() { print("Hello world.") }' > hello_world.ace +ace hello_world # Read more -man cider +man ace ``` ## Description -Cider is a statically typed procedural/functional language. It is a work in +Ace is a statically typed procedural/functional language. It is a work in progress. Please reach out if you'd like to get involved. ### Syntax @@ -105,7 +105,7 @@ fn main() { ### Semantics -The evaluation of Cider is strict, not lazy. The call-by-value method of passing +The evaluation of Ace is strict, not lazy. The call-by-value method of passing arguments is used. ### Mutability @@ -138,7 +138,7 @@ fn main() { ### Encapsulation -There is no class-based encapsulation in Cider. Encapsulation can be achieved by +There is no class-based encapsulation in Ace. Encapsulation can be achieved by 1. using modules to implement Abstract Data Types, exposing only the functions relevant to the creation, use, and lifetime of a type. @@ -147,14 +147,14 @@ There is no class-based encapsulation in Cider. Encapsulation can be achieved by #### Modularity -Cider lacks support for shared libraries or any shareable intermediate +Ace lacks support for shared libraries or any shareable intermediate representation. Code complexity and leaky abstractions can still be avoided by limiting which symbols are exposed from source modules. ### Type System Types are inferred but type annotations are also allowed/encouraged as -documentation and sometimes necessary when types cannot be inferred. Cider +documentation and sometimes necessary when types cannot be inferred. Ace rejects [intermediate type defaulting](https://kseo.github.io/posts/2017-01-04-type-defaulting-in-haskell.html) by design. Although, if a good design for that comes along, it might happen. @@ -164,14 +164,14 @@ Polymorphism comes in two flavors. Type-based polymorphism exists at compile time in the ability to use type variables which are re-bound per function invocation. At run-time, there are a -couple different notions of polymorphism. First, Cider supports sum types by +couple different notions of polymorphism. First, Ace supports sum types by allowing the declaration of types with multiple data constructors. This then relies on `match` statements (pattern matching) to branch on the run-time value. This form of polymorphism may feel unfamiliar to folks coming from "OOP" languages that rely on inheritance and/or abstract classes with any number of derived implementations. -Since Cider treats functions as values and allows closure over function +Since Ace treats functions as values and allows closure over function definitions (`fn`), you can `return` new behaviors as functions. Users of those functions will get statically checked run-time varying behavior (aka run-time polymorphism). For example, the `Iterable` type-class requires the definition @@ -200,9 +200,9 @@ the target host. ### Learning more The best way to learn more at this time is to read through the -`tests/test_*.cider` code. +`tests/test_*.ace` code. TODO: struct types do not support pattern matching. proposed solution: eliminate structs, but add names to newtypes. -[![HitCount](http://hits.dwyl.com/ciderlang/cider.svg)](http://hits.dwyl.com/ciderlang/cider) +[![HitCount](http://hits.dwyl.com/acelang/ace.svg)](http://hits.dwyl.com/acelang/ace) diff --git a/TODO.md b/TODO.md index c6ddb620..80051a62 100644 --- a/TODO.md +++ b/TODO.md @@ -25,12 +25,12 @@ - [x] int matching - [x] tuple matching - [x] string matching -- [x] Play: Rewrite expect.py in Cider +- [x] Play: Rewrite expect.py in Ace - [x] decide on `with` (Python) / `using`(`dispose`) (C#) / 'defer' (Golang) style syntax for deterministic destruction - or ref-counting - [x] Implement generic in-place sort for vectors - [x] Ergo: Ability to import symbols from modules by name (symbol injection) - [x] Add safety checks on casting (as) -- [x] Exercise: implement parser combinators in Cider +- [x] Exercise: implement parser combinators in Ace - [x] Implement closures with capture by value - [x] Implement backtracking in unification of product types - [x] Consider marking null-terminated strings differently for FFI purposes (ended up doing this as part of "safe-unboxing" for easier FFI. @@ -51,7 +51,7 @@ - [x] change `str` to use `wchar_t` as its underlying physical character type - [x] use C99's `mbstowcs` and `wcstombs` to convert back and forth - [x] propagate usage of utf8 for `char` -- [x] 'for' syntax - based on `tests/test_list_iter.cider` pattern +- [x] 'for' syntax - based on `tests/test_list_iter.ace` pattern - [x] Ternary operator - [x] Logical and/or (build with ternary operator) - [x] Type refinements for ternary / conditional expressions diff --git a/ace-link-to-src b/ace-link-to-src new file mode 100644 index 00000000..502d23c0 --- /dev/null +++ b/ace-link-to-src @@ -0,0 +1,10 @@ +#!/bin/bash +# Note this assumes ACE_SRC_DIR is $HOME/src/ace. +ACE_SRC_DIR="${ACE_SRC_DIR:-$PWD}" +ACE_ROOT="${ACE_ROOT:-/usr/local/share/ace}" + +cd "$ACE_ROOT" || { printf "Couldn't cd into %s.\n" "$ACE_ROOT"; exit 1; } +rm -rf runtime +rm -rf lib +ln -s "$ACE_SRC_DIR/runtime" . +ln -s "$ACE_SRC_DIR/lib" . diff --git a/cider-tags b/ace-tags similarity index 80% rename from cider-tags rename to ace-tags index 861bd550..349a4eb5 100644 --- a/cider-tags +++ b/ace-tags @@ -12,7 +12,7 @@ if [ $# -eq 0 ]; then targets=( . "$(maybe-dir "$(llvm-config --cppflags | xargs -n 1 echo | grep '^-I' | cut -c3-)")" - "${CIDER_ROOT:-/usr/local/share/cider}" + "${ACE_ROOT:-/usr/local/share/ace}" ) else targets=( @@ -29,7 +29,7 @@ trap 'rm -f "$ztags"' EXIT # shellcheck disable=SC2068 ctags -f "$tags_file" -R ${targets[@]} || exit 1 -gather-cider-tags() { +gather-ace-tags() { keyword=$1 code=$2 allow_indent=$3 @@ -42,7 +42,7 @@ gather-cider-tags() { # shellcheck disable=SC2068 for target in ${targets[@]}; do # shellcheck disable=SC2038 - find -L "$target" -regex '.*\.cider$' \ + find -L "$target" -regex '.*\.ace$' \ | xargs grep -ERn "^$indent$keyword$spacePlus.*" \ | sed \ -Ene \ @@ -51,12 +51,12 @@ gather-cider-tags() { done } -gather-cider-tags "let" "v" -gather-cider-tags "fn" "f" 1 -gather-cider-tags "class" "s" -gather-cider-tags "instance" "s" -gather-cider-tags "newtype" "s" -gather-cider-tags "struct" "s" +gather-ace-tags "let" "v" +gather-ace-tags "fn" "f" 1 +gather-ace-tags "class" "s" +gather-ace-tags "instance" "s" +gather-ace-tags "newtype" "s" +gather-ace-tags "struct" "s" # TODO: support data-ctors cat "$tags_file" >> "$ztags" diff --git a/cider.1 b/ace.1 similarity index 66% rename from cider.1 rename to ace.1 index cba0ec25..39405045 100644 --- a/cider.1 +++ b/ace.1 @@ -1,30 +1,30 @@ -.TH CIDER 1 +.TH ACE 1 .SH NAME -cider \- Cider programming language compiler +ace \- Ace programming language compiler .SH SYNOPSIS -cider [\fIprogram\fR] [\fIargs\fR ...] +ace [\fIprogram\fR] [\fIargs\fR ...] .br -cider [\fBrun\fR \fIprogram\fR] [\fIargs\fR ...] +ace [\fBrun\fR \fIprogram\fR] [\fIargs\fR ...] .br -cider [\fBfind\fR \fIprogram\fR] +ace [\fBfind\fR \fIprogram\fR] .br -cider [\fBlex\fR \fIprogram\fR] +ace [\fBlex\fR \fIprogram\fR] .br -cider [\fBparse\fR \fIprogram\fR] +ace [\fBparse\fR \fIprogram\fR] .br -cider [\fBcompile\fR \fIprogram\fR] +ace [\fBcompile\fR \fIprogram\fR] .br -cider [\fBspecialize\fR \fIprogram\fR] +ace [\fBspecialize\fR \fIprogram\fR] .br -cider [\fBll\fR \fIprogram\fR] +ace [\fBll\fR \fIprogram\fR] .br -cider [\fBtest\fR] \-\- run unit tests +ace [\fBtest\fR] \-\- run unit tests .SH DESCRIPTION .na -Cider is a general purpose programming language. -The source code is available at \fBhttps://github.com/ciderlang/cider\fR. +Ace is a general purpose programming language. +The source code is available at \fBhttps://github.com/acelang/ace\fR. .P -cider +ace .B run will attempt to compose all the phases of compilation, then pass the resulting LLVM code off to .B clang @@ -34,7 +34,7 @@ It will then the built user program and pass along any remaining \fIargs\fR. .br .P -cider +ace .B ll will emit an LLVM IR file of the .I program @@ -42,39 +42,39 @@ and its dependencies. .P .I program is resolved by -.B cider +.B ace into an actual filename. -When you reference a source file, you can omit the `.cider` extension. -When searching for the specified \fIprogram\fR, \fBcider\fR will look in the current directory first, then proceed to looking through the \fBCIDER_PATH\fR, as described below. +When you reference a source file, you can omit the `.ace` extension. +When searching for the specified \fIprogram\fR, \fBace\fR will look in the current directory first, then proceed to looking through the \fBACE_PATH\fR, as described below. .SH ENVIRONMENT .TP .br -CIDER_ROOT=\fI/usr/local/share/cider\fR +ACE_ROOT=\fI/usr/local/share/ace\fR Should point to the base directory for standard runtime and library. If -.B CIDER_PATH +.B ACE_PATH is not set, it will default to -.B $CIDER_ROOT/lib +.B $ACE_ROOT/lib \&. If -.B CIDER_RUNTIME +.B ACE_RUNTIME is not set, it will default to " -.B $CIDER_ROOT/runtime +.B $ACE_ROOT/runtime \&. .TP .br -CIDER_PATH=\fI/usr/local/share/cider/lib\fR +ACE_PATH=\fI/usr/local/share/ace/lib\fR A colon-separated list of directories to search for imported libraries. Libraries are imported with the `import` keyword. -The `lib/std.cider` library is called the prelude and is automatically imported unless +The `lib/std.ace` library is called the prelude and is automatically imported unless .B NO_PRELUDE is given. Setting this variable overrides the -.B $CIDER_ROOT/lib +.B $ACE_ROOT/lib location. .TP .br -CIDER_RUNTIME=\fI/usr/local/share/cider/runtime\fR -The location of the C-runtime portion of Cider's builtins. See src/cider_rt.c. Setting this variable overrides the -.B $CIDER_ROOT/runtime +ACE_RUNTIME=\fI/usr/local/share/ace/runtime\fR +The location of the C-runtime portion of Ace's builtins. See src/ace_rt.c. Setting this variable overrides the +.B $ACE_ROOT/runtime location. .TP .br @@ -88,26 +88,26 @@ DEBUG=\fI[0-10]\fR Sets the level of debugging information to spew. Default is 0 or none. Note that -.B cider +.B ace must be compiled with -.B \-DCIDER_DEBUG +.B \-DACE_DEBUG in order to enable debug logging. See src/logging.cpp. .TP .br STATUS_BREAK=\fI1\fR When set to non-zero value, -.B cider +.B ace breaks into the debugger at the first user error found (helpful when working on the compiler). .TP .br DUMP_BUILTINS=\fI1\fR When set to non-zero value, -.B cider +.B ace lists all the registered builtin functions and quits. .SH LICENSE .sp -Cider Programming Environment +Ace Programming Environment .TP .br MIT License @@ -137,8 +137,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \ SOFTWARE. .SH "REPORTING BUGS" .sp -Note that this version of Cider is pre-release quality software. No guarantees \ +Note that this version of Ace is pre-release quality software. No guarantees \ are given regarding changes to protocols, language grammar, semantics, or \ standard library interface. Bug reports are greatly appreciated. Report bugs to \ -the Cider GitHub site. \fBhttps://github.com/ciderlang/cider/issues\fR. Pull Requests \ +the Ace GitHub site. \fBhttps://github.com/acelang/ace/issues\fR. Pull Requests \ are welcome! diff --git a/cider.jpg b/ace.jpg similarity index 100% rename from cider.jpg rename to ace.jpg diff --git a/apps/logit.cider b/apps/logit.ace similarity index 100% rename from apps/logit.cider rename to apps/logit.ace diff --git a/apps/tee.cider b/apps/tee.ace similarity index 100% rename from apps/tee.cider rename to apps/tee.ace diff --git a/bench/fib-mem.cider b/bench/fib-mem.ace similarity index 100% rename from bench/fib-mem.cider rename to bench/fib-mem.ace diff --git a/bench/fib.cider b/bench/fib.ace similarity index 100% rename from bench/fib.cider rename to bench/fib.ace diff --git a/cider-link-to-src b/cider-link-to-src deleted file mode 100644 index 636c45a5..00000000 --- a/cider-link-to-src +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# Note this assumes CIDER_SRC_DIR is $HOME/src/cider. -CIDER_SRC_DIR="${CIDER_SRC_DIR:-$PWD}" -CIDER_ROOT="${CIDER_ROOT:-/usr/local/share/cider}" - -cd "$CIDER_ROOT" || { printf "Couldn't cd into %s.\n" "$CIDER_ROOT"; exit 1; } -rm -rf runtime -rm -rf lib -ln -s "$CIDER_SRC_DIR/runtime" . -ln -s "$CIDER_SRC_DIR/lib" . diff --git a/docker-build.sh b/docker-build.sh index 0fe0f7f9..9390a1f7 100644 --- a/docker-build.sh +++ b/docker-build.sh @@ -1,5 +1,5 @@ #!/bin/bash -IMAGE="ciderlang/cider" +IMAGE="acelang/ace" VERSION="$(cat VERSION)" docker build -t "${IMAGE}:${VERSION}" . diff --git a/docker-run.sh b/docker-run.sh index 171aa4c8..cd0a6429 100644 --- a/docker-run.sh +++ b/docker-run.sh @@ -6,9 +6,9 @@ set +x # Running docker tests by default, add a parameter to execute that command # instead of the tests. -IMAGE="ciderlang/cider" +IMAGE="acelang/ace" VERSION="$(cat VERSION)" -NAME="cider-build" +NAME="ace-build" docker kill "${NAME}" 2>/dev/null docker rm "${NAME}" 2>/dev/null @@ -16,7 +16,7 @@ docker rm "${NAME}" 2>/dev/null docker run \ --rm \ --name "${NAME}" \ - -v "$(pwd)/tests:/opt/cider/tests" \ - -v "$(pwd)/lib:/opt/cider/lib" \ + -v "$(pwd)/tests:/opt/ace/tests" \ + -v "$(pwd)/lib:/opt/ace/lib" \ -t "${IMAGE}:${VERSION}" \ - "${1:-/opt/cider/docker-test.sh}" + "${1:-/opt/ace/docker-test.sh}" diff --git a/docker-test.sh b/docker-test.sh index 27f4be7b..e78b8941 100644 --- a/docker-test.sh +++ b/docker-test.sh @@ -1,5 +1,5 @@ #!/bin/bash set -ex -cd /opt/cider +cd /opt/ace make DEBUG= test diff --git a/install.sh b/install.sh index 259abc29..bfd21ad2 100644 --- a/install.sh +++ b/install.sh @@ -5,15 +5,15 @@ prefix=$2 mkdir -p "$prefix/bin" -echo "Installing Cider to ${DESTDIR}..." +echo "Installing Ace to ${DESTDIR}..." echo "Copying compiler binary from $build_dir $prefix/bin" -cp "$build_dir/cider" "$prefix/bin" -cp cider-tags "$prefix/bin" +cp "$build_dir/ace" "$prefix/bin" +cp ace-tags "$prefix/bin" mkdir -p "$prefix/share/lib" mkdir -p "$prefix/share/runtime" find runtime -regex '.*\.c$' -exec cp '{}' "$prefix/share/runtime" \; -find lib -regex '.*lib/.*\.cider$' -exec cp '{}' "$prefix/share/lib" \; +find lib -regex '.*lib/.*\.ace$' -exec cp '{}' "$prefix/share/lib" \; mkdir -p "$prefix/share/man/man1" -cp cider.1 "$prefix/share/man/man1" +cp ace.1 "$prefix/share/man/man1" diff --git a/lib/append.cider b/lib/append.ace similarity index 100% rename from lib/append.cider rename to lib/append.ace diff --git a/lib/argparser.cider b/lib/argparser.ace similarity index 100% rename from lib/argparser.cider rename to lib/argparser.ace diff --git a/lib/backtrack.cider b/lib/backtrack.ace similarity index 100% rename from lib/backtrack.cider rename to lib/backtrack.ace diff --git a/lib/bufio.cider b/lib/bufio.ace similarity index 100% rename from lib/bufio.cider rename to lib/bufio.ace diff --git a/lib/color.cider b/lib/color.ace similarity index 100% rename from lib/color.cider rename to lib/color.ace diff --git a/lib/complex.cider b/lib/complex.ace similarity index 100% rename from lib/complex.cider rename to lib/complex.ace diff --git a/lib/copy.cider b/lib/copy.ace similarity index 100% rename from lib/copy.cider rename to lib/copy.ace diff --git a/lib/csv.cider b/lib/csv.ace similarity index 100% rename from lib/csv.cider rename to lib/csv.ace diff --git a/lib/defaults.cider b/lib/defaults.ace similarity index 100% rename from lib/defaults.cider rename to lib/defaults.ace diff --git a/lib/geometry.cider b/lib/geometry.ace similarity index 100% rename from lib/geometry.cider rename to lib/geometry.ace diff --git a/lib/hash.cider b/lib/hash.ace similarity index 69% rename from lib/hash.cider rename to lib/hash.ace index 138c678d..5d851462 100644 --- a/lib/hash.cider +++ b/lib/hash.ace @@ -1,5 +1,5 @@ link pkg "libsodium" -link in "cider_sodium.c" +link in "ace_sodium.c" class Hashable a { fn hash(a) Int # NB: probably should be an uint but we don't have @@ -9,16 +9,16 @@ class Hashable a { instance Hashable String { fn hash(s) { let String(sz, len) = s - return ffi cider_hash(sz, len) + return ffi ace_hash(sz, len) } } instance Hashable Int { fn hash(i) { - return ffi cider_hash_int(i) + return ffi ace_hash_int(i) } } fn hash_combine(seed Int, value Int) Int { - return ffi cider_hash_combine(seed, value) + return ffi ace_hash_combine(seed, value) } diff --git a/lib/itertools.cider b/lib/itertools.ace similarity index 100% rename from lib/itertools.cider rename to lib/itertools.ace diff --git a/lib/json.cider b/lib/json.ace similarity index 100% rename from lib/json.cider rename to lib/json.ace diff --git a/lib/list.cider b/lib/list.ace similarity index 100% rename from lib/list.cider rename to lib/list.ace diff --git a/lib/map.cider b/lib/map.ace similarity index 99% rename from lib/map.cider rename to lib/map.ace index b82512f1..110179fb 100644 --- a/lib/map.cider +++ b/lib/map.ace @@ -1,4 +1,4 @@ -# Implements the default Map type in Cider +# Implements the default Map type in Ace import mutable_list {MutableList, MutableCons, MutableNil, remove_if} import copy {Copy, copy} diff --git a/lib/math.cider b/lib/math.ace similarity index 100% rename from lib/math.cider rename to lib/math.ace diff --git a/lib/matrix.cider b/lib/matrix.ace similarity index 100% rename from lib/matrix.cider rename to lib/matrix.ace diff --git a/lib/maybe.cider b/lib/maybe.ace similarity index 100% rename from lib/maybe.cider rename to lib/maybe.ace diff --git a/lib/mutable_list.cider b/lib/mutable_list.ace similarity index 100% rename from lib/mutable_list.cider rename to lib/mutable_list.ace diff --git a/lib/os.cider b/lib/os.ace similarity index 100% rename from lib/os.cider rename to lib/os.ace diff --git a/lib/parser.cider b/lib/parser.ace similarity index 100% rename from lib/parser.cider rename to lib/parser.ace diff --git a/lib/random.cider b/lib/random.ace similarity index 100% rename from lib/random.cider rename to lib/random.ace diff --git a/lib/readline.cider b/lib/readline.ace similarity index 85% rename from lib/readline.cider rename to lib/readline.ace index 6c42fa9f..6d6aa095 100644 --- a/lib/readline.cider +++ b/lib/readline.ace @@ -6,7 +6,7 @@ fn readline(prompt String) Maybe String { if raw_line == null { return Nothing } else { - let line = ffi cider_dup_free(raw_line) + let line = ffi ace_dup_free(raw_line) return Just(String(line, strlen(line))) } } diff --git a/lib/repr.cider b/lib/repr.ace similarity index 100% rename from lib/repr.cider rename to lib/repr.ace diff --git a/lib/result.cider b/lib/result.ace similarity index 100% rename from lib/result.cider rename to lib/result.ace diff --git a/lib/set.cider b/lib/set.ace similarity index 100% rename from lib/set.cider rename to lib/set.ace diff --git a/lib/socket.cider b/lib/socket.ace similarity index 94% rename from lib/socket.cider rename to lib/socket.ace index e787c81e..df527068 100644 --- a/lib/socket.cider +++ b/lib/socket.ace @@ -20,7 +20,7 @@ let SOCK_DGRAM = __host_int(SOCK_STREAM) as! Type fn socket(domain Domain, type Type) { let Domain(domain) = domain let Type(type) = type - let ret = ffi cider_socket(domain, type, 0) + let ret = ffi ace_socket(domain, type, 0) if ret == -1 { return ResourceFailure(get_errno()) } else { diff --git a/lib/sort.cider b/lib/sort.ace similarity index 100% rename from lib/sort.cider rename to lib/sort.ace diff --git a/lib/std.cider b/lib/std.ace similarity index 97% rename from lib/std.cider rename to lib/std.ace index 4915e6f5..93d7a5d2 100644 --- a/lib/std.cider +++ b/lib/std.ace @@ -70,11 +70,11 @@ instance Repr () { fn repr(a) => "()" } -fn strlen(sz *Char) Int => ffi cider_strlen(sz) +fn strlen(sz *Char) Int => ffi ace_strlen(sz) instance Str Int { fn str(x Int) { - let sz = ffi cider_itoa(x) + let sz = ffi ace_itoa(x) return String(sz, strlen(sz)) } } @@ -93,8 +93,8 @@ instance Str UInt8 { instance Str Float { fn str(x) { - let sz = ffi cider_ftoa(x) - let length = ffi cider_strlen(sz) + let sz = ffi ace_ftoa(x) + let length = ffi ace_strlen(sz) return String(sz, length) } } @@ -108,7 +108,7 @@ instance Str (var a) { } instance Str (* Char) { - fn str(a) => String(a, ffi cider_strlen(a)) + fn str(a) => String(a, ffi ace_strlen(a)) } instance Str [a] { @@ -129,7 +129,7 @@ instance Str (a, b) { } fn putch(ch Char) () { - (ffi cider_write_char(1, ch) as Int)! + (ffi ace_write_char(1, ch) as Int)! } fn print(x) () { @@ -429,7 +429,7 @@ instance ConvertibleToInt Int { instance ConvertibleToInt Char { fn int(a) Int { - return ffi cider_char_to_int(a) + return ffi ace_char_to_int(a) } } @@ -444,13 +444,13 @@ class ConvertibleToFloat a { } instance ConvertibleToFloat Int { - fn float(a) => ffi cider_itof(a) + fn float(a) => ffi ace_itof(a) } instance ConvertibleToFloat String { fn float(a) Float { let String(sz, n) = a - return ffi cider_atof(sz, n) + return ffi ace_atof(sz, n) } } diff --git a/lib/string.cider b/lib/string.ace similarity index 98% rename from lib/string.cider rename to lib/string.ace index c4565405..6293c9d9 100644 --- a/lib/string.cider +++ b/lib/string.ace @@ -47,7 +47,7 @@ instance Ord String { fn compare(a, b) { let String(a, len_a) = a let String(b, len_b) = b - let ret = ffi cider_memcmp(a, b, min(len_a, len_b)) + let ret = ffi ace_memcmp(a, b, min(len_a, len_b)) if ret == 0 { if len_a == len_b { return EQ @@ -67,7 +67,7 @@ instance Ord String { instance ConvertibleToInt String { fn int(sz) Int { let String(a, len_a) = sz - return ffi cider_atoi(a, len_a) + return ffi ace_atoi(a, len_a) } } @@ -322,7 +322,7 @@ instance Serializeable String { } fn memmem(big *Char, big_len Int, little *Char, little_len Int) *Char { - return ffi cider_memmem(big, big_len, little, little_len) + return ffi ace_memmem(big, big_len, little, little_len) } fn split(input String, delim String) [String] { diff --git a/lib/svg.cider b/lib/svg.ace similarity index 100% rename from lib/svg.cider rename to lib/svg.ace diff --git a/lib/sys.cider b/lib/sys.ace similarity index 92% rename from lib/sys.cider rename to lib/sys.ace index 57b26e0e..58d3579b 100644 --- a/lib/sys.cider +++ b/lib/sys.ace @@ -10,8 +10,8 @@ newtype LineReader stream = LineReader(BufferedFileIO stream) let args = get_args() fn get_args() [String] { - let argc = ffi cider_sys_argc() as Int - let argv = ffi cider_sys_argv() as *(*Char) + let argc = ffi ace_sys_argc() as Int + let argv = ffi ace_sys_argv() as *(*Char) let args = [] reserve(args, argc) var i = 0 @@ -109,7 +109,7 @@ instance Str Errno { fn str(errno) { let Errno(errno) = errno let buffer = alloc(1024) as *Char - let res = ffi cider_strerror(errno, buffer, 1024) as *Char + let res = ffi ace_strerror(errno, buffer, 1024) as *Char return String(res, strlen(res)) } } @@ -189,7 +189,7 @@ class FileOpen params error { } fn get_errno() { - return Errno(ffi cider_errno()) + return Errno(ffi ace_errno()) } newtype File = File(String, OpenFlags, CreateMode) @@ -197,10 +197,10 @@ newtype File = File(String, OpenFlags, CreateMode) instance FileOpen File Errno { fn open(params) { let File(String(sz_filename, _), OpenFlags(flags), CreateMode(mode)) = params - return match ffi cider_open(sz_filename, flags, mode) { + return match ffi ace_open(sz_filename, flags, mode) { -1 => ResourceFailure(get_errno()) fd => ResourceAcquired(WithResource(FileDescriptor(fd), || { - (ffi cider_close(fd) as Int)! + (ffi ace_close(fd) as Int)! })) } } @@ -219,17 +219,17 @@ instance FileOpen String Errno { fn unlink(filename String) Int { let String(filename, _) = filename - return ffi cider_unlink(filename) + return ffi ace_unlink(filename) } fn close(fd Int) Int { - return ffi cider_close(fd) + return ffi ace_close(fd) } fn creat(filename, mode CreateMode) Int { let String(filename, _) = filename let CreateMode(mode) = mode - return ffi cider_creat(filename, mode) + return ffi ace_creat(filename, mode) } class Readable a { @@ -241,9 +241,9 @@ instance Readable FileDescriptor { let FileDescriptor(fd) = fd var bytes_read = 0 while True { - let new_bytes_read = ffi cider_read(fd as! Int, __builtin_ptr_add(buffer, bytes_read), nbyte - bytes_read) + let new_bytes_read = ffi ace_read(fd as! Int, __builtin_ptr_add(buffer, bytes_read), nbyte - bytes_read) if new_bytes_read <= -1 { - return Left(ffi cider_errno()) + return Left(ffi ace_errno()) } else if new_bytes_read == 0 { return Right(bytes_read) } else { @@ -279,8 +279,8 @@ class WriteBuffer file { instance WriteBuffer FileDescriptor { fn write_buffer(fd, pb, cb) { let FileDescriptor(fd) = fd - return match ffi cider_write(fd, pb, cb) { - -1 => Left(Errno(ffi cider_errno())) + return match ffi ace_write(fd, pb, cb) { + -1 => Left(Errno(ffi ace_errno())) cb => Right(cb) } } @@ -321,8 +321,8 @@ instance FileSize FileDescriptor { fn seek(fd FileDescriptor, offset Int, whence SeekWhence) Either Errno Int { let FileDescriptor(fd) = fd - return match ffi cider_seek(fd, offset, whence) { - -1 => Left(Errno(ffi cider_errno())) + return match ffi ace_seek(fd, offset, whence) { + -1 => Left(Errno(ffi ace_errno())) offset => Right(offset) } } diff --git a/lib/time.cider b/lib/time.ace similarity index 85% rename from lib/time.cider rename to lib/time.ace index d7d2015c..b1c2e7d6 100644 --- a/lib/time.cider +++ b/lib/time.ace @@ -11,7 +11,7 @@ data TimeDelta { newtype EpochMilliseconds = EpochMilliseconds(Int) -fn time() => EpochMilliseconds(ffi cider_epoch_millis()) +fn time() => EpochMilliseconds(ffi ace_epoch_millis()) instance Str EpochMilliseconds { fn str(e) { diff --git a/lib/trigonometry.cider b/lib/trigonometry.ace similarity index 100% rename from lib/trigonometry.cider rename to lib/trigonometry.ace diff --git a/lib/vector.cider b/lib/vector.ace similarity index 100% rename from lib/vector.cider rename to lib/vector.ace diff --git a/local.vimrc b/local.vimrc index c1aeb4a2..d12b901d 100644 --- a/local.vimrc +++ b/local.vimrc @@ -4,7 +4,7 @@ autocmd FileType cpp vnoremap autocmd FileType c nnoremap :wa :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp, autocmd FileType c inoremap autocmd FileType c vnoremap -nnoremap ` :echom system("./cider-tags\ .") +nnoremap ` :echom system("./ace-tags\ .") autocmd FileType * setlocal makeprg=make\ debug let &path=substitute( diff --git a/play/active_record.cider b/play/active_record.ace similarity index 100% rename from play/active_record.cider rename to play/active_record.ace diff --git a/play/ambiguous.cider b/play/ambiguous.ace similarity index 100% rename from play/ambiguous.cider rename to play/ambiguous.ace diff --git a/play/b.cider b/play/b.ace similarity index 100% rename from play/b.cider rename to play/b.ace diff --git a/play/bare.cider b/play/bare.ace similarity index 100% rename from play/bare.cider rename to play/bare.ace diff --git a/play/bool.cider b/play/bool.ace similarity index 100% rename from play/bool.cider rename to play/bool.ace diff --git a/play/cap.cider b/play/cap.ace similarity index 100% rename from play/cap.cider rename to play/cap.ace diff --git a/play/conway.cider b/play/conway.ace similarity index 98% rename from play/conway.cider rename to play/conway.ace index c90b2fb0..900cbd05 100644 --- a/play/conway.cider +++ b/play/conway.ace @@ -1,6 +1,6 @@ # An implementation of Conway's Game of Life. # Stolen shamelessly from https://golang.org/ in order to -# see how hard it would be to port to Cider. +# see how hard it would be to port to Ace. import random {rand} diff --git a/play/deduce.cider b/play/deduce.ace similarity index 100% rename from play/deduce.cider rename to play/deduce.ace diff --git a/play/g.cider b/play/g.ace similarity index 100% rename from play/g.cider rename to play/g.ace diff --git a/play/generics.cider b/play/generics.ace similarity index 100% rename from play/generics.cider rename to play/generics.ace diff --git a/play/hashing.cider b/play/hashing.ace similarity index 100% rename from play/hashing.cider rename to play/hashing.ace diff --git a/play/hello.cider b/play/hello.ace similarity index 100% rename from play/hello.cider rename to play/hello.ace diff --git a/play/if_var.cider b/play/if_var.ace similarity index 100% rename from play/if_var.cider rename to play/if_var.ace diff --git a/play/lisp.cider b/play/lisp.ace similarity index 100% rename from play/lisp.cider rename to play/lisp.ace diff --git a/play/nested_list.cider b/play/nested_list.ace similarity index 100% rename from play/nested_list.cider rename to play/nested_list.ace diff --git a/play/net.cider b/play/net.ace similarity index 100% rename from play/net.cider rename to play/net.ace diff --git a/play/parse.cider b/play/parse.ace similarity index 100% rename from play/parse.cider rename to play/parse.ace diff --git a/play/patterns.cider b/play/patterns.ace similarity index 100% rename from play/patterns.cider rename to play/patterns.ace diff --git a/play/resolution.cider b/play/resolution.ace similarity index 100% rename from play/resolution.cider rename to play/resolution.ace diff --git a/play/simple.cider b/play/simple.ace similarity index 100% rename from play/simple.cider rename to play/simple.ace diff --git a/play/tree_test.cider b/play/tree_test.ace similarity index 100% rename from play/tree_test.cider rename to play/tree_test.ace diff --git a/play/write_file.cider b/play/write_file.ace similarity index 100% rename from play/write_file.cider rename to play/write_file.ace diff --git a/roadmap.md b/roadmap.md index a4ac86df..0bd0d1f8 100644 --- a/roadmap.md +++ b/roadmap.md @@ -1,6 +1,6 @@ -# Cider Roadmap +# Ace Roadmap -## Language/Compiler (cider) +## Language/Compiler (ace) - [x] (v0.3) global variable initialization - [ ] do notation @@ -14,14 +14,14 @@ - [ ] deriving Ord - [ ] error on unused imports - [ ] allow nested modules (ie: net/http) -- [ ] design/implement some form of [functional dependencies](https://github.com/ciderlang/reference-docs/blob/master/docs/2000-jones-functional-dependencies.pdf) for mptc sanity +- [ ] design/implement some form of [functional dependencies](https://github.com/acelang/reference-docs/blob/master/docs/2000-jones-functional-dependencies.pdf) for mptc sanity - [ ] unused variable check (variables that only appear on lhs) - [ ] higher-kinded type functions to allow for pulling types from other types for the purpose of mapping between types (for example to_with :: Either a b -> WithElseResource resource error) ## Standard Library (lib/std) - [ ] gain consistency around error handling in lib/sys, etc. (Choose between Either Errno () and WithElseResource where it makes sense) -- [ ] option parsing - update lib/argparse.cider +- [ ] option parsing - update lib/argparse.ace - [ ] net/http client - [ ] net/http server - [ ] HTML parser @@ -30,7 +30,7 @@ - [ ] language reference documentation - [ ] example code documentation - [ ] tutorial documentation -- [ ] finalize name (Cider is a codename) +- [ ] finalize name (Ace is a codename) - [ ] homebrew bottling releases - [ ] a debian package - [ ] a package management system (v0.8) @@ -38,7 +38,7 @@ - [ ] onboarding page - tutorial, etc... ## Tooling -- [ ] cider-format tool +- [ ] ace-format tool - [ ] `compile` should build binary, rename existing `compile` phase to `check` ### Performance diff --git a/runtime/cider_rt.c b/runtime/ace_rt.c similarity index 67% rename from runtime/cider_rt.c rename to runtime/ace_rt.c index 9b980f7a..342393e4 100644 --- a/runtime/cider_rt.c +++ b/runtime/ace_rt.c @@ -16,67 +16,67 @@ #include -const char **cider_argv; -int64_t cider_argc; +const char **ace_argv; +int64_t ace_argc; -void cider_init(int argc, const char *argv[]) { +void ace_init(int argc, const char *argv[]) { /* initialize the collector */ GC_INIT(); - cider_argc = argc; - cider_argv = argv; + ace_argc = argc; + ace_argv = argv; /* start mutator ... */ } -int64_t cider_sys_argc() { - return (int64_t)cider_argc; +int64_t ace_sys_argc() { + return (int64_t)ace_argc; } -const char **cider_sys_argv() { - return cider_argv; +const char **ace_sys_argv() { + return ace_argv; } -int64_t cider_errno() { +int64_t ace_errno() { return (int64_t)errno; } -int64_t cider_memcmp(const char *a, const char *b, int64_t len) { +int64_t ace_memcmp(const char *a, const char *b, int64_t len) { return memcmp(a, b, len); } -int64_t cider_open(const char *path, int64_t flags, int64_t mode) { +int64_t ace_open(const char *path, int64_t flags, int64_t mode) { return open(path, flags, mode); } -int64_t cider_seek(int fd, int64_t offset, int64_t whence) { +int64_t ace_seek(int fd, int64_t offset, int64_t whence) { return lseek(fd, offset, whence); } -int64_t cider_creat(const char *path, int64_t mode) { +int64_t ace_creat(const char *path, int64_t mode) { return creat(path, mode); } -int64_t cider_close(int64_t fd) { +int64_t ace_close(int64_t fd) { return close(fd); } -int64_t cider_read(int64_t fd, char *pb, int64_t nbyte) { +int64_t ace_read(int64_t fd, char *pb, int64_t nbyte) { return read(fd, pb, nbyte); } -int64_t cider_write(int64_t fd, char *pb, int64_t nbyte) { +int64_t ace_write(int64_t fd, char *pb, int64_t nbyte) { return write(fd, pb, nbyte); } -int64_t cider_unlink(const char *filename) { +int64_t ace_unlink(const char *filename) { return unlink(filename); } -int64_t cider_socket(int64_t domain, int64_t type, int64_t protocol) { +int64_t ace_socket(int64_t domain, int64_t type, int64_t protocol) { return socket(domain, type, protocol); } -const char *cider_memmem(const char *big, +const char *ace_memmem(const char *big, int64_t big_len, const char *little, int64_t little_len) { @@ -110,7 +110,7 @@ const char *cider_memmem(const char *big, } } -const char *cider_strerror(int errnum, char *buf, int64_t bufsize) { +const char *ace_strerror(int errnum, char *buf, int64_t bufsize) { #ifdef __APPLE__ if (strerror_r(errnum, buf, bufsize) == 0) { return buf; @@ -124,62 +124,62 @@ const char *cider_strerror(int errnum, char *buf, int64_t bufsize) { #endif } -void *cider_malloc(uint64_t cb) { +void *ace_malloc(uint64_t cb) { void *pb = GC_MALLOC(cb); // printf("allocated %" PRId64 " bytes at 0x%08" PRIx64 "\n", cb, // (uint64_t)pb); return pb; } -int64_t cider_strlen(const char *sz) { +int64_t ace_strlen(const char *sz) { return strlen(sz); } -void *cider_print_int64(int64_t x) { +void *ace_print_int64(int64_t x) { printf("%" PRId64 "\n", x); return 0; } -int64_t cider_write_char(int64_t fd, char x) { +int64_t ace_write_char(int64_t fd, char x) { char sz[] = {x}; return write(fd, sz, 1); } -int64_t cider_char_to_int(char ch) { +int64_t ace_char_to_int(char ch) { return (int64_t)ch; } -double cider_itof(int64_t x) { +double ace_itof(int64_t x) { return (double)x; } -char *cider_itoa(int64_t x) { +char *ace_itoa(int64_t x) { char sz[128]; if (snprintf(sz, sizeof(sz), "%" PRId64, x) < 1) { - perror("Failed in cider_itoa"); + perror("Failed in ace_itoa"); exit(1); } return GC_strndup(sz, strlen(sz)); } -const char *cider_dup_free(const char *src) { +const char *ace_dup_free(const char *src) { const char *sz = GC_strndup(src, strlen(src)); free((void *)src); return sz; } -char *cider_ftoa(double x) { +char *ace_ftoa(double x) { char sz[128]; /* IEEE double precision floats have about 15 decimal digits of precision */ // For now, let's use 6. if (snprintf(sz, sizeof(sz), "%.6f", x) < 1) { - perror("Failed in cider_ftoa"); + perror("Failed in ace_ftoa"); exit(1); } return GC_strndup(sz, strlen(sz)); } -double cider_atof(const char *sz, size_t n) { +double ace_atof(const char *sz, size_t n) { char buf[64]; const size_t buf_size = sizeof(buf) / sizeof(buf[0]); size_t byte_count_to_copy = (n >= buf_size ? buf_size - 1 : n); @@ -188,7 +188,7 @@ double cider_atof(const char *sz, size_t n) { return atof(buf); } -int64_t cider_atoi(const char *sz, size_t n) { +int64_t ace_atoi(const char *sz, size_t n) { char buf[64]; const size_t buf_size = sizeof(buf) / sizeof(buf[0]); size_t byte_count_to_copy = (n >= buf_size ? buf_size - 1 : n); @@ -197,21 +197,21 @@ int64_t cider_atoi(const char *sz, size_t n) { return atoll(buf); } -void cider_pass_test() { +void ace_pass_test() { write(1, "PASS\n", 5); } -int64_t cider_puts(char *sz) { +int64_t ace_puts(char *sz) { if (sz == 0) { const char *error = "attempt to puts a null pointer!\n"; - write(1, error, cider_strlen(error)); + write(1, error, ace_strlen(error)); } - write(1, sz, cider_strlen(sz)); + write(1, sz, ace_strlen(sz)); write(1, "\n", 1); return 0; } -int64_t cider_epoch_millis() { +int64_t ace_epoch_millis() { long ms; // Milliseconds time_t s; // Seconds struct timespec spec; @@ -227,6 +227,6 @@ int64_t cider_epoch_millis() { return (int64_t)s * 1000 + ms; } -int64_t cider_hash_combine(uint64_t seed, uint64_t value) { +int64_t ace_hash_combine(uint64_t seed, uint64_t value) { return seed ^ (value + 0x9e3779b97f4a7c15LLU + (seed << 12) + (seed >> 4)); } diff --git a/runtime/cider_sodium.c b/runtime/ace_sodium.c similarity index 84% rename from runtime/cider_sodium.c rename to runtime/ace_sodium.c index 6a894dbb..f660c939 100644 --- a/runtime/cider_sodium.c +++ b/runtime/ace_sodium.c @@ -5,13 +5,13 @@ #include #include -int64_t cider_hash(unsigned char *input, int64_t len) { +int64_t ace_hash(unsigned char *input, int64_t len) { unsigned char hash[crypto_generichash_BYTES_MAX]; int ret = crypto_generichash(hash, sizeof(hash), input, len, NULL, 0); return (*(uint64_t *)hash) & INT64_MAX; } -int64_t cider_hash_int(int64_t x) { +int64_t ace_hash_int(int64_t x) { unsigned char hash[crypto_generichash_BYTES_MAX]; int ret = crypto_generichash(hash, sizeof(hash), (unsigned char *)&x, sizeof(x), NULL, 0); diff --git a/src/cider.h b/src/ace.h similarity index 70% rename from src/cider.h rename to src/ace.h index f828f55d..811d186b 100644 --- a/src/cider.h +++ b/src/ace.h @@ -1,14 +1,14 @@ #pragma once -#include "cider_assert.h" +#include "ace_assert.h" -#define CIDER 1 +#define ACE 1 #define GLOBAL_SCOPE_NAME "std" #define DEFAULT_INT_BITSIZE 64 #define DEFAULT_INT_SIGNED true -#define CIDER_BITSIZE_STR "64" -#define CIDER_TYPEID_BITSIZE_STR "16" +#define ACE_BITSIZE_STR "64" +#define ACE_TYPEID_BITSIZE_STR "16" #define SCOPE_TK tk_dot diff --git a/src/cider_assert.h b/src/ace_assert.h similarity index 97% rename from src/cider_assert.h rename to src/ace_assert.h index a1890980..dc000a22 100644 --- a/src/cider_assert.h +++ b/src/ace_assert.h @@ -17,7 +17,7 @@ void _emit_assert(const char *filename, #define verbose() (getenv("DEBUG") != nullptr) -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG #define assert(x) \ do { \ if (!(x)) { \ @@ -29,7 +29,7 @@ void _emit_assert(const char *filename, #else #define assert(x) ((void)0) #define null_impl() nullptr -#endif // CIDER_DEBUG +#endif // ACE_DEBUG #define not_impl() panic("not yet implemented") @@ -57,7 +57,7 @@ void _emit_assert(const char *filename, } while (0) #endif -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG #define assert_implies(x, y) \ do { \ if (x) \ diff --git a/src/ast.cpp b/src/ast.cpp index 4c213de1..bc4bce43 100644 --- a/src/ast.cpp +++ b/src/ast.cpp @@ -4,9 +4,9 @@ #include "parens.h" #include "ptr.h" #include "tld.h" -#include "cider.h" +#include "ace.h" -std::ostream &operator<<(std::ostream &os, cider::ast::Program *program) { +std::ostream &operator<<(std::ostream &os, ace::ast::Program *program) { os << "program"; const char *delim = "\n"; for (auto decl : program->decls) { @@ -15,16 +15,16 @@ std::ostream &operator<<(std::ostream &os, cider::ast::Program *program) { return os << std::endl; } -std::ostream &operator<<(std::ostream &os, cider::ast::Decl *decl) { +std::ostream &operator<<(std::ostream &os, ace::ast::Decl *decl) { os << decl->id.name << " = "; return decl->value->render(os, 0); } -std::ostream &operator<<(std::ostream &os, cider::ast::Expr *expr) { +std::ostream &operator<<(std::ostream &os, ace::ast::Expr *expr) { return expr->render(os, 0); } -namespace cider { +namespace ace { namespace ast { std::string Expr::str() const { @@ -413,7 +413,7 @@ const Predicate *IrrefutablePredicate::rewrite( types::Ref TypeDecl::get_type() const { std::vector types; -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG std::vector pieces = tld::split_fqn(id.name); assert(isupper(pieces.back()[0])); #endif @@ -585,4 +585,4 @@ tarjan::Vertices get_free_vars( } } -} // namespace cider +} // namespace ace diff --git a/src/ast.h b/src/ast.h index 5b1f12cf..8721bd5b 100644 --- a/src/ast.h +++ b/src/ast.h @@ -13,7 +13,7 @@ #include "token.h" #include "types.h" -namespace cider { +namespace ace { namespace ast { std::string fresh(); @@ -555,8 +555,8 @@ ast::Expr *unit_expr(Location location); tarjan::Vertices get_free_vars( const ast::Expr *expr, const std::unordered_set &bound_vars); -} // namespace cider +} // namespace ace -std::ostream &operator<<(std::ostream &os, cider::ast::Program *program); -std::ostream &operator<<(std::ostream &os, cider::ast::Decl *decl); -std::ostream &operator<<(std::ostream &os, cider::ast::Expr *expr); +std::ostream &operator<<(std::ostream &os, ace::ast::Program *program); +std::ostream &operator<<(std::ostream &os, ace::ast::Decl *decl); +std::ostream &operator<<(std::ostream &os, ace::ast::Expr *expr); diff --git a/src/ast_decls.h b/src/ast_decls.h index a613038e..fd91c0d2 100644 --- a/src/ast_decls.h +++ b/src/ast_decls.h @@ -2,7 +2,7 @@ #include #include -namespace cider { +namespace ace { namespace ast { struct Expr; struct Var; @@ -25,7 +25,7 @@ struct Decl; struct Module; struct Program; } // namespace ast -} // namespace cider +} // namespace ace -std::ostream &operator<<(std::ostream &os, cider::ast::Program *program); -std::ostream &operator<<(std::ostream &os, cider::ast::Decl *decl); +std::ostream &operator<<(std::ostream &os, ace::ast::Program *program); +std::ostream &operator<<(std::ostream &os, ace::ast::Decl *decl); diff --git a/src/builtins.cpp b/src/builtins.cpp index 247ea536..7adc85c7 100644 --- a/src/builtins.cpp +++ b/src/builtins.cpp @@ -2,9 +2,9 @@ #include "tld.h" -std::string ARROW_TYPE_OPERATOR = cider::tld::mktld("std", "->"); -std::string PTR_TYPE_OPERATOR = cider::tld::mktld("std", "Ptr"); -std::string REF_TYPE_OPERATOR = cider::tld::mktld("std", "Ref"); +std::string ARROW_TYPE_OPERATOR = ace::tld::mktld("std", "->"); +std::string PTR_TYPE_OPERATOR = ace::tld::mktld("std", "Ptr"); +std::string REF_TYPE_OPERATOR = ace::tld::mktld("std", "Ref"); std::string CHAR_TYPE = "Char"; std::string INT_TYPE = "Int"; @@ -19,12 +19,12 @@ std::string INT8_TYPE = "Int8"; std::string UINT8_TYPE = "UInt8"; std::string FLOAT_TYPE = "Float"; -std::string BOOL_TYPE = cider::tld::mktld("std", "Bool"); -std::string MAYBE_TYPE = cider::tld::mktld("maybe", "Maybe"); -std::string VECTOR_TYPE = cider::tld::mktld("vector", "Vector"); -std::string MAP_TYPE = cider::tld::mktld("map", "Map"); -std::string SET_TYPE = cider::tld::mktld("set", "Set"); -std::string STRING_TYPE = cider::tld::mktld("string", "String"); +std::string BOOL_TYPE = ace::tld::mktld("std", "Bool"); +std::string MAYBE_TYPE = ace::tld::mktld("maybe", "Maybe"); +std::string VECTOR_TYPE = ace::tld::mktld("vector", "Vector"); +std::string MAP_TYPE = ace::tld::mktld("map", "Map"); +std::string SET_TYPE = ace::tld::mktld("set", "Set"); +std::string STRING_TYPE = ace::tld::mktld("string", "String"); const types::Scheme::Map &get_builtins() { static std::unique_ptr map; diff --git a/src/checked.cpp b/src/checked.cpp index a56c1f5a..b232be29 100644 --- a/src/checked.cpp +++ b/src/checked.cpp @@ -1,6 +1,6 @@ #include "checked.h" -namespace cider { +namespace ace { CheckedDefinition::CheckedDefinition(types::SchemeRef scheme, const ast::Decl *decl, @@ -14,4 +14,4 @@ Location CheckedDefinition::get_location() const { return decl->get_location(); } -} // namespace cider +} // namespace ace diff --git a/src/checked.h b/src/checked.h index 383eb590..8c33f65d 100644 --- a/src/checked.h +++ b/src/checked.h @@ -5,18 +5,18 @@ #include #include -namespace cider { +namespace ace { struct CheckedDefinition; typedef std::shared_ptr CheckedDefinitionRef; typedef std::map> CheckedDefinitionsByName; -} // namespace cider +} // namespace ace #include "ast.h" #include "scheme.h" #include "types.h" -namespace cider { +namespace ace { struct CheckedDefinition { CheckedDefinition(types::SchemeRef scheme, @@ -29,4 +29,4 @@ struct CheckedDefinition { Location get_location() const; }; -} // namespace cider +} // namespace ace diff --git a/src/class_predicate.cpp b/src/class_predicate.cpp index 6a9c436f..9cdf43b4 100644 --- a/src/class_predicate.cpp +++ b/src/class_predicate.cpp @@ -25,7 +25,7 @@ bool ClassPredicateRefEqualTo::operator()(const ClassPredicateRef &lhs, ClassPredicate::ClassPredicate(Identifier classname, const types::Refs ¶ms) : classname(classname), params(params) { - assert(cider::tld::is_tld_type(classname.name)); + assert(ace::tld::is_tld_type(classname.name)); } ClassPredicate::ClassPredicate(Identifier classname, const Identifiers ¶ms) @@ -56,7 +56,7 @@ bool ClassPredicate::operator==(const ClassPredicate &rhs) const { std::string ClassPredicate::repr() const { if (!has_repr_) { std::stringstream ss; - ss << cider::tld::strip_prefix(classname.name); + ss << ace::tld::strip_prefix(classname.name); for (auto ¶m : params) { if (dyncast(param)) { ss << " (" << param->repr() << ")"; @@ -72,7 +72,7 @@ std::string ClassPredicate::repr() const { std::string ClassPredicate::str() const { std::stringstream ss; - ss << C_TYPECLASS << cider::tld::strip_prefix(classname.name) << C_RESET; + ss << C_TYPECLASS << ace::tld::strip_prefix(classname.name) << C_RESET; for (auto ¶m : params) { if (dyncast(param)) { ss << " (" << param->str() << ")"; diff --git a/src/compiler.cpp b/src/compiler.cpp index c127e9a5..47b206c1 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -17,60 +17,60 @@ #include "prefix.h" #include "tld.h" #include "utils.h" -#include "cider.h" +#include "ace.h" -namespace cider { +namespace ace { using namespace ast; -std::string strip_cider_extension(std::string module_name) { - if (ends_with(module_name, ".cider")) { +std::string strip_ace_extension(std::string module_name) { + if (ends_with(module_name, ".ace")) { /* as a courtesy, strip the extension from the filename here */ - return module_name.substr(0, module_name.size() - strlen(".cider")); + return module_name.substr(0, module_name.size() - strlen(".ace")); } else { return module_name; } } -const std::vector &get_cider_paths() { +const std::vector &get_ace_paths() { static bool checked = false; - static std::vector cider_paths; + static std::vector ace_paths; if (!checked) { checked = true; - if (getenv("CIDER_PATH") != nullptr) { - for (auto &path : split(getenv("CIDER_PATH"), ":")) { + if (getenv("ACE_PATH") != nullptr) { + for (auto &path : split(getenv("ACE_PATH"), ":")) { if (path != "") { - /* just be careful that user didn't put in an empty CIDER_PATH */ - cider_paths.push_back(path); + /* just be careful that user didn't put in an empty ACE_PATH */ + ace_paths.push_back(path); } } } else { log(log_error, - "CIDER_PATH is not set. It should be set to the dirname of std.cider. " - "That is typically /usr/local/share/cider/lib."); + "ACE_PATH is not set. It should be set to the dirname of std.ace. " + "That is typically /usr/local/share/ace/lib."); exit(1); } - cider_paths.insert(cider_paths.begin(), "."); - for (auto &cider_path : cider_paths) { + ace_paths.insert(ace_paths.begin(), "."); + for (auto &ace_path : ace_paths) { /* fix any paths to be absolute */ - real_path(cider_path, cider_path); + real_path(ace_path, ace_path); } } - return cider_paths; + return ace_paths; } namespace compiler { void resolve_module_filename_in_path(Location location, - std::string cider_path, + std::string ace_path, std::string leaf_name, std::string name, std::string &working_resolution) { debug_above(2, log("attempting to resolve filename %s in %s", - leaf_name.c_str(), cider_path.c_str())); - auto test_path = cider_path + "/" + leaf_name; + leaf_name.c_str(), ace_path.c_str())); + auto test_path = ace_path + "/" + leaf_name; if (file_exists(test_path)) { std::string test_resolution; if (real_path(test_path, test_resolution)) { @@ -136,8 +136,8 @@ std::string resolve_module_filename(Location location, working_resolution); } - for (auto cider_path : get_cider_paths()) { - resolve_module_filename_in_path(location, cider_path, leaf_name, name, + for (auto ace_path : get_ace_paths()) { + resolve_module_filename_in_path(location, ace_path, leaf_name, name, working_resolution); } @@ -148,8 +148,8 @@ std::string resolve_module_filename(Location location, } else { throw user_error( location, - "module not found: " c_error("`%s`") ". Looked in CIDER_PATH=[%s]", - name.c_str(), join(get_cider_paths(), ":").c_str()); + "module not found: " c_error("`%s`") ". Looked in ACE_PATH=[%s]", + name.c_str(), join(get_ace_paths(), ":").c_str()); return ""; } } @@ -175,7 +175,7 @@ struct GlobalParserState { return module; } std::string module_filename = compiler::resolve_module_filename( - module_id.location, module_id.name, ".cider", reference_path); + module_id.location, module_id.name, ".ace", reference_path); if (auto module = get(modules_map_by_filename, module_filename, static_cast(nullptr))) { return module; @@ -341,7 +341,7 @@ std::shared_ptr merge_compilation( Compilation::ref parse_program( std::string user_program_name, const std::map &builtin_arities) { - std::string program_name = strip_cider_extension( + std::string program_name = strip_ace_extension( leaf_from_file_path(user_program_name)); try { /* first just parse all the modules that are reachable from the initial @@ -377,7 +377,7 @@ Compilation::ref parse_program( gps.symbol_imports, gps.symbol_exports); std::string program_filename = compiler::resolve_module_filename( - INTERNAL_LOC(), user_program_name, ".cider", maybe()); + INTERNAL_LOC(), user_program_name, ".ace", maybe()); return merge_compilation( program_filename, program_name, rewrite_modules(rewriting_imports_rules, gps.modules), gps.comments, @@ -390,4 +390,4 @@ Compilation::ref parse_program( } } // namespace compiler -} // namespace cider +} // namespace ace diff --git a/src/compiler.h b/src/compiler.h index 39f27dab..069ef6cd 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -6,9 +6,9 @@ #include "data_ctors_map.h" #include "location.h" #include "parse_state.h" -#include "cider.h" +#include "ace.h" -namespace cider { +namespace ace { struct Compilation { using ref = std::shared_ptr; Compilation(std::string program_filename, @@ -54,6 +54,6 @@ std::set get_top_level_decls( const std::vector &imports); }; // namespace compiler -std::string strip_cider_extension(std::string module_name); -const std::vector &get_cider_paths(); -} // namespace cider +std::string strip_ace_extension(std::string module_name); +const std::vector &get_ace_paths(); +} // namespace ace diff --git a/src/constraint.cpp b/src/constraint.cpp index 8f091672..a4a87c46 100644 --- a/src/constraint.cpp +++ b/src/constraint.cpp @@ -2,7 +2,7 @@ #include -const bool dbg_show_constraints = std::getenv("CIDER_SHOW_CONSTRAINTS") != +const bool dbg_show_constraints = std::getenv("ACE_SHOW_CONSTRAINTS") != nullptr; namespace types { diff --git a/src/data_ctors_map.cpp b/src/data_ctors_map.cpp index c5fb9e69..54882a4a 100644 --- a/src/data_ctors_map.cpp +++ b/src/data_ctors_map.cpp @@ -9,7 +9,7 @@ #include "tld.h" #include "user_error.h" -namespace cider { +namespace ace { types::Ref get_data_ctor_type(const DataCtorsMap &data_ctors_map, types::Ref type, @@ -141,9 +141,9 @@ types::Ref get_fresh_data_ctor_type(const DataCtorsMap &data_ctors_map, throw error; } -} // namespace cider +} // namespace ace -std::string str(const cider::DataCtorsMap &data_ctors_map) { +std::string str(const ace::DataCtorsMap &data_ctors_map) { std::stringstream ss; const char *delim = ""; for (auto pair : data_ctors_map.data_ctors_type_map) { diff --git a/src/data_ctors_map.h b/src/data_ctors_map.h index 34a121ec..954ecaa6 100644 --- a/src/data_ctors_map.h +++ b/src/data_ctors_map.h @@ -3,7 +3,7 @@ #include "identifier.h" #include "types.h" -namespace cider { +namespace ace { typedef std::map ParsedDataCtorsMap; typedef std::unordered_map ParsedCtorIdMap; @@ -25,6 +25,6 @@ int get_ctor_id(Location location, types::Ref get_fresh_data_ctor_type(const DataCtorsMap &data_ctors_map, Identifier ctor_id); -} // namespace cider +} // namespace ace -std::string str(const cider::DataCtorsMap &data_ctors_map); +std::string str(const ace::DataCtorsMap &data_ctors_map); diff --git a/src/dbg.cpp b/src/dbg.cpp index 33136853..54613f2e 100644 --- a/src/dbg.cpp +++ b/src/dbg.cpp @@ -43,7 +43,7 @@ DepthGuard::DepthGuard(Location location, int &depth, int max_depth) : depth(depth) { ++depth; if (!__depth_level_override && (depth > max_depth)) { - throw cider::user_error(location, "maximum recursion depth reached"); + throw ace::user_error(location, "maximum recursion depth reached"); } } @@ -56,7 +56,7 @@ bool AmIBeingDebugged(void) // Returns true if the current process is being debugged (either // running under the debugger or has a debugger attached post facto). { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG int junk; #endif int mib[4]; @@ -79,7 +79,7 @@ bool AmIBeingDebugged(void) // Call sysctl. size = sizeof(info); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG junk = #endif sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0); diff --git a/src/dbg.h b/src/dbg.h index 0e399907..937ce223 100644 --- a/src/dbg.h +++ b/src/dbg.h @@ -9,7 +9,7 @@ bool AmIBeingDebugged(); #else // TODO: find ways of detecting this on other platforms -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG #define AmIBeingDebugged() true #else #define AmIBeingDebugged() false @@ -70,7 +70,7 @@ extern int __dbg_level; DEBUG_BREAK(); \ } while (0) -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG #define dbg_when(x) \ if (x) { \ fprintf(stderr, \ @@ -89,7 +89,7 @@ extern int __dbg_level; #define wat() panic("wat is this branch doing?") -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG #define debug(x) ((x)) #define debug_else(x, y) ((x)) #define debug_above(level, x) \ diff --git a/src/disk.cpp b/src/disk.cpp index d9f4bbab..8851c8c0 100644 --- a/src/disk.cpp +++ b/src/disk.cpp @@ -24,7 +24,7 @@ #include "dbg.h" #include "logger_decls.h" #include "utils.h" -#include "cider.h" +#include "ace.h" bool file_exists(const std::string &file_path) { errno = 0; diff --git a/src/gen.cpp b/src/gen.cpp index db9f9ead..6e5de8d4 100644 --- a/src/gen.cpp +++ b/src/gen.cpp @@ -14,7 +14,7 @@ assert(false); \ } while (0) -namespace cider { +namespace ace { namespace gen { @@ -129,7 +129,7 @@ struct FreeVars { } }; -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG static types::Ref get_nth_type_in_lambda_type(types::Ref arrow_type, int n) { return unfold_arrows(arrow_type)[n]; } @@ -150,7 +150,7 @@ void get_free_vars(const ast::Expr *expr, } else if (auto lambda = dcast(expr)) { debug_above(5, log("checking lambda %s", lambda->str().c_str())); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG auto lambda_type = typing.at(lambda); std::vector already_has_lambda_vars; int i = 0; @@ -168,7 +168,7 @@ void get_free_vars(const ast::Expr *expr, } get_free_vars(lambda->body, typing, new_globals, {}, free_vars); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG /* we should never be adding a bound variable name to the closure if it is * being overwritten at a lower scope prior to capture */ i = 0; @@ -300,7 +300,7 @@ llvm::Value *get_env_var(llvm::IRBuilder<> &builder, throw error; } -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG debug_above(5, log("get_env_var(%s, %s) -> %s", id.str().c_str(), type->str().c_str(), llvm_print(llvm_value).c_str())); if (auto arg = llvm::dyn_cast(llvm_value)) { @@ -609,7 +609,7 @@ llvm::Value *gen_builtin(llvm::IRBuilder<> &builder, auto llvm_func_decl = llvm::cast( llvm_module ->getOrInsertFunction( - "cider_pass_test", + "ace_pass_test", llvm::FunctionType::get(builder.getInt8Ty()->getPointerTo(), llvm::ArrayRef(), false /*isVarArg*/)) @@ -626,7 +626,7 @@ llvm::Value *gen_builtin(llvm::IRBuilder<> &builder, auto llvm_print_int_func_decl = llvm::cast( llvm_module ->getOrInsertFunction( - "cider_print_int64", + "ace_print_int64", llvm::FunctionType::get( builder.getInt8Ty()->getPointerTo(), llvm::ArrayRef(print_int_terms), @@ -643,7 +643,7 @@ llvm::Value *gen_builtin(llvm::IRBuilder<> &builder, auto func_decl = llvm::cast( llvm_module ->getOrInsertFunction( - "cider_ftoa", + "ace_ftoa", llvm::FunctionType::get(builder.getInt8Ty()->getPointerTo(), llvm::ArrayRef(terms), false /*isVarArg*/)) @@ -658,7 +658,7 @@ llvm::Value *gen_builtin(llvm::IRBuilder<> &builder, auto ffi_function = llvm::cast( llvm_module - ->getOrInsertFunction("cider_malloc", + ->getOrInsertFunction("ace_malloc", llvm::FunctionType::get( builder.getInt8Ty()->getPointerTo(), llvm::ArrayRef(param_types), @@ -749,7 +749,7 @@ llvm::Value *gen_builtin(llvm::IRBuilder<> &builder, // libc dependency auto llvm_write_func_decl = llvm::cast( llvm_module - ->getOrInsertFunction("cider_puts", + ->getOrInsertFunction("ace_puts", llvm::FunctionType::get( builder.getInt64Ty(), llvm::ArrayRef(write_terms), @@ -848,7 +848,7 @@ void gen_lambda(std::string name, llvm::StructType *llvm_closure_type = llvm::StructType::get( llvm_function->getType(), builder.getInt8Ty()->getPointerTo()); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG auto _llvm_closure_type = get_llvm_closure_type(builder, type_env, type_terms); debug_above( @@ -978,7 +978,7 @@ ResolutionStatus gen_literal(std::string name, return rs_resolve_again; } else if (type_equality(type, type_id(make_iid(INT_TYPE)))) { int64_t value = parse_int_value(token); - auto llvm_value = builder.getCiderInt(value); + auto llvm_value = builder.getAceInt(value); if (publisher != nullptr) { publisher->publish(llvm_value); } @@ -1195,7 +1195,7 @@ ResolutionStatus gen(std::string name, string_format("phi%s{%s}", tag.c_str(), condition->get_location().repr().c_str()), merge_block); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG phi_node->setName(string_format("phi::%s", type->repr().c_str())); #endif phi_node->addIncoming(truthy_value, builder.GetInsertBlock()); @@ -1222,7 +1222,7 @@ ResolutionStatus gen(std::string name, string_format("phi%s{%s}", tag.c_str(), condition->get_location().repr().c_str()), merge_block); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG phi_node->setName(string_format("phi::%s", type->repr().c_str())); #endif } @@ -1314,7 +1314,7 @@ ResolutionStatus gen(std::string name, llvm_value = llvm::Constant::getNullValue( builder.getInt8Ty()->getPointerTo()); } -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (auto llvm_inst = llvm::dyn_cast(llvm_value)) { if (llvm_inst->getParent()->getParent() != llvm_get_function(builder)) { /* there seems to be an attempt to load an instruction value from @@ -1438,4 +1438,4 @@ ResolutionStatus gen(std::string name, } // namespace gen -} // namespace cider +} // namespace ace diff --git a/src/gen.h b/src/gen.h index 7f8bd9ea..fa83f3c9 100644 --- a/src/gen.h +++ b/src/gen.h @@ -8,7 +8,7 @@ #include "unification.h" #include "user_error.h" -namespace cider { +namespace ace { namespace gen { @@ -48,4 +48,4 @@ ResolutionStatus gen(std::string name, Publisher *publisher); } // namespace gen -} // namespace cider +} // namespace ace diff --git a/src/graph.cpp b/src/graph.cpp index e4094ed1..16b0909b 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -5,7 +5,7 @@ #include "tld.h" #include "user_error.h" -namespace cider { +namespace ace { namespace graph { void dfs(FILE *fp, std::string node, @@ -45,7 +45,7 @@ void emit_graphviz_dot(const tarjan::Graph &graph, std::string filename) { FILE *fp = fopen(filename.c_str(), "wt"); if (fp == nullptr) { - throw cider::user_error(INTERNAL_LOC(), + throw ace::user_error(INTERNAL_LOC(), "unable to open %s for writing DOT_DEPS", filename.c_str()); } @@ -76,4 +76,4 @@ void emit_graphviz_dot(const tarjan::Graph &graph, } } // namespace graph -} // namespace cider +} // namespace ace diff --git a/src/graph.h b/src/graph.h index 316061d0..36abc853 100644 --- a/src/graph.h +++ b/src/graph.h @@ -4,11 +4,11 @@ #include "tarjan.h" -namespace cider { +namespace ace { namespace graph { void emit_graphviz_dot(const tarjan::Graph &graph, const tarjan::SCCs &sccs, std::string entry_point, std::string filename); } -} // namespace cider +} // namespace ace diff --git a/src/host.cpp b/src/host.cpp index f0f651a4..0b6a5b49 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -9,7 +9,7 @@ #include "user_error.h" -namespace cider { +namespace ace { namespace { std::unordered_map host_values; @@ -236,4 +236,4 @@ int get_host_int(Location location, std::string name) { return host_values.at(name); } -} // namespace cider +} // namespace ace diff --git a/src/host.h b/src/host.h index 0615e52e..7047e31b 100644 --- a/src/host.h +++ b/src/host.h @@ -4,9 +4,9 @@ #include "location.h" -namespace cider { +namespace ace { void init_host(); int get_host_int(Location location, std::string name); -} // namespace cider +} // namespace ace diff --git a/src/identifier.cpp b/src/identifier.cpp index e01955eb..ba716f4a 100644 --- a/src/identifier.cpp +++ b/src/identifier.cpp @@ -5,11 +5,11 @@ #include "dbg.h" #include "tld.h" #include "user_error.h" -#include "cider.h" +#include "ace.h" Identifier::Identifier(const std::string &name, Location location) : name(name), location(location) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG assert(name.size() != 0); for (auto ch : name) { assert(!iscntrl(ch)); @@ -37,16 +37,16 @@ std::set to_atom_set(const Identifiers &refs) { return set; } -cider::Token Identifier::get_token() const { - return cider::Token{location, cider::tk_identifier, name}; +ace::Token Identifier::get_token() const { + return ace::Token{location, ace::tk_identifier, name}; } std::string Identifier::str() const { - return string_format(c_id("%s"), cider::tld::strip_prefix(name).c_str()); + return string_format(c_id("%s"), ace::tld::strip_prefix(name).c_str()); } -Identifier Identifier::from_token(cider::Token token) { - assert(token.tk == cider::tk_identifier || token.tk == cider::tk_operator); +Identifier Identifier::from_token(ace::Token token) { + assert(token.tk == ace::tk_identifier || token.tk == ace::tk_operator); return Identifier{token.text, token.location}; } diff --git a/src/identifier.h b/src/identifier.h index f7c00c81..4b2edd6b 100644 --- a/src/identifier.h +++ b/src/identifier.h @@ -16,8 +16,8 @@ struct Identifier { std::string name; Location location; - static Identifier from_token(cider::Token token); - cider::Token get_token() const; + static Identifier from_token(ace::Token token); + ace::Token get_token() const; std::string str() const; bool operator<(const Identifier &rhs) const; diff --git a/src/import_rules.cpp b/src/import_rules.cpp index 9457b868..51eff1bc 100644 --- a/src/import_rules.cpp +++ b/src/import_rules.cpp @@ -4,7 +4,7 @@ #include "tld.h" #include "user_error.h" -namespace cider { +namespace ace { RewriteImportRules solve_rewriting_imports( const parser::SymbolImports &symbol_imports, @@ -12,7 +12,7 @@ RewriteImportRules solve_rewriting_imports( std::map graph; std::set legal_exports; -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG for (auto &module_pair : symbol_imports) { for (auto &pair_ids : module_pair.second) { debug_above(3, log("import: " c_module("%s") " imports from " c_module( @@ -24,10 +24,10 @@ RewriteImportRules solve_rewriting_imports( #endif if (getenv("DOT_DEPS") != nullptr) { - std::string filename = "cider.dot"; + std::string filename = "ace.dot"; FILE *fp = fopen(filename.c_str(), "wt"); if (fp == nullptr) { - throw cider::user_error(INTERNAL_LOC(), + throw ace::user_error(INTERNAL_LOC(), "unable to open %s for writing DOT_DEPS", filename.c_str()); } @@ -194,7 +194,7 @@ const types::Refs rewrite_types(const RewriteImportRules &rewrite_import_rules, namespace { -using namespace ::cider::ast; +using namespace ::ace::ast; std::vector rewrite_exprs( const RewriteImportRules &rewrite_import_rules, @@ -474,4 +474,4 @@ std::vector rewrite_modules( return new_modules; } -} // namespace cider +} // namespace ace diff --git a/src/import_rules.h b/src/import_rules.h index 39410ed6..ffc73efd 100644 --- a/src/import_rules.h +++ b/src/import_rules.h @@ -8,7 +8,7 @@ #include "identifier.h" #include "parse_state.h" -namespace cider { +namespace ace { typedef std::map RewriteImportRules; @@ -29,4 +29,4 @@ Identifier rewrite_identifier(const RewriteImportRules &rewrite_import_rules, const types::Refs rewrite_types(const RewriteImportRules &rewrite_import_rules, types::Refs types); -} // namespace cider +} // namespace ace diff --git a/src/infer.cpp b/src/infer.cpp index a4b0e84a..611b34b9 100644 --- a/src/infer.cpp +++ b/src/infer.cpp @@ -7,7 +7,7 @@ #include "unification.h" #include "user_error.h" -namespace cider { +namespace ace { using namespace ast; @@ -433,4 +433,4 @@ types::Ref CtorPredicate::tracking_infer( return ctor_terms.back(); } -} // namespace cider +} // namespace ace diff --git a/src/infer.h b/src/infer.h index 92cb81f2..b355fad5 100644 --- a/src/infer.h +++ b/src/infer.h @@ -7,7 +7,7 @@ #include "scheme_resolver.h" #include "tracked_types.h" -namespace cider { +namespace ace { types::Ref infer(const ast::Expr *expr, const DataCtorsMap &data_ctors_map, const types::Ref &return_type, @@ -15,4 +15,4 @@ types::Ref infer(const ast::Expr *expr, TrackedTypes &tracked_types, types::Constraints &constraints, types::ClassPredicates &instance_requirements); -} // namespace cider +} // namespace ace diff --git a/src/lexer.cpp b/src/lexer.cpp index 8dd3f948..e575ccf5 100644 --- a/src/lexer.cpp +++ b/src/lexer.cpp @@ -9,9 +9,9 @@ #include "logger_decls.h" #include "user_error.h" #include "utils.h" -#include "cider.h" +#include "ace.h" -namespace cider { +namespace ace { Lexer::Lexer(std::string filename, std::istream &sock_is) : m_filename(filename), m_is(sock_is) { @@ -640,7 +640,7 @@ bool Lexer::_get_tokens() { } if (scan_ahead && gts != gts_error) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG char ch_old = ch; #endif m_is.get(ch); @@ -717,4 +717,4 @@ void Lexer::pop_nested(TokenKind tk) { Lexer::~Lexer() { } -} // namespace cider +} // namespace ace diff --git a/src/lexer.h b/src/lexer.h index c74b6c65..8d8d7cf0 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -8,7 +8,7 @@ #define debug_lexer(x) #endif -namespace cider { +namespace ace { struct token_pair { TokenKind tk; @@ -37,4 +37,4 @@ class Lexer { TokenQueue m_token_queue; }; -} // namespace cider +} // namespace ace diff --git a/src/link_ins.cpp b/src/link_ins.cpp index a7f99834..a3f7ce8e 100644 --- a/src/link_ins.cpp +++ b/src/link_ins.cpp @@ -4,7 +4,7 @@ #include "user_error.h" -namespace cider { +namespace ace { LinkIn::LinkIn(const LinkIn &link_in) : lit(link_in.lit), name(link_in.name) { } @@ -27,4 +27,4 @@ bool LinkIn::operator<(const LinkIn &rhs) const { return lit < rhs.lit || name < rhs.name; } -} // namespace cider +} // namespace ace diff --git a/src/link_ins.h b/src/link_ins.h index f098ad04..4606f9b6 100644 --- a/src/link_ins.h +++ b/src/link_ins.h @@ -3,7 +3,7 @@ #include "token.h" -namespace cider { +namespace ace { enum LinkInType { lit_pkgconfig, @@ -21,4 +21,4 @@ struct LinkIn { bool operator<(const LinkIn &) const; }; -} // namespace cider +} // namespace ace diff --git a/src/llvm_cider.h b/src/llvm_ace.h similarity index 93% rename from src/llvm_cider.h rename to src/llvm_ace.h index 694a819c..4f8e6956 100644 --- a/src/llvm_cider.h +++ b/src/llvm_ace.h @@ -33,7 +33,7 @@ #include #include -#define getCiderIntTy getInt64Ty -#define getCiderInt getInt64 +#define getAceIntTy getInt64Ty +#define getAceInt getInt64 -#include "cider_assert.h" +#include "ace_assert.h" diff --git a/src/llvm_utils.cpp b/src/llvm_utils.cpp index 16986522..feb5eace 100644 --- a/src/llvm_utils.cpp +++ b/src/llvm_utils.cpp @@ -8,7 +8,7 @@ #include "logger.h" #include "utils.h" -namespace cider { +namespace ace { llvm::Value *llvm_create_global_string(llvm::IRBuilder<> &builder, std::string value) { @@ -50,7 +50,7 @@ llvm::Value *llvm_create_bool(llvm::IRBuilder<> &builder, bool value) { } llvm::ConstantInt *llvm_create_int(llvm::IRBuilder<> &builder, int64_t value) { - return builder.getCiderInt(value); + return builder.getAceInt(value); } llvm::ConstantInt *llvm_create_int16(llvm::IRBuilder<> &builder, @@ -246,7 +246,7 @@ llvm::AllocaInst *llvm_create_entry_block_alloca(llvm::Function *llvm_function, var_name.c_str()); } -llvm::Value *llvm_cider_bool_to_i1(llvm::IRBuilder<> &builder, +llvm::Value *llvm_ace_bool_to_i1(llvm::IRBuilder<> &builder, llvm::Value *llvm_value) { if (llvm_value->getType()->isIntegerTy(1)) { return llvm_value; @@ -268,7 +268,7 @@ void llvm_create_if_branch(llvm::IRBuilder<> &builder, llvm::BasicBlock *else_bb) { /* the job of this function is to derive a value from the input value that is * a valid input to a branch instruction */ - builder.CreateCondBr(llvm_cider_bool_to_i1(builder, llvm_value), then_bb, + builder.CreateCondBr(llvm_ace_bool_to_i1(builder, llvm_value), then_bb, else_bb); } @@ -332,7 +332,7 @@ llvm::StructType *llvm_create_struct_type( } void llvm_verify_function(Location location, llvm::Function *llvm_function) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG debug_above(5, log("writing to function-verification-failure.ll...")); std::string llir_filename = "function-verification-failure.ll"; #if 0 @@ -389,7 +389,7 @@ llvm::Constant *llvm_sizeof_type(llvm::IRBuilder<> &builder, llvm::Constant *alloc_size_const = llvm::ConstantExpr::getSizeOf(llvm_type); llvm::Constant *size_value = llvm::ConstantExpr::getTruncOrBitCast( alloc_size_const, builder.getInt64Ty()); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG size_value->setName("size_value"); #endif debug_above(3, @@ -549,7 +549,7 @@ llvm::Type *get_llvm_type_(llvm::IRBuilder<> &builder, if (name == CHAR_TYPE) { return builder.getInt8Ty(); } else if (name == INT_TYPE) { - return builder.getCiderIntTy(); + return builder.getAceIntTy(); } else if (name == FLOAT_TYPE) { return builder.getDoubleTy(); } else { @@ -675,7 +675,7 @@ llvm::Value *llvm_tuple_alloc(llvm::IRBuilder<> &builder, auto llvm_alloc_func_decl = llvm::cast( llvm_module ->getOrInsertFunction( - "cider_malloc", + "ace_malloc", llvm::FunctionType::get(builder.getInt8Ty()->getPointerTo(), alloc_terms, false /*isVarArg*/)) .getCallee()); @@ -684,7 +684,7 @@ llvm::Value *llvm_tuple_alloc(llvm::IRBuilder<> &builder, std::vector{ llvm_sizeof_type(builder, llvm_tuple_type)}), llvm_tuple_type->getPointerTo()); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG llvm_allocated_tuple->setName( string_format("tuple/%d", int(llvm_dims.size()))); #endif @@ -705,7 +705,7 @@ llvm::Value *llvm_tuple_alloc(llvm::IRBuilder<> &builder, llvm_print(llvm_allocated_tuple->getType()).c_str(), i)); llvm::Value *llvm_member_address = builder.CreateInBoundsGEP( llvm_tuple_type, llvm_allocated_tuple, llvm_gep_args); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG llvm_member_address->setName( string_format("&tuple/%d[%d]", int(llvm_dims.size()), i)); #endif @@ -728,7 +728,7 @@ void destructure_closure(llvm::IRBuilder<> &builder, llvm::Value *closure, llvm::Value **llvm_function, llvm::Value **llvm_closure_env) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG assert(closure->getType()->isPointerTy()); auto inner_type = closure->getType()->getPointerElementType(); auto struct_type = llvm::dyn_cast(inner_type); @@ -760,7 +760,7 @@ void destructure_closure(llvm::IRBuilder<> &builder, if (llvm_function != nullptr) { *llvm_function = builder.CreateLoad(builder.CreateInBoundsGEP( closure, llvm::ArrayRef(gep_function_path))); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (llvm_function_type != (*llvm_function)->getType()->getPointerElementType()) { log("why does %s != %s", llvm_print(llvm_function_type).c_str(), @@ -795,11 +795,11 @@ llvm::Value *llvm_create_closure_callsite(Location location, llvm_print(args[1]->getType()).c_str())); auto callee = llvm::FunctionCallee(llvm_function_type, llvm_function_to_call); return builder.CreateCall(callee, llvm::ArrayRef(args) -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG , string_format("call{%s}", location.repr().c_str()) #endif ); } -} // namespace cider +} // namespace ace diff --git a/src/llvm_utils.h b/src/llvm_utils.h index a9ded48a..fa4cc02d 100644 --- a/src/llvm_utils.h +++ b/src/llvm_utils.h @@ -1,9 +1,9 @@ #pragma once -#include "llvm_cider.h" +#include "llvm_ace.h" #include "types.h" -#include "cider.h" +#include "ace.h" -namespace cider { +namespace ace { llvm::Constant *llvm_create_struct_instance( std::string var_name, @@ -36,7 +36,7 @@ llvm::Type *get_llvm_type(llvm::IRBuilder<> &builder, llvm::Value *llvm_create_bool(llvm::IRBuilder<> &builder, bool value); llvm::ConstantInt *llvm_create_int(llvm::IRBuilder<> &builder, int64_t value); llvm::ConstantInt *llvm_create_int32(llvm::IRBuilder<> &builder, int32_t value); -llvm::Value *llvm_cider_bool_to_i1(llvm::IRBuilder<> &builder, +llvm::Value *llvm_ace_bool_to_i1(llvm::IRBuilder<> &builder, llvm::Value *llvm_value); llvm::Value *llvm_create_double(llvm::IRBuilder<> &builder, double value); llvm::GlobalVariable *llvm_get_global(llvm::Module *llvm_module, @@ -146,4 +146,4 @@ llvm::Value *llvm_create_closure_callsite(Location location, llvm::FunctionType *llvm_function_type, std::vector args); -} // namespace cider +} // namespace ace diff --git a/src/location.cpp b/src/location.cpp index 458ce55a..1d065014 100644 --- a/src/location.cpp +++ b/src/location.cpp @@ -7,7 +7,7 @@ #include "dbg.h" #include "utils.h" -#include "cider.h" +#include "ace.h" Location::Location() : Location({}, -1, -1) { } diff --git a/src/logger.h b/src/logger.h index 04f8840c..a5623b6b 100644 --- a/src/logger.h +++ b/src/logger.h @@ -8,7 +8,7 @@ #include "logger_decls.h" #include "utils.h" -#include "cider.h" +#include "ace.h" const char *logstr(LogLevel ll); void time_now(std::ostream &os, bool exact, bool for_humans); @@ -110,7 +110,7 @@ struct indent_logger : logger { logger *logger_old; }; -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG #define INDENT(level, message) \ indent_logger _indent(INTERNAL_LOC(), level, \ debug_above_else(level, message, "")) diff --git a/src/main.cpp b/src/main.cpp index 76dd0d01..034cf0e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,14 +36,14 @@ const char *LOGO = C_UNCHECKED R"( )" C_RESET; -namespace cider { +namespace ace { using namespace ast; namespace { bool get_help = false; -bool fast_fail = true && (getenv("CIDER_SHOW_ALL_ERRORS") == nullptr); +bool fast_fail = true && (getenv("ACE_SHOW_ALL_ERRORS") == nullptr); bool debug_compiled_env = getenv("SHOW_ENV") != nullptr; bool debug_compile_step = getenv("SHOW_CC") != nullptr; bool debug_specialized_env = getenv("SHOW_ENV2") != nullptr; @@ -109,7 +109,7 @@ types::Map resolve_free_type_after_specialization_inference( const types::ClassPredicates &instance_requirements, const types::ClassPredicates &instance_predicates) { if (type->ftv_count() != 0) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG INDENT(2, "--resolve_free_type_after_specialization_inference--"); debug_above(7, log_location(expr->get_location(), "rftasi ::: %s :: %s", expr->str().c_str(), type->str().c_str())); @@ -225,7 +225,7 @@ CheckedDefinitionRef check_decl( make_context(expected_type->get_location(), "declaration %s has its expected type", id.str().c_str())); - types::Map bindings = cider::solver( + types::Map bindings = ace::solver( check_constraint_coverage, make_context(id.location, "solving %s :: %s", id.name.c_str(), ty->str().c_str()), @@ -364,13 +364,13 @@ tarjan::Graph build_program_graph(const std::vector &decls) { const auto &name = decl->id.name; const auto free_vars = get_free_vars(decl->value, {}); for (auto free_var : free_vars) { - if (!cider::tld::is_fqn(free_var)) { + if (!ace::tld::is_fqn(free_var)) { throw user_error(decl->id.location, "found free_var \"%s\" that is not fully qualified " "within %s (TODO: extract free variable locations, " "not just the containing function's location)", free_var.c_str(), - cider::tld::strip_prefix(name).c_str()); + ace::tld::strip_prefix(name).c_str()); } } graph.insert({name, free_vars}); @@ -396,7 +396,7 @@ CheckedDefinitionsByName check_decls(std::string user_program_name, debug_above(5, log("found program ordering %s", str(sccs).c_str())); if (emit_graph_dot) { auto dot_file = user_program_name + ".dot"; - cider::graph::emit_graphviz_dot(graph, sccs, entry_point_name, dot_file); + ace::graph::emit_graphviz_dot(graph, sccs, entry_point_name, dot_file); auto png_file = dot_file + ".png"; auto dot_cmd = "dot " + dot_file + " -Tpng -Gdpi=1000 -o " + png_file; if (system(dot_cmd.c_str())) { @@ -420,7 +420,7 @@ CheckedDefinitionsByName check_decls(std::string user_program_name, local_scheme_resolver.insert_scheme( name, scheme(decl_map.at(name)->get_location(), {}, {}, map[name])); } else { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (debug_level() > 2) { log("found a reference to " c_id("%s") " in SCCs that has no decl", name.c_str()); @@ -477,13 +477,13 @@ CheckedDefinitionsByName check_decls(std::string user_program_name, log("%s", str(constraints).c_str()); } - types::Map bindings = cider::solver(false /*check_constraint_coverage*/, + types::Map bindings = ace::solver(false /*check_constraint_coverage*/, make_context(INTERNAL_LOC(), "solving"), constraints, tracked_types, scheme_resolver, instance_requirements); rebind_tracked_types(tracked_types, bindings); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (debug_all_expr_types) { log("Rebound Expression Types for {%s}", join(scc, ", ").c_str()); for (auto pair : tracked_types) { @@ -542,7 +542,7 @@ const Decl *find_overload_for_instance(std::string name, } } throw user_error(location, "could not find decl for %s in instance %s", - cider::tld::strip_prefix(name).c_str(), + ace::tld::strip_prefix(name).c_str(), instance->class_predicate->str().c_str()); } @@ -690,7 +690,7 @@ void check_instances( auto error = user_error(instance->class_predicate->get_location(), "could not find type class for instance %s", instance->class_predicate->str().c_str()); - auto leaf_name = cider::tld::split_fqn( + auto leaf_name = ace::tld::split_fqn( instance->class_predicate->classname.name) .back(); for (auto type_class_pair : type_class_map) { @@ -774,7 +774,7 @@ CheckedDefinitionRef specialize_checked_defn( if (checked_defn_to_specialize == nullptr) { auto error = user_error( location, "could not find a definition for " c_id("%s") " :: %s", - cider::tld::strip_prefix(name).c_str(), type->str().c_str()); + ace::tld::strip_prefix(name).c_str(), type->str().c_str()); for (auto checked_defn : checked_defns_non_matching) { error.add_info(checked_defn->get_location(), "%s :: %s did not match", checked_defn->decl->str().c_str(), @@ -870,7 +870,7 @@ Phase2 compile(std::string user_program_name_, bool emit_graph_dot) { scheme_resolver); /* start resolving more schemes */ CheckedDefinitionsByName checked_defns = check_decls( - user_program_name_, cider::tld::mktld(compilation->program_name, "main"), + user_program_name_, ace::tld::mktld(compilation->program_name, "main"), program->decls, compilation->data_ctors_map, scheme_resolver, emit_graph_dot); @@ -902,7 +902,7 @@ void specialize_core(const types::TypeEnv &type_env, /* expected type schemes for specializations can have unresolved type * variables. That indicates that an input to the function is irrelevant to - * the output. However, since Cider is eagerly evaluated and permits impure + * the output. However, since Ace is eagerly evaluated and permits impure * side effects, it may not be irrelevant to the overall program's * semantics, so terms with ambiguous types cannot be thrown out altogether. */ @@ -973,7 +973,7 @@ void specialize_core(const types::TypeEnv &type_env, std::unordered_set bound_vars; INDENT(1, string_format("----------- specialize %s ------------", defn_id.str().c_str())); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG for (auto pair : tracked_types) { const ast::Expr *expr; types::Ref type; @@ -1024,13 +1024,13 @@ Phase3 specialize(const Phase2 &phase_2) { if (user_error::errors_occurred()) { throw user_error(INTERNAL_LOC(), "quitting"); } - std::string entry_point_name = cider::tld::mktld( + std::string entry_point_name = ace::tld::mktld( phase_2.compilation->program_name, "main"); if (phase_2.checked_defns.count(entry_point_name) == 0) { auto error = user_error( Location{phase_2.compilation->program_filename, 1, 1}, "could not find a definition for %s", - cider::tld::strip_prefix(entry_point_name).c_str()); + ace::tld::strip_prefix(entry_point_name).c_str()); for (auto pair : phase_2.checked_defns) { if (pair.first.find(entry_point_name) != std::string::npos) { for (auto checked_def : pair.second) { @@ -1158,17 +1158,17 @@ llvm::Function *build_main_function(llvm::IRBuilder<> &builder, builder.SetInsertPoint(entry_block); // Initialize the process - auto llvm_cider_init_func_decl = llvm::cast( + auto llvm_ace_init_func_decl = llvm::cast( llvm_module - ->getOrInsertFunction("cider_init", llvm_main_function_type(builder)) + ->getOrInsertFunction("ace_init", llvm_main_function_type(builder)) .getCallee()); auto arg_iter = llvm_function->args().begin(); llvm::Value *llvm_argc = *&arg_iter; ++arg_iter; llvm::Value *llvm_argv = *&arg_iter; - std::vector cider_main_args{llvm_argc, llvm_argv}; - builder.CreateCall(llvm_cider_init_func_decl, - llvm::ArrayRef(cider_main_args)); + std::vector ace_main_args{llvm_argc, llvm_argv}; + builder.CreateCall(llvm_ace_init_func_decl, + llvm::ArrayRef(ace_main_args)); llvm::IRBuilderBase::InsertPointGuard ipg(builder); @@ -1188,7 +1188,7 @@ void write_main_block(llvm::IRBuilder<> &builder, std::string main_closure, llvm::Function *llvm_function) { builder.SetInsertPoint( - cider::llvm_find_block_by_name(llvm_function, MAIN_PROGRAM_BLOCK)); + ace::llvm_find_block_by_name(llvm_function, MAIN_PROGRAM_BLOCK)); llvm::Value *llvm_main_closure = gen::get_env_var( builder, gen_env, make_iid(main_closure), main_closure_type()); @@ -1224,7 +1224,7 @@ Phase4 ssa_gen(llvm::LLVMContext &context, const Phase3 &phase_3) { llvm::Function *llvm_main_function = build_main_function( builder, llvm_module, gen_env, program_name); - const std::string main_closure = cider::tld::mktld(program_name, "main"); + const std::string main_closure = ace::tld::mktld(program_name, "main"); debug_above(6, log("globals are %s", join(globals).c_str())); debug_above(2, log("type_env is %s", @@ -1253,7 +1253,7 @@ Phase4 ssa_gen(llvm::LLVMContext &context, const Phase3 &phase_3) { /* at this point we should not have a resolver or a declaration or * definition or anything for this symbol */ -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG llvm::Value *value = gen::maybe_get_env_var( builder, gen_env, Identifier{pair.first, overload.second->expr->get_location()}, @@ -1397,7 +1397,7 @@ bool build_binary(const Job &job, bool explain, std::string &program_name) { std::stringstream ss_c_flags; std::stringstream ss_compilands; std::stringstream ss_lib_flags; - ss_compilands << "\"$CIDER_RUNTIME/cider_rt.c\" "; + ss_compilands << "\"$ACE_RUNTIME/ace_rt.c\" "; for (auto link_in : phase_4.phase_3.phase_2.compilation->link_ins) { std::string link_text = unescape_json_quotes(link_in.name.text); switch (link_in.lit) { @@ -1410,7 +1410,7 @@ bool build_binary(const Job &job, bool explain, std::string &program_name) { ss_lib_flags << "-l\"" << link_text << "\" "; break; case lit_compile: - ss_compilands << "\"$CIDER_RUNTIME/" << link_text << "\" "; + ss_compilands << "\"$ACE_RUNTIME/" << link_text << "\" "; break; } } @@ -1429,7 +1429,7 @@ bool build_binary(const Job &job, bool explain, std::string &program_name) { "-I \"$(xcrun --sdk macosx --show-sdk-path)/usr/include\" " #endif // Allow for the user to specify optimizations - "$CIDER_OPT_FLAGS " + "$ACE_OPT_FLAGS " // NB: we don't embed the target triple into the LL, so any // targeted triple causes an ugly error from clang, so I just // ignore it here. @@ -1480,8 +1480,8 @@ int run_job(const Job &job) { std::map> cmd_map; cmd_map["help"] = [&](const Job &job, bool explain) { std::cout << clean_ansi_escapes_if_not_tty(stdout, LOGO); - std::cout << "cider"; -#ifdef CIDER_DEBUG + std::cout << "ace"; +#ifdef ACE_DEBUG std::cout << " (debug build)"; #endif std::cout << ':' << std::endl; @@ -1493,12 +1493,12 @@ int run_job(const Job &job) { cmd_pair.second(job, true); } } - std::cout << "Also try looking at the manpage. man cider." << std::endl; + std::cout << "Also try looking at the manpage. man ace." << std::endl; return EXIT_FAILURE; }; cmd_map["test"] = [&](const Job &job, bool explain) { if (explain || job.args.size() > 1) { - std::cout << "test: find and run tests within ./tests\ncider test " + std::cout << "test: find and run tests within ./tests\nace test " "" << std::endl; return EXIT_FAILURE; @@ -1512,11 +1512,11 @@ int run_job(const Job &job) { if (file_stat.regular_file() && (job.args.size() == 0 || regex_exists(name, job.args[0])) && name.find("/test_") != std::string::npos && - ends_with(name, ".cider")) { + ends_with(name, ".ace")) { tests_to_run.push_back(name); } }); - return cider::testing::run_tests(tests_to_run); + return ace::testing::run_tests(tests_to_run); }; cmd_map["unit-test"] = [&](const Job &job, bool explain) { if (explain) { @@ -1524,7 +1524,7 @@ int run_job(const Job &job) { return EXIT_FAILURE; } - return cider::testing::run_unit_tests(); + return ace::testing::run_unit_tests(); }; cmd_map["find"] = [&](const Job &job, bool explain) { if (explain) { @@ -1535,13 +1535,13 @@ int run_job(const Job &job) { return run_job({"help", {}, {}}); } log("%s", compiler::resolve_module_filename(INTERNAL_LOC(), job.args[0], - ".cider", maybe()) + ".ace", maybe()) .c_str()); return EXIT_SUCCESS; }; cmd_map["lex"] = [&](const Job &job, bool explain) { if (explain) { - std::cout << "lex: lexes Cider into tokens" << std::endl; + std::cout << "lex: lexes Ace into tokens" << std::endl; return EXIT_FAILURE; } if (job.args.size() != 1) { @@ -1561,7 +1561,7 @@ int run_job(const Job &job) { return EXIT_SUCCESS; } else { std::string filename = compiler::resolve_module_filename( - INTERNAL_LOC(), job.args[0], ".cider", maybe()); + INTERNAL_LOC(), job.args[0], ".ace", maybe()); std::ifstream ifs; ifs.open(filename.c_str()); Lexer lexer({filename}, ifs); @@ -1577,7 +1577,7 @@ int run_job(const Job &job) { cmd_map["parse"] = [&](const Job &job, bool explain) { if (explain) { - std::cout << "parse: parses Cider into an intermediate lambda calculus" + std::cout << "parse: parses Ace into an intermediate lambda calculus" << std::endl; return EXIT_FAILURE; } @@ -1606,7 +1606,7 @@ int run_job(const Job &job) { }; cmd_map["compile"] = [&](const Job &job, bool explain) { if (explain) { - std::cout << "compile: parses and compiles Cider into an intermediate " + std::cout << "compile: parses and compiles Ace into an intermediate " "lambda calculus. this performs type checking" << std::endl; return EXIT_FAILURE; @@ -1626,7 +1626,7 @@ int run_job(const Job &job) { }; cmd_map["specialize"] = [&](const Job &job, bool explain) { if (explain) { - std::cout << "specialize: compiles, then specializes the Cider lambda " + std::cout << "specialize: compiles, then specializes the Ace lambda " "calculus to a monomorphized form" << std::endl; return EXIT_FAILURE; @@ -1681,10 +1681,10 @@ int run_job(const Job &job) { cmd_map["build"] = [&](const Job &job, bool explain) { std::string program_name; if (build_binary(job, explain, program_name)) { - debug_above(1, log("cider build succeeded: %s", program_name.c_str())); + debug_above(1, log("ace build succeeded: %s", program_name.c_str())); return EXIT_SUCCESS; } else { - std::cerr << "cider build failed." << std::endl; + std::cerr << "ace build failed." << std::endl; return EXIT_FAILURE; } }; @@ -1701,7 +1701,7 @@ int run_job(const Job &job) { } } -} // namespace cider +} // namespace ace namespace { void append_env(std::string var_name, std::string value) { @@ -1711,38 +1711,38 @@ void append_env(std::string var_name, std::string value) { if (existing_value.size() != 0) { std::stringstream ss; ss << existing_value << ":" << value; - setenv("CIDER_PATH", ss.str().c_str(), true /*overwrite*/); - std::cout << "Setting CIDER_PATH to " << ss.str() << std::endl; + setenv("ACE_PATH", ss.str().c_str(), true /*overwrite*/); + std::cout << "Setting ACE_PATH to " << ss.str() << std::endl; } else { - setenv("CIDER_PATH", value.c_str(), true /*overwrite*/); + setenv("ACE_PATH", value.c_str(), true /*overwrite*/); } } void setup_environment_variables() { - const char *default_cider_root = + const char *default_ace_root = #ifdef __APPLE__ - "/usr/local/share/cider"; + "/usr/local/share/ace"; #else "."; #endif - setenv("CIDER_ROOT", default_cider_root, false /*overwrite*/); + setenv("ACE_ROOT", default_ace_root, false /*overwrite*/); std::stringstream ss; - ss << getenv("CIDER_ROOT") << "/lib"; - append_env("CIDER_PATH", ss.str()); + ss << getenv("ACE_ROOT") << "/lib"; + append_env("ACE_PATH", ss.str()); ss.str(""); - ss << getenv("CIDER_ROOT") << "/runtime"; - setenv("CIDER_RUNTIME", ss.str().c_str(), false /*overwrite*/); + ss << getenv("ACE_ROOT") << "/runtime"; + setenv("ACE_RUNTIME", ss.str().c_str(), false /*overwrite*/); } } // namespace int main(int argc, char *argv[]) { setup_environment_variables(); init_dbg(); - cider::init_host(); + ace::init_host(); std::shared_ptr logger(std::make_shared("", ".")); - cider::Job job; + ace::Job job; if (1 < argc) { int index = 1; job.cmd = argv[index++]; @@ -1758,9 +1758,9 @@ int main(int argc, char *argv[]) { } try { - return cider::run_job(job); - } catch (cider::user_error &e) { - cider::print_exception(e); + return ace::run_job(job); + } catch (ace::user_error &e) { + ace::print_exception(e); /* and continue */ return EXIT_FAILURE; } diff --git a/src/match.cpp b/src/match.cpp index 36dc350a..03f07dae 100644 --- a/src/match.cpp +++ b/src/match.cpp @@ -13,7 +13,7 @@ #include "types.h" #include "unification.h" #include "user_error.h" -#include "cider.h" +#include "ace.h" namespace match { @@ -55,12 +55,12 @@ struct CtorPatterns : std::enable_shared_from_this, Pattern { struct AllOf : std::enable_shared_from_this, Pattern { maybe name; - const cider::DataCtorsMap &data_ctors_map; + const ace::DataCtorsMap &data_ctors_map; types::Ref type; AllOf(Location location, maybe name, - const cider::DataCtorsMap &data_ctors_map, + const ace::DataCtorsMap &data_ctors_map, types::Ref type) : Pattern(location), name(name), data_ctors_map(data_ctors_map), type(type) { @@ -101,22 +101,22 @@ struct Scalars : std::enable_shared_from_this>, Pattern { }; template <> std::string Scalars::scalar_name() { - static auto s = cider::tld::strip_prefix(INT_TYPE) + "s"; + static auto s = ace::tld::strip_prefix(INT_TYPE) + "s"; return s; } template <> std::string Scalars::scalar_name() { - static auto s = cider::tld::strip_prefix(CHAR_TYPE) + "s"; + static auto s = ace::tld::strip_prefix(CHAR_TYPE) + "s"; return s; } template <> std::string Scalars::scalar_name() { - static auto s = cider::tld::strip_prefix(FLOAT_TYPE) + "s"; + static auto s = ace::tld::strip_prefix(FLOAT_TYPE) + "s"; return s; } template <> std::string Scalars::scalar_name() { - static auto s = cider::tld::strip_prefix(STRING_TYPE) + "s"; + static auto s = ace::tld::strip_prefix(STRING_TYPE) + "s"; return s; } @@ -158,7 +158,7 @@ std::shared_ptr> allStrings = Pattern::Ref all_of(Location location, maybe expr, - const cider::DataCtorsMap &data_ctors_map, + const ace::DataCtorsMap &data_ctors_map, types::Ref type) { return std::make_shared(location, expr, data_ctors_map, type); } @@ -169,7 +169,7 @@ Pattern::Ref reduce_all_datatype(Location location, const std::vector &cpvs) { for (auto cpv : cpvs) { if (cpv.type_name != type_name) { - auto error = cider::user_error( + auto error = ace::user_error( location, "invalid typed ctor pattern found. expected %s " "but ctor_pattern indicates it is a %s", @@ -351,7 +351,7 @@ Pattern::Ref intersect(Pattern::Ref lhs, Pattern::Ref rhs) { "intersect is not implemented yet (%s vs. %s)", lhs->str().c_str(), rhs->str().c_str()); - throw cider::user_error(INTERNAL_LOC(), "not implemented"); + throw ace::user_error(INTERNAL_LOC(), "not implemented"); return nullptr; } @@ -407,12 +407,12 @@ Pattern::Ref pattern_union(Pattern::Ref lhs, Pattern::Ref rhs) { log_location(log_error, lhs->location, "unhandled pattern_union (%s ∪ %s)", lhs->str().c_str(), rhs->str().c_str()); - throw cider::user_error(INTERNAL_LOC(), "not implemented"); + throw ace::user_error(INTERNAL_LOC(), "not implemented"); return nullptr; } Pattern::Ref from_type(Location location, - const cider::DataCtorsMap &data_ctors_map, + const ace::DataCtorsMap &data_ctors_map, types::Ref type) { if (auto tuple_type = dyncast(type)) { std::vector args; @@ -436,7 +436,7 @@ Pattern::Ref from_type(Location location, .result) { return all_of(location, {}, data_ctors_map, type); } else { - auto ctors_types = cider::get_data_ctors_types(data_ctors_map, type); + auto ctors_types = ace::get_data_ctors_types(data_ctors_map, type); std::vector cpvs; for (auto pair : ctors_types) { @@ -459,7 +459,7 @@ Pattern::Ref from_type(Location location, } else if (cpvs.size() > 1) { return std::make_shared(location, cpvs); } else { - throw cider::user_error(INTERNAL_LOC(), "not implemented"); + throw ace::user_error(INTERNAL_LOC(), "not implemented"); } } @@ -572,7 +572,7 @@ void difference(Pattern::Ref lhs, return; } - auto error = cider::user_error( + auto error = ace::user_error( lhs->location, "type mismatch when comparing ctors for pattern intersection"); error.add_info(rhs->location, "comparing this type"); @@ -614,7 +614,7 @@ void difference(Pattern::Ref lhs, } return; } else { - throw cider::user_error(rhs->location, "type mismatch"); + throw ace::user_error(rhs->location, "type mismatch"); } } @@ -672,7 +672,7 @@ void difference(Pattern::Ref lhs, if (rhs_ctor_pattern->cpv.name == STRING_TYPE) { for (auto arg : rhs_ctor_pattern->cpv.args) { if (!asAllOf(arg)) { - throw cider::user_error( + throw ace::user_error( arg->location, "%s pattern matching is only allowed in String(a, b) form (all " "irrefutables. this is to allow for string literal matching. i " @@ -701,7 +701,7 @@ void difference(Pattern::Ref lhs, log_location(log_error, lhs->location, "unhandled difference - %s \\ %s", lhs->str().c_str(), rhs->str().c_str()); - throw cider::user_error(INTERNAL_LOC(), "not implemented"); + throw ace::user_error(INTERNAL_LOC(), "not implemented"); } Pattern::Ref difference(Pattern::Ref lhs, Pattern::Ref rhs) { @@ -742,7 +742,7 @@ std::string CtorPatterns::str() const { std::string CtorPatternValue::str() const { std::stringstream ss; - ss << cider::tld::strip_prefix(name); + ss << ace::tld::strip_prefix(name); if (args.size() != 0) { ss << "(" << ::join_str(args, ", ") << ")"; } @@ -751,18 +751,18 @@ std::string CtorPatternValue::str() const { } // namespace match -namespace cider { +namespace ace { namespace ast { using namespace ::match; using namespace ::types; Pattern::Ref TuplePredicate::get_pattern( types::Ref type, - const cider::DataCtorsMap &data_ctors_map) const { + const ace::DataCtorsMap &data_ctors_map) const { std::vector args; if (auto tuple_type = dyncast(type)) { if (tuple_type->dimensions.size() != params.size()) { - throw cider::user_error(location, + throw ace::user_error(location, "tuple predicate has an incorrect number of " "sub-patterns. there are %d, there should be %d", int(params.size()), @@ -777,7 +777,7 @@ Pattern::Ref TuplePredicate::get_pattern( return std::make_shared( location, CtorPatternValue{tuple_type->repr(), "tuple", args}); } else { - throw cider::user_error(location, + throw ace::user_error(location, "type mismatch on pattern. incoming type is %s. " "it is not a %d-tuple.", type->str().c_str(), (int)params.size()); @@ -787,7 +787,7 @@ Pattern::Ref TuplePredicate::get_pattern( Pattern::Ref CtorPredicate::get_pattern( types::Ref type, - const cider::DataCtorsMap &data_ctors_map) const { + const ace::DataCtorsMap &data_ctors_map) const { auto ctor_terms = unfold_arrows( get_data_ctor_type(data_ctors_map, type, ctor_name)); @@ -795,7 +795,7 @@ Pattern::Ref CtorPredicate::get_pattern( if (ctor_terms.size() - 1 != params.size()) { log("params = %s", join_str(params).c_str()); log("ctor_terms = %s", join_str(ctor_terms).c_str()); - throw cider::user_error( + throw ace::user_error( location, "%s has an incorrect number of sub-patterns. there are " "%d, there should be %d", @@ -813,14 +813,14 @@ Pattern::Ref CtorPredicate::get_pattern( Pattern::Ref IrrefutablePredicate::get_pattern( types::Ref type, - const cider::DataCtorsMap &data_ctors_map) const { + const ace::DataCtorsMap &data_ctors_map) const { return std::make_shared(location, name_assignment, data_ctors_map, type); } Pattern::Ref Literal::get_pattern( types::Ref type, - const cider::DataCtorsMap &data_ctors_map) const { + const ace::DataCtorsMap &data_ctors_map) const { if (type_equality(type, type_int(INTERNAL_LOC()))) { if (token.tk == tk_integer) { int64_t value = parse_int_value(token); @@ -855,10 +855,10 @@ Pattern::Ref Literal::get_pattern( } } - throw cider::user_error( + throw ace::user_error( token.location, "invalid type for literal '%s' (%s). should be a %s", token.text.c_str(), tkstr(token.tk), type->str().c_str()); return nullptr; } } // namespace ast -} // namespace cider +} // namespace ace diff --git a/src/match.h b/src/match.h index 2f6413e5..65472d9b 100644 --- a/src/match.h +++ b/src/match.h @@ -30,6 +30,6 @@ Pattern::Ref difference(Pattern::Ref lhs, Pattern::Ref rhs); Pattern::Ref pattern_union(Pattern::Ref lhs, Pattern::Ref rhs); Pattern::Ref all_of(Location location, maybe expr, - const cider::DataCtorsMap &data_ctors_map, + const ace::DataCtorsMap &data_ctors_map, types::Ref type); } // namespace match diff --git a/src/parse_state.cpp b/src/parse_state.cpp index 5d3c8ff4..ceba97f0 100644 --- a/src/parse_state.cpp +++ b/src/parse_state.cpp @@ -11,9 +11,9 @@ #include "parser.h" #include "tld.h" #include "types.h" -#include "cider.h" +#include "ace.h" -namespace cider { +namespace ace { namespace parser { @@ -61,7 +61,7 @@ ParseState::ParseState(std::string filename, : filename(filename), module_name(module_name.size() != 0 ? module_name - : strip_cider_extension(leaf_from_file_path(filename))), + : strip_ace_extension(leaf_from_file_path(filename))), builtin_arities(builtin_arities), lexer(lexer), comments(comments), link_ins(link_ins), symbol_exports(symbol_exports), symbol_imports(symbol_imports) { @@ -175,4 +175,4 @@ void ParseState::add_term_map(Location location, } } // namespace parser -} // namespace cider +} // namespace ace diff --git a/src/parse_state.h b/src/parse_state.h index f0d042c1..207f6f44 100644 --- a/src/parse_state.h +++ b/src/parse_state.h @@ -11,7 +11,7 @@ #include "types.h" #include "user_error.h" -namespace cider { +namespace ace { namespace parser { typedef std::map> SymbolExports; @@ -102,4 +102,4 @@ struct TypeVarRemappingTracker { }; } // namespace parser -} // namespace cider +} // namespace ace diff --git a/src/parser.cpp b/src/parser.cpp index b508144c..b2223504 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -17,7 +17,7 @@ #include "tld.h" #include "token.h" -namespace cider { +namespace ace { namespace parser { using namespace ast; @@ -436,7 +436,7 @@ const Expr *parse_ffi(ParseState &ps) { RawParseMode rpm(ps); /* get the name of the FFI user wants to call. Non-quoted is fine, but quotes - * are allowed in case of system linker/Cider lexer compatibility issues. */ + * are allowed in case of system linker/Ace lexer compatibility issues. */ Identifier id; if (ps.token.tk == tk_identifier) { id = iid(ps.token); @@ -731,7 +731,7 @@ const Expr *parse_generator(ParseState &ps, const Expr *expr) { GeneratorFor generator_for = parse_generator_for(ps); if (ps.token.is_ident(K(for))) { throw user_error(ps.token.location, - "nested comprehensions are not legal in Cider"); + "nested comprehensions are not legal in Ace"); } return build_generator(expr->get_location(), expr, generator_for); } @@ -3001,4 +3001,4 @@ const Module *parse_module(ParseState &ps, } } // namespace parser -} // namespace cider +} // namespace ace diff --git a/src/parser.h b/src/parser.h index d0fad9e8..6bc5f5bf 100644 --- a/src/parser.h +++ b/src/parser.h @@ -6,7 +6,7 @@ #include "lexer.h" #include "parse_state.h" -namespace cider { +namespace ace { namespace parser { std::map get_builtin_arities(); @@ -122,4 +122,4 @@ const ast::Predicate *unfold_application_into_predicate( const ast::Predicate *convert_expr_to_predicate(const ast::Expr *expr); } // namespace parser -} // namespace cider +} // namespace ace diff --git a/src/patterns.cpp b/src/patterns.cpp index ac74c0f6..d4628a7c 100644 --- a/src/patterns.cpp +++ b/src/patterns.cpp @@ -9,9 +9,9 @@ #include "tld.h" #include "translate.h" #include "unification.h" -#include "cider.h" +#include "ace.h" -namespace cider { +namespace ace { using namespace ast; @@ -539,4 +539,4 @@ const Expr *IrrefutablePredicate::translate( needed_defns, returns); } -} // namespace cider +} // namespace ace diff --git a/src/patterns.h b/src/patterns.h index d4e0b852..e6c16e54 100644 --- a/src/patterns.h +++ b/src/patterns.h @@ -7,7 +7,7 @@ #include "tracked_types.h" #include "types.h" -namespace cider { +namespace ace { const ast::Expr *translate_match_expr( const types::DefnId &for_defn_id, @@ -29,4 +29,4 @@ typedef const std::function &TranslateContinuationFn; -} // namespace cider +} // namespace ace diff --git a/src/prefix.cpp b/src/prefix.cpp index e748ed76..08f3c529 100644 --- a/src/prefix.cpp +++ b/src/prefix.cpp @@ -4,7 +4,7 @@ #include "ptr.h" #include "tld.h" -namespace cider { +namespace ace { using namespace ast; @@ -298,4 +298,4 @@ types::Scheme::Ref prefix(const std::set &bindings, prefix(bindings, pre, scheme->type)); } -} // namespace cider +} // namespace ace diff --git a/src/prefix.h b/src/prefix.h index 95373ad2..e26f9e7d 100644 --- a/src/prefix.h +++ b/src/prefix.h @@ -5,7 +5,7 @@ #include "ast.h" #include "identifier.h" -namespace cider { +namespace ace { std::string prefix(const std::set &bindings, std::string pre, @@ -123,4 +123,4 @@ std::unordered_map prefix( return new_map; } -} // namespace cider +} // namespace ace diff --git a/src/resolver.cpp b/src/resolver.cpp index ed8f3895..68fa17a5 100644 --- a/src/resolver.cpp +++ b/src/resolver.cpp @@ -8,7 +8,7 @@ #include "types.h" #include "user_error.h" -namespace cider { +namespace ace { namespace gen { @@ -52,4 +52,4 @@ void Publishable::publish(llvm::Value *llvm_value_) const { } // namespace gen -} // namespace cider +} // namespace ace diff --git a/src/resolver.h b/src/resolver.h index 3a4cd877..5ae1c10e 100644 --- a/src/resolver.h +++ b/src/resolver.h @@ -6,7 +6,7 @@ #include "llvm_utils.h" #include "types.h" -namespace cider { +namespace ace { namespace gen { @@ -49,4 +49,4 @@ std::shared_ptr lazy_resolver(std::string name, } // namespace gen -} // namespace cider +} // namespace ace diff --git a/src/resolver_impl.cpp b/src/resolver_impl.cpp index 9e8e476f..2e505040 100644 --- a/src/resolver_impl.cpp +++ b/src/resolver_impl.cpp @@ -6,7 +6,7 @@ #include "llvm_utils.h" #include "user_error.h" -namespace cider { +namespace ace { namespace gen { @@ -128,4 +128,4 @@ std::string LazyResolver::str() const { } // namespace gen -} // namespace cider +} // namespace ace diff --git a/src/resolver_impl.h b/src/resolver_impl.h index 8fab31c4..a5b2de80 100644 --- a/src/resolver_impl.h +++ b/src/resolver_impl.h @@ -5,7 +5,7 @@ #include "llvm_utils.h" #include "resolver.h" -namespace cider { +namespace ace { namespace gen { @@ -49,4 +49,4 @@ struct LazyResolver final : public Resolver { } // namespace gen -} // namespace cider +} // namespace ace diff --git a/src/scheme.cpp b/src/scheme.cpp index f964ef45..067b162e 100644 --- a/src/scheme.cpp +++ b/src/scheme.cpp @@ -9,7 +9,7 @@ Scheme::Scheme(Location location, const ClassPredicates &predicates, types::Ref type) : location(location), vars(vars), predicates(predicates), type(type) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (vars.size() == 0) { if (types::get_ftvs(predicates).size() != 0) { log("unexpected lack of vars in scheme %s", str().c_str()); diff --git a/src/scheme_resolver.cpp b/src/scheme_resolver.cpp index 12fee51e..a187f1c3 100644 --- a/src/scheme_resolver.cpp +++ b/src/scheme_resolver.cpp @@ -48,9 +48,9 @@ types::SchemeRef SchemeResolver::lookup_scheme( if (parent != nullptr) { return parent->lookup_scheme(id, candidates); } else { - auto user_error = cider::user_error( + auto user_error = ace::user_error( id.location, "symbol " c_id("%s") " is undefined", - cider::tld::strip_prefix(id.name).c_str()); + ace::tld::strip_prefix(id.name).c_str()); for (auto &id : candidates) { user_error.add_info(id.location, "did you mean %s?", id.str().c_str()); } diff --git a/src/solver.cpp b/src/solver.cpp index ade8835d..88375c06 100644 --- a/src/solver.cpp +++ b/src/solver.cpp @@ -1,6 +1,6 @@ #include "solver.h" -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG #include "ast.h" #endif @@ -9,11 +9,11 @@ #include "unification.h" #include "user_error.h" -namespace cider { +namespace ace { namespace { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG void check_constraints_cover_tracked_types( const Context &context, const TrackedTypes &tracked_types, @@ -54,7 +54,7 @@ types::Map solver(bool check_constraint_coverage, types::ClassPredicates &instance_requirements) { debug_above(2, log("solver(%s, ... %d constraints)", context.message.c_str(), constraints.size())); -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (debug_level() > 3) { for (auto &constraint : constraints) { log_location(best_location(constraint.a->get_location(), @@ -112,4 +112,4 @@ types::Map solver(bool check_constraint_coverage, return bindings; } -} // namespace cider +} // namespace ace diff --git a/src/solver.h b/src/solver.h index 83109732..fbcca064 100644 --- a/src/solver.h +++ b/src/solver.h @@ -6,7 +6,7 @@ #include "tracked_types.h" #include "types.h" -namespace cider { +namespace ace { types::Map solver(bool check_constraint_coverage, Context &&context, @@ -15,4 +15,4 @@ types::Map solver(bool check_constraint_coverage, const types::SchemeResolver &scheme_resolver, types::ClassPredicates &instance_requirements); -} // namespace cider +} // namespace ace diff --git a/src/testing.cpp b/src/testing.cpp index 226c16ed..cc7f71d3 100644 --- a/src/testing.cpp +++ b/src/testing.cpp @@ -17,7 +17,7 @@ #include "user_error.h" #include "utils.h" -namespace cider { +namespace ace { namespace testing { struct TestFlag { @@ -174,7 +174,7 @@ enum RunTestResult { RunTestResult run_test(std::string test_name) { std::stringstream ss; - ss << "DEBUG= cider run " << test_name; + ss << "DEBUG= ace run " << test_name; std::string command_line = ss.str(); std::vector lines = readlines(test_name); @@ -314,14 +314,14 @@ int run_unit_tests() { test_assert(false); } - test_assert(cider::tld::split_fqn("::copy::Copy").size() == 2); - test_assert(cider::tld::is_tld_type("::Copy")); - test_assert(cider::tld::is_tld_type("::Z")); - test_assert(!cider::tld::is_tld_type("::copy::copy")); - test_assert(!cider::tld::is_tld_type("copy::copy")); - test_assert(!cider::tld::is_tld_type("copy")); - test_assert(cider::tld::is_tld_type("::copy::Copy")); - test_assert(!cider::tld::is_tld_type("::copy::copy")); + test_assert(ace::tld::split_fqn("::copy::Copy").size() == 2); + test_assert(ace::tld::is_tld_type("::Copy")); + test_assert(ace::tld::is_tld_type("::Z")); + test_assert(!ace::tld::is_tld_type("::copy::copy")); + test_assert(!ace::tld::is_tld_type("copy::copy")); + test_assert(!ace::tld::is_tld_type("copy")); + test_assert(ace::tld::is_tld_type("::copy::Copy")); + test_assert(!ace::tld::is_tld_type("::copy::copy")); test_assert(tld::split_fqn("::inc").size() == 1); auto pair = shell_get_output("seq 10000"); if (pair.first) { @@ -331,11 +331,11 @@ int run_unit_tests() { test_assert(!pair.first); test_assert(pair.second.find("10000") != std::string::npos); std::string output = - "tests/test_assert_fail.cider:5:17: assertion failed: (std::False)\n"; + "tests/test_assert_fail.ace:5:17: assertion failed: (std::False)\n"; test_assert(regex_exists(output, "assertion failed.*False")); return EXIT_SUCCESS; } } // namespace testing -} // namespace cider +} // namespace ace diff --git a/src/testing.h b/src/testing.h index 41cc32e8..f473b75e 100644 --- a/src/testing.h +++ b/src/testing.h @@ -1,9 +1,9 @@ #pragma once #include #include -namespace cider { +namespace ace { namespace testing { int run_tests(std::list tests); int run_unit_tests(); } // namespace testing -} // namespace cider +} // namespace ace diff --git a/src/tld.cpp b/src/tld.cpp index 7f6f297f..4ee95a32 100644 --- a/src/tld.cpp +++ b/src/tld.cpp @@ -2,7 +2,7 @@ #include "builtins.h" -namespace cider { +namespace ace { namespace tld { #define SCOPE_SEP "::" @@ -100,4 +100,4 @@ std::string strip_prefix(std::string fqn) { } } // namespace tld -} // namespace cider +} // namespace ace diff --git a/src/tld.h b/src/tld.h index 564f722f..f5674cf5 100644 --- a/src/tld.h +++ b/src/tld.h @@ -5,7 +5,7 @@ #include "identifier.h" -namespace cider { +namespace ace { namespace tld { std::string mktld(std::string module, std::string name); @@ -21,4 +21,4 @@ bool is_in_module(std::string module, std::string name); std::string strip_prefix(std::string fqn); } // namespace tld -} // namespace cider +} // namespace ace diff --git a/src/token.cpp b/src/token.cpp index b05ef03e..2257ef25 100644 --- a/src/token.cpp +++ b/src/token.cpp @@ -5,9 +5,9 @@ #include "dbg.h" #include "user_error.h" -#include "cider_assert.h" +#include "ace_assert.h" -namespace cider { +namespace ace { bool is_restricted_var_name(std::string x) { static const std::string keywords[] = { @@ -151,10 +151,10 @@ int64_t parse_int_value(Token token) { return value; } default: - throw cider::user_error(token.location, + throw ace::user_error(token.location, "unable to read an integer value from %s", token.str().c_str()); } } -} // namespace cider +} // namespace ace diff --git a/src/token.h b/src/token.h index 31178bab..e786b304 100644 --- a/src/token.h +++ b/src/token.h @@ -5,7 +5,7 @@ #include "location.h" #include "stackstring.h" -namespace cider { +namespace ace { enum TokenKind { tk_none, /* NULL TOKEN */ @@ -134,4 +134,4 @@ const char *tkstr(TokenKind tk); int64_t parse_int_value(Token token); double parse_float_value(Token token); bool is_assignment_operator(const Token &tk); -} // namespace cider +} // namespace ace diff --git a/src/token_queue.cpp b/src/token_queue.cpp index b04d4d52..39a7b5c2 100644 --- a/src/token_queue.cpp +++ b/src/token_queue.cpp @@ -3,7 +3,7 @@ #include "dbg.h" #include "utils.h" -namespace cider { +namespace ace { struct token_matcher { const char *text; @@ -63,4 +63,4 @@ void TokenQueue::set_last_tk(TokenKind tk) { m_last_tk = tk; } -} // namespace cider +} // namespace ace diff --git a/src/token_queue.h b/src/token_queue.h index 264d9798..765608da 100644 --- a/src/token_queue.h +++ b/src/token_queue.h @@ -2,7 +2,7 @@ #include "token.h" -namespace cider { +namespace ace { struct TokenQueue { std::list m_queue; @@ -17,4 +17,4 @@ struct TokenQueue { Token pop(); }; -} // namespace cider +} // namespace ace diff --git a/src/tracked_types.cpp b/src/tracked_types.cpp index 4cab7e99..7569cd85 100644 --- a/src/tracked_types.cpp +++ b/src/tracked_types.cpp @@ -4,7 +4,7 @@ #include "dbg.h" #include "logger_decls.h" -namespace cider { +namespace ace { types::Ref get_tracked_type(const TrackedTypes &tracked_types, const ast::Expr *e) { @@ -36,4 +36,4 @@ void rebind_tracked_types(TrackedTypes &tracked_types, } } -} // namespace cider +} // namespace ace diff --git a/src/tracked_types.h b/src/tracked_types.h index 335528b2..79f75877 100644 --- a/src/tracked_types.h +++ b/src/tracked_types.h @@ -5,13 +5,13 @@ #include "ast_decls.h" #include "types.h" -namespace cider { +namespace ace { -typedef std::unordered_map TrackedTypes; +typedef std::unordered_map TrackedTypes; types::Ref get_tracked_type(const TrackedTypes &tracked_types, const ast::Expr *e); void rebind_tracked_types(TrackedTypes &tracked_types, const types::Map &bindings); -} // namespace cider +} // namespace ace diff --git a/src/translate.cpp b/src/translate.cpp index e3cd4272..c40bfcc3 100644 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -9,7 +9,7 @@ #include "unification.h" #include "user_error.h" -namespace cider { +namespace ace { using namespace ast; @@ -70,7 +70,7 @@ const Expr *texpr(const types::DefnId &for_defn_id, /* check for fully concrete type */ if (type->generalize({})->btvs() != 0) { throw user_error(expr->get_location(), - "while (%s) is type-safe, Cider cannot figure out which " + "while (%s) is type-safe, Ace cannot figure out which " "instance within %s to use. please use an 'as' operator " "to add a type hint.", expr->str().c_str(), type->str().c_str()); @@ -372,4 +372,4 @@ Location Translation::get_location() const { return expr->get_location(); } -} // namespace cider +} // namespace ace diff --git a/src/translate.h b/src/translate.h index 39585f23..02377882 100644 --- a/src/translate.h +++ b/src/translate.h @@ -8,7 +8,7 @@ #include "tracked_types.h" #include "types.h" -namespace cider { +namespace ace { struct Translation { typedef std::shared_ptr ref; @@ -43,4 +43,4 @@ const ast::Expr *texpr(const types::DefnId &for_defn_id, // TODO: pass in overloads in order to perform resolution bool &returns); -} // namespace cider +} // namespace ace diff --git a/src/types.cpp b/src/types.cpp index 3e511079..88b589e7 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -16,7 +16,7 @@ #include "unification.h" #include "user_error.h" #include "utils.h" -#include "cider.h" +#include "ace.h" const char *NULL_TYPE = "null"; const char *STD_MANAGED_TYPE = "Var"; @@ -87,7 +87,7 @@ types::ClassPredicates get_overlapping_predicates( Ftvs *overlapping_ftvs) { /* eliminate class predicates that do not mention any ftvs. fill out the * |overlapping_ftvs|. */ -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (class_predicates.size() != 0 || ftvs.size() != 0) { debug_above(5, log("looking for overlapping predicates between {%s} and {%s}", @@ -108,7 +108,7 @@ types::ClassPredicates get_overlapping_predicates( overlapping_ftvs->clear(); std::swap(*overlapping_ftvs, existing_ftvs); } -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG if (class_predicates.size() != 0) { debug_above(5, log("found new class_predicates %s", str(new_class_predicates).c_str())); @@ -145,8 +145,8 @@ Ref Type::apply(types::Ref type) const { } TypeId::TypeId(Identifier id) : id(id) { - if (cider::tld::is_lowercase_leaf(id.name)) { - throw cider::user_error( + if (ace::tld::is_lowercase_leaf(id.name)) { + throw ace::user_error( id.location, "type identifiers must begin with an upper-case letter (%s)", str().c_str()); @@ -156,7 +156,7 @@ TypeId::TypeId(Identifier id) : id(id) { std::ostream &TypeId::emit(std::ostream &os, const Map &bindings, int parent_precedence) const { - return os << cider::tld::strip_prefix(id.name); + return os << ace::tld::strip_prefix(id.name); } void TypeId::compute_ftvs() const { @@ -192,7 +192,7 @@ Ref TypeId::remap_vars(const std::map &map) const { types::Ref TypeId::rewrite_ids( const std::map &rewrite_rules) const { if (in(id, rewrite_rules)) { - return type_id(cider::rewrite_identifier(rewrite_rules, id)); + return type_id(ace::rewrite_identifier(rewrite_rules, id)); } else { return shared_from_this(); } @@ -201,7 +201,7 @@ types::Ref TypeId::rewrite_ids( Ref TypeId::prefix_ids(const std::set &bindings, const std::string &pre) const { if (in(id.name, bindings)) { - return type_id(cider::prefix(bindings, pre, id)); + return type_id(ace::prefix(bindings, pre, id)); } else { return shared_from_this(); } @@ -212,7 +212,7 @@ Location TypeId::get_location() const { } TypeVariable::TypeVariable(Identifier id) : id(id) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG for (auto ch : id.name) { assert(islower(ch) || !isalpha(ch)); } @@ -294,7 +294,7 @@ std::ostream &TypeOperator::emit(std::ostream &os, auto rebound_oper = oper->rebind(bindings); if (auto op = dyncast(rebound_oper)) { if (auto inner_op = dyncast(op->oper)) { - if (strspn(cider::tld::fqn_leaf(inner_op->id.name).c_str(), + if (strspn(ace::tld::fqn_leaf(inner_op->id.name).c_str(), MATHY_SYMBOLS) != 0) { op->operand->emit(os, {}, get_precedence()); if (inner_op->id.name == ARROW_TYPE_OPERATOR) { @@ -369,7 +369,7 @@ Location TypeOperator::get_location() const { TypeTuple::TypeTuple(Location location, const Refs &dimensions) : location(location), dimensions(dimensions) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG for (auto dimension : dimensions) { assert(dimension != nullptr); } @@ -457,7 +457,7 @@ Ref TypeTuple::remap_vars(const std::map &map) const { types::Ref TypeTuple::rewrite_ids( const std::map &rewrite_rules) const { - return ::type_tuple(location, cider::rewrite_types(rewrite_rules, dimensions)); + return ::type_tuple(location, ace::rewrite_types(rewrite_rules, dimensions)); } Ref TypeTuple::prefix_ids(const std::set &bindings, @@ -489,7 +489,7 @@ Location TypeTuple::get_location() const { TypeParams::TypeParams(Location location, const Refs &dimensions) : location(location), dimensions(dimensions) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG for (auto dimension : dimensions) { assert(dimension != nullptr); } @@ -575,7 +575,7 @@ Ref TypeParams::remap_vars( types::Ref TypeParams::rewrite_ids( const std::map &rewrite_rules) const { - return ::type_params(cider::rewrite_types(rewrite_rules, dimensions)); + return ::type_params(ace::rewrite_types(rewrite_rules, dimensions)); } Ref TypeParams::prefix_ids(const std::set &bindings, @@ -827,7 +827,7 @@ types::Ref type_map(types::Ref a, types::Ref b) { } types::Ref type_params(const types::Refs ¶ms) { -#ifdef CIDER_DEBUG +#ifdef ACE_DEBUG for (auto ¶m : params) { assert(!dyncast(param)); } @@ -997,7 +997,7 @@ types::Ref type_deref(Location location, types::Ref type) { if (types::is_type_id(ptr->oper, PTR_TYPE_OPERATOR)) { return ptr->operand; } else { - throw cider::user_error(location, "attempt to dereference value of type %s", + throw ace::user_error(location, "attempt to dereference value of type %s", type->str().c_str()); } } @@ -1007,7 +1007,7 @@ types::Ref tuple_deref_type(Location location, int index) { auto tuple = safe_dyncast(tuple_); if (int(tuple->dimensions.size()) < index || index < 0) { - auto error = cider::user_error( + auto error = ace::user_error( location, "attempt to access type of element at index %d which is out of range", index); diff --git a/src/unification.cpp b/src/unification.cpp index 3fbf4f98..bc6c55fd 100644 --- a/src/unification.cpp +++ b/src/unification.cpp @@ -10,7 +10,7 @@ #include "types.h" #include "user_error.h" #include "utils.h" -#include "cider.h" +#include "ace.h" namespace types { @@ -121,7 +121,7 @@ bool type_equality(types::Ref a, types::Ref b) { return true; } } else { - auto error = cider::user_error( + auto error = ace::user_error( a->get_location(), "type_equality is not implemented between these two types"); error.add_info(b->get_location(), "%s and %s", a->str().c_str(), @@ -262,7 +262,7 @@ Unification unify_many(const types::Refs &as, const types::Refs &bs) { str(as).c_str(), str(bs).c_str()), {}}; /* - throw cider::user_error( + throw ace::user_error( as.size() != 0 ? as[0]->get_location() : (bs.size() != 0 ? bs[0]->get_location() : INTERNAL_LOC()), diff --git a/src/unification.h b/src/unification.h index 16943104..a5f1dcb4 100644 --- a/src/unification.h +++ b/src/unification.h @@ -5,7 +5,7 @@ #include "location.h" #include "types.h" -#include "cider_assert.h" +#include "ace_assert.h" namespace types { diff --git a/src/user_error.cpp b/src/user_error.cpp index 78a74711..e6ca3814 100644 --- a/src/user_error.cpp +++ b/src/user_error.cpp @@ -7,7 +7,7 @@ #include "dbg.h" #include "logger.h" -namespace cider { +namespace ace { namespace { bool errors_occurred_ = false; @@ -108,4 +108,4 @@ user_error &user_error::add_info(Location location, const char *format...) { return *this; } -} // namespace cider +} // namespace ace diff --git a/src/user_error.h b/src/user_error.h index 32dbe704..4e89075a 100644 --- a/src/user_error.h +++ b/src/user_error.h @@ -3,9 +3,9 @@ #include "location.h" #include "logger_decls.h" -#include "cider.h" +#include "ace.h" -namespace cider { +namespace ace { struct user_error : std::exception { user_error(LogLevel log_level, Location location); @@ -38,4 +38,4 @@ struct user_error : std::exception { void print_exception(const user_error &e, int level = 0); -} // namespace cider +} // namespace ace diff --git a/src/utils.cpp b/src/utils.cpp index 9c5caf5e..9c187471 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -14,7 +14,7 @@ #include "dbg.h" #include "logger_decls.h" #include "user_error.h" -#include "cider_assert.h" +#include "ace_assert.h" #define SWP(x, y) (x ^= y, y ^= x, x ^= y) @@ -592,7 +592,7 @@ std::string join(int argc, const char *argv[]) { void check_command_line_text(Location location, std::string text) { for (auto ch : "`$%&()|") { if (text.find(ch) != std::string::npos) { - throw cider::user_error( + throw ace::user_error( location, "illegal command-line text found in link in statement"); } } @@ -603,7 +603,7 @@ std::string shell_get_line(std::string command) { check_command_line_text(INTERNAL_LOC(), command); FILE *fp = popen(command.c_str(), "r"); if (fp == nullptr) { - throw cider::user_error(INTERNAL_LOC(), "failed to invoke command %s", + throw ace::user_error(INTERNAL_LOC(), "failed to invoke command %s", command.c_str()); } @@ -612,7 +612,7 @@ std::string shell_get_line(std::string command) { auto cb = getline(&linep, &linecap, fp); if (cb == -1) { - throw cider::user_error( + throw ace::user_error( INTERNAL_LOC(), "failed to read output of command %s", command.c_str()); } @@ -635,7 +635,7 @@ std::pair shell_get_output(std::string command, } FILE *fp = popen(command.c_str(), "r"); if (fp == nullptr) { - throw cider::user_error(INTERNAL_LOC(), "failed to invoke command %s", + throw ace::user_error(INTERNAL_LOC(), "failed to invoke command %s", command.c_str()); } diff --git a/src/utils.h b/src/utils.h index 09208891..0f6fbd29 100644 --- a/src/utils.h +++ b/src/utils.h @@ -10,7 +10,7 @@ #include #include -#include "cider_assert.h" +#include "ace_assert.h" struct shared_comparator { template diff --git a/tests/circular_exports/moon1.cider b/tests/circular_exports/moon1.ace similarity index 100% rename from tests/circular_exports/moon1.cider rename to tests/circular_exports/moon1.ace diff --git a/tests/circular_exports/moon2.cider b/tests/circular_exports/moon2.ace similarity index 100% rename from tests/circular_exports/moon2.cider rename to tests/circular_exports/moon2.ace diff --git a/tests/circular_exports/test_circular_exports.cider b/tests/circular_exports/test_circular_exports.ace similarity index 100% rename from tests/circular_exports/test_circular_exports.cider rename to tests/circular_exports/test_circular_exports.ace diff --git a/tests/destructuring/test_filtered_matching.cider b/tests/destructuring/test_filtered_matching.ace similarity index 100% rename from tests/destructuring/test_filtered_matching.cider rename to tests/destructuring/test_filtered_matching.ace diff --git a/tests/list/test_remove_if.cider b/tests/list/test_remove_if.ace similarity index 100% rename from tests/list/test_remove_if.cider rename to tests/list/test_remove_if.ace diff --git a/tests/map/test_insertion.cider b/tests/map/test_insertion.ace similarity index 100% rename from tests/map/test_insertion.cider rename to tests/map/test_insertion.ace diff --git a/tests/map/test_keys.cider b/tests/map/test_keys.ace similarity index 100% rename from tests/map/test_keys.cider rename to tests/map/test_keys.ace diff --git a/tests/map/test_map_generators.cider b/tests/map/test_map_generators.ace similarity index 100% rename from tests/map/test_map_generators.cider rename to tests/map/test_map_generators.ace diff --git a/tests/map/test_map_iter.cider b/tests/map/test_map_iter.ace similarity index 100% rename from tests/map/test_map_iter.cider rename to tests/map/test_map_iter.ace diff --git a/tests/map/test_random_insertions.cider b/tests/map/test_random_insertions.ace similarity index 100% rename from tests/map/test_random_insertions.cider rename to tests/map/test_random_insertions.ace diff --git a/tests/map/test_string_key.cider b/tests/map/test_string_key.ace similarity index 100% rename from tests/map/test_string_key.cider rename to tests/map/test_string_key.ace diff --git a/tests/map/test_values.cider b/tests/map/test_values.ace similarity index 100% rename from tests/map/test_values.cider rename to tests/map/test_values.ace diff --git a/tests/match/test_name_assignment.cider b/tests/match/test_name_assignment.ace similarity index 100% rename from tests/match/test_name_assignment.cider rename to tests/match/test_name_assignment.ace diff --git a/tests/net/test_socket.cider b/tests/net/test_socket.ace similarity index 100% rename from tests/net/test_socket.cider rename to tests/net/test_socket.ace diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 8b980011..3e5facc1 100644 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -11,5 +11,5 @@ cd "$src_dir" || { } echo "Running tests in $(pwd)..." -cider help -cider test +ace help +ace test diff --git a/tests/set/test_set_insertion.cider b/tests/set/test_set_insertion.ace similarity index 100% rename from tests/set/test_set_insertion.cider rename to tests/set/test_set_insertion.ace diff --git a/tests/set/test_set_iter.cider b/tests/set/test_set_iter.ace similarity index 100% rename from tests/set/test_set_iter.cider rename to tests/set/test_set_iter.ace diff --git a/tests/set/test_set_vector.cider b/tests/set/test_set_vector.ace similarity index 100% rename from tests/set/test_set_vector.cider rename to tests/set/test_set_vector.ace diff --git a/tests/string/test_has_substring_at.cider b/tests/string/test_has_substring_at.ace similarity index 100% rename from tests/string/test_has_substring_at.cider rename to tests/string/test_has_substring_at.ace diff --git a/tests/string/test_replace.cider b/tests/string/test_replace.ace similarity index 100% rename from tests/string/test_replace.cider rename to tests/string/test_replace.ace diff --git a/tests/string/test_split.cider b/tests/string/test_split.ace similarity index 100% rename from tests/string/test_split.cider rename to tests/string/test_split.ace diff --git a/tests/string/test_strip.cider b/tests/string/test_strip.ace similarity index 100% rename from tests/string/test_strip.cider rename to tests/string/test_strip.ace diff --git a/tests/strings/test_eof_within.cider b/tests/strings/test_eof_within.ace similarity index 100% rename from tests/strings/test_eof_within.cider rename to tests/strings/test_eof_within.ace diff --git a/tests/strings/test_eof_within_string_expr.cider b/tests/strings/test_eof_within_string_expr.ace similarity index 100% rename from tests/strings/test_eof_within_string_expr.cider rename to tests/strings/test_eof_within_string_expr.ace diff --git a/tests/strings/test_join_in_string_expr.cider b/tests/strings/test_join_in_string_expr.ace similarity index 100% rename from tests/strings/test_join_in_string_expr.cider rename to tests/strings/test_join_in_string_expr.ace diff --git a/tests/strings/test_join_multiple_strings.cider b/tests/strings/test_join_multiple_strings.ace similarity index 100% rename from tests/strings/test_join_multiple_strings.cider rename to tests/strings/test_join_multiple_strings.ace diff --git a/tests/strings/test_var_ref.cider b/tests/strings/test_var_ref.ace similarity index 100% rename from tests/strings/test_var_ref.cider rename to tests/strings/test_var_ref.ace diff --git a/tests/sys/test_open_string.cider b/tests/sys/test_open_string.ace similarity index 100% rename from tests/sys/test_open_string.cider rename to tests/sys/test_open_string.ace diff --git a/tests/test-assert-fail.sh b/tests/test-assert-fail.sh index d3872426..4594da7d 100644 --- a/tests/test-assert-fail.sh +++ b/tests/test-assert-fail.sh @@ -2,6 +2,6 @@ bin_dir=$1 source_dir=$2 -"${bin_dir}/cider" run ${source_dir}/tests/test_assert_fail | grep -E "tests/test_assert_fail.cider:2:17.* assertion failed: .*std.False.* is False" +"${bin_dir}/ace" run ${source_dir}/tests/test_assert_fail | grep -E "tests/test_assert_fail.ace:2:17.* assertion failed: .*std.False.* is False" ret=$? exit ${ret} diff --git a/tests/test_accidental_newtype_variables.cider b/tests/test_accidental_newtype_variables.ace similarity index 100% rename from tests/test_accidental_newtype_variables.cider rename to tests/test_accidental_newtype_variables.ace diff --git a/tests/test_accidental_struct_variables.cider b/tests/test_accidental_struct_variables.ace similarity index 100% rename from tests/test_accidental_struct_variables.cider rename to tests/test_accidental_struct_variables.ace diff --git a/tests/test_accidental_type_variables.cider b/tests/test_accidental_type_variables.ace similarity index 100% rename from tests/test_accidental_type_variables.cider rename to tests/test_accidental_type_variables.ace diff --git a/tests/test_added_ir.cider b/tests/test_added_ir.ace similarity index 100% rename from tests/test_added_ir.cider rename to tests/test_added_ir.ace diff --git a/tests/test_all_unification_errors.cider b/tests/test_all_unification_errors.ace similarity index 100% rename from tests/test_all_unification_errors.cider rename to tests/test_all_unification_errors.ace diff --git a/tests/test_arg_parser.cider b/tests/test_arg_parser.ace similarity index 100% rename from tests/test_arg_parser.cider rename to tests/test_arg_parser.ace diff --git a/tests/test_array_literal.cider b/tests/test_array_literal.ace similarity index 100% rename from tests/test_array_literal.cider rename to tests/test_array_literal.ace diff --git a/tests/test_assert.cider b/tests/test_assert.ace similarity index 100% rename from tests/test_assert.cider rename to tests/test_assert.ace diff --git a/tests/test_assert_fail.cider b/tests/test_assert_fail.ace similarity index 100% rename from tests/test_assert_fail.cider rename to tests/test_assert_fail.ace diff --git a/tests/test_backtrack.cider b/tests/test_backtrack.ace similarity index 100% rename from tests/test_backtrack.cider rename to tests/test_backtrack.ace diff --git a/tests/test_backtrack_unique.cider b/tests/test_backtrack_unique.ace similarity index 100% rename from tests/test_backtrack_unique.cider rename to tests/test_backtrack_unique.ace diff --git a/tests/test_bad_import.cider b/tests/test_bad_import.ace similarity index 100% rename from tests/test_bad_import.cider rename to tests/test_bad_import.ace diff --git a/tests/test_bad_instance.cider b/tests/test_bad_instance.ace similarity index 100% rename from tests/test_bad_instance.cider rename to tests/test_bad_instance.ace diff --git a/tests/test_basic.cider b/tests/test_basic.ace similarity index 100% rename from tests/test_basic.cider rename to tests/test_basic.ace diff --git a/tests/test_basic_tuple.cider b/tests/test_basic_tuple.ace similarity index 80% rename from tests/test_basic_tuple.cider rename to tests/test_basic_tuple.ace index 9648a24c..c99fa5fc 100644 --- a/tests/test_basic_tuple.cider +++ b/tests/test_basic_tuple.ace @@ -7,6 +7,6 @@ data T { fn main() { let x = T(1, 2) let T(y, _) = x - (ffi cider_print_int64(y))! + (ffi ace_print_int64(y))! __builtin_pass_test } diff --git a/tests/test_bool_match.cider b/tests/test_bool_match.ace similarity index 100% rename from tests/test_bool_match.cider rename to tests/test_bool_match.ace diff --git a/tests/test_boris.cider b/tests/test_boris.ace similarity index 100% rename from tests/test_boris.cider rename to tests/test_boris.ace diff --git a/tests/test_bubble_sort.cider b/tests/test_bubble_sort.ace similarity index 100% rename from tests/test_bubble_sort.cider rename to tests/test_bubble_sort.ace diff --git a/tests/test_builtin_memcpy.cider b/tests/test_builtin_memcpy.ace similarity index 100% rename from tests/test_builtin_memcpy.cider rename to tests/test_builtin_memcpy.ace diff --git a/tests/test_capital_parameter.cider b/tests/test_capital_parameter.ace similarity index 100% rename from tests/test_capital_parameter.cider rename to tests/test_capital_parameter.ace diff --git a/tests/test_chaining_function_calls.cider b/tests/test_chaining_function_calls.ace similarity index 100% rename from tests/test_chaining_function_calls.cider rename to tests/test_chaining_function_calls.ace diff --git a/tests/test_chaining_local_fn.cider b/tests/test_chaining_local_fn.ace similarity index 100% rename from tests/test_chaining_local_fn.cider rename to tests/test_chaining_local_fn.ace diff --git a/tests/test_chaining_multiple.cider b/tests/test_chaining_multiple.ace similarity index 100% rename from tests/test_chaining_multiple.cider rename to tests/test_chaining_multiple.ace diff --git a/tests/test_char_tuple_size.cider b/tests/test_char_tuple_size.ace similarity index 100% rename from tests/test_char_tuple_size.cider rename to tests/test_char_tuple_size.ace diff --git a/tests/test_check_decls_order.cider b/tests/test_check_decls_order.ace similarity index 100% rename from tests/test_check_decls_order.cider rename to tests/test_check_decls_order.ace diff --git a/tests/test_closure_offsets.cider b/tests/test_closure_offsets.ace similarity index 100% rename from tests/test_closure_offsets.cider rename to tests/test_closure_offsets.ace diff --git a/tests/test_color.cider b/tests/test_color.ace similarity index 100% rename from tests/test_color.cider rename to tests/test_color.ace diff --git a/tests/test_compose.cider b/tests/test_compose.ace similarity index 85% rename from tests/test_compose.cider rename to tests/test_compose.ace index 8ac76c20..c45746ff 100644 --- a/tests/test_compose.cider +++ b/tests/test_compose.ace @@ -5,7 +5,7 @@ let . = |f, g| => |x| => f(g(x)) let + = |x, y| => __builtin_add_int(x, y) let * = |x, y| => __builtin_multiply_int(x, y) -fn print_int(x Int) () => ffi cider_print_int64(x) +fn print_int(x Int) () => ffi ace_print_int64(x) fn inc(x) => x + 1 fn square(x) => x * x let inc_square_print = print_int . square . inc diff --git a/tests/test_comprehensions.cider b/tests/test_comprehensions.ace similarity index 100% rename from tests/test_comprehensions.cider rename to tests/test_comprehensions.ace diff --git a/tests/test_csv_reader.cider b/tests/test_csv_reader.ace similarity index 100% rename from tests/test_csv_reader.cider rename to tests/test_csv_reader.ace diff --git a/tests/test_ctor_predicate_destructuring.cider b/tests/test_ctor_predicate_destructuring.ace similarity index 100% rename from tests/test_ctor_predicate_destructuring.cider rename to tests/test_ctor_predicate_destructuring.ace diff --git a/tests/test_ctor_predicate_destructuring_error.cider b/tests/test_ctor_predicate_destructuring_error.ace similarity index 100% rename from tests/test_ctor_predicate_destructuring_error.cider rename to tests/test_ctor_predicate_destructuring_error.ace diff --git a/tests/test_default_type_class_implementations.cider b/tests/test_default_type_class_implementations.ace similarity index 100% rename from tests/test_default_type_class_implementations.cider rename to tests/test_default_type_class_implementations.ace diff --git a/tests/test_defer.cider b/tests/test_defer.ace similarity index 100% rename from tests/test_defer.cider rename to tests/test_defer.ace diff --git a/tests/test_defer_continue.cider b/tests/test_defer_continue.ace similarity index 100% rename from tests/test_defer_continue.cider rename to tests/test_defer_continue.ace diff --git a/tests/test_deriving_eq.cider b/tests/test_deriving_eq.ace similarity index 100% rename from tests/test_deriving_eq.cider rename to tests/test_deriving_eq.ace diff --git a/tests/test_divide_by_eq.cider b/tests/test_divide_by_eq.ace similarity index 100% rename from tests/test_divide_by_eq.cider rename to tests/test_divide_by_eq.ace diff --git a/tests/test_dot_postfix_compose.cider b/tests/test_dot_postfix_compose.ace similarity index 100% rename from tests/test_dot_postfix_compose.cider rename to tests/test_dot_postfix_compose.ace diff --git a/tests/test_eightq.cider b/tests/test_eightq.ace similarity index 100% rename from tests/test_eightq.cider rename to tests/test_eightq.ace diff --git a/tests/test_empty_pattern.cider b/tests/test_empty_pattern.ace similarity index 100% rename from tests/test_empty_pattern.cider rename to tests/test_empty_pattern.ace diff --git a/tests/test_empty_slice.cider b/tests/test_empty_slice.ace similarity index 100% rename from tests/test_empty_slice.cider rename to tests/test_empty_slice.ace diff --git a/tests/test_eq_ptrs.cider b/tests/test_eq_ptrs.ace similarity index 100% rename from tests/test_eq_ptrs.cider rename to tests/test_eq_ptrs.ace diff --git a/tests/test_eq_values.cider b/tests/test_eq_values.ace similarity index 100% rename from tests/test_eq_values.cider rename to tests/test_eq_values.ace diff --git a/tests/test_euler_01.cider b/tests/test_euler_01.ace similarity index 100% rename from tests/test_euler_01.cider rename to tests/test_euler_01.ace diff --git a/tests/test_euler_02.cider b/tests/test_euler_02.ace similarity index 100% rename from tests/test_euler_02.cider rename to tests/test_euler_02.ace diff --git a/tests/test_ferber.cider b/tests/test_ferber.ace similarity index 100% rename from tests/test_ferber.cider rename to tests/test_ferber.ace diff --git a/tests/test_ffi.cider b/tests/test_ffi.ace similarity index 100% rename from tests/test_ffi.cider rename to tests/test_ffi.ace diff --git a/tests/test_fib.cider b/tests/test_fib.ace similarity index 100% rename from tests/test_fib.cider rename to tests/test_fib.ace diff --git a/tests/test_float_destructuring.cider b/tests/test_float_destructuring.ace similarity index 100% rename from tests/test_float_destructuring.cider rename to tests/test_float_destructuring.ace diff --git a/tests/test_fmap_either.cider b/tests/test_fmap_either.ace similarity index 91% rename from tests/test_fmap_either.cider rename to tests/test_fmap_either.ace index 9e5a4fc2..0bfd5b2c 100644 --- a/tests/test_fmap_either.cider +++ b/tests/test_fmap_either.ace @@ -24,7 +24,7 @@ instance Functor (Either a) { fn main() { let e = Right(3.0) as Either Char Float match fmap(const42, e) { - Right(i) => ffi cider_print_int64(i) + Right(i) => ffi ace_print_int64(i) Left(_) => () } ffi puts("PASS") diff --git a/tests/test_fn_ordering.cider b/tests/test_fn_ordering.ace similarity index 100% rename from tests/test_fn_ordering.cider rename to tests/test_fn_ordering.ace diff --git a/tests/test_for_loop.cider b/tests/test_for_loop.ace similarity index 100% rename from tests/test_for_loop.cider rename to tests/test_for_loop.ace diff --git a/tests/test_for_var_destructuring.cider b/tests/test_for_var_destructuring.ace similarity index 100% rename from tests/test_for_var_destructuring.cider rename to tests/test_for_var_destructuring.ace diff --git a/tests/test_generic_overloading.cider b/tests/test_generic_overloading.ace similarity index 100% rename from tests/test_generic_overloading.cider rename to tests/test_generic_overloading.ace diff --git a/tests/test_geometry.cider b/tests/test_geometry.ace similarity index 100% rename from tests/test_geometry.cider rename to tests/test_geometry.ace diff --git a/tests/test_get_out_of_order.cider b/tests/test_get_out_of_order.ace similarity index 100% rename from tests/test_get_out_of_order.cider rename to tests/test_get_out_of_order.ace diff --git a/tests/test_global_call.cider b/tests/test_global_call.ace similarity index 100% rename from tests/test_global_call.cider rename to tests/test_global_call.ace diff --git a/tests/test_global_call_complex.cider b/tests/test_global_call_complex.ace similarity index 100% rename from tests/test_global_call_complex.cider rename to tests/test_global_call_complex.ace diff --git a/tests/test_global_call_nested.cider b/tests/test_global_call_nested.ace similarity index 100% rename from tests/test_global_call_nested.cider rename to tests/test_global_call_nested.ace diff --git a/tests/test_global_map.cider b/tests/test_global_map.ace similarity index 100% rename from tests/test_global_map.cider rename to tests/test_global_map.ace diff --git a/tests/test_global_name_override.cider b/tests/test_global_name_override.ace similarity index 100% rename from tests/test_global_name_override.cider rename to tests/test_global_name_override.ace diff --git a/tests/test_global_var_cycle.cider b/tests/test_global_var_cycle.ace similarity index 100% rename from tests/test_global_var_cycle.cider rename to tests/test_global_var_cycle.ace diff --git a/tests/test_global_vector.cider b/tests/test_global_vector.ace similarity index 100% rename from tests/test_global_vector.cider rename to tests/test_global_vector.ace diff --git a/tests/test_hexadecimal.cider b/tests/test_hexadecimal.ace similarity index 100% rename from tests/test_hexadecimal.cider rename to tests/test_hexadecimal.ace diff --git a/tests/test_if_in_match.cider b/tests/test_if_in_match.ace similarity index 100% rename from tests/test_if_in_match.cider rename to tests/test_if_in_match.ace diff --git a/tests/test_if_is.cider b/tests/test_if_is.ace similarity index 100% rename from tests/test_if_is.cider rename to tests/test_if_is.ace diff --git a/tests/test_if_is_else.cider b/tests/test_if_is_else.ace similarity index 100% rename from tests/test_if_is_else.cider rename to tests/test_if_is_else.ace diff --git a/tests/test_illegal_imports.cider b/tests/test_illegal_imports.ace similarity index 100% rename from tests/test_illegal_imports.cider rename to tests/test_illegal_imports.ace diff --git a/tests/test_import_exported_class_fn.cider b/tests/test_import_exported_class_fn.ace similarity index 100% rename from tests/test_import_exported_class_fn.cider rename to tests/test_import_exported_class_fn.ace diff --git a/tests/test_import_pi.cider b/tests/test_import_pi.ace similarity index 100% rename from tests/test_import_pi.cider rename to tests/test_import_pi.ace diff --git a/tests/test_import_unexported_class.cider b/tests/test_import_unexported_class.ace similarity index 100% rename from tests/test_import_unexported_class.cider rename to tests/test_import_unexported_class.ace diff --git a/tests/test_inferred_return_type.cider b/tests/test_inferred_return_type.ace similarity index 100% rename from tests/test_inferred_return_type.cider rename to tests/test_inferred_return_type.ace diff --git a/tests/test_instance_deduction.cider b/tests/test_instance_deduction.ace similarity index 100% rename from tests/test_instance_deduction.cider rename to tests/test_instance_deduction.ace diff --git a/tests/test_instance_vars.cider b/tests/test_instance_vars.ace similarity index 100% rename from tests/test_instance_vars.cider rename to tests/test_instance_vars.ace diff --git a/tests/test_instance_vars_no_var.cider b/tests/test_instance_vars_no_var.ace similarity index 100% rename from tests/test_instance_vars_no_var.cider rename to tests/test_instance_vars_no_var.ace diff --git a/tests/test_is_sorted.cider b/tests/test_is_sorted.ace similarity index 100% rename from tests/test_is_sorted.cider rename to tests/test_is_sorted.ace diff --git a/tests/test_iter_array.cider b/tests/test_iter_array.ace similarity index 100% rename from tests/test_iter_array.cider rename to tests/test_iter_array.ace diff --git a/tests/test_iter_filter.cider b/tests/test_iter_filter.ace similarity index 100% rename from tests/test_iter_filter.cider rename to tests/test_iter_filter.ace diff --git a/tests/test_iter_map.cider b/tests/test_iter_map.ace similarity index 100% rename from tests/test_iter_map.cider rename to tests/test_iter_map.ace diff --git a/tests/test_itertools_cycle.cider b/tests/test_itertools_cycle.ace similarity index 100% rename from tests/test_itertools_cycle.cider rename to tests/test_itertools_cycle.ace diff --git a/tests/test_itertools_dropwhile.cider b/tests/test_itertools_dropwhile.ace similarity index 100% rename from tests/test_itertools_dropwhile.cider rename to tests/test_itertools_dropwhile.ace diff --git a/tests/test_itertools_take.cider b/tests/test_itertools_take.ace similarity index 100% rename from tests/test_itertools_take.cider rename to tests/test_itertools_take.ace diff --git a/tests/test_itertools_takewhile.cider b/tests/test_itertools_takewhile.ace similarity index 100% rename from tests/test_itertools_takewhile.cider rename to tests/test_itertools_takewhile.ace diff --git a/tests/test_jacq.cider b/tests/test_jacq.ace similarity index 100% rename from tests/test_jacq.cider rename to tests/test_jacq.ace diff --git a/tests/test_json.cider b/tests/test_json.ace similarity index 100% rename from tests/test_json.cider rename to tests/test_json.ace diff --git a/tests/test_json_strings.cider b/tests/test_json_strings.ace similarity index 100% rename from tests/test_json_strings.cider rename to tests/test_json_strings.ace diff --git a/tests/test_lambda.cider b/tests/test_lambda.ace similarity index 100% rename from tests/test_lambda.cider rename to tests/test_lambda.ace diff --git a/tests/test_lambda_inference.cider b/tests/test_lambda_inference.ace similarity index 100% rename from tests/test_lambda_inference.cider rename to tests/test_lambda_inference.ace diff --git a/tests/test_let.cider b/tests/test_let.ace similarity index 100% rename from tests/test_let.cider rename to tests/test_let.ace diff --git a/tests/test_let_destructuring_var.cider b/tests/test_let_destructuring_var.ace similarity index 100% rename from tests/test_let_destructuring_var.cider rename to tests/test_let_destructuring_var.ace diff --git a/tests/test_let_lambda.cider b/tests/test_let_lambda.ace similarity index 100% rename from tests/test_let_lambda.cider rename to tests/test_let_lambda.ace diff --git a/tests/test_long_op.cider b/tests/test_long_op.ace similarity index 78% rename from tests/test_long_op.cider rename to tests/test_long_op.ace index b8be1337..75b83f35 100644 --- a/tests/test_long_op.cider +++ b/tests/test_long_op.ace @@ -5,5 +5,5 @@ fn !=(x, y) => __builtin_int_ne(x, y) ? 1 : 0 fn <>(x, y) => x != y fn main() { - ffi cider_print_int64(1 <> 2) + ffi ace_print_int64(1 <> 2) } diff --git a/tests/test_ltgt_operator.cider b/tests/test_ltgt_operator.ace similarity index 92% rename from tests/test_ltgt_operator.cider rename to tests/test_ltgt_operator.ace index 1f48ca14..abb2de8a 100644 --- a/tests/test_ltgt_operator.cider +++ b/tests/test_ltgt_operator.ace @@ -19,5 +19,5 @@ fn main() { let a = Integer(1) let b = Integer(2) let Integer(c) = a <> b - ffi cider_print_int64(c) + ffi ace_print_int64(c) } diff --git a/tests/test_mandel.cider b/tests/test_mandel.ace similarity index 100% rename from tests/test_mandel.cider rename to tests/test_mandel.ace diff --git a/tests/test_many_delimited.cider b/tests/test_many_delimited.ace similarity index 100% rename from tests/test_many_delimited.cider rename to tests/test_many_delimited.ace diff --git a/tests/test_match.cider b/tests/test_match.ace similarity index 100% rename from tests/test_match.cider rename to tests/test_match.ace diff --git a/tests/test_match_int.cider b/tests/test_match_int.ace similarity index 100% rename from tests/test_match_int.cider rename to tests/test_match_int.ace diff --git a/tests/test_match_string.cider b/tests/test_match_string.ace similarity index 100% rename from tests/test_match_string.cider rename to tests/test_match_string.ace diff --git a/tests/test_matrix.cider b/tests/test_matrix.ace similarity index 100% rename from tests/test_matrix.cider rename to tests/test_matrix.ace diff --git a/tests/test_minus_eq.cider b/tests/test_minus_eq.ace similarity index 100% rename from tests/test_minus_eq.cider rename to tests/test_minus_eq.ace diff --git a/tests/test_mod.cider b/tests/test_mod.ace similarity index 100% rename from tests/test_mod.cider rename to tests/test_mod.ace diff --git a/tests/test_mod_eq.cider b/tests/test_mod_eq.ace similarity index 100% rename from tests/test_mod_eq.cider rename to tests/test_mod_eq.ace diff --git a/tests/test_mod_eq_fail.cider b/tests/test_mod_eq_fail.ace similarity index 100% rename from tests/test_mod_eq_fail.cider rename to tests/test_mod_eq_fail.ace diff --git a/tests/test_mptc.cider b/tests/test_mptc.ace similarity index 100% rename from tests/test_mptc.cider rename to tests/test_mptc.ace diff --git a/tests/test_mptc_01.cider b/tests/test_mptc_01.ace similarity index 100% rename from tests/test_mptc_01.cider rename to tests/test_mptc_01.ace diff --git a/tests/test_name_collision_top_level.cider b/tests/test_name_collision_top_level.ace similarity index 100% rename from tests/test_name_collision_top_level.cider rename to tests/test_name_collision_top_level.ace diff --git a/tests/test_nested_newtype.cider b/tests/test_nested_newtype.ace similarity index 100% rename from tests/test_nested_newtype.cider rename to tests/test_nested_newtype.ace diff --git a/tests/test_nested_string_match.cider b/tests/test_nested_string_match.ace similarity index 100% rename from tests/test_nested_string_match.cider rename to tests/test_nested_string_match.ace diff --git a/tests/test_nested_vectors.cider b/tests/test_nested_vectors.ace similarity index 100% rename from tests/test_nested_vectors.cider rename to tests/test_nested_vectors.ace diff --git a/tests/test_newtype.cider b/tests/test_newtype.ace similarity index 100% rename from tests/test_newtype.cider rename to tests/test_newtype.ace diff --git a/tests/test_newtype_fn.cider b/tests/test_newtype_fn.ace similarity index 100% rename from tests/test_newtype_fn.cider rename to tests/test_newtype_fn.ace diff --git a/tests/test_newtype_in_tuple_destructure.cider b/tests/test_newtype_in_tuple_destructure.ace similarity index 100% rename from tests/test_newtype_in_tuple_destructure.cider rename to tests/test_newtype_in_tuple_destructure.ace diff --git a/tests/test_newtype_int.cider b/tests/test_newtype_int.ace similarity index 100% rename from tests/test_newtype_int.cider rename to tests/test_newtype_int.ace diff --git a/tests/test_newtype_nested_newtypes.cider b/tests/test_newtype_nested_newtypes.ace similarity index 100% rename from tests/test_newtype_nested_newtypes.cider rename to tests/test_newtype_nested_newtypes.ace diff --git a/tests/test_newtype_tuple.cider b/tests/test_newtype_tuple.ace similarity index 100% rename from tests/test_newtype_tuple.cider rename to tests/test_newtype_tuple.ace diff --git a/tests/test_octal.cider b/tests/test_octal.ace similarity index 100% rename from tests/test_octal.cider rename to tests/test_octal.ace diff --git a/tests/test_ord_int.cider b/tests/test_ord_int.ace similarity index 100% rename from tests/test_ord_int.cider rename to tests/test_ord_int.ace diff --git a/tests/test_ord_int_compare.cider b/tests/test_ord_int_compare.ace similarity index 100% rename from tests/test_ord_int_compare.cider rename to tests/test_ord_int_compare.ace diff --git a/tests/test_ord_pair.cider b/tests/test_ord_pair.ace similarity index 100% rename from tests/test_ord_pair.cider rename to tests/test_ord_pair.ace diff --git a/tests/test_panic.cider b/tests/test_panic.ace similarity index 100% rename from tests/test_panic.cider rename to tests/test_panic.ace diff --git a/tests/test_parser_combinators.cider b/tests/test_parser_combinators.ace similarity index 100% rename from tests/test_parser_combinators.cider rename to tests/test_parser_combinators.ace diff --git a/tests/test_pass.cider b/tests/test_pass.ace similarity index 100% rename from tests/test_pass.cider rename to tests/test_pass.ace diff --git a/tests/test_pass_infix_as_param.cider b/tests/test_pass_infix_as_param.ace similarity index 100% rename from tests/test_pass_infix_as_param.cider rename to tests/test_pass_infix_as_param.ace diff --git a/tests/test_passing.cider b/tests/test_passing.ace similarity index 100% rename from tests/test_passing.cider rename to tests/test_passing.ace diff --git a/tests/test_pi_used_in_multiple_functions.cider b/tests/test_pi_used_in_multiple_functions.ace similarity index 100% rename from tests/test_pi_used_in_multiple_functions.cider rename to tests/test_pi_used_in_multiple_functions.ace diff --git a/tests/test_plus_eq.cider b/tests/test_plus_eq.ace similarity index 100% rename from tests/test_plus_eq.cider rename to tests/test_plus_eq.ace diff --git a/tests/test_precedence.cider b/tests/test_precedence.ace similarity index 100% rename from tests/test_precedence.cider rename to tests/test_precedence.ace diff --git a/tests/test_prefixing.cider b/tests/test_prefixing.ace similarity index 100% rename from tests/test_prefixing.cider rename to tests/test_prefixing.ace diff --git a/tests/test_primes.cider b/tests/test_primes.ace similarity index 100% rename from tests/test_primes.cider rename to tests/test_primes.ace diff --git a/tests/test_print_iter.cider b/tests/test_print_iter.ace similarity index 100% rename from tests/test_print_iter.cider rename to tests/test_print_iter.ace diff --git a/tests/test_quicksort.cider b/tests/test_quicksort.ace similarity index 100% rename from tests/test_quicksort.cider rename to tests/test_quicksort.ace diff --git a/tests/test_rand.cider b/tests/test_rand.ace similarity index 100% rename from tests/test_rand.cider rename to tests/test_rand.ace diff --git a/tests/test_readline.cider b/tests/test_readline.ace similarity index 100% rename from tests/test_readline.cider rename to tests/test_readline.ace diff --git a/tests/test_recursion.cider b/tests/test_recursion.ace similarity index 100% rename from tests/test_recursion.cider rename to tests/test_recursion.ace diff --git a/tests/test_return_unit_conditional.cider b/tests/test_return_unit_conditional.ace similarity index 100% rename from tests/test_return_unit_conditional.cider rename to tests/test_return_unit_conditional.ace diff --git a/tests/test_set_destructure.cider b/tests/test_set_destructure.ace similarity index 100% rename from tests/test_set_destructure.cider rename to tests/test_set_destructure.ace diff --git a/tests/test_shadowing.cider b/tests/test_shadowing.ace similarity index 100% rename from tests/test_shadowing.cider rename to tests/test_shadowing.ace diff --git a/tests/test_slice_from.cider b/tests/test_slice_from.ace similarity index 100% rename from tests/test_slice_from.cider rename to tests/test_slice_from.ace diff --git a/tests/test_slice_from_to.cider b/tests/test_slice_from_to.ace similarity index 100% rename from tests/test_slice_from_to.cider rename to tests/test_slice_from_to.ace diff --git a/tests/test_slice_vector.cider b/tests/test_slice_vector.ace similarity index 100% rename from tests/test_slice_vector.cider rename to tests/test_slice_vector.ace diff --git a/tests/test_sort.cider b/tests/test_sort.ace similarity index 100% rename from tests/test_sort.cider rename to tests/test_sort.ace diff --git a/tests/test_str_float.cider b/tests/test_str_float.ace similarity index 100% rename from tests/test_str_float.cider rename to tests/test_str_float.ace diff --git a/tests/test_string_compare.cider b/tests/test_string_compare.ace similarity index 100% rename from tests/test_string_compare.cider rename to tests/test_string_compare.ace diff --git a/tests/test_string_has_prefix.cider b/tests/test_string_has_prefix.ace similarity index 100% rename from tests/test_string_has_prefix.cider rename to tests/test_string_has_prefix.ace diff --git a/tests/test_string_has_substring.cider b/tests/test_string_has_substring.ace similarity index 100% rename from tests/test_string_has_substring.cider rename to tests/test_string_has_substring.ace diff --git a/tests/test_string_has_suffix.cider b/tests/test_string_has_suffix.ace similarity index 100% rename from tests/test_string_has_suffix.cider rename to tests/test_string_has_suffix.ace diff --git a/tests/test_string_pattern_coverage.cider b/tests/test_string_pattern_coverage.ace similarity index 100% rename from tests/test_string_pattern_coverage.cider rename to tests/test_string_pattern_coverage.ace diff --git a/tests/test_strings.cider b/tests/test_strings.ace similarity index 100% rename from tests/test_strings.cider rename to tests/test_strings.ace diff --git a/tests/test_struct_destructuring.cider b/tests/test_struct_destructuring.ace similarity index 100% rename from tests/test_struct_destructuring.cider rename to tests/test_struct_destructuring.ace diff --git a/tests/test_struct_destructuring_from_other_module.cider b/tests/test_struct_destructuring_from_other_module.ace similarity index 100% rename from tests/test_struct_destructuring_from_other_module.cider rename to tests/test_struct_destructuring_from_other_module.ace diff --git a/tests/test_struct_member_vars.cider b/tests/test_struct_member_vars.ace similarity index 100% rename from tests/test_struct_member_vars.cider rename to tests/test_struct_member_vars.ace diff --git a/tests/test_super_application.cider b/tests/test_super_application.ace similarity index 100% rename from tests/test_super_application.cider rename to tests/test_super_application.ace diff --git a/tests/test_sys_args.cider b/tests/test_sys_args.ace similarity index 100% rename from tests/test_sys_args.cider rename to tests/test_sys_args.ace diff --git a/tests/test_sys_creat.cider b/tests/test_sys_creat.ace similarity index 100% rename from tests/test_sys_creat.cider rename to tests/test_sys_creat.ace diff --git a/tests/test_ternary.cider b/tests/test_ternary.ace similarity index 100% rename from tests/test_ternary.cider rename to tests/test_ternary.ace diff --git a/tests/test_times_eq.cider b/tests/test_times_eq.ace similarity index 100% rename from tests/test_times_eq.cider rename to tests/test_times_eq.ace diff --git a/tests/test_transform2d.cider b/tests/test_transform2d.ace similarity index 100% rename from tests/test_transform2d.cider rename to tests/test_transform2d.ace diff --git a/tests/test_trigonometry.cider b/tests/test_trigonometry.ace similarity index 100% rename from tests/test_trigonometry.cider rename to tests/test_trigonometry.ace diff --git a/tests/test_tuple_create.cider b/tests/test_tuple_create.ace similarity index 100% rename from tests/test_tuple_create.cider rename to tests/test_tuple_create.ace diff --git a/tests/test_tuple_functions.cider b/tests/test_tuple_functions.ace similarity index 100% rename from tests/test_tuple_functions.cider rename to tests/test_tuple_functions.ace diff --git a/tests/test_tuple_offsets.cider b/tests/test_tuple_offsets.ace similarity index 100% rename from tests/test_tuple_offsets.cider rename to tests/test_tuple_offsets.ace diff --git a/tests/test_two_for_loops.cider b/tests/test_two_for_loops.ace similarity index 100% rename from tests/test_two_for_loops.cider rename to tests/test_two_for_loops.ace diff --git a/tests/test_type_variable_new.cider b/tests/test_type_variable_new.ace similarity index 100% rename from tests/test_type_variable_new.cider rename to tests/test_type_variable_new.ace diff --git a/tests/test_unary_tuple_newtype.cider b/tests/test_unary_tuple_newtype.ace similarity index 75% rename from tests/test_unary_tuple_newtype.cider rename to tests/test_unary_tuple_newtype.ace index 86102424..cbb43cea 100644 --- a/tests/test_unary_tuple_newtype.cider +++ b/tests/test_unary_tuple_newtype.ace @@ -3,5 +3,5 @@ newtype A = A(Int) fn main() { let A(x) = A(3) - ffi cider_print_int64(x)! + ffi ace_print_int64(x)! } diff --git a/tests/test_unit_callsite_after_dot_ident.cider b/tests/test_unit_callsite_after_dot_ident.ace similarity index 100% rename from tests/test_unit_callsite_after_dot_ident.cider rename to tests/test_unit_callsite_after_dot_ident.ace diff --git a/tests/test_utils.cider b/tests/test_utils.ace similarity index 100% rename from tests/test_utils.cider rename to tests/test_utils.ace diff --git a/tests/test_var_ref_destructuring.cider b/tests/test_var_ref_destructuring.ace similarity index 100% rename from tests/test_var_ref_destructuring.cider rename to tests/test_var_ref_destructuring.ace diff --git a/tests/test_vector_growth.cider b/tests/test_vector_growth.ace similarity index 100% rename from tests/test_vector_growth.cider rename to tests/test_vector_growth.ace diff --git a/tests/test_while_in_expr_block.cider b/tests/test_while_in_expr_block.ace similarity index 100% rename from tests/test_while_in_expr_block.cider rename to tests/test_while_in_expr_block.ace diff --git a/tests/test_whole_slice.cider b/tests/test_whole_slice.ace similarity index 100% rename from tests/test_whole_slice.cider rename to tests/test_whole_slice.ace diff --git a/tests/test_with.cider b/tests/test_with.ace similarity index 100% rename from tests/test_with.cider rename to tests/test_with.ace diff --git a/tests/test_write_to_root.cider b/tests/test_write_to_root.ace similarity index 100% rename from tests/test_write_to_root.cider rename to tests/test_write_to_root.ace diff --git a/tests/test_wrong_number_of_parameters.cider b/tests/test_wrong_number_of_parameters.ace similarity index 100% rename from tests/test_wrong_number_of_parameters.cider rename to tests/test_wrong_number_of_parameters.ace