GithubHelp home page GithubHelp logo

Comments (2)

palvaro avatar palvaro commented on June 17, 2024

safe rewrite will take this block, try to parse it, extract some information and possibly transform the parse tree, and then rewrite the block as ruby again. some illegal ruby will break this and we'll catch it then. some illegal ruby will look 'legal enough' to get parsed and rewritten and will fail at runtime, as it would have if written in 'pure' ruby. wouldn't doing what you suggest ("catch stuff" instead of letting ruby catch it) duplicate functionality?

from bud.

billmarczak avatar billmarczak commented on June 17, 2024

it duplicates functionality in exactly the same way a static type system duplicates the functionality of a runtime exception with a compile-time exception. in other words, what i'm proposing is more compile-time safety. in general, i think that's a good thing because catching errors at runtime may be very costly, but the specific reason i opened this ticket is because in the REPL, no execution happens by default until the user explicitly types a "/tick" command. this means they can enter arbitrarily many messed up statements (undefined identifiers, type errors, etc), and nothing will fail until they hit "/tick". what do you do when something fails on /tick? if you have static checking, then nothing can "fail" on tick. if you don't have static checking, then either the REPL has to understand the error thrown by Ruby, and understand how to fix the program, or the user has to understand the error message and do some back and forth where they remove and re-add rules to get it working. the last way seems kind of ugly, but then again i suppose it's what you'd expect from an interpreted, duck-typed language like Ruby.

i just thought of another way to fix this in the REPL, I could tick by default whenever any code was added.

from bud.

Related Issues (20)

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.