Better HN
topnewbestaskshowjobs
Log inSign up

TuringTest

4,482 karma · joined Sep 28, 2012 (14y ago) · 2,101 submissions

Send me a note at turingt+fromhackernews (at) gmail.com

I hope the spam filter will respect it!

Submissions

comment 4y ago · link · parent

The computer is not an imperative machine. It's a physical machine that you describe with an imperative representation in your mind. Can you tell the difference, or are you unaware of the map-territory distinction going on?

Functional programmers are simply choosing to use a different style of map, but we both represent the same reality.

comment 4y ago · link · parent

> Just because you could shoehorn reality into a physical model, does not make it equally valid.

Hey, physicists do it all the time. Having mathematical representations of how things work in the real world often turn out to give you complex devices that you wouldn't get by intuition alone. Thanks to doing it, we have Special Relativity and Schrodinger equations, that bring you advantages as GPS and insanely-high-speed networks.

There's nothing wrong with modelling interrupts and mutable state as static mathematical entities a.k.a. functions; and if you think it is, you don't know enough about functional programming - in fact, doing it allows for advanced tactics like automatic verification and very high scale generation of electronic devices.

Those less degrees of indirection may make it simple to build some kinds of programs; but they also introduce complexity in modelling the possible states of the system when you allow for arbitrary, unchecked side effects. So no, that representation is not inherently better - only most suited for some tasks than others; but the converse is also true for functional models of computation. If you think it is always better, it's because you're not taking all possible scenarios and utilities into account.

(Besides, as I already said elsewhere, "computers are mutable state" is not incompatible with functional representation; as mutable state can be represented with it). It seems that you're confusing mutable, wich is a property of computational devices, with 'imperative' which is a style of writing source code and defining relations between statements in your written program.

> Literally the exact opposite of functional, IO registers are the epitome of global mutable state.

Yup, you definitively don't know what functional programming is if you think you can't have global mutable state in it. In fact, every top-level Haskell program is defined as a global mutable IO monad...

comment 4y ago · link · parent

That, and the comments in this thread reminding us that you have powerful tools in pure functional languages to represent state and handle those pesky side effects causing the bugs that plague imperative programmers' nightmares.

comment 4y ago · link · parent

For anyone interested in programming paradigms, I strongly recommend the online 'Paradigms'[1] course by Peter Van Roy, which you can take for free if you don't want to get certified. It uses the multi-paradigm language Oz to explain the essence of each paradigm and the differences between them. (Learning that new language makes sense in this case, as it prevents you from being distracted by the idioms of languages you already know).

The course distills the primitives of different programming languages in terms of how they see state (see Van Roy's diagram in [2]), and how deciding to incorporate and combine some of those primitives and not others gives rise to the different programming styles. I found it enlightening, in the way that programmers' koans refer to.

[1] https://www.edx.org/es/course/paradigms-of-computer-programm...

[2] https://en.wikipedia.org/wiki/Programming_paradigm#Overview

(This is a repost of a comment I made below, so that readers who don't read the whole thread can still see it).

comment 4y ago · link · parent

A stream is in essence the same as the Observer pattern; every function that depends on the values of a mutable variable must use accessor methods to extract the most recent value when they need it, or pass it 'hook' callback functions that represent the next steps to take on new values.

So, in principle, it should have the same performance as the 'Chil­dren can issue noti­fi­ca­tion events' method in the article, since it's using what in essence is the same structure (just with a much nicer syntax, better adapted to functional programs).

The advantage of using functional streams instead of OOP observable callbacks is that it tends to be easier to write the program's large structure as compositions of functions over streams, i.e. it is easy to build modular functions without the bugs introduced by side effects.

I learned this style of programming through the online 'Paradigms'[1] course by Peter Van Roy, which you can take for free if you don't want credits. It uses the multi-paradigm language Oz to explain the essence of each paradigm and the differences between them. The course distills the primitives of different programming languages in terms of how they see state (see Van Roy's diagram in [2]), and how deciding to incorporate and combine some of those primitives and not others gives rise to the different programming styles. I found it enlightening, in the way that programmers' koans refer to.

[1] https://www.edx.org/es/course/paradigms-of-computer-programm...

[2] https://en.wikipedia.org/wiki/Programming_paradigm#Overview

comment 4y ago · link · parent

I think the crux is that any complex data structure f1 using glyphs would not need to be updated explicitly in an imperative program through a function like updateFontInGlyph; the runtime would do it as part of its semantics. Of course that's a double-edged sword, as you may get undesired side effects as well as the desired ones like this.

There are ways to achieve such "automatic updating" of items in a functional data structure, but you need to build them explicitly instead of relying on the runtime, which gives you more responsibility but also more control. The most direct approach as compared to imperative code would be to build the data structure on top of mutable state-based streams, though there are other possibilities like monotonic or immutable structures.

https://blog.waleedkhan.name/monotonicity/

comment 4y ago · link · parent

travisathougies is not alone on that. Every one of us functional programmers worth their salt will consider a sequence of transformations from one state to the next as a functional program, as long as there are no side effects outside the current function that may transform state in ways that aren't declared in the types of the input and return values (which would break the referential transparency).

Functional Reactive programming (i.e. combining functions over streams of mutating objects) is essentially that, and it's a pure functional paradigm, quite popular in front-end web development (and I hear it's even creeping its way into the back-end).

