I think the current Expr object is ill-suited for anything like a gofix tool, because it is essentially not capable of lossless round-tripping a source code file into an Expr and then back into a file. Things like comments, formatting etc would all be lost.
I’ve written up a very rough draft proposal for something that might be able to achieve this here: https://github.com/jakebolewski/JuliaParser.jl/issues/22 This is very rough, I’m not an expert in this area (and of course it violates to core julia idea to submit a PR instead of long texts with suggestions…). But I would be interested to hear what people think. Cheers, David From: [email protected] [mailto:[email protected]] On Behalf Of Erik Schnetter Sent: Friday, August 21, 2015 7:56 PM To: [email protected] Subject: Re: [julia-users] "What makes a programming language successful?" So Robert Griesemer's points (features important for a new language to be successful) are: 1. clear target 2. solid implementation: language, libraries, and tools 3. market readiness 4. technological breakthrough 5. language features without competitors I think Julia has all of 1 to 4. If I understand correctly, "language features without competitors" means that there is basically only one way to do a certain thing, not many, so that one doesn't have to make meaningless decisions when implementing an algorithm. I don't think Julia has this; instead of striving for minimalistic clarity only, Julia often seems to cater to the casual script programmer. There's another point that Robert makes on a different slide: he points to two tools, "gofmt" and "gofix", which helped make incompatible changes during development. Apparently, gofmt would change the syntax of existing code (e.g. remove trailing semicolons when they became optional), while gofix would change library APIs when incompatible changes were necessary. Julia has something similar to gofix in @Compat. A tool like gofix is missing -- wouldn't it be nice to be able to automatically convert the array / tuple / Union() / Uint places in the code? Naively, it looks like an easy task to slurp in the syntax tree of a Julia module, do a bit of pattern matching on it, and then dump the updated version. Maybe the automated high-quality human-readable formatting is the missing piece? One would think that this would come in handy at many other occasions as well, for example when debugging macros or generic functions... -erik On Thu, Aug 20, 2015 at 4:22 PM, Waldir Pimenta <[email protected] <mailto:[email protected]> > wrote: I just watched Robert Griesemer's GopherCon 2015 talk "The Evolution of Go <https://www.youtube.com/watch?v=0ReKdcpNyQg> ", and although I believe the whole talk will be quite interesting to many in this list, I wondered particularly if people here would agree with his assessment of "What makes a programming language successful?", at 33:00 <https://www.youtube.com/watch?v=0ReKdcpNyQg&t=33m02s> (slide #24 <http://talks.golang.org/2015/gophercon-goevolution.slide#24> ), and whether those Julia ticks those boxes. -- Erik Schnetter < <mailto:[email protected]> [email protected]> <http://www.perimeterinstitute.ca/personal/eschnetter/> http://www.perimeterinstitute.ca/personal/eschnetter/
