News for hackers. Stuff that matters.
Re:A Plea for Lean Software (1995) [pdf] by pjmlp on Wednesday August 05, 2020 @09:50AM (#24060699)
I love Wirth's work, but that has been available in Ada, Mesa, Mesa/Cedar and a plenty of other languages as well.

And since it is available in Ada, it is rivalled today.

More to the point, Ada allows for multiple interface packages, an idea also copied by Modula-3, where the same package can be exposed in different ways to multiple clients.

For example, the same package can have a public interface for in-house consume that is wider than the official public interface for third parties.

Re:A Plea for Lean Software (1995) [pdf] by bpyne on Wednesday August 05, 2020 @11:16AM (#24061735)
Ada came to mind when the parent mentioned separate interface and implementation files. Making methods in the implementation private unless they appear in the interface was an inspired design decision. I use only Oracle's PL/SQL dialect but I appreciate the design of Ada more the longer I code. Honestly, I'd consider using full-blown Ada in modern software development. It gives you the ability to write really clean code.
Re:A Plea for Lean Software (1995) [pdf] by m463 on Wednesday August 05, 2020 @03:24PM (#24064512)
When I wrote Ada code long ago, it was only used on military projects.

To me, it was hard to write code in Ada. Lots of niceties from other languages were unavailable in Ada, by design. For example there were no variable argument lists.

It grew on me though, and several years later I worked on a commercial project that used Ada. I was surprised because I expected adopting Ada to be like adopting the adopting the tax code.

Then I realized one thing - although Ada is harder to write, it is nice to have an existing Ada project. And people who have done Ada a while learn to think in Ada and it's not as hard to be expressive.

It's also possible to be pretty accurate in Ada. You can know exactly what the largest or smallest integer is. Moreover you can define integers of a specific range, like -11 to 219.

Nowadays all of that has matured and I think ada is a viable commercial language, and interesting things like spark have happened.

Too bad in the intervening years other languages haven't changed much.

For example, C could have added modules. I guess nobody cares about C.

Re:A Plea for Lean Software (1995) [pdf] by pjmlp on Wednesday August 05, 2020 @03:41PM (#24064726)
I think that by Ada 95 they were already available, were you still using Ada 83?

Yeah, just check the list of features for C2X, WG14 isn't that keen in innovating that much, nor in fixing C's flaws.

Re:A Plea for Lean Software (1995) [pdf] by bpyne on Wednesday August 05, 2020 @04:20PM (#24065105)
I notice that Ada 95 included inheritance. My experience in other languages with inheritance is that the feature creates a lot of complexity. Have you used inheritance in Ada and, if so, has it created any issues?
Re:A Plea for Lean Software (1995) [pdf] by kqr on Thursday August 06, 2020 @02:18AM (#24068559)
The problem with many other languages is that they do everything through inheritance. In most popular languages, inheritance is set up such that it does anything you want it to. This is what creates complexity, not the inheritance in and of itself.

Ada does things slightly differently. It manages to separate out the various parts of OOP into different language constructs, and this makes it possible to pick and choose what you need, and not get everything including the kitchen sink when you try to use one thing (like inheritance.)

Re:A Plea for Lean Software (1995) [pdf] by pjmlp on Thursday August 06, 2020 @02:10AM (#24068519)
I use OOP languages since I learned OOP with Turbo Pascal 5.5 back in 1991.

So no, I never had any big deal with inheritance in any language, and in what concerns Ada its tag based dispatch is also quite interesting as idea.

Re:A Plea for Lean Software (1995) [pdf] by 7thaccount on Wednesday August 05, 2020 @02:49PM (#24064160)
I'd use Ada if there was a really good open source version with an MIT or similar license. It does "feel" nice.
Re:A Plea for Lean Software (1995) [pdf] by auxym on Wednesday August 05, 2020 @03:38PM (#24064701)
Nim has a type system that is heavily inspired by Modula/Oberon/Ada
Re:A Plea for Lean Software (1995) [pdf] by froh on Wednesday August 05, 2020 @05:16PM (#24065688)
Did you have a look at gnat?

Your generated code is free:

https://en.m.wikipedia.org/wiki/GNAT#License

Re:A Plea for Lean Software (1995) [pdf] by wtetzner on Wednesday August 05, 2020 @12:32PM (#24062667)
OCaml (and probably Standard ML) also have powerful module systems that I would argue rival Modula-2's module system.
Re:A Plea for Lean Software (1995) [pdf] by jstimpfle on Wednesday August 05, 2020 @10:10AM (#24060914)
Don't forget C, which has separate compilation as well ;-). And you can trivially make multiple interfaces, too.
Re:A Plea for Lean Software (1995) [pdf] by pjmlp on Wednesday August 05, 2020 @10:21AM (#24061067)
Separate compilation without type safety, hardly much better than macro assemblers.

So yeah, you can go that route and I have done so, poor man's modules, as it helped to keep me sane with C, but it requires discipline.

Re:A Plea for Lean Software (1995) [pdf] by ChrisMarshallNY on Wednesday August 05, 2020 @11:29AM (#24061910)
> but it requires discipline.

That pretty much defines software engineering.

For as long as I have been coding, I’ve watched people and corporations chase the will’o the wisp of the “undisciplined coder,” where we can hire naive, barely-educated children, straight out of school, and mold them into our personal “coding automatons,” or even better, let people who are experts in other domains, create software, without having to deal with “annoying” engineers.

So...how’s that working out?

Even when we have AI creating software (and we will), the AI will still need disciplined requirements, which, I suspect, will look a lot like...code.

Re:A Plea for Lean Software (1995) [pdf] by pjmlp on Wednesday August 05, 2020 @12:20PM (#24062542)
Pretty good, every solution that expects discipline is a source of revenue for security consulting, code quality automation products and conferences.

The outcome of Azure Sphere having chosen C as their main SDK language is proving itself without surprises,

https://techcommunity.microsoft.com/t5/internet-of-things/az...

Re:A Plea for Lean Software (1995) [pdf] by wtetzner on Wednesday August 05, 2020 @12:19PM (#24062531)
> That pretty much defines software engineering. Sure, but by moving things that require discipline into type systems/tools, it makes working with others easier.

Not to mention that no matter how disciplined you are, you will make mistakes, and having the compiler catch those for you is valuable.

It also means that the discipline applied by the programmer can be focused on areas that can't be checked or enforced by a compiler.

Re:A Plea for Lean Software (1995) [pdf] by Jtsummers on Wednesday August 05, 2020 @11:32AM (#24061946)
> So...how’s that working out?

Fantastically if the goal is to set up recurring revenue to maintain the produced systems.

> Even when we have AI creating software (and we will), the AI will still need disciplined requirements, which, I suspect, will look a lot like...code.

https://github.com/webyrd/quines is an interesting example of writing code to create code based on a specification. Perhaps not the AI code generator of some people's dreams, but it exists today.

Re:A Plea for Lean Software (1995) [pdf] by legulere on Wednesday August 05, 2020 @05:24PM (#24065781)
There’s just a certain amount of effort that you can spend in a certain amount of time. And discipline takes effort. If you need less discipline you can spend your effort somewhere else. For instance you can put effort into fitting your code into an ownership model like in Rust or proof the code with Coq. The difference is that with C you can never know if there was enough discipline (usually there isn’t).
Re:A Plea for Lean Software (1995) [pdf] by ChrisMarshallNY on Thursday August 06, 2020 @05:46AM (#24069488)
It’s my experience that discipline is “front-loaded.” It takes conscious effort for some time, while establishing a habit, then, it becomes pretty much “free.”

For example, when I was writing ObjC and PHP, I got used to using Whitesmiths indenting. Once I started writing Swift, it was more appropriate to use KNF style.

It took a couple of months of having to remember to not use the old indenting style, but I haven’t given indenting any thought in years.

”We are what we repeatedly do. Excellence, then, is not act; but a habit.” -Attributed to Aristotle

Re:A Plea for Lean Software (1995) [pdf] by noir_lord on Wednesday August 05, 2020 @02:56PM (#24064235)
> So...how’s that working out?

So well that it was a large part of the reason I accepted an offer (today in fact) somewhere else, life is too short for that mess.

Re:A Plea for Lean Software (1995) [pdf] by jstimpfle on Wednesday August 05, 2020 @12:25PM (#24062597)
How are modules related to type safety?
Re:A Plea for Lean Software (1995) [pdf] by AnimalMuppet on Wednesday August 05, 2020 @01:48PM (#24063489)
Because, if you program in a type-safe language, if you call something that is compiled separately from you, you'd still like to maintain type safety across that call boundary.
Re:A Plea for Lean Software (1995) [pdf] by jstimpfle on Thursday August 06, 2020 @04:02PM (#24074852)
You absolutely get type safety across module boundaries with C in that if provider and user both compile against the same interface, this will be typesafe.

You could even have this type safety on the linker level as far as C is concerned. You just need an object file format that exports C types for symbols. This is not done on any of the (few) systems I know, and probably for practical reasons.

Some other languages give you this link time safety, but I assume at the cost of less interoperable object files.

Re:A Plea for Lean Software (1995) [pdf] by jolux on Wednesday August 05, 2020 @01:55PM (#24063573)
> For example, the same package can have a public interface for in-house consume that is wider than the official public interface for third parties.

Isn’t this similar to package private in Java or internal in C#?

Re:A Plea for Lean Software (1995) [pdf] by pjmlp on Wednesday August 05, 2020 @03:44PM (#24064761)
Not really, because the interface is separate from the implementation and you can provide multiple interface packages for the same implementation package.

So client A sees mylib-public-A, client B sees mylib-public-B, but both link to the same mylib so to speak.

Re:A Plea for Lean Software (1995) [pdf] by jolux on Thursday August 06, 2020 @09:18AM (#24070579)
Ahhh, neat!
Re:A Plea for Lean Software (1995) [pdf] by kqr on Wednesday August 05, 2020 @03:19PM (#24064464)
Yes, except that still limits you to two consumers.