-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic cast breaks playground #6083
Comments
Yeah, that won't work. I think that gets re-written to:
and of course that won't compile. My suggestion: move the playground outside of the compiler, as a separate project. It will free us from having to track and fix these bugs here. I really like the playground, but because of how it's currently implemented there's no way it can be exactly the Crystal language. There are many easy ways to break it by now. |
Having the playground in the compiler directory looks a bit weird. |
Actually, no, I've changed my mind. The playground is fantastic, and it'll probably be doing better where it is than where it'd be by itself. |
I don't see much benefit of splitting it out. It's not crystal but it's hardly icr-levels of hacks and works as a good first approximation. Removing it is just detrimental to newcomers for purism's sake. |
Who from the core team uses the playground? Or someone here that uses the playground daily? |
@asterite I do, also @ArtLinkov its great for prototype and testing new ideas and types |
In my opinion, a "standard playground" has little sense, it's a separate project of the Crystal compiler. It has its own HTML Tere are so many awesome tools like ameba that will fit better in the compiler tools, but they aren't integrated and it is fine. |
Not to mention that the compiler depends on |
I don't see removing it as scaring away newcomers. If the newcomers are going to go to the docs anyway, and the docs say "Hey, we have a playground, and here's how you install, run, and play with it!", then it's not really a huge deal. Plus, I think it invites more people to work on the playground because PRs won't need to worry about running the entire compiler test suite to contribute. |
IMO we should ship playground with releases, but not necessarily have it part of the compiler itself. Similar to how shards is built and bundled with a new release, the same should be for playground. My 2 cents. Cheers. |
If we ship it with the release that would mean we still need to have I strongly vote keep it. |
Let's do a poll for the future of playground: |
Yes, but just for While Crystal still don't have a IPC or plugin mechanism, nothing stop us from having a shim command that invokes the playground binary (ala The compiler source code is always available to any project, so playground can be split from the codebase, maintained and build independently. If the concerns are around the time will take to build playground and compiler in release mode, then we can benchmark the efficiency of the bc+obj cache of the two different projects accessing the same classes. Cheers. |
@RX14 , @bcardiff or @asterite, could you move out the playground to https://github.com/crystal-lang/playground – most of the community agree on this. |
I would like to see this done only and as long as the compiler is extended to let the program be instrumented in a better way as it is today. Otherwise changes to the language or the the ToSVisitor are too sensible to break the playground. As pointed out, taking out the playground will result in bigger binary to distribute and specially some more distribution tasks that should be deferred since there was already a lot of work in distribution/infrastructure tasks. |
Exactly, just because the "community agrees" on something doesn't mean it's actually a good idea. |
To get back on track - why is the code rewritten to x : Int8
x = instrument { 1 } instead of x : Int8
__tmp437 = x = 1
instrument(__tmp437) ? It seems to me this would fix a lot of bugs in the playground |
seems a good rule, yet multi assignments wont work with that rule. but we can define different rules for multi-assign (there are already some custom rules for puts and print) The instrumentation until now avoided adding new variables. |
sounds good
We add new variables with unguessable names all over desugaring and in macros, so this is acceptable. |
One to throw my opinion about spliting the Playground. The other day I want to take that playground for something else(basically an devops tool to write runbook for oncall and execute from playground) then I realize it depends on the compiler repo somehow and cannot easy to split it out to compile and run on its own :(. |
@v9n it'll always depend on the compiler whether or not its in a seperate repo. The crystal compiler is part of the stdlib however, so you should be able to require parts of the playground from any crystal program right now with no dependencies |
@v9n you can build the playground (or the compiler) and tweak things. But maybe you can use the playground workbooks for your needs. There in a link in the navbar explaining a bit of them. In a folder were you will start the |
The error shown in playground is different now
Crystal 0.31.1 on MacOS
If I change the code to this (added x : Int8
x = 1_i8
pp x The output in playground is
|
After #6074 merged, the following works.
However it fails in playground with the following error
The text was updated successfully, but these errors were encountered: