Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a basic JavaScript-to-FuzzIL compiler
The new compiler: - Is (mostly) written in Swift to ensure that changes to FuzzIL are reflected in the compiler. - Features an "end-to-end" testsuite that runs as part of `swift test`. The testsuite consists of a number of JavaScript programs which are compiled to FuzzIL, then lifted back to JavaScript and checked to produce the same output as the original code. - Uses a (fairly) stable protobuf-based AST format which is currently produced by a node.js-based parser (since there seem to be no good JavaScript parsers with swift integration), but could also be produced by any other parser. The compiler is still quite far away from being feature complete but it should support the most important language features. Adding support for more features is usually relatively simple: typically it involves adding one or more tests to the testuite, adding the relevant AST nodes to ast.proto, updating the parser script to emit these nodes, and updating the compiler to handle them. However, some features may require changes to FuzzIL, such as proper handling of loop headers. The compiler is currently exposed through the FuzzILTool's --compile option. In the future we may want to have a more sophisticated CLI interface, for example to allow removing calls to certain functions (such as assertX from tests) from the compiled code.
- Loading branch information
Samuel Groß
committed
Feb 22, 2023
1 parent
c8b25c3
commit 807625f
Showing
156 changed files
with
7,815 additions
and
10,340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*js | ||
*fuzzil.protobuf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.