GithubHelp home page GithubHelp logo

stark's Issues

null pointer error

Have the program throw a null pointer error if it attempts to dereference a null pointer.

standardized way of throwing errors

Right now each time there is an instruction with the chance of throwing errors, a new "error" basic block is created. Would be a lot neater and more scaleable to have one basic block created per function for the purpose of throwing any error, and some sort of global pointer to an error message that it will print. This way a new basic block doesn't need to be created every time.

comparison operators for floats

Comparison operators (=, !=, >, <, >=, <=) are supported for int and float types. However, they are currently being implemented with operators from Llvm.Icmp, which only works for integers. IR generation needs to check the type of the the operands and use the appropriate operator from either Icmp (for integers) or Fcmp (for floats), similar to what is currently being done for the arithmetic operators.

duplicate printing with nested tilde logging

When tilde operators are nested, there is sometimes strange behavior with items being printed twice.
For example, printc( ~ (~ (~ 'a' as int) + 1) as char ) prints a 97 98 b
but ~ (~ (~ (~ 'a' as int) + 1) as char ) (replacing the outermost printc with ~) prints a 97 98 a 97 98 b.

for loops for floats

Currently, for loops only supports integer variables. We should have it work for floats too.

printf doesn't work

Currently printf always prints 0.0 regardless of the value passed in. Needs to be fixed.

descending for loops

Currently for loops only work when ascending (i.e. for positive increments) because the compiler uses the lte comparison operator. Would be nice to have it work for negative increments as well. One idea is to require the increment to be an integer and not an expression so that its sign can be easily checked for at compile time and the appropriate comparison operator used.

casting data types

Need to add feature for casting data types, with the following syntax: i <- j as int

out-of-bounds checking for array accesses

Have each array index be checked against the size of the array (should be relatively simple because the size is explicitly stored in the array's wrapping struct). If not a valid index, throw an out-of-bounds error and exit the program.

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.