comment 4y ago · link · parent

> Every popular CPU architecture is imperative.

That's arguable, given that every (deterministic) imperative computation can be expressed as a pure functional program. "Imperative" is more of a viewpoint that the developer is using to understand the behavior of the computer, rather than a property of the machine itself.

A pure functional analysis will describe a computation on that "imperative" architecture as an inmutable, monotonic sequence of all the states that the CPU goes through over time; or maybe, if you know enough PL theory, as a chain of rewritings of a program-long expression that is updated, one term at a time, when each expression is replaced by the result of a function as it consumes its input parameters.

And no viewpoint is inherently better than the other (except that the functional version can be analyzed in a natural way with mathematical tools, which is often difficult with the imperative description).

comment 4y ago · link · parent

The thing is, functional and imperative programming are mathematically equivalent - to the point that you can express imperative code in a pure functional language, if that's what you really need. If you want a O(1) random access in a functional language, you can formally define it; the problem with this is that you may end up embedding a whole computer in your program to do it, if your program heavily depends on side effects like those in the article. So, if you really need O(1) mutability for a large part of your program, maybe functional programming is not the tool for the job? Being too tied to a paradigm prevents you from finding the best tool at hand.

Functional programs are best used when you want referential transparency[1] as your problem domain benefits from it. If you want to represent mutable state in a functional, transparent way you use a subset of temporal logic[2] - each function has an additional state of the world input parameter, and return an additional updated state of the world value with all the mutated objects in it. The State monad is a version of this with increased legibility (as long as you don't combine many different sources of mutation).

If your needs for mutation are limited to a few objects in each module, you represent those as streams (the generalized version of futures which are able to be repeatedly updated with new values); a stream represents the history of all values that a mutable variable takes during the program execution. This is the basis of the functional reactive paradigm[3] on which modern web frameworks like React and Vue are converging, as it happens that modeling asynchronous state mutations of multiple loosely connected elements is easier in the functional paradigm than in the imperative.

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

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

[3] https://en.wikipedia.org/wiki/Functional_reactive_programmin...

comment 4y ago · link · parent

> Not sure how big the market is, but...

Probably, good enough for a Wordpress plugin.

comment 4y ago · link · parent

The multiple '???!' should be enough of a hint (as well as the obvious context of contradicting reality)

comment 4y ago · link · parent

In countries where it is very hot during the day, there is a cliché that people make the minimum effort necessary or even less.

The cliché is true during the hottest hours, but it fails to admit that it is simply because most activity moves to the twilight hours when the heat subsides.

comment 4y ago · link · parent

> Do you mean something like emacs and other modeless editors? Emacs particularly, had incremental search in the 1970s.

Yeah, and I suspect it may have influenced Raskin in designing the Canon Cat. But good luck with quasimodes and spacial navigation among files in Emacs. The refined interactions provide an extra value in terms of approachability that Emacs is notorious for lacking.

The Canon Cat was easy to learn even for advanced use, something that you'll never hear about Emacs.

comment 4y ago · link · parent

It's better to do an internet search for those terms, and look at what catches your eye according to your interests. There are many players pushing for their own understanding on how to reach that goal, and I would not promote any one over the others (especially as they all seem to be a bit unripe right now).

Look for modern notetaking apps (Notion, Obsidian, logseq, Airtable, Roam Research... and "alternatives to" any of those) to see what style of knowledge management I'm talking about (there are two main varieties - the "outliner" and the "user-friendly relational database", with a lot of overlap between them).

comment 4y ago · link · parent

> It's indeed surprising that there are not more new ideas around.

There are lots of new ideas... if you know where to look ;-) The problem is that, being new, they are neither widely distributed nor as well refined as the old ones.

