News for hackers. Stuff that matters.
Re:Can Programming Be Liberated from the von Neumann Style? ... by amelius on Monday December 19, 2016 @08:59AM (#13211376)
> it seems human nature is preferring languages such as C, Python, C# and Java, exactly due to their expressiveness and distance from the pure math side of things

I personally think humans prefer imperative languages because they are closer to the metal, and hence more predictable in terms of performance.

Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @09:09AM (#13211425)
Also closer to how most of us learn and are taught.

Consider, I often tell my kids that they need a cup if they want water. I just as often have to change that to "go get a cup, and I'll get you water."

Declarative seems to be natural at a desire level, but at an action level, imperative seems to be more common.

I believe this is flipped for topics and actions that are well internalized. When my kids are older, I can just say "cup". If cups aren't in the right drawer, I have to provide imperative to where to check, though.

And yes, all of this is anecdotal. YMMV. I'm highly interested if folks know of studies or counter examples.

Re:Can Programming Be Liberated from the von Neumann Style? ... by digi_owl on Monday December 19, 2016 @09:51AM (#13211712)
Or it could simply be that your kids have wrapped the imperatives in a object called cup.

All this gets me thinking back to the micros and how they booted straight into a BASIC interpreter.

In a sense while booting to a mouse (or touch) driven GUI helps with getting now common tasks done out of the box. That no mainstream OS ship with something that allows someone to sit down and instruct a computer similarly to how it was done back then seems to have turned modern personal computers into near appliances.

Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @10:10AM (#13211819)
I believe this is a common line of thinking. More so with phones, which are surprisingly difficult to get self written programs on. Compared to early computers where I literally bought printouts of programs. (Toys, but still...)

Not that it is impossible, but it is surprisingly difficult and not shocking that fewer do it. (Of course, I question myself on that claim. Fewer, but by what measure? And do I have proof?)

Re:Can Programming Be Liberated from the von Neumann Style? ... by digi_owl on Monday December 19, 2016 @10:49AM (#13212101)
Thing is, back around the early days of Android Google offered a online dev environment that could sideload APKs to phones. I think it was based on Scratch.

But they have since handed the whole project over to MIT.

Frankly Android could have been a computer in our pockets, and i get the feel Rubin wanted to take it in that direction.

But around the time of 3.x-4.0 there was pressure from elsewhere in Google to take in a more iOS direction. We see this with the introduction of music and video into the then named Android Marketplace (later renamed Google Play).

And then there was the whole push towards ChromeOS as the choice of businesses, complete with Citrix being a launch day demo.

Only in the last few years have Google done an about face regading Android. Both with Android apps coming to ChromeOS, and with various functionality being added to Android to make it more business friendly.

Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @12:19PM (#13213014)
I see I also missed you comment on internalizing concepts. I think that is absolutely true. Also at the language level. There are a lot of things "internalized" by higher level languages.

To the point of android, though. I am getting my kids a Kano computer. Hoping that line will get them interested in the nuts and bolts, as it were. I need to be better and build things with them. :(

Re:Can Programming Be Liberated from the von Neumann Style? ... by digi_owl on Monday December 19, 2016 @01:54PM (#13213908)
Looks like a nifty kit indeed.
Re:Can Programming Be Liberated from the von Neumann Style? ... by godmodus on Monday December 19, 2016 @11:02AM (#13212224)
I have my hopes up for Nokia and Microsoft - win10 devices are more or less a pocket PC. When Linux Support gets properly implemented into Windows, a brilliant new era will dawn.

Not to mention c# is a beautiful language.

Re:Can Programming Be Liberated from the von Neumann Style? ... by digi_owl on Monday December 19, 2016 @11:06AM (#13212268)
> When Linux Support gets properly implemented into Windows, a brilliant new era will dawn.

Dream on. MS will implement just enough for cloud devs to use Windows as their dev environment, with a clear push towards Azure as the cloud of choice.

Re:Can Programming Be Liberated from the von Neumann Style? ... by godmodus on Monday December 19, 2016 @11:44AM (#13212645)
We'll see how it'll get bootstrapped when it happens. It takes an optimist and a pessimist for balance :)
Re:Can Programming Be Liberated from the von Neumann Style? ... by digi_owl on Monday December 19, 2016 @11:44AM (#13212649)
Touche, sir.
Re:Can Programming Be Liberated from the von Neumann Style? ... by analog31 on Monday December 19, 2016 @12:36PM (#13213178)
All this gets me thinking back to the micros and how they booted straight into a BASIC interpreter.

I grew up in that era, and I'm still nostalgic about it. On the other hand, a tablet PC plus Jupyter/Python comes pretty darn close to satisfying that need.

Re:Can Programming Be Liberated from the von Neumann Style? ... by digi_owl on Monday December 19, 2016 @04:05PM (#13214956)
I dunno. Current tablet offerings seems to be stuck either as a entertainment appliance, or straddling that and desktop Windows.

Microsoft screwed up badly when they decided you can't put a Metro style interface on a Win32 program and get touch support that way.

You either have to make it a Metro app (and ship it via their store), massively curtailing what you can do, or stay with the Win32 WIMP. And even when you tweak the size of various Win32 elements it is still a mess to operate via touch.

Edit: and using jupyter with a tablet strikes me as accessing a mainframe from a terminal (something a micro could act as with the right software).

Re:Can Programming Be Liberated from the von Neumann Style? ... by analog31 on Monday December 19, 2016 @05:09PM (#13215419)
It's certainly not as good as it could be. I have a "convertible" laptop, where the screen detaches from the keyboard to become a tablet. It runs Windows 10, so I can run the Jupyter server and a browser directly on the device. I've also played with Azure Notebooks, but I don't always have Internet access.

This isn't my only computer, and indeed doing anything with code from a touch screen is marginal at best, but at least it's possible. On a bigger computer, of course I get a bigger screen and keyboard.

Admittedly, I had to look up what Metro and WIMP are. I'm not actually trying to create apps that others can use. My use of programming is largely for my own productivity and learning.

Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @06:53PM (#13216108)
What makes jupyter/python closer to this than booting into emacs? (With something like org-mode?)

Just the point/click nature of jupyter?

Re:Can Programming Be Liberated from the von Neumann Style? ... by analog31 on Monday December 19, 2016 @09:42PM (#13216983)
That's a good question. I've built systems that boot into a command prompt, and booting into emacs wouldn't be too big a step away from that. But what always seems to happen is that after a while the nostalgia wears off and I remember why I like my Jupyter.

I guess it's the REPL-on-steroids nature of Jupyter that I like. Also, having inline matplotlib graphs is pretty killer.

Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @09:48PM (#13217016)
If you haven't, check out org mode in emacs. It can also inline graphs easily. With ready to go bindings for Python, graphviz, gnuplot, and R. (C-c C-x C-v will show charts inline with default bindings.)

My favorite is grabbing logs with a shell block. Reshaping with elisp or Python, and then charting with gnuplot. All in one file with an iterative workflow.

Re:Can Programming Be Liberated from the von Neumann Style? ... by hood_syntax on Monday December 19, 2016 @09:32AM (#13211576)
You're right that it's closer to how people are taught, but there's no reason we can't teach from the FP perspective.

Consider the imperative

  cup_of_water get_water (cup_loc, water_loc) {
      cup = get_cup(cup_loc);
      return fill_cup(cup, water_loc);
  }
or something like that, versus

  getWater :: CupLoc -> WaterLoc -> Cup Water
  getWater cupLoc waterLoc = fillCup (getCup cupLoc) waterLoc
It's just a slightly different way of thinking about things.
Re:Can Programming Be Liberated from the von Neumann Style? ... by hyperpape on Monday December 19, 2016 @09:49AM (#13211698)
There's nothing in either example that is intrinsically functional or imperative, they're just different syntax.
Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @10:01AM (#13211769)
This is dodging things by all being symbolic. Which is well after the point my kids are at in these examples. I'm taking about my one year old.

It is amazing how they can understand well before they can say words. Or read and write them. Sign language can be taught really early. Not sure what data that adds here.

But, I believe that imperative makes sense because so much in life is imperative. Especially directions we give each other.

For things that can be done symbolically, declarative can be a big boon. But it does seem to be the minority.

Re:Can Programming Be Liberated from the von Neumann Style? ... by pjc50 on Monday December 19, 2016 @10:54AM (#13212138)
Now audit each cup-filling in a database.

(Easy in an imperative system, painful in a functional one where you have to start passing monads around and caring how many times the cup is constructed rather than how many cups you end up with.)

Re:Can Programming Be Liberated from the von Neumann Style? ... by lacampbell on Monday December 19, 2016 @04:29PM (#13215134)
I am not sure what can be gained by comparing human languages or speech to computer language paradigms. I mean I could easily encode "go get a cup, and I'll get you water." as (ocamlish/F#ish)

    get_a_cup |> Option.map(fill_with_water)
Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @05:04PM (#13215384)
My assertion is that people are more comfortable with imperative programming, because we are learning imperative thinking from a very early age.

That is, there is no intrinsic advantage to imperative, by my assertion. Just that it is something we are much more comfortable with from experience.

Re:Can Programming Be Liberated from the von Neumann Style? ... by lacampbell on Monday December 19, 2016 @06:14PM (#13215853)
What I am trying to get in as I am not sure that this kind of thinking/speech is inherently imperative or declarative in (in the computing sense). The idea of modifying and controlling bits of state which other processes depend is fairly novel to the novice programmer, isn't it? I'm sure it tripped me up a lot.
Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @06:49PM (#13216078)
I'm not sure I follow. Imperative/Declarative in the programming sense is no different from the speech sense, is it? Quickly skimming the wikipedia page [1] for imperative mood makes it look similar enough to me. The page for imperative programming [2] references the grammar page, even.

As for the state, I think in life everything has state. Kids are quickly learning which ones have states that they care about. It is not uncommon to see them learn that cups filled with water need to be held a certain way, otherwise they spill.

Now, like more formalisms, computing and programming is much more strict. But that is a matter of rigor, moreso than of form. That is, it is the same form, just not forgiving in syntax/content.

Though, seriously, if I am abusing terms here please let me know. Is not my intent.

[1] https://en.wikipedia.org/wiki/Imperative_mood

[2] https://en.wikipedia.org/wiki/Imperative_programming

Re:Can Programming Be Liberated from the von Neumann Style? ... by Buttons840 on Monday December 19, 2016 @12:52PM (#13213338)
I think once someone has done enough programming to understand or care about being closer to the metal, they prefer what they already know, which is usually imperative languages.

I wonder which paradigm a total beginner would prefer? As a beginner they would not be influenced by "how the metal works" because they don't know or don't care. My guess is that beginners would prefer imperative languages as well, even though it has nothing to do with "the metal".

Re:Can Programming Be Liberated from the von Neumann Style? ... by DigitalJack on Monday December 19, 2016 @03:02PM (#13214551)
My experience is that most software engineers don't really understand the hardware at all, so the idea that "how the hardware works" is influencing anything is a red-herring in my opinion. I say this as a hardware designer.
Re:Can Programming Be Liberated from the von Neumann Style? ... by godmodus on Monday December 19, 2016 @09:56AM (#13211747)
not to mention they're battle tested. and C is predictable, period. no other language can come close bar ASM. even Rust has a long way to go before it matures to C11 levels - in terms of industry trust, community adoption and backtrack of delivering.

but ill have to still admit ignorance to a greater understanding of Rust.

Re:Can Programming Be Liberated from the von Neumann Style? ... by ianamartin on Monday December 19, 2016 @10:44AM (#13212072)
> and C is predictable, period.

Really?

Re:Can Programming Be Liberated from the von Neumann Style? ... by godmodus on Monday December 19, 2016 @11:05AM (#13212262)
If it's written spartan style, yes. If you go nuts with its dark corners things do get wierd. It's why it's a hard labour to write safely - and a contributing reason to JVM success.

It's the mother of all, and abusing it in ways that make it unpredictable is more than likely.

Re:Can Programming Be Liberated from the von Neumann Style? ... by kahnpro on Monday December 19, 2016 @02:30PM (#13214276)
If you have to add that qualifier, then is it really a predictable like language?
Re:Can Programming Be Liberated from the von Neumann Style? ... by godmodus on Monday December 19, 2016 @03:32PM (#13214752)
I don't see a problem with proper use of qualifiers.

It has to be said that I'm a "right tool for the job" kind of man, and spend less time worrying about the perfect-ness of a language. Can't think of a better language to write crypto/network routing code with. Though a colleague did implement some mDNS craziness with java.

Don't shoot me. Heh.

Re:Can Programming Be Liberated from the von Neumann Style? ... by godmodus on Monday December 19, 2016 @09:20AM (#13211512)
That's why a hardware change would be a step towards a change. If the metal was less von neumann and more Turing/number theoretical approach, it'd be a deep change.

So far the limitation of what's practical were/are the driver of industry.

And von neumann did solve a real problem they had back then. These days were facing a software engineering problem which is more high level, and most faculties are triaging the situation - but I can't really blame them. Many unis lack the funding for ground breaking experimental work - and the likes of Turing/von neumann/knuth/dijkstra et Al, only come once a generation.