Skip to content

Commit

Permalink
Merge pull request #892 from andrew-johnson-4/remove-backend
Browse files Browse the repository at this point in the history
Remove backend
  • Loading branch information
andrew-johnson-4 authored Nov 3, 2024
2 parents 726dbe9 + cd1ff18 commit 7e29d8d
Show file tree
Hide file tree
Showing 43 changed files with 22,720 additions and 22,944 deletions.
45,514 changes: 22,676 additions & 22,838 deletions BOOTSTRAP/cli.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lambda_mountain"
version = "1.18.2"
version = "1.18.3"
authors = ["Andrew <andrew@subarctic.org>"]
license = "MIT"
description = "Typed Macro Assembler (backed by Coq proofs-of-correctness)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

compile-blob := λ. (: (
plugins-backend-blob-compile := λ. (: (
(let preview-program ast-parsed-program)
(while (non-zero preview-program) (match preview-program (
()
Expand Down
2 changes: 2 additions & 0 deletions PLUGINS/BACKEND/BLOB/index-index.lm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

import PLUGINS/BACKEND/BLOB/compile-blob.lm;
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions SRC/cc-blob.lm → PLUGINS/BACKEND/C/cc-blob.lm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ cc-blob := λ(: caller-ctx FContext)(: function-name String)(: args AST)(: offse
(set r (blob-render( callee-ctx rhs r offset )))
(let t (.term f))
(set.type( r (range(typeof t)) ))
#(set r (fragment::set-type( r (range(typeof t)) )))
(set r (fragment::set-offset( r offset )))
(set r (fragment::set-context( r caller-ctx )))
))
Expand All @@ -34,7 +33,6 @@ cc-blob := λ(: callee-ctx FContext)(: function-name String)(: args-tt Type)(: o
(set r (blob-render( callee-ctx rhs r offset )))
(let t (.term f))
(set.type( r (range(typeof t)) ))
#(set r (fragment::set-type( r (range(typeof t)) )))
(set r (fragment::set-offset( r offset )))
(set r (fragment::set-context( r callee-ctx )))
))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion SRC/compile-c.lm → PLUGINS/BACKEND/C/compile-c.lm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

compile-c := λ . (: (
plugins-backend-c-compile := λ . (: (
(let preview-program ast-parsed-program)
(let typedefs ASTEOF)
(while (non-zero preview-program) (match preview-program (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions PLUGINS/BACKEND/C/index-index.lm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

import PLUGINS/BACKEND/C/compile-c.lm;
import PLUGINS/BACKEND/C/compile-expr.lm;
import PLUGINS/BACKEND/C/compile-expr-direct.lm;
import PLUGINS/BACKEND/C/compile-declare-cstring.lm;
import PLUGINS/BACKEND/C/compile-expr-direct.lm;
import PLUGINS/BACKEND/C/compile-global.lm;
import PLUGINS/BACKEND/C/compile-push-rvalue.lm;
import PLUGINS/BACKEND/C/compile-stack-call.lm;
import PLUGINS/BACKEND/C/translate-local-variables.lm;
import PLUGINS/BACKEND/C/compile-constructor.lm;
import PLUGINS/BACKEND/C/compile-destructure-args.lm;
import PLUGINS/BACKEND/C/compile-expr.lm;
import PLUGINS/BACKEND/C/compile-maybe-push-stack.lm;
import PLUGINS/BACKEND/C/compile-stack-call-push-args.lm;
import PLUGINS/BACKEND/C/compile-stack-calls.lm;
import PLUGINS/BACKEND/C/never-as-expr-type.lm;
import PLUGINS/BACKEND/C/compile-c-function-args.lm;
import PLUGINS/BACKEND/C/compile-c-text-header.lm;
import PLUGINS/BACKEND/C/compile-c-typedef.lm;
import PLUGINS/BACKEND/C/compile-data-header.lm;
import PLUGINS/BACKEND/C/compile-exit-cleanup.lm;
import PLUGINS/BACKEND/C/compile-finish.lm;
import PLUGINS/BACKEND/C/compile-program-ordered.lm;
import PLUGINS/BACKEND/C/compile-text-header.lm;
import PLUGINS/BACKEND/C/compile-write.lm;
import PLUGINS/BACKEND/C/initialize-c-struct.lm;
import PLUGINS/BACKEND/C/cc-args.lm;
import PLUGINS/BACKEND/C/cc-blob.lm;
import PLUGINS/BACKEND/C/blob-render.lm;
import PLUGINS/BACKEND/C/mangle-c-type.lm;
import PLUGINS/BACKEND/C/mangle-identifier.lm;
import PLUGINS/BACKEND/C/escape-string.lm;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 0 additions & 49 deletions SRC/compile-gnu.lm

This file was deleted.

7 changes: 0 additions & 7 deletions SRC/compile.lm

This file was deleted.

17 changes: 0 additions & 17 deletions SRC/index-assemble.lm

This file was deleted.

17 changes: 0 additions & 17 deletions SRC/index-codegen.lm

This file was deleted.

2 changes: 0 additions & 2 deletions SRC/index-index.lm
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import SRC/index-definitions.lm;
import SRC/index-globals.lm;
import SRC/index-utility.lm;
import SRC/index-types.lm;
import SRC/index-assemble.lm;
import SRC/index-context.lm;
import SRC/index-tokenize.lm;
import SRC/index-ast.lm;
import SRC/index-parse.lm;
import SRC/index-codegen.lm;
import SRC/index-preprocess.lm;
import SRC/index-fragment.lm;
import SRC/index-plugins.lm;
Expand Down
3 changes: 3 additions & 0 deletions SRC/index-plugins.lm
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ plugin-null-backend := λ. (: (
) Nil);

plugin-current-backend := (: (& plugin-null-backend) Arrow<Nil,Nil>[]);

import PLUGINS/BACKEND/C/index-index.lm;
import PLUGINS/BACKEND/BLOB/index-index.lm;
3 changes: 0 additions & 3 deletions SRC/index-utility.lm
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

import SRC/index-definitions.lm;

import SRC/mangle-identifier.lm;
import SRC/mangle-c-type.lm;
import SRC/escape-string.lm;
import SRC/error-formatting.lm;
import SRC/is-variable.lm;
import SRC/to-string.lm;
Expand Down
9 changes: 3 additions & 6 deletions SRC/main.lm
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ main := λ(: argc U64)(: argv String[]). (: (
(set config-assemble-mode AssembleC)
(set config-platform-prefix 'PLATFORM/C/_s)
(if (==( config-target '_s )) (set config-target 'tmp.c_s) ())
(set plugin-current-backend (& plugins-backend-c-compile))
))
('--blob_s (
(set config-assemble-mode AssembleBlob)
(set config-platform-prefix 'PLATFORM/BLOB/_s)
(if (==( config-target '_s )) (set config-target 'tmp.txt_s) ())
))
('--gnu_s (
(set config-assemble-mode AssembleGNU)
(set config-platform-prefix 'PLATFORM/GNU-X86/_s)
(if (==( config-target '_s )) (set config-target 'tmp.s_s) ())
(set plugin-current-backend (& plugins-backend-blob-compile))
))
('--tokenize_s (set config-mode ModeTokenize))
('--parse_s (set config-mode ModeParse))
Expand Down Expand Up @@ -74,7 +71,7 @@ main := λ(: argc U64)(: argv String[]). (: (
(parse())
(preprocess())
(typecheck())
(compile())
(plugin-current-backend())
))
))
) Nil);
Expand Down

0 comments on commit 7e29d8d

Please sign in to comment.