Keep an eye on 'modern note taking' productivity tools in the orbit of 'second brain' or 'networked thought'; they are upgrading many of the principles of the Canon Cat to the current networked environment, and follow through on the spirit of the classic "augmenting the human intelect" dream.

I believe they have the potential to replace the outdated desktop metaphor, and offer a digitally native metaphor for information processing and productiviy.

comment 4y ago · link · parent

> Incremental search as I'm used to the term certainly existed long before and still exists now: did the Cat do something different?

Yes, it did. It included two functions that significantly change the system's user-friendliness:

- Search and navigation was done through quasi-mode interactions, instead as with point-and-click. This gave end-users the powerful keyboard-only navigation capabilities of vi, without all the cognitive load of its navigation&commands mode.

- All content in the system was organized as a single infinite stream of text. There were special characters for sections and files, so you could always navigate to the previous/next section or file by leaping to that character. And you could open a section or file by typing the character plus the file name.

Several of these conventions have been since adopted by browsers' "smart address bars", allowing users to navigate the web through a limited version of this keyboard-first style. But there is no desktop environment that fully takes advantage of these principles for a general audience. Typically, only some power users benefit from a similar workflow in controlled environments like Emacs, without all the simplicity and gentle learning curve of the Canon Cat.

comment 4y ago · link · parent

> For the way I type, with my thumb angled so the knuckle would hit the Leap key, that would be absolutely infuriating. But it's an interesting idea nonetheless.

I've seen an adaptation[1] of the concept to a standard keyboard that used the Alt + Alt gr keys for Leap back/forward, and the result was quite usable.

[1] the Archy project by Raskin's son Aza https://en.wikipedia.org/wiki/Archy_(software)

comment 4y ago · link · parent

Second-generation outliners and data-heavy notetaking apps (Notion, Obsidian, logseq, Airtable, Roam Research...) provide similar functionality as a unified environment for all your information needs stored on a single device with a homogeneous interface.

Though I'd say they have huge shortcomings in terms of usability with respect to using them solely from keyboard shortcuts, at least compared to the simple efficient model of the Canon Cat and its radically modeless interactions.[1]

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

comment 4y ago · link · parent

I strongly suspect that AR devices for productivity will greatly benefit for this kind of radical spatial information management, to the point of making it viable for information workers.

comment 4y ago · link · parent

I linked elsewhere to an essay showing how 'lazy' or 'idle' aren't insults, but mere synonyms for 'efficient' and 'purposeful'.

I don't get how you deduce that there's no room for agency. You seem to confound that with the different amounts of leverage that people with widely different origins get; those coming from a more resourceful starting point will produce more, regardless of the actual effort they put in.

comment 4y ago · link · parent

https://harpers.org/archive/1932/10/in-praise-of-idleness/

comment 4y ago · link · parent

Actually it is, and only a very strict and damaging protestant work ethic would tell you otherwise.

Oh, you meant that those poor workaholics shouldn't exhaust themselves by overexerting over too much work? With that I can agree. But taxing those producing the most so as not to leave behind those who have received fewer gifts, inheritance or good contacts? That's how you build a civilization. If only because those producing the most are also those receiving the most from their peers upfront.

comment 4y ago · link · parent

Ontology ("the science of 'being'") is a whole branch of philosophy that has varied widely during history and won't fit in a forum comment and I'm in no way an expert, so I won't try to. I'll rather give a few strokes of how I use it myself as derived from epistemology ("what can be known?"); I would say that my view is close to (weak) social constructionism[1] - i.e. even though knowledge can be inferred directly from study of the material world, most of it is mediated by the ways we have learned to think about it.

In short, what matters to me as "real" is what can potentially be experienced and studied to make sense of it. The vast majority of "what's real" comes from a physical world external to us; and thanks to modern science, we know that even the part we perceive as thoughts and emotions comes from material processes in our bodies, without the need to postulate the reality of a supernatural substance as its basis.

