Git Product home page Git Product logo

generatedtypes.jl's People

Contributors

andyferris avatar hpoit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

generatedtypes.jl's Issues

Allow `return` in code generator

The code generator is in code block, but under most circumstances it won't allow a return statement. To make this more consistent with @generated functions, we should find a way to allow return, perhaps by wrapping the code block with an (anonymous) function.

Inner constructors

If a function definition under the super's type name is found, we should replace that with the concrete typename, so that people can include inner constructors in their generated code.

Stability and `eval` on 0.5

After JuliaLang/julia#16040, we can't use eval from @generated functions in Julia 0.5. It is discussed in JuliaLang/julia#16806 that the reason is that some eval calls can cause severe problems during the compilation phase:

It's undefined how your program will behavior if you call eval from an @generated or @pure function. It's generally a straightforward way to corrupt the runtime system state, so in v0.5 it went from being a very dangerous operation that sort-of manages to pass simple tests to safely throwing an error always.

Nevertheless, this package seems to run fine on 0.4 (c.f. "sort-of manges to pass simple tests", above). While it is obvious that there exists some eval calls that might corrupt Julia's runtime system state, it would be useful to know whether these particular eval calls can and will do that. If so, generated types may have to be integrated at the language level (like generated functions) and we need to add prominent warnings to the README. On the other hand, if they are "provably" non-corrupting (under assumptions like the user not trying to predict the mangled name of the concrete subtype), then perhaps we could safely tag a release for METADATA for v0.4.

Allow non-block outputs

Generated functions don't care if their output is in an Expr(:block, ...) but at the moment there is a different between returning a quote block or a :(...) quoted expression (the latter returing an error).

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.