How an Engineering Company Chose to Migrate to D
1–10 of 170 posts
Re: How an Engineering Company Chose to Migrate to D
#2Re: How an Engineering Company Chose to Migrate to D
#3Re: How an Engineering Company Chose to Migrate to D
#4While variables which were declared prior to it in its outer function were available to its inner functions.
Re: How an Engineering Company Chose to Migrate to D
#5I feel that splitting as much as possible the project into chunks/components and then replacing them one by one sounds more realistic (with the appropriate test harness). Maybe that is the plan but it is not touched in the post.
And then maybe an issue that is not that bad, but you are going to have a hard time comparing old_codebase with new_codebase once you've switched. If you have to maintain old branches, porting the fix to recent branches will be more time consuming that simply do a merge.
Re: How an Engineering Company Chose to Migrate to D
#6Go did have closure support, where you can assign functions to normal variables and move them around, just like any other primitive data type. While variables which were declared prior to it in its outer function were available to its inner functions.
Unless there is an obvious example of where this breaks down in Go and Rust, I’d certainly like to know how.
Re: How an Engineering Company Chose to Migrate to D
#7The need for nested functions bugged me as well. That seems like an odd deal-breaker and hints at code smell, rather than a genuine technical need. If it's just for the sake of one-to-one transpilation, then I can see the point, but a refactoring exercise seems like a better effort to make than language migration. (Also, don't Rust and Go have closures? Surely that would satisfy this requirement.)
Re: How an Engineering Company Chose to Migrate to D
#8Go did have closure support, where you can assign functions to normal variables and move them around, just like any other primitive data type. While variables which were declared prior to it in its outer function were available to its inner functions.
Also I inagine the qt bindings are better in D.
Re: How an Engineering Company Chose to Migrate to D
#9Re: How an Engineering Company Chose to Migrate to D
#10Maybe I've misunderstood, but aren't Rust's closures [1] exactly what the author is describing? Specifically, you can capture variables from the environment into functions.
[1] https://doc.rust-lang.org/book/first-edition/closures.html