Closed asterite closed 3 years ago
Hello,
Sorry for the response delay, I had very little time to work on this project lately, and I had even not seen the issue on github :open_mouth: !
That was in effect a really great experience to work on that and I've learned a lot on crystal internal working, make me loving it more even :heart:
I'm not frustrated by the announcement of crystal i,
on the contrary if find that awesome!
I would be glad to help on the crystal i
project, so as a first help, and if you have not ever done, you can take a look to my code. I've succeeded to make some part of language working very well, like yield
or closures
!. (though I have some difficulties with dispatch, making lot of thing not working yet)
You can see what is functional in the specs
, for example this some heavy random code with closures work as expected: :smile:
x = 42
p1 = ->(a : Int32, b : Int32) { a + b }
p2 = ->(a : Int32, b : Int32, c : Int32) { a + p1.call(b, c) }
p3 = ->(a : Int32, b : Int32) { p2.call(b, p2.call(a, 2*a, b), a - 10) }
p4 = ->(p1_ : Proc(Int32, Int32, Int32, Int32), p2_ : Proc(Proc(Int32)), arg : Int32) do
->(y : Int32) do
p3.call(p1_.call(arg + x, 5, arg - 4), p2_.call.call)*y
end
end
p4.call(->(c : Int32, b : Int32, a : Int32) do
p4.call(p2, ->{ p1.partial(42, c) }, 7 + c).call 31 + a + b
end, ->{ p3.partial(1, 2) }, -1).call 7
#
# => 617_918 on both `crystal` and `ic`
I've also done some improvements on highlighter from https://github.com/crystal-community/icr/blob/master/src/icr/highlighter.cr, I see that you have take and optimized the same source code too.
I've done some fix with ivars, heredoc or added coloration for named tuple or named argument:
I've also write a very powerful macro to map all the interpreted libC, LibCG and LibIntrinsics, to their equivalent calls in compiled crystal.
However I've really not designed IC for performance. IC dynamically walk on the ASTNode and return the result recursively, meaning that literal are reinterpreted all time, making IC really slow. I think bytecode is really the best way for a such project, good jobs to have accomplish that! :tada:
So I am totally in favor of Crystal i
if this is fasted and directly included in crystal :heart: !
I really hope my project can help to achieve that, and a could be here if you have any question on the code or other.
Finally if it interest you, I have also spend lot of time on user interface and add some nice features like auto-indent, auto-formatting or the ability to write .[some code]
as an equivalent to __.[some code]
, in which __
is the same as _
of irb.
Here is an overview of what is look like: :smiley:
That is,
I hope that we can merge our ideas to achieve the best crystal i
🚀🚀🚀!
Hi!
I started working on
crystal i
(announced at today's Crystal Conference) about two months ago and after a month or so of working on it I revealed it to some of the core team members. One of them (Johannes) told me that you were working on this already, and I felt a bit bad that we were duplicating work. At that time I couldn't tell you this because I wanted to keep it a secret until today. I also didn't know if what I was doing was going to work at all. I hope you are not mad! 🙏 I think working on these things is super fun and interesting, regardless of whether they see the light some day or not. I hope with the lessons you learned with this project you can help us makecrystal i
complete and even better. Thank you! ❤️