However, it is a useful shortcut to consider these mental processes in themselves, without always referring to what physical processes underlie them, but looking at them from our own inner perceptions. So, the 'real' things are the material entities outside our brains, and also the thoughts, feelings and perceptions we hold about those external entities and about our own mental processes. Mathematics would belong to this second mode of being real. (This is different from classic Dualism, which would assert that what I see as 'mind entities' do have an existence outside our own minds, but their essence is different from that of material entities).

In the case of math, the concrete ways we communicate them to our peers and the representations we use are of great relevance. Even though two very different representations of a phenomenon can be claimed to model the same 'underlying mathematical reality', I see no need to assert the reality of a mathematical object existing in the celestial sphere somewhere above the orbit of Uranus, which is how Plato imagined the actual reality of the mathematical objects on which the imperfect real things were based.[2] I'm content to say that such reality is a logical consequence of the axioms we have socially chosen to use as the basis of our mathematical theories (and that, starting from other axioms, the mathematical reality of such objects could be slightly or totally different. I'm currently studying Category theory to see how precise one can be in studying such differences and similarities).

(However, if somewhere found a way to demonstrate empirically that such realm exists and show the way how physical objects are connected to it, I would change my position and would be eager to study whatever can be known from that approach - I just don't expect it to happen anytime soon). For this latest position, see the classic Carl Sagan's The Dragon in My Garage [3]; I find that arguments from Dualism about the existence of mathematical entities often tend to parallel those from religion, as they stem from the same Western tradition of ontology.

I hope all this wall of text makes sense and your curiosity has been satisfied :-) What ontological tradition do you come from, and how do you see this perspective of mine?

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

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

[3] https://rationalwiki.org/wiki/The_Dragon_in_My_Garage

comment 4y ago · link · parent

Both stars and math are real, each in their own way.

The way maths are real is as ideas within human minds trying to describe unambiguous assumptions in a detailed formal system; mathematical objects like spheres certainly don't exist in nature, so their definition of 'real' is quite different from the definition of 'real' for physical entities.

comment 4y ago · link · parent

> Does anyone defend this as being useful for anything?

Extreme relativistic phenomena like "spooky action at a distance" or the Alcubierre's warp engine folding space may be intuitively easier to grasp if you think of space as a structure made of wobbly interacting elements approaching or receding from one another, rather than extreme deformations of abstract euclidean geometry or probabilistic waveforms.

For example, time ticking at different rates in different places could be explained by a constant rate of causal propagation through regions with a different density of these elements. Or, alternatively, by causation propagating at different rates going slower through elements with very high energy. This can create two competing models, which could be tested experimentally to see which one is closer to reality. (This capability to ultimately being tested empirically is the main thing that differentiates theoretical physics from scholastic speculation; if not for that, both would be rationalistic masturbations to see how far you can push your logic models, without a way to put them to the test).

For a scientific theory, "being easier to grasp intuitively" may be the basis for more rapid advances over the previous version based entirely on a complex formal notation.

comment 4y ago · link · parent

"I would enjoy Ulises more, if only James Joyce had published a 3rd Grade version alongside".

Sometimes it's worthwhile to keep an artistic vision as intended, even if not everyone will enjoy the work for it.

comment 4y ago · link · parent

I really hope it works that way. Of course the original licensor can distribute their software under any terms they like; even if the license looks similar to the AGPL3 license for the most part, the Commons Clause turns it into a totally different license.

It would be extremely worrisome that the court admitted sub-licensors to add something like the Commons Clause to software they get under the GPL-like licenses; it would completely invalidate them for all purposes, turning them into MIT-like permissive licenses instead.

comment 4y ago · link · parent

I don't get why this text says AGPL's section 10 would "allows removal of additional restrictions". But AGPL's section 10 does not such thing, it forbids imposition of any further restrictions - which is somewhat the opposite.

comment 4y ago · link · parent

I think it made more sense as a list when it was contained within a rectangle, suggesting a paper with written text.

Just the lines is abstract geometry, like the navigation buttons on android; they don't mean anything on their own.

comment 4y ago · link · parent

Accordions, lists where selecting one item scrolls the view one screen to the right to show a sublist... there are many common idioms for nested structures.

But the best strategy is always to simplify the number of different nodes to flatten navigation as much as possible.

1
202122
71