Live data from Hacker News

Near Future of Programming Languages [pdf]

dev.stephendiehl.com

221–230 of 306 posts

Re: Near Future of Programming Languages [pdf]

#221
post #213
post #198

Earlier quoted context omitted.

> When your constraints mean that only the right thing can be done, you can make the thing implicit. Except that sometimes, when you think about the practical issue long and hard enough, you can find that some constraints need not be stated at all, and can be completely factored out of the language, at least in most cases. For example, GC removes resource management out of the equation (it's not always the right solu…

> If you take a step back, ignore formalism altogether and ask yourself -- or better yet, conduct research -- on what are the actual problems in programming, you may find solutions in completely different directions. It's hard to know what I don't know. I try to look at what people are doing/liking. But I feel confident that programming is inherently going to be about expressing the essence of the problem you're solv…

> I don't see the need to do anything more radical.

I do, because the things that you mostly value (I guess I value them a lot less) seem to me incredibly complex for the good that they do, and we already have some alternatives that seem both more powerful and vastly simpler. But I am skeptical of them, too, though :)

> I think the industry switching to Idris-level languages will bring a factor of 10 to 100 improvement in productivity - i.e. I expect we'll see companies of ~100 people putting the Google/Amazon/Citibanks out of business, and companies of less than 10 people competing heavily with the giants.

That is a very powerful statement, and I'd like to know why you'd think that. I would even like to know what makes you think that any language (never mind which) can make such an impact, even though we've seen nothing of this sort. I do not share your belief that Idris could make such an impact or anywhere near it, nor probably any other language.

I am skeptical, because having looked at Idris and played with it a bit, I was completely underwhelmed. Java + JML can do pretty much the same, if not better, and for a lowe cost, and this is not a statement about Java+JML being a leap forward. I have no idea if Eve could make an impact as big as the one you predict, but at least I don't feel I can instinctively reject this possibility as easily as I could Idris, as Eve actually brings a lot of new things to the table, where Idris feels like some ergonomic improvement over things that may have had some potential that never materialized, in the hope that better ergonomics is what should do it.

I would like to point out one more problem with viewing the abundance of research as a proxy for utility or of an "established idea", one that touches on my own personal biases :) When you publish a paper, certainly in good journals/conferences, you must exhibit some significant novelty. This, ironically, rewards the more complicated (and so arguably less useful in the real world) frameworks and punishes the simpler ones. For example, I've seen papers talking about embedding separation logic, or specifying amortized worst-case complexity in Coq. You won't see such papers on TLA, because doing both in TLA is rather trivial. Lamport himself complained that he had trouble publishing a paper on specifying and verifying realtime systems in TLA because it is so straightforward that it was hard to demonstrate mathematical novelty. He had to artificially add an extra novelty (the use of a model checker) to make the paper worthy of publication [1].

[1]: http://lamport.azurewebsites.net/pubs/pubs.html#real-simple

Re: Near Future of Programming Languages [pdf]

#222
I like the slides and agree with the widening language gap. I have a few comments about the conclusions, though.

> The UPenn dependently typed Haskell > program shows a great deal of promise and > is likely to manifest a decade before other > DT languages generate practical backends.

I don't agree with this at all. The design problems with tacking on dependent types to an existing system are massive - it's a research problem for a reason. On the other hand, writing a "ghc quality" backend for Coq/Agda/Idris/F* seems difficult, but at least it's an engineering problem instead of a rough idea.

In particular, CertiCoq is a compiler for Coq written in Coq, and the main problem here is verification. Simply writing a compiler is no harder than writing a compiler in any language.

> Interesting ideas out of Microsoft Research on SMT solver > directed programming editors that enforce invariants and can > generate code during development.

Another interesting Microsoft Research project along the same lines as Dafny is F. Both are nice, but F is closer to modern dependently typed languages.

> Lots of non-local reporting problems associated > with using unification during type-checker.

I would argue that the problem is that we use constraint solving for type checking. For example, strict bidirectional type checking leads to more tractable errors, since it's straightforward to follow the compiler's reasoning. On the other hand, bidirectional type checking is less powerful, so it's not like there's a silver bullet here.

> Type-safe OTP.

I wish more people were working on things like this. There's some theoretical work on calculi for distributed systems, but once they encounter the real world they inevitably become horrendously complicated.

Re: Near Future of Programming Languages [pdf]

