Giter Site home page Giter Site logo

cinc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cinc's Issues

remove :env where not needed

currently every node has an :env node, this is for consisntency but many nodes (such as :bindings) will never need it and having it makes the ast incredibly long and unreadable

License

There doesn't seem to be one.

Add sane error reporting

Right now we use mostly :pre to report errors for ease of development.

Need to switch to ex-info everywhere and report line/column info aswell

deftype* analysis is tricky

currently deftype expands to something like (let [](deftype* x ..) (import ns.x) ns.x)

Compiler.java can analyze this because the deftype gets build during analysis, completing analysis and emission.

Need to figure out a way to handle this in order not to get a ClassNotFoundException

Create an "add-children" pass

As mentioned in http://dev.clojure.org/display/design/AST+children Rich has a requirement that the AST be walkable in a "generic" way, using a :children attribute of each node.

Unfortunately, keeping children up to date while doing a bunch of transformations is difficult, so the best thing to do would just be to add a generic "add-children" pass which is always (optionally?) executed at the end of analysis.

Is this analysis correct?

The tag for the first :arg is [C (array of Class), which seems suspicious.

user=>(pprint (ana/analyze '(java.lang.String/valueOf (+ 1 1)) {}))
{:tag java.lang.String,
:args
[{:tag [C,
:op :invoke,
:form (+ 1 1),
:env
{:file
"C:\Users\joel-cohen\AppData\Local\Temp\form-init7760639548724569008.clj",
:line 1,
:column 49,
:context :expr},
:meta
{:tag clojure.lang.IPersistentMap,
:op :const,
:env
{:file
"C:\Users\joel-cohen\AppData\Local\Temp\form-init7760639548724569008.clj",
:context :expr},
:type :map,
:literal? true,
:form {:column 49, :line 1}},
:fn
{:form +,
:env
{:file
"C:\Users\joel-cohen\AppData\Local\Temp\form-init7760639548724569008.clj",
:context :expr},
:op :var,
:name +,
:ns clojure.core,
:assignable? false,
:var #<Var@2dcf4363:
#<core$PLUS clojure.core$PLUS@47229edd>>},
:args
[{:tag java.lang.Long,
:op :const,
:env
{:file
"C:\Users\joel-cohen\AppData\Local\Temp\form-init7760639548724569008.clj",
:context :expr},
:type :number,
:literal? true,
:form 1}
{:tag java.lang.Long,
:op :const,
:env
{:file
"C:\Users\joel-cohen\AppData\Local\Temp\form-init7760639548724569008.clj",
:context :expr},
:type :number,
:literal? true,
:form 1}]}],
:method valueOf,
:op :static-call,
:class java.lang.String,
:form (. java.lang.String (valueOf (+ 1 1))),
:env
{:file
"C:\Users\joel-cohen\AppData\Local\Temp\form-init7760639548724569008.clj",
:line 1,
:column 23}}
nil

Preserve metadata everywhere

Currently metadata is only attached to the :form node for most of the AST nodes, we need to put it in a node everywhere

prevent passes to do the work multiple times

There are some passes that are repeated until nothing more can be done, those passes re-run everywhere they have already run recomputing the already-computed results, we should just leave there what's already there and only do the work that's needed

better cast/box handling

Currently cast/box handling is handled both by the box pass and in emit.

The cast/box info should only be set by the box pass

remove need for :eval

We should remove any usage of :eval, wrapping the top-level form with ((fn* [] ..)) in the eval function thus removing any need for an interpreted eval

Is there a performance cost?
Do I care?

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.