Comments (8)
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.
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.
@asterite I think you came up with a better use than I would have thought of 😄
from crystal.
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.
@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.
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.
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.
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)
- The warning when building for FreeBSD and OpenBSD HOT 4
- Allow rescuing exceptions based on included modules HOT 1
- Drop delay-load helper and `CRYSTAL_LIBRARY_RPATH`
- Time zones read from Windows Registry lack historic DST rules HOT 1
- Duplicate ancestors in `ReferenceStorage`
- Unhandled exception on HTTP::Handler HOT 3
- Crystal runtime crashes on closed file descriptor for STDIN HOT 3
- BUG: unhandled primitive in codegen: slice_literal
- Console streams are blocking on Windows HOT 1
- Using `include` with a `module` with a `private macro` exposes it HOT 2
- Crystal doesn't UTF-8-Validate first byte of input HOT 4
- Redirecting standard streams feels more hackish/clumsy than it needs to be HOT 3
- Invalid memory error accessing local variable from closure when closure is stored in an array HOT 2
- `Range` includes `Enumerable` but doesn't always implement it HOT 1
- Loc pragma directly after `def` makes parser skip token
- crystal tool format doesn't work within nested macros
- Range#size returns an Union instead of an Int32
- Inconsistent behaviour regarding line break requirement in method definition HOT 1
- `Module validation failed` with proc in recursive def HOT 3
- Crystal REPL instantly executes statement with intertwined heredoc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crystal.