#223
post #140

The "Language Gap" slide seems massively overstated, or maybe I'm misunderstanding. We really have seen a lot of progress in the last 10-20 years, both in industrial languages and in academic ideas that could become the industrial languages of the next 10-20 years (e.g. Idris on the short end, Noether on the longer end). The author laments that pattern-matching is still not standard, but we're getting there; map/redu…

The "Language Gap" slide seems massively overstated, or maybe I'm misunderstanding.

The language gap is relative to where he thinks we should be aiming for, what the author thinks is possible. If you think that we're already "there", then there is no gap for you, and there's nothing wrong with feeling that way.

Personally, I agree with the author: we can do vastly better. I think it's a failure of imagination and effort, not potential.

Re: Near Future of Programming Languages [pdf]

#224
"Use the right tool for the job" is not the dumbest cliche in software... in theory. But it requires actually knowing what options are available, what their strengths and weaknesses are, and what problems (various kinds of yak shaving) the job will throw at you. Picking the tool that can best reduce the yak shaving is the difference between professionalism and masochism.

In practice, though, a lot of people quote this who don't know what options are available, what their strengths and weaknesses are, and what the problems of the job will be, and so when those people quote it, it's just a cliche.

Re: Near Future of Programming Languages [pdf]

#225

Earlier quoted context omitted.

> My experience is that functional alone is impossible, since the only useful thing a program can do is through state changes Some programs are simply pure functions. If your program entry point accepts a string and returns a string, then you can write useful things, such as compilers, image processing, grep, etc, entirely as pure functions.

Unless you want logging with timestamps.

Logging with timestamps is not in opposition to purity.

All purity does is force you to change the type of a function that wants to log something, to reflect that it’s returning a value that, when evaluated at run-time, will have the side-effect of printing to the console. It’s still a pure function since it returns the same description given the same argument(s), the only difference is that when this description is evaluated by the run-time system, something will be printed to the console (in accordance with the description).

In other words, you’re not restricting the effects your program can have, only how you can choose to describe them (as first-class values whose evaluation has a side-effect that is not observable by your code).

It’s all explained perfectly in this talk: https://www.infoq.com/presentations/io-functional-side-effec...

Re: Near Future of Programming Languages [pdf]

#226
post #135

Earlier quoted context omitted.

It's flawed because 99.999% of the time your code will work just fine. Job done. Then one day, "undefined is not a function" and your airplane falls out of the air.

This happens in all languages... look at the Toyota acceleration bug for a real world of example of your hyperbole. They were using MISRA C. Languages dont fix spaghetti, laziness, tight deadlines, bad engineers, etc.

I'm not sure you can do spaghetti and still do MISRA C. Doesn't MISRA have some things about goto, cyclomatic complexity, and such?

Re: Near Future of Programming Languages [pdf]

#227

Earlier quoted context omitted.

In a sense yes, although I suggest that a "business process" is too broad and difficult an abstraction. Better for most [1] systems in industry and commerce to elicit and model sequences of recorded events [2] involving interactions with things, people and places in different contexts, with support for constraints [3]. Modeling the above in a business sense, with support in existing paradigms and languages is already…

I’m not sure I understand everything you said there. Software engineers are often tasked with designing and implementing “business processes”, just as they are tasked with implementing correct logic in a concurrent threaded program, or system of microservices. Don’t you feel that when they step up to the whiteboard and draw yet another completely ad-hoc diagram, for any of the above problems, with no agreed rules of…

There are some that can walk up to a white-board and (repeatedly and predictably) create a domain object model representing complex business requirements. One directly convertible to code.

They can do this because they know a set of higher order patterns, beyond just a knowledge of "objects" and "classes". Beyond just a design approach of identifying classes as the "nouns" in a problem domain.

These higher order patterns represent those business processes, as you call them.

Sadly such a skill is very rarely seen, or even in demand, given that data modeling is the basis for most design today.

Re: Near Future of Programming Languages [pdf]

#228
post #221
post #213

Earlier quoted context omitted.

> If you take a step back, ignore formalism altogether and ask yourself -- or better yet, conduct research -- on what are the actual problems in programming, you may find solutions in completely different directions. It's hard to know what I don't know. I try to look at what people are doing/liking. But I feel confident that programming is inherently going to be about expressing the essence of the problem you're solv…

