Live data from Hacker News

What was the last breakthrough in computer programming? (2019)

quora.com

91–100 of 226 posts

Re: What was the last breakthrough in computer programming? (2019)

#91

Earlier quoted context omitted.

> almost zero mainstream (statically typed) programming languages can even let you write down that you want a non-empty string. Today D will fulfill your dreams! struct MyString { private string s = "error"; alias s this; this(string s) { assert(s.length); this.s = s; } } void main() { MyString ms = "hello"; test(ms); MyString mserror = ""; // runtime assert fail } void test(string s) { }

Would it be possible to have a static assert? In that case I would expect it to fail at compile time, not run time.

You can use static asserts if you turn the constructor into a template and pass the initializer into a compile time parameter.

Re: What was the last breakthrough in computer programming? (2019)

#92
post #67

Earlier quoted context omitted.

I'm not so sure that I sympathize with your example. Why not a type for even numbers? Odd, prime, not-prime, etc? You really are asking for a type that is "valid data." Commendable, but not a static property of data. As a fun example, what is a valid email address? Once established as valid, how long will it stay that way? If invalid, how long until it can become valid? Do I think better typing can be a boon? Absolut…

Validating an email is different from validating a primitive. You can validate a primitive like an int based on it's own state alone.

Different validation, but yes?

And then there is validating it is a valid int, but is it valid to use it somewhere? 7642468 is a valid int, but is it a valid address?

That is, the primitives are unlikely to be your concern in programming. Handy tools, but not your problem domain.

Re: What was the last breakthrough in computer programming? (2019)

#93

There isn't so much in languages features themselves, but in their implementations. GC can be largely pauseless for many practical purposes and a GC language can be within 2x-3x the performance of C-like languages. Also the amount/cost of memory has improved so that we can use immutable datastructures and functional style in many contexts, which definitely feels like a 'level-up'. Concurrency has been getting easier…

Another problem is that no language hits the sweetspot of a truly general purpose language. For example Rust doesn't allow freestyle functional programming (Haskell relies on a garbage collector for a reason), whereas at the other end of the spectrum Haskell doesn't allow precise control of CPU usage.

Re: What was the last breakthrough in computer programming? (2019)

#94
post #80
post #67

Earlier quoted context omitted.

I'm not so sure that I sympathize with your example. Why not a type for even numbers? Odd, prime, not-prime, etc? You really are asking for a type that is "valid data." Commendable, but not a static property of data. As a fun example, what is a valid email address? Once established as valid, how long will it stay that way? If invalid, how long until it can become valid? Do I think better typing can be a boon? Absolut…

Dependent typing can do that sort of thing. In fact, here's a stackoverflow answer that uses even numbers as an example of a dependent type: https://stackoverflow.com/questions/9338709/what-is-dependen...

Right. And I look forward to advances in them. I can count how many times this would have actually helped my program, though...

Re: What was the last breakthrough in computer programming? (2019)

#95
post #25

Earlier quoted context omitted.

It's nice to read a positive comment like yours occasionally, because the vast majority of the time, I'm just disappointed in how bad our programming tools (including languages) are. It's become a meme in my office that I'm the guy constantly bitching about how stupid our languages are. This week I was back on my soap box about the fact that almost zero mainstream (statically typed) programming languages can even let…

It’d also be handy to put other limits on my numeric variables, for instance to automatically throw an exception if an angle delta goes out of the range -180 to 180, or whatever.

Yes, it is handy. This is why I like Ada (or the idea of it, it's rarely been used in my work because it's hard to sell others on) for safety critical systems. With SPARK/Ada you can even work towards proofs that your code won't assign outside of that range so that you don't end up with runtime exceptions.

Re: What was the last breakthrough in computer programming? (2019)

#96
I'd say being able to program GPUs as general purpose compute devices & general SIMD vectorization in high level language is pretty significant. it has opened up many applications like machine learning previously unavailable.

IMO some C++20 features like coroutines rank pretty high in introducing new ways of programming.

Re: What was the last breakthrough in computer programming? (2019)

#97
post #67

Earlier quoted context omitted.

I'm not so sure that I sympathize with your example. Why not a type for even numbers? Odd, prime, not-prime, etc? You really are asking for a type that is "valid data." Commendable, but not a static property of data. As a fun example, what is a valid email address? Once established as valid, how long will it stay that way? If invalid, how long until it can become valid? Do I think better typing can be a boon? Absolut…

> Why not a type for even numbers? Odd, prime, not-prime, etc? Why not indeed? See my other comment https://news.ycombinator.com/item?id=28214776 about how to create such types.

I meant that line as a bit of a tease to other tricks.

And it isn't like this isn't done often. Take the lowly format string in c languages. With the requirement that the format string has to be static, it is common to fail builds if you give it a bad format string or supply the wrong number of arguments.

Re: What was the last breakthrough in computer programming? (2019)

#98
post #7

I think Kay's complaint about engineering rigor ignores the explosive growth of programming. Sure, bridge-builders have rigor; there's also probably about the same number of them today as there were 50 years ago. The number of programmers has grown by at least two, maybe three orders of magnitude over the last half century. And more importantly, almost anyone can do it. A kid whose closest approach to structural engi…

...the rigor Kay is suggesting would kill the software industry as we know it.

You say that like it's a bad thing.

Anyone's plans to make software sane would kill the software industry as people love and hate it. A substantial portion of this industry involves supporting horrific abortions of a system that seem to live far too long. That includes the functional programming people and anyone who believes some method of theirs will produce an explosion of productivity. Hopefully, the effect will be people quickly rewriting old systems to be sane and creating many new system.

Unfortunately, such starry eyed idealism is unlikely to be realized and the rolling a 1000 pounds of jello up a hill jobs are safe. But this kind of idealism is still needed to motivate the systems builders so it's not a complete loss.

Re: What was the last breakthrough in computer programming? (2019)

#99
post #42

I feel like Kay has taken a rather too narrow view of what counts as programming. IMO here are the breakthroughs in the last 20 (ish) years: 1. Stack Overflow - search for your problem, copy and paste the answer. 2. git - Revision control that is low enough overhead that you need to have a reason not to use it. 3. Open-source software as a commodity - Unless you've got very specific requirements there's probably a sy…

YouTube. My son learns a lot of his programming from searching YouTube and watching videos. Doesn't seem like it would be high density, but I'm amazed that there are really good videos/tutorials on pretty obscure topics. And since all YouTube videos have dates, it's actually easier to find current tutorials.

Re: What was the last breakthrough in computer programming? (2019)

#100
My problem with this is it sort of implicitly assumes that languages are the unit of progress. It's unlikely that we will get progress solely by coming up with better languages, it's more like different people invent different tools to suit different problems. In the explosion, we are more likely to find what we need.

I don't think I've ever used just one language for a project.

The progress at least personally is that there are now so many resources to use a bunch of different languages to knit together a solution that a lot more can get done. You can write your low latency code in a variety of languages, and ship the data via a web server to a browser or a mobile app. For every part you have several choices of tech to use, and they're realistic choices with lots of help online. Almost everything is available for free, so you can try all sorts of libs without committing to one. There's no longer a need to sit down with a textbook and learn a bunch of stuff before starting, you can just jump in with a brief tutorial and explore the language or lib as you discover them.

The plethora of choices also teaches you a lot about languages in general, because you see so many that you can start to make generalizations.

Post reply on HN