Giter Site home page Giter Site logo

rial's Introduction

RIAL

rial's People

Contributors

l3tum avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

rial's Issues

Struct/Class member access modifier

  • Functions in classes with private access modifier should not be accessible from outside
  • Check if any function has a more open access modifier than its class -> This is not good. A private struct is available to its surrounding module so we scratch this
  • Properties should be able to specify access modifier as well

Type checking

  • Check types of function calls
  • Check types of math operations
  • Check types of assignments

Require initial value

  • Check if struct properties are either assigned a value inline or in the constructor

Underscrores in numbers

  • Support in floating point numbers #16
  • Support in integers

(The parser theoretically already supports them but would most likely throw an error if actually used)

None Handling

  • Handle function/constructor calls being None
  • Handle variables being None

Elseif

  • Decide on a name
  • Support in conditional block

Streamline variables and function arguments

  • Both should be implemented with RIALVariable
  • Implement helper methods in RIALVariable
    • Check if it's a pointer
    • Check if it requires a load for assignment
    • Refcounting
    • Check if it's a struct/pointer to a struct
    • Check if it needs redaclaration (global) in the current module

Switch

  • Switch
  • Arbitrary number of cases
  • Default case
  • Break
  • No-Break

Long and unsigned integers

  • Support "long", "uint" and "ulong"
  • Support "l", "u" and "ul" suffixes
  • Support them in the various math operations

Comments

  • Single-line comments
  • Multi-line comments

Invalid name support

  • Functions can be declared with @"[name]" which will allow otherwise not allowed characters
  • Function calls work the same

Detect infinite loops

  • Detect a function calling itself unconditionally

  • Detect an always-true condition

  • Detect never exiting loops

  • Require a marker on never-ending functions to allow them

Inheritance

  • Collect inherited structs in Metadata
  • Search them for function calls as well (requires some juggling of the implicit parameter)
  • Detect bitcasting requirement
  • Append constructor with base constructor calling (?)
  • STRETCH: Handle multiple inheritance

Improve error handling

  • Bubble with exceptions
  • Central, synchronized logger
  • Well-defined exception messages
  • SLOC in the messages (if available)

Operator overloading

  • Decide on special syntax
  • When generating an operation check for structs
  • When generating a call check for overloaded operators

Automatic memory management

  • Actually track objects rather than best-guess it with the current algorithm
  • Insert (placeholder) logic for actual free calls

Casts

  • Support primitive casts
  • Support struct/class casts to base/derivative structs/classes

Configuration file

  • Support configuration files instead of CLI args
    • Decide a file type (UCL? YAML? TOML?)
    • Implement configuration file finder
    • Parse configuration like the CLI args would be

Build lib

  • Recursively collect all source files in directory
  • Do not link in builtin/start.rial
  • Link as library (static? shared?) instead of exe

String type

  • Char*
  • length integer
  • Create Strings for string literals

Destructor calling

Collect all local variables and call their respective destructors

  • Walk the current instruction tree backwards
  • Collect the returned values
  • Collect the allocad or otherwise allocated values (for example function call returns)
  • Insert destructor calls

Base Object Class

  • Every Class/Struct is derived from Object
  • Object implements basic equality operation

Cache

  • Check for hash
  • Check for dependencies
  • Recompile if dependency changed
  • Check file modification time

Unsafe blocks and functions

  • Mark certain operations as unsafe in the compiler
  • Allow specifying unsafe blocks and functions
  • Allow these operations in unsafe blocks and functions
  • Example unsafe operation: Create variable by pointing to a memory location

Custom LLVM Statements

  • Decide on which statements and update this issue
  • Assignment
  • Function call
  • Allocation
  • Deallocation (And destructor calling)

This is primarily to mirror what numba did. It improves the readability of most code in LLVMGen.py and ASTVisitor.py if we don't require immediate IR generation, capsule it away nicely and also improves support variations in assignments, function calls and what not.
The ASTVisitor.py will most likely become even more of an analysis pass while LLVMGen.py will most likely lose a few methods.

Likely/Unlikely for conditional blocks

  • Likely hint for conditions
  • Unlikely hint for conditions
  • Probably keyword? Like if (likely/unlikely) (condition) or after like if (condition) (likely/unlikely)

Floating point numbers

  • Support "x.x" notation
  • Support "xex" notation
  • Support specifying type via "f" and "d" but defaulting to Double ("d")

Everything else should already be baked in

Function arguments

  • Functions are passed by value by default
  • ref keyword to pass by reference
  • allocas in the function itself for the args
  • Constructors take the "this" as a pointer and return nothing
  • Sort out the mess that the current metadata implemention is

Attributes

  • Compiler directives (prefixed with #)
  • Normal attributes ([attribute])
  • Pseudo attributes (like NoMangle)

Refactor compilation unit scheduling

It's a mess

  • One list of stuff to do
  • One method/Multiple methods? (One method more efficient, maybe less readable, lets see)
  • ThreadPoolExecutor and scheduling via compiler method

Dtors

  • Global dtors for structs in global variables
  • Dtors inserted into code (compile time reference counting, maybe on the AST?)

First pass Transformer

  • Transform Classes into structs with properties first before anything else!
  • Transform methods into function declarations (body in separate Interpreter)
  • Integrate with PrimitiveASTVisitor via Combined Transformer

--> Enables position-independent method calls (do not have to declare before use)

Float/Double

When using float or double, a segmentation fault with invalid read occurs, stating that the adress hasn't been alloca'd.

Function call logic refactoring

  • Move function call construction into separate function
    • Function finding
    • Function declaration in current module if it doesn't exist
    • Argument type checker
  • Use that function for regular function calls
  • Use that function for specifically inserted function calls (derived constructor).

Compile-time directives

  • Support executing self-contained functions at "compile-time"
    • Detect the function
    • Collect local variables
    • Compile into separate exe whose target triplet is always the native one
    • Execute said code and get the output (maybe patch the main method to print the return value into a file?)

Struct method finding optimization

  • Collect all functions belonging to a struct in the LLVMStruct (25574ae)
  • Check if the function takes an implicit parameter
  • Get the LLVMStruct from that implicit parameter
  • Search for function

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.