> I don't see the need to do anything more radical. I do, because the things that you mostly value (I guess I value them a lot less) seem to me incredibly complex for the good that they do, and we already have some alternatives that seem both more powerful and vastly simpler. But I am skeptical of them, too, though :) > I think the industry switching to Idris-level languages will bring a factor of 10 to 100 improveme…

> That is a very powerful statement, and I'd like to know why you'd think that. I would even like to know what makes you think that any language (never mind which) can make such an impact, even though we've seen nothing of this sort.

I think we have; I think we've seen dramatically accelerating programmer productivity. I think language improvements compound heavily: if a language is slightly more efficient in the small, that means code has to be broken up less, which give it more and more of an efficiency advantage as the codebase gets larger.

> I am skeptical, because having looked at Idris and played with it a bit, I was completely underwhelmed. Java + JML can do pretty much the same, if not better, and for a lowe cost, and this is not a statement about Java+JML being a leap forward. I have no idea if Eve could make an impact as big as the one you predict, but at least I don't feel I can instinctively reject this possibility as easily as I could Idris, as Eve actually brings a lot of new things to the table, where Idris feels like some ergonomic improvement over things that may have had some potential that never materialized, in the hope that better ergonomics is what should do it.

All of programming language design could be called ergonomic improvements. I always found all the pre/post contract stuff too complicated and too different from normal programming to get any value out of; being able to capture more in plain old functions, values and types is where I see value.

Re: Near Future of Programming Languages [pdf]

#229
post #220

Earlier quoted context omitted.

How much of that is just solving a problem created by Javascript? A community accepting of new engineers isn't. But it isn't something to brag about either, because it never means its literal sense. Instead, people say a community accepts new engineers when it has low enough standards that newbies feel empowered without learning anything new. The one language to rule them all mentality is also about low standards. Th…

Almost none of the things I mentioned are solutions to 'a problem created by JavaScript' therefore your question seems deliberately misleading. An accepting community can be a large funnel: it doesn't need to mean that nobody improves or that there are no selection effects. More candidates means more chaff, but also more wheat. Babel isn't merely contributing to a 'lack of a good VM'. It's more valuable to see it as…

> More candidates means more chaff, but also more wheat.

That needs substantiation. It's not immediately obvious in any way.

About Babel, notice how we never had a problem playing with language-level features that target the PC? That's the difference a good VM makes (although on the PC case, it's not virtual). Besides, you are conflating VMs and languages somehow - they have only a tenuous relation.

About the speed, Javascript misses most of the expressiveness of Python and Ruby. It's more on line with Java but if you want dynamically typed languages, with PHP and Perl too. Yet, it's not any faster than PHP and Perl. It has reasonably fast runtimes - those are not an issue for the language, but are not a big selling point either.

Overall, the reason Javascript still exists and is viewed as a serious language is all because it has a monopoly on the browsers. It was worked on enough that if that monopoly goes away it will still be a good choice for some stuff, but it is not an stellar language, and can't be coerced into becoming one unless it can pass through a Perl5 - Perl6 level transition.

Re: Near Future of Programming Languages [pdf]

#230
post #198
post #168

Earlier quoted context omitted.

> if the extent of the imagination is languages like Idris and ideas like effect systems, that follow a gradient descent from Java, and always in the same direction: being able to express more constraints. I don't think that's a fair reflection of what these languages feel like. When your constraints mean that only the right thing can be done, you can make the thing implicit. The things that are tacit when humans tal…

> When your constraints mean that only the right thing can be done, you can make the thing implicit. Except that sometimes, when you think about the practical issue long and hard enough, you can find that some constraints need not be stated at all, and can be completely factored out of the language, at least in most cases. For example, GC removes resource management out of the equation (it's not always the right solu…

> If Idris is a big step ahead of Java, by how much do you think costs at, say, Google or Amazon or Citibank would drop if they decided they would all switch to Idris tomorrow? I'm fairly certain that it wouldn't be anywhere near 30%, and I'm not even sure costs wouldn't actually rise.

How much would something like Idris lower costs at Experian? That is, in your "cost" metric, what weight do you assign to the cost of catastrophic bugs?

(Yes, I know, the Experian bug was in a third-party component that wasn't updated when it should have been. I assert that it's still a relevant question...)

Also note: I am not actually claiming that Idris would prevent catastrophic security bugs. But the question adds another axis where Idris could give you a 30% cost reduction.

Post reply on HN