Giter Club home page Giter Club logo

Comments (8)

bcardiff avatar bcardiff commented on May 22, 2024

In the mid term the ruby compiler will go away actually (as soon as the bootstrap is ready). So, if you wan't that API, I will suggest to treat the crystal compiler as an external executable.

BTW, why do you need that API?

from crystal.

asterite avatar asterite commented on May 22, 2024

Even though the compiler will eventually be written in Crystal itself I don't think it's a bad idea to refactor the Crystal::Compiler class to be used as a gem to compile a source file. We could use this in a website to let users play with the language without having to install it. They could see the generated LLVM IR, for example, or the types graph or class hierarchy.

I say "go for it" :-)

But I'm also very curious about why you need such an API.

from crystal.

farleyknight avatar farleyknight commented on May 22, 2024

@asterite I think you came up with a better use than I would have thought of 😄

from crystal.

farleyknight avatar farleyknight commented on May 22, 2024

Basically, I don't "need" such an API. It's just that I want to learn more about this project and the main starting point is, for myself, the compiler tool. To be able to compile & run Crystal programs from Ruby would be the ideal way to learn more about the language, and (I feel) also for other Ruby developers.

from crystal.

farleyknight avatar farleyknight commented on May 22, 2024

@asterite Okay, so what small step can I make towards this? I don't want to bang away at a branch and have it get rejected. I'd love some more guidance on this.

from crystal.

asterite avatar asterite commented on May 22, 2024

If you want to refactor the Crystal::Compiler class you can touch that file and add specs to it. I don't see the need to change the Gemfile, spec_helper.rb or any other file.

from crystal.

farleyknight avatar farleyknight commented on May 22, 2024

Right, however refactoring it won't help if I can't get test results around it, nor can I see if my tests are actually calling all the necessary parts of the compiler class. Having SimpleCov locally tells me if I'm covering all the files in the Compiler class (and at this point, it's not being covered much: https://coveralls.io/files/54609883)

from crystal.

farleyknight avatar farleyknight commented on May 22, 2024

Decentralization is a huge benefit for developers. Having all the information in one central place makes it difficult for other people to participate.

Github is founded on git, which is markedly different from subversion in the sense that you can commit to locally with git and push your changes later, whereas subversion requires all changes be pushed to the server immediately. If the subversion server goes down, you can't commit at all. That makes merging difficult later on.

The changes I'm proposing are similar, in that they are ways for developers to run tests and run test coverage locally before having to push them to github to get results.

from crystal.

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.