← Back to context

Comment by AceJohnny2

10 years ago

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/

> 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

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)

The reason for layering is that the lower layer code remains compatible and even, let's say, idiomatically acceptable if excessively verbose.

True. However, it would also be nice if there is an automated upgrade path for syntactic changes like python 2to3.

  • Python 2 to Python 3 is a semantic change, which is why it has been so slow going for some codebases.