News for hackers. Stuff that matters.
Re:Ask HN: How would a programming language look if designed... by j-pb on Friday December 17, 2021 @06:38AM (#29590861)
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 and logicians

The ugly: SPSS, R, two languages done by statisticians, and they are absolutely abhorrent, and often missused.

If we reinvented programming today my guess is that it would be a lot less text driven and a lot more data oriented.

Re:Ask HN: How would a programming language look if designed... by lokedhs on Friday December 17, 2021 @08:18AM (#29591672)
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 an example of data-oriented programming. It actually hides the code and displays the data, which is why most programmers hate it. It's not the data that is important when doing development, but the code.

Array oriented languages like APL and R allows you to work with data like Excel, but you work with the code, not the numbers. I'd argue that once you learn more about programming, one tends to want to work with the code rather than just looking at data.

Re:Ask HN: How would a programming language look if designed... by j-pb on Friday December 17, 2021 @09:01AM (#29592222)
> one tends to want to work with the code rather than just looking at data

I've observed the opposite trend. The more senior people get the more they care about the data and less about the code.

Programming = Datastructures + Algorithms

But it's the Data-structures/-models that dictate the algorithms and it's the domain and data therein that dictates the model.

Most companies could survive their code being lost. None would survive loosing all their customer data.

Functional programming is all about data, react is about data, machine learning is about data, google and facebook are about data.

Code is an incidental means to an end, in 90% of all cases, except flight software and games maybe, but even there the trend is towards data driven ECS-Systems and "collect all data for a timestep, and execute your flight control program to compute all actuator outputs in one go"-approaches.

And observability is one of THE hot topics in the biz right now.

Re:Ask HN: How would a programming language look if designed... by Someone on Friday December 17, 2021 @09:37AM (#29592702)
> 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 Jtsummers on Friday December 17, 2021 @10:19AM (#29593299)
I think we underestimate them, but they also underestimate themselves (I hear a lot of "I can't..." by people who definitely can, once that word is in their head they no longer can but because of the mental block).

Also, there was a major difference between what the secretaries would have been using before troff and their experience with troff. In particular, at that time, they were probably using typewriters. A digital workflow would have been a massive improvement in experience. Need multiple copies? No more carbon copies or retyping, now it just comes off the printer (which may still use a carbon copy, but at least you don't have to retype it). Need to adjust something? At least for future printouts it's just changing the file, and maybe using whiteout and handwriting the correction in a few printouts. Want to reflow the entire page? On a typewriter you start over, with troff you edit.

Today, people have Word and Google Docs, why do they need troff/Markdown/TeX/LaTeX/Asciidoc/org-mode/etc.?

The experience, for the user, is not as qualitatively different as those secretaries would have experienced at the time. Not just secretaries, my parents (a pilot and an engineer) took to computers in the 1970s (in college)/1980s (work, later home) for the same reason, it was a better experience than using typewriters and hand calculating things (even with a calculator).

Re:Ask HN: How would a programming language look if designed... by TheMonarchist on Saturday December 18, 2021 @09:31PM (#29610822)
> Today, people have Word and Google Docs, why do they need troff/Markdown/TeX/LaTeX/Asciidoc/org-mode/etc.?

Because what they write has structure and they don't want to be distracted by the looks.

Re:Ask HN: How would a programming language look if designed... by Jtsummers on Sunday December 19, 2021 @08:18PM (#29620545)
Just saw your reply, but I think you're missing my point and I'm not sure if it's willful or not. If not, here it is again: The difference in experience between Word/Docs and the various text-based markup languages is not as significant as the difference that someone would have experienced going from a typewriter to something digital, whether troff or anything else. It is like trying to get someone to go from Excel -> another programming language, versus a handheld calculator and pen and paper to anything on a computer. There are differences, I'm not saying there aren't and you're being obtuse if that's how you're taking it, but the magnitude is far less.

Regarding your "don't want to be distracted", Word has had an outline mode since at least 1995 (first time I used Word). Not sure about Google Docs, but it's a perfectly fine distraction free writing environment. So that's not even a selling point for users of Word.

Re:Ask HN: How would a programming language look if designed... by TheMonarchist on Sunday December 19, 2021 @09:27PM (#29620927)
> I think you're missing my point

I just don't object to anything but that one question.

> Word has had an outline mode since at least 1995

I haven't had Word for years so I can't check it out, but if you take WYSIWYG out of a WYSIWYG editor, what is left? Why would I use it instead of other tools you listed? I have used some of them.

Re:Ask HN: How would a programming language look if designed... by t-3 on Friday December 17, 2021 @10:21AM (#29593326)
To be fair, troff was designed when typewriters were ubiquitous and is basically a direct analogue. It's not going to be hard for a professional typist (ie. secretary) to learn troff. It's like teaching R to a statistician.
Re:Ask HN: How would a programming language look if designed... by ModernMech on Friday December 17, 2021 @01:58PM (#29596712)
> It has been said that non-programmers used to catch on to APL quite quickly back in the day.

This is still true today. I used to run a program for kids where they coded with robots. We used C for a while and we spent the whole time teaching C, never really getting to cool robot activities. Then we switched to Matlab, and it was like night and day. They took to Matlab so quickly, and I think you are right that the array nature of the language is the main reason. Others include the ubiquitous table datatype, and a REPL interface.

Re:Ask HN: How would a programming language look if designed... by wodenokoto on Friday December 17, 2021 @03:55PM (#29598236)
I’m mid 30s and still think 50 years ago is 1950 …
Re:Ask HN: How would a programming language look if designed... by ModernMech on Friday December 17, 2021 @08:04AM (#29591563)
50 years ago was 1971. There were lots of programmers and programming languages in 1971. By then we had Fortran, Algol, Cobol, Logo, Basic, Simula, Lisp, Snobol, B, APL… I could go on.
Re:Ask HN: How would a programming language look if designed... by hugh-avherald on Friday December 17, 2021 @07:38AM (#29591336)
I'm struggling to think of an aesthetic reason why SQL would be "good" yet R, "ugly".
Re:Ask HN: How would a programming language look if designed... by j-pb on Friday December 17, 2021 @08:49AM (#29592027)
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/fast way to wrangle data, with higher order functions like map, is hidden behind idiosyncratic names and obscure APIs.

Even the creator of R considered making it a language instead of the scheme library that it started iut as, as a mistake.

Re:Ask HN: How would a programming language look if designed... by Someone on Friday December 17, 2021 @09:14AM (#29592399)
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 marianoguerra on Tuesday December 21, 2021 @04:06PM (#29642092)
I'm working on that :)

Instadeq: A Live Programming Environment for End User Data Analysis and Visualization

Video: https://www.youtube.com/watch?v=mTEkYqnGICE Slides: https://marianoguerra.github.io/presentations/2021-live/

Re:Ask HN: How would a programming language look if designed... by Nekorosu on Friday December 17, 2021 @10:01AM (#29593044)
Looks a lot like declarative logical programming language in disguise (Datalog, Prolog).
Re:Ask HN: How would a programming language look if designed... by jhbadger on Friday December 17, 2021 @10:02AM (#29593054)
I was a huge fan of xlispstat in the 1990s (which I've archived on Github at (https://github.com/jhbadger/xlispstat), but the simple fact is that the majority of the statistics community just didn't like Lisp-like languages, and not only xlispstat, but newer projects like Incanter (statistics for Clojure) have pretty much failed as well. R meets its need far better than a Scheme library that nobody would have used. It's yet another example of "worse is better".
Re:Ask HN: How would a programming language look if designed... by k_sze on Friday December 17, 2021 @08:01AM (#29591547)
I don’t know R but SQL is definitely ugly.

There is no world in which listing the columns before the tables in a SELECT statement is a good idea. It makes intellisense/autocomplete awkward.

Re:Ask HN: How would a programming language look if designed... by JackMorgan on Friday December 17, 2021 @08:04AM (#29591562)
R has a lot of surprises built in and is fairly inconsistent. That makes it harder to fully learn (always have to pull up docs for everything). Also it means every so often I'll forget some weird edge case of a function and get a totally wrong result. For a certain class of work, this is fine: if you use it every day and are confident catching errata you'll learn all the weirdnesses. Many professional programmers work in a half dozen languages a week, so one that is significantly harder to learn will feel frustrating. For me it'll be actually slower to get the same result as other tools since I have to relearn its unique way of working.
Re:Ask HN: How would a programming language look if designed... by clircle on Friday December 17, 2021 @07:09AM (#29591112)
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.
Re:Ask HN: How would a programming language look if designed... by rich_sasha on Friday December 17, 2021 @09:01AM (#29592216)
From memory, R is quite slow, and has syntax I found really ugly. Dots as part of names (my.variable), $ for member access, operators wrapped in % for pointwise operations, eg %*% for pointwise multiplication.

These probably shouldn’t matter but did for me. FWIW the statistical offering was fantastic.

Re:Ask HN: How would a programming language look if designed... by qqqwwweeerrr on Friday December 17, 2021 @07:40AM (#29591358)
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.

Re:Ask HN: How would a programming language look if designed... by Someone on Friday December 17, 2021 @09:25AM (#29592554)
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 wcerfgba on Friday December 17, 2021 @09:43AM (#29592788)
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

Re:Ask HN: How would a programming language look if designed... by cube00 on Friday December 17, 2021 @06:55AM (#29591009)
The ugly: SAS
Re:Ask HN: How would a programming language look if designed... by mothsonasloth on Friday December 17, 2021 @07:03AM (#29591072)
Siebel CRM