Live data from Hacker News

Ask HN: How would a programming language look if designed by non-programmer

news.ycombinator.com

51–60 of 132 posts

Re: Ask HN: How would a programming language look if designed by non-programmer

#51

One possibility: the non-programmer is more open to designing a language that is more than just text. Programming in plain text (in a monospace font) hasn't changed for decades. It doesn't look like it will change for the foreseeable future either. This isn't because plain text is inherently superior. We're still relying on clumsy, cryptic syntax determined by the limited characters available on a keyboard. The simpl…

IMO, you have that backwards. We have lots of tools for plain text languages because it's easier to write tools for a language when it's plain text. Plain text is a blessing, not a curse.

Re: Ask HN: How would a programming language look if designed by non-programmer

#52
post #44

Earlier quoted context omitted.

I'm struggling to think of an aesthetic reason why SQL would be "good" yet R, "ugly".

SQL made relational programming possible, when computer were too slow to do declarative programming. The modern aproach would be something more highlevel/declarative like Datalog, but given the context SQL made a good tradeoff in terms of programmer control and declarativity. R is ugly because it encourages users to use it wrong. For loops are slow as a snail, but are what everybody uses and teaches, while the proper…

I think something like QBE (https://en.wikipedia.org/wiki/Query_by_Example; about as old as SQL) is the way to let non-programmers write queries.

Re: Ask HN: How would a programming language look if designed by non-programmer

#55
post #13

Earlier quoted context omitted.

Despite constantly reading on this website that R is bad or wrong, I somehow manage to get all of my data work done quicker and with fewer headaches than excel, sas, or Python.

I hear the complaint that R is a terrible language mainly from professional programmers. I'm sure it is poorly designed from a computer science perspective, but there is no programming language out there which makes it so easy to run any model under the sun as does R.

I think that’s not a feature of the language, but of its libraries. R is popular for similar reasons why it’s so hard to replace python.

In Python’s case, the language isn’t bad, but the implementation is horrible for performance. It sits on the back of lots of fast C/Fortran/whatever code, and polished the (relative) turd a lot, making the end result quite usable, but the “sitting on top of part” also makes it hard to improve the performance of the implementation.

For both R and python the end result is good, but they still are local optima in the space of what is possible.

Re: Ask HN: How would a programming language look if designed by non-programmer

#56

Perhaps I'm grumpy, but questions like this irk me. A programming language designed by a non-programmer would simply not work. It would have non-logical magic the non-programmer expects us programmers to create, things like the "do what I mean" function. One would have to seek out someone with a nearly programming language formality in their logical thinking, such as a mathematician, or linguist. Whatever such a non-…

> One would have to seek out someone with a nearly programming language formality in their logical thinking, such as a mathematician, or linguist I’ll give you some examples of people who possess the kind of logical mind you describe here yet lack programming ability: - lawyers work with legal code trying to figure out ways to hack it to help their clients. Say what you will about lawyers, but they are good at findin…

I completely agree the professions you provide would be people capable of a creating logical critical paths and therefore a programming language. Lawyers would be quite adapt at it, doctors as well, as would be educators - the examples you cite all exhibit professions that require critical analysis to achieve the basics of their profession. However, at the same time I might suspect the attorney would be the best of these three, followed by the educator. My reasoning for why these two would be better than a doctor at creating a programming language is because doctors do not need to work through the understandings of others, while both attorneys' and teachers' work requires the collective understandings of others to agree and that agreement is through the effort of the attorneys and teachers. That logical indirection required by attorneys and teachers is the insight that would enable them to create a programming language capable of use by others. Doctors would create some illegible scribble.

Re: Ask HN: How would a programming language look if designed by non-programmer

#58
post #42
post #5

50 years ago, these people were quite common. There were only mathematicians and engineers, but programmers didn't exist yet. The good: Excel, Dataflow Diagrams (commonly found in game, music and arts), SQL, Declarative Dataflow Paradigms in general. Mutablity is counterintuitively counterintuitive if you don't have a model of the underlying execution system. The weird: Prolog, APL, languages done by mathematicians a…

I'm of the age that I also consider 50 years ago to be the dawn of computing. Turns out it's closer to 75. :-) It has been said that non-programmers used to catch on to APL quite quickly back in the day. Faster than regular programming languages in fact. The designers, Ken Iverson, didn't even design the language to be run on computers but rather as a mathematical notation. Someone else mentioned Excel, and that is a…

> It has been said that non-programmers used to catch on to APL quite quickly back in the day

Thompson and Ritchie also said their secretaries happily wrote troff.

Do people get pampered too much today or are we severely underestimating them?

Re: Ask HN: How would a programming language look if designed by non-programmer

#59
You will be very interested in my colleague Brad Myers' work on Natural Programming. http://www.cs.cmu.edu/~NatProg/

In particular, one of his PhD students John Pane did a number of studies looking at how people would naturally describe the behaviors in Pac Man. It was really nice work.

You should also take a look at Programming by Demonstration. One book, Watch What I Do, is published online in its entirety by the editor Allen Cypher, see here http://acypher.com/wwid/.

Another book in this space, Your Wish is My Command, is also published online https://web.media.mit.edu/~lieber/Your-Wish/

Both of these are collections of research papers showing how people can demonstrate what they want to a computer, and have the computer figure out what they want. There's a more recent book on programming by demonstration, but I don't recall the title.

But definitely check out the first link on Natural Programming, Brad Myers is one of the world experts on this topic.

Re: Ask HN: How would a programming language look if designed by non-programmer

#60
post #55

Earlier quoted context omitted.

I hear the complaint that R is a terrible language mainly from professional programmers. I'm sure it is poorly designed from a computer science perspective, but there is no programming language out there which makes it so easy to run any model under the sun as does R.

I think that’s not a feature of the language, but of its libraries. R is popular for similar reasons why it’s so hard to replace python. In Python’s case, the language isn’t bad, but the implementation is horrible for performance. It sits on the back of lots of fast C/Fortran/whatever code, and polished the (relative) turd a lot, making the end result quite usable, but the “sitting on top of part” also makes it hard…

I've had the opposite experience. My preferred programming style is functional. My current gig has been in Clojure, and I couldn't ask for a better product programming language. I find Python code very difficult to write in a functional way (even the official howto is littered with for loops [1]), but in R I can feel an underlying lispiness, and the pipe operator `%>%` from magittr is really nice: whereas in Clojure there is `->`, `->>` and `as->` for thread-first, thread-last, and named threading respectively, in R with `%>%` I get thread-first as the default and I can override it by placing `.` wherever I want in the downstream function calls.

[1] https://docs.python.org/3/howto/functional.html

Post reply on HN