Code Monkey home page Code Monkey logo

clojure-monkey's People

Contributors

driphter avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

clojure-monkey's Issues

Decrease output filesize

The current output file is over 6 MB (~700 KB gzipped). This is probably being caused by the usage of Closure's "simple" optimizations. Currently, we can't use the "advanced" optimization because it munges the names of the cljs.core functions we are trying to export. Calls to require also seem to get too mangled for things like Browserify to recognize.

Possible solutions to investigate:

  • Use a macro to call goog.exportSymbol on everything in cljs.core (similar to mori)
  • Compile with an externs file for external dependencies and wrap the output file with the necessary require calls.

Add option for restricted Vars

Being able to restrict the usage of certain functions could be appropriate when using clojure-monkey to run code in a sandbox (eg: CodeCombat, 4clojure, etc.). This may be a bit outside the scope of the project, but it seems useful enough to warrant it's inclusion.

This could be done by:

  1. Getting the Clojure AST with cljs.js/analyze-str
  2. Walking the AST with clojure.walk looking for any usages of the restricted Var's identifier
  3. Throwing an error when any restricted Var usage is found
  4. Compiling the Clojure AST to Javascript code with cljs.compiler.api/emit

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.