3 ms·
I do get that Haskell is useful to be taken as a tool for these kind of code transformations (at least I have seen quite a few of those) but I am always a bit s
by wink 10y ago
I do get that Haskell is useful to be taken as a tool for these kind of code transformations (at least I have seen quite a few of those) but I am always a bit surprised that people would start such a project in a language that has -per se- nothing to do with either the source or the target language. I know, I know, it doesn't always have to be this way, but I am very much of the opinion that everytime good tools in an ecosystem are written in the language in said ecosystem you get a lot more (and meaningful) contributions.
Best examples: rake (and everything in the ruby ecosystem basically), the amount of people touching ruby c code is very small compared to all the 'standard tools', or cargo.
- duaneb 10y agoHaskell is very good at writing correct parsers easily—that's one thing. This is part of the reason it was chosen as an early perl6 test bed via pugs. Rust is getting there (I'm a big fan of the lalrpop library) but the ecosystem is no where near as mature as Haskell's for feature-complete libraries. The pace of development of the rust ecosystem is mind-boggling, though—I never guessed that rust would have taken off in popularity as much as it has.
- samatman 10y agoIf you like lalrpop, check out nom: https://github.com/Geal/nom https://github.com/Geal/nom
- masklinn 10y ago> I do get that Haskell is useful to be taken as a tool for these kind of code transformations (at least I have seen quite a few of those) but I am always a bit surprised that people would start such a project in a language that has -per se- nothing to do with either the source or the target language. The author explained this in a blog post[0]: Haskell has a very complete C parser library with a nice API[1] which the author already knows, Rust doesn't; furthermore since one of the project's goal is to be as syntax-directed as possible the translator is straightforward and should be understandable with very little understanding of Haskell (which can be bootstrapped from understanding Rust) [0] http://jamey.thesharps.us/2016/07/translating-c-to-rust-and-how-you-can.html http://jamey.thesharps.us/2016/07/translating-c-to-rust-and-... [1] http://hackage.haskell.org/package/language-c http://hackage.haskell.org/package/language-c
- wink 10y agoThanks, I had overlooked that explanation. My -general- point still stands, appaently Haskell is very good at this and the people undertaking these projects choose to value this over ease of contribution :) (says someone who just doesn't come to terms with Haskell)
- posterboy 10y agomight be easier to do something between clang and the llvm.