Closed proyb6 closed 5 years ago
This is really not appropriate since Oj is a Ruby gem. While Crystal has a similar syntax to Ruby it is not the same. I did look at Crystal in the hopes that I could write a JSON parser as a way to try out Crystal's C bindings but I was not able to find much documentation on how to do that in a reasonable way.
In any case, even if there were to be a Oj for Crystal it would be a complete rewrite and a separate repository. Glad you felt Oj was worth porting to Crystal though. I am keeping an eye on Crystal so maybe in the future some time.
I get it, there is a need to refactor and replace Ruby header, and I assume you read this?
https://crystal-lang.org/docs/syntax_and_semantics/c_bindings/
Yes, read that. Oj parses into Ruby values. Would have to change to Crystal but there does not seem to be an API for that.
Yup, no API for that. I think there might be an interest for agnostic libraries.
Crystal is still pretty young. Maybe as it grows. If the primary developers are interested I might be interested in being the JSON, XML, and web server guy.
In my opinion, I do feel the web server could be improve and I used H2O for my sites, until I'm surprise H2O.cr outperforms H2O in C according to the TechEmpower Benchmark. Perhaps, they are useful for your research and reset.cr
https://github.com/S-YOU/h2o.cr https://github.com/S-YOU/reset.cr
I wonder how H2O compares to my Agoo server.
Just to clarify, I use the H2O with MRuby as a proxy server, not the libh2o which allows me to leverage with HTTP/2 Push which is no different in performance for a 1 core VPS. I think the advantage that Kazuho and his team are working on new features including QUIC.
I would prefer compiled code and typed language for security reasons when compare to Ruby when we going to deal with different kinds for data structure.
There are some advantages to having a compiled app. That and performance.
What about getting Agoo in the benchmark?
Interesting. I’ll have to submit Agoo results. Thanks.
Looked into it but Crystal is a different language all together. While it might be interesting to write a new package for Crystal it would not be part of Oj for Ruby.
Crystal programming language https://crystal-lang.org/
Another request for C binding in Crystal. Could be refactor Ruby code for Crystal is even awesome.
I assume one of the tool could be used to auto generate C header for Crystal. https://github.com/j8r/crystal-autobind/blob/master/README.md