News for hackers. Stuff that matters.
Re:Stroustrup's Rule and Layering Over Time in Rust by AceJohnny2 on Friday December 16, 2016 @06:21PM (#13197810)
Change takes time! This is a great example, as he has specific instances of evolving syntax to describe the same thing, semantically.

The big problem, of course, is that code hangs around. Can you evolve your syntax as people get used to it? Not only are you adding work to your parser, but people who use your language also have to deal with the multiple iterations of the syntax that linger in various codebases. This is one reason I detest dealing with Perl codebases.

Anyhow, as an exercise of evolving syntax while keeping the underlying semantics, I find Reason [1], a new syntactic layer over OCaml, particularly interesting.

[1] https://facebook.github.io/reason/

Re:Stroustrup's Rule and Layering Over Time in Rust by stymaar on Friday December 16, 2016 @08:09PM (#13198425)
> Can you evolve your syntax as people get used to it? Not only are you adding work to your parser, but people who use your language also have to deal with the multiple iterations of the syntax that linger in various codebases.

Clippy[1] helps a lot in this case, it helps people writting idiomatic Rust and it's updated when new syntaxes introduces new ways to do stuff, so the old one is deprecated _de facto_.

[1] https://github.com/Manishearth/rust-clippy

Re:Stroustrup's Rule and Layering Over Time in Rust by Manishearth on Friday December 16, 2016 @11:47PM (#13199263)
There's actually some interesting discussion about making Clippy suggest ? instead of try: https://github.com/Manishearth/rust-clippy/issues/1361
Re:Stroustrup's Rule and Layering Over Time in Rust by kazagistar on Saturday December 17, 2016 @11:44AM (#13201301)
It would make sense to leave some time for the documentation to stabilize and usage to spread a little before pushing hard in that direction I think.
Re:Stroustrup's Rule and Layering Over Time in Rust by rtpg on Friday December 16, 2016 @08:44PM (#13198605)
Syntax is one of the easiest things to migrate, because it can be statically detected. Though it could be a bit trickier with optional types and pattern matching

If your company decides to not use try!, then you can set that up (and have an opt-out for when you "really" know what you're doing)

Re:Stroustrup's Rule and Layering Over Time in Rust by dherman on Friday December 16, 2016 @07:14PM (#13198114)
The reason for layering is that the lower layer code remains compatible and even, let's say, idiomatically acceptable if excessively verbose.
Re:Stroustrup's Rule and Layering Over Time in Rust by sriram_sun on Friday December 16, 2016 @06:35PM (#13197887)
True. However, it would also be nice if there is an automated upgrade path for syntactic changes like python 2to3.
Re:Stroustrup's Rule and Layering Over Time in Rust by nickm12 on Saturday December 17, 2016 @12:35PM (#13201522)
Python 2 to Python 3 is a semantic change, which is why it has been so slow going for some codebases.