Giter VIP home page Giter VIP logo

scheme-jit's People

Contributors

james-perretta avatar porglezomp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

icodein

scheme-jit's Issues

PTR_EQ doesn't handle SFunction

We need an instruction that will let us do a fast verification that a function is the same as before, PTR_EQ still seems like the correct one here.

Arity instruction

We need a way to check that a function has a compatible arity before we call it. This is made more complex by the desire to make sure that our approach supports variadic functions. Even if we don't implement them, we should generate bytecode that checks variadic compatibility, for more realistic bounds check elimination.

Variadic handling:
Possibly return -1 for variadic arguments, -2 for variadic arguments with 1 required parameter, etc? If we use this scheme, then:

(define (func2 v0)
   (func v0))

Compiles to:

function (v0) entry=bb0
bb0:
  v1 = lookup 'func
  v2 = typeof v1
  v3 = sym_eq v2 'function
  brn v3 bb3
  v4 = arity v1
  v5 = num_lt v4 0
  br v5 bb1
  v6 = num_eq v4 1
  br v6 bb2
  trap "Arity mismatch"
bb1:
  v7 = sub -1 v4
  v8 = num_lt 1 v7
  brn v8 bb4
  trap "Not enough parameters"
bb2:
  v9 = call v1 (v0)
  return v9
bb3:
  trap "Called non-function"

Runtime type assertion for branch condition

Currently, there's an assertion it the interpreter that makes sure the branch is given a bool. We should either:

  • Specify which values are truthy and falsey and remove the assertion
  • Add a type check to the generated code

(begin โ€ฆ) form

We need a special form for sequencing multiple things, because I need to do multiple things in an if block.

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.