123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Gravity: Files</title>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css" />
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,800">
- <link rel="stylesheet" href="../scripts/highlight/styles/github-gist.css">
- <link rel="stylesheet" href="../stylesheets/styles.css">
- <script src="https://use.fontawesome.com/2e9ff283e5.js"></script>
- </head>
- <body>
- <!-- BEGIN NAVIGATION BAR -->
- <nav class="navbar navbar-default navbar-fixed-top">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="http://gravity-lang.org"><img src="../images/logo.png" width="32px" height="36px"></a>
- </div>
- <div id="navbar" class="navbar-collapse collapse">
- <ul class="nav navbar-nav navbar-right">
- <li><a href="../index.html">Gravity</a></li>
- <li class="active"><a href="index.html">Internals</a></li>
- <li><a href="https://github.com/marcobambini/gravity">GitHub</a></li>
- </ul>
- </div><!--/.nav-collapse -->
- </div>
- </nav>
- <!-- END NAVIGATION BAR -->
- <div class="container body-container">
- <div class="main-content">
- <div class="row">
-
- <!-- BEGIN SIDEBAR -->
- <div class="col-sm-3 border-right section-left">
- <div saveheight="1" class="sidebar-nav">
- <h4>1. OVERVIEW</h4>
- <ul>
- <li><a href="index.html"><span>Introduction</span></a></li>
- <li><a href="1_changelog.html"><span>Changelog</span></a></li>
- <li><a href="1_files.html" class="active"><span>Gravity files</span></a></li>
- </ul>
-
- <h4>2. PREREQUISITES</h4>
- <ul>
- <li><a href="2_overview.html"><span>Overview</span></a></li>
- <li><a href="2_array.html"><span>Array</span></a></li>
- <li><a href="2_hash.html"><span>Hash</span></a></li>
- <li><a href="2_memory.html"><span>Memory</span></a></li>
- <li><a href="2_utils.html"><span>Utils</span></a></li>
- <li><a href="2_json.html"><span>JSON</span></a></li>
- <li><a href="2_visitor.html"><span>Visitor Pattern</span></a></li>
- <li><a href="2_vm.html"><span>Stack vs Register VM</span></a></li>
- <li><a href="2_class.html"><span>Class and metaclass</span></a></li>
- </ul>
-
- <h4>3. COMPILER</h4>
- <ul>
- <li><a href="3_overview.html"><span>Overview</span></a></li>
- <li><a href="3_grammar.html"><span>Grammar</span></a></li>
- <li><a href="3_lexer.html"><span>Lexer</span></a></li>
- <li><a href="3_parser.html"><span>Parser</span></a></li>
- <li><a href="3_prattparser.html"><span>Pratt Parser</span></a></li>
- <li><a href="3_ast.html"><span>AST</span></a></li>
- <li><a href="3_symboltable.html"><span>Symbol Table</span></a></li>
- <li><a href="3_semantic.html"><span>Semantic Analyses</span></a></li>
- <li><a href="3_opcodes.html"><span>Opcodes</span></a></li>
- <li><a href="3_ircode.html"><span>IRCode</span></a></li>
- <li><a href="3_codegen.html"><span>Code Generation</span></a></li>
- <li><a href="3_optimizer.html"><span>Optimizer</span></a></li>
- <li><a href="3_bytecode.html"><span>Bytecode</span></a></li>
- </ul>
-
- <h4>4. RUNTIME</h4>
- <ul>
- <li><a href="4_overview.html"><span>Overview</span></a></li>
- <li><a href="4_objmodel.html"><span>Object Model</span></a></li>
- <li><a href="4_memory.html"><span>Memory Ownership</span></a></li>
- <li><a href="4_vm.html"><span>Virtual Machine</span></a></li>
- <li><a href="4_performance.html"><span>Efficient Interpreter</span></a></li>
- <li><a href="4_base.html"><span>Base Classes</span></a></li>
- <li><a href="4_gc.html"><span>Garbage Collector</span></a></li>
- </ul>
-
- <h4>5. LLVM</h4>
- <ul>
- <li><a href="5_overview.html"><span>Overview</span></a></li>
- <li><a href="5_jit.html"><span>LLVM JIT</span></a></li>
- </ul>
-
- </div>
- </div>
- <!-- END SIDEBAR -->
-
- <!-- BEGIN CONTENT -->
- <div class="col-sm-9 border-left section-right">
- <h1 class="section-header">Gravity files</h1><hr>
-
- <p class="section-content">
- In order to increase modularity, Gravity is divided into 4 main components and each one (except shared) is completely independent from the others. In this way there is a clear separation between the compiler itself that end up producing the bytecode and the virtual machine that is responsible to execute that bytecode.
- </p>
- <p style="color: #7E267E;"><i class="fa fa-folder-o" aria-hidden="true"></i> Utils</p>
- <ul style="list-style: none;">
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_utils: <span style="color: #797979;">Collects useful functions extensively used by other files. Time, IO, strings, UTF-8 and many other functions can be found in this file.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_json: <span style="color: #797979;">Very efficient JSON parser from <a href="https://github.com/udp/json-parser">https://github.com/udp/json-parser</a>.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_debug: <span style="color: #797979;">Contains the gravity_disassemble function used for debugging purpose.</span></li>
- <!--<li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_objc: <span style="color: #797979;">Official objc bridge used in the <a href="http://creolabs.com">Creo</a> project (not yet committed).</span></li>-->
- </ul>
- <p style="color: #7E267E;"><i class="fa fa-folder-o" aria-hidden="true"></i> Compiler</p>
- <ul style="list-style: none;">
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> debug_macros: <span style="color: #797979;">Debug macros used internally during development.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_ast: <span style="color: #797979;">Abstract syntax tree implementation.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_codegen: <span style="color: #797979;">Code generation module.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_compiler: <span style="color: #797979;">Main compiler module that can hides other internal modules.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_ircode: <span style="color: #797979;">Intermediate code and register allocation management.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_lexer: <span style="color: #797979;">Lexer implementation.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_optimizer: <span style="color: #797979;">Optimizer and bytecode finalyzer.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_parser: <span style="color: #797979;">Parser implementation and syntax checker.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_semacheck1: <span style="color: #797979;">Semantic checker step 1 (used for non-local identifiers).</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_semacheck2: <span style="color: #797979;">Semantic checker step 2 (used for local identifiers).</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_symboltable: <span style="color: #797979;">Symbol table management and creation.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_token: <span style="color: #797979;">Tokenizer implementation.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_visitor: <span style="color: #797979;">Visitor patter for C.</span></li>
- </ul>
- <p style="color: #7E267E;"><i class="fa fa-folder-o" aria-hidden="true"></i> Shared</p>
- <ul style="list-style: none;">
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_array: <span style="color: #797979;">Dynamic array macros implementation from <a href="https://github.com/attractivechaos/klib/blob/master/kvec.h">https://github.com/attractivechaos/klib/blob/master/kvec.h</a>.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_delegate: <span style="color: #797979;">This is where utilities are collected in a single file.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_hash: <span style="color: #797979;">Hash table implementation.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_macros: <span style="color: #797979;">Useful macros mainly used at runtime.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_memory: <span style="color: #797979;">Memory management module with built-in leaks checker for MacOS.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_opcodes: <span style="color: #797979;">Enum opcodes officially supported by Gravity.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_value: <span style="color: #797979;">One of the most important module that declare the struct of each object and value used inside Gravity.</span></li>
- </ul>
- <p style="color: #7E267E;"><i class="fa fa-folder-o" aria-hidden="true"></i> Runtime</p>
- <ul style="list-style: none;">
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_core: <span style="color: #797979;">Core classes implementation and definition.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_vm: <span style="color: #797979;">Interpreter and garbage collector implementation.</span></li>
- <li style="color: #7E267E; margin: 8px 0;"><i class="fa fa-file-text-o" aria-hidden="true"></i> gravity_vmmacros: <span style="color: #797979;">Collects various macros used by the Virtual Machine.</span></li>
- </ul>
- </div>
- <!-- END CONTENT -->
-
- </div> <!-- /row -->
- </div> <!-- /main-content -->
- </div> <!-- /container -->
- <!-- BEGIN FOOTER -->
- <footer class="navbar-fixed-bottom">
- <div class="container footer">
- <p>
- </p>
- </div>
- </footer>
- <!-- END FOOTER -->
-
- <!-- Bootstrap JS -->
- <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
-
- <!-- Highlights JS -->
- <script src="../scripts/highlight/highlight.min.js"></script>
- <script>hljs.initHighlightingOnLoad();</script>
-
- </body>
- </html>
|