Giter Site home page Giter Site logo

i8c's Introduction

i8c's People

Contributors

tromey avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

i8c's Issues

i8c should honour $CC etc

i8c does not honour $CC etc, and it should. Presently it just uses "gcc" and there's no way to change this short of editing the code.

Stack walker does not support loops

Excepting very basic cases the stack walker does not support entering a BasicBlock that has already been entered. This means it is impossible to compile a note that contains a loop.

Add an xderef instruction

xderef could easily be implemented, it just isn't.

It could piggy-back on the code and tests for deref (only the stack walker would be different).

Inconsistency with GCC

GCC outputs to "file.s" if invoked as gcc -S file.c . I8C should output to file.S if invoked as i8c -S file.i8 for consistency.

i8x stack errors are just assertions

i8x stack errors are just assertions (and whatever "pop from empty list" throws, for underflow). They should be proper checks that raise a subclass of ExecutionError. stack.op is always set for things to throw with (and set cleverly enough to do the right thing across calls), it just needs the checks writing.

GPL not suitable for i8x?

i8x loads user code (testcases) written in Python into itself. If i8x is GPL then testcases must also be GPL. Maybe i8x should be LGPL (with i8c remaining GPL)

Most optimizations are untested

So far only the cmp-bra-{const,const} optimizer has a test. At least all block optimizers should have tests before the initial 0.0.1 release.

i8x header inclusion is very strict

i8x testcases can import constants from C-style header files, but the format required is very strict. Each line must be exactly #define NAME VALUE, and VALUE must be numeric. Not even comments are allowed.

deref sign extension bytecode is untested

deref s8, deref s16 and deref s32 emit a DW_OP_deref_size followed by a sequence of DWARF operations to sign-extend the dereferenced value.

This sign-extension sequence is untested in that it has never been executed by a DWARF interpreter.

Clean up --debug=stack and add a user option for it

The hidden* option --debug=stack is pretty useful for figuring out stack walker errors. It's output should be cleaned up** and a user*** option added for it.

By "hidden option" I mean "it's not shown in i8c --help".

By "cleaned up" I mean, e.g., CompareOp("bne not_done_yet") is confusing. It should probably have the filename and line number and whatever the user typed

By "user option" I mean something like --trace. Something not in the --debug= namespace.

Type checking bytecode not fully possible?

Should cast actually emit something so bytecode can be type checked? If so deref needs it too (or some special deref_int with a type (signed byte, 0 means regular int, -8 means s8, etc) That would get rid of that sign-extension sequence too

Docstrings need work

Two issues:

  1. Not everything that should have a docstring has one.
  2. Existing docstrings mostly don't comply with PEP 257.

Need to do a docstring audit, perhaps using the pep357 static analysis tool.

Need to make sure arguments/externs have unique names

Something (the entry stack builder?) should check that arguments and externs have unique names. Currently it's not possible to shadow a name with name, but it is possible to start your function with shadowed names.

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.