Live data from Hacker News

How an Engineering Company Chose to Migrate to D

dlang.org

21–30 of 170 posts

Re: How an Engineering Company Chose to Migrate to D

#21
post #11
post #9

... and went bankrupt because of not being able to finding Engineers.

Developers can learn new languages though if a company lets them. (Edited to be less glib. bad habit)

A friend (C# dev) just refused a job from a company in the Netherlands, for a D dev position. I don't know if it's the same company.

It's not that they're not capable, but some will not want to risk several years of their career to learn it.

Re: How an Engineering Company Chose to Migrate to D

#22

> Nowadays, whenever D is publicly evaluated, the younger languages Go and Rust are often brought up as alternatives. Here, we need not go into an in-depth comparison of these languages because both Rust and Go lack one feature that we rely on heavily: nested functions with access to variables in their enclosing scope. Maybe I've misunderstood, but aren't Rust's closures [1] exactly what the author is describing? Spe…

Closures are, but functions defined using "fn" syntax cannot capture from the environment. This is a useful feature, and I can see why people would want it, but it was considered ultimately not consistent with Rust's aims to be excellent at the low level. See [1] for more discussion of the tradeoffs and why Rust chose not to include the feature. [1] https://users.rust-lang.org/t/inner-functions-not-closed-ove...

I believe the story here is the same in C++. Functions are just a pointer to some compiled code. Closures are an object that represents all the captured variables, in addition to the code. That object has a size, and a destructor, and the variables it's holding might have pointer lifetimes that you need to worry about. In Rust, quite a lot of type system machinery gets invoked when you create a closure, to make sure it doesn't outlive any of the references it's closing over.

Re: How an Engineering Company Chose to Migrate to D

#23

> Nowadays, whenever D is publicly evaluated, the younger languages Go and Rust are often brought up as alternatives. Here, we need not go into an in-depth comparison of these languages because both Rust and Go lack one feature that we rely on heavily: nested functions with access to variables in their enclosing scope. Maybe I've misunderstood, but aren't Rust's closures [1] exactly what the author is describing? Spe…

Go also certainly supports this. Here's a playground example: https://play.golang.org/p/_BLguocGBRn

Does Go take a copy or a reference?

Re: How an Engineering Company Chose to Migrate to D

#24

While the article states that other languages were evaluated, it seems as though the project was motivated entirely by the author and the evaluation was just paying lip service to what was basically a foregone conclusion. Don't get me wrong, I like D from the small amount of playing I've done with it -- and maybe it is the best tool for their purposes -- but this doesn't strike me as an impartial evaluation. The 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.

I think the author makes it clear that direct conversion from Pascal is the primary goal. I'm guessing that once the codebase is fully transpiled to D, refactoring would be the logical next step.

Re: How an Engineering Company Chose to Migrate to D

#25
post #11
post #9

... and went bankrupt because of not being able to finding Engineers.

Developers can learn new languages though if a company lets them. (Edited to be less glib. bad habit)

I agree, but that costs money for the company and time for the developer.

Airbnb dropping react native due to a lack of qualified candidates that were articulate in both the native and javascript realm is a great example. Something can work flawlessly with the right conditions (for instance, developers that understand and can implement the path of least resistance across native and react), yet if its prohibitive to create those conditions you are back where you started.

If the dominant ideology among developers is that learning X language or technology costs more of their career than its worth, it dies out. Same goes for the company and their resources.

Re: How an Engineering Company Chose to Migrate to D

#28

Earlier quoted context omitted.

Closures are, but functions defined using "fn" syntax cannot capture from the environment. This is a useful feature, and I can see why people would want it, but it was considered ultimately not consistent with Rust's aims to be excellent at the low level. See [1] for more discussion of the tradeoffs and why Rust chose not to include the feature. [1] https://users.rust-lang.org/t/inner-functions-not-closed-ove...

I believe the story here is the same in C++. Functions are just a pointer to some compiled code. Closures are an object that represents all the captured variables, in addition to the code. That object has a size, and a destructor, and the variables it's holding might have pointer lifetimes that you need to worry about. In Rust, quite a lot of type system machinery gets invoked when you create a closure, to make sure…

Yes, it's similar to C++. A Rust `fn()` type is similar to a C++ `(*foo)()` type and at the low level is just a pointer to code. A Rust `Fn` trait object (of which there are several variants) is roughly similar to a C++ std::function and is "fat" in that it can contain data as well as code. Most higher level languages don't make the distinction, buying conceptual simplicity at the cost of potential optimizations when a simple code pointer will do.

Re: How an Engineering Company Chose to Migrate to D

#29

D has support for nested functions: I love nested functions. It's good when you need a quick local function, and don't want to expose it to the rest of the code base. But, how do you systematically unit test nested functions?

"But, how do you systematically unit test nested functions?"

You don't. You test the enclosing function. The nested function is just an implementation detail like any other line of code in that function.

Re: How an Engineering Company Chose to Migrate to D

#30
post #27

> it will possibly take a year, and probably longer, to migrate to D The article title is misleading. They still have not migrated.

>How an Engineering Company Chose to Migrate to D

I mean, they have chosen to migrate. That doesn't imply they're done with the implementation.

Post reply on HN