HNHacker News
TopNewBestAskShowJobs

dgreensp

3,476 karma · joined April 10, 2007

David Greenspan
submissionscomments
dgreensp··on Marijuana use holds three-fold blood pressure death risk: study
Just because consuming something regularly for 12 years raises your blood pressure doesn't mean it's a danger to the public that needs to be illegal. You might as well criminalize junk food. In a context of overblown fear and stigma around marijuana, the article should have at least put some perspective on the health risks, rather than having the message of, "Some people say marijuana has no health risks, but according to a study, there are. Be worried."
dgreensp··on How to Determine If Candidates Will Thrive in a Remote Work Environment
We’ve found that people from big companies with a slower work pace and unclear project owners often find it difficult to adjust to a culture that expects them to personally drive their own deliverables.

This doesn't sound very compassionate to engineers leaving big, dysfunctional companies (which by the way preach the exact same ethos of personal responsibility). Basically, they are damaged goods who aren't expected to thrive in a better environment?

dgreensp··on LSTM trained on HN
Brain drivers are reality as a service

Some pretty hilarious and/or thought-provoking headlines! LSTMs capture so much about the input (compared to N-grams, say), it can be almost eerie.

dgreensp··on Tofu – The opposite of a font
I feel like I'm missing the punchline. How big is the generated font?
dgreensp··on Deep Bilateral Learning for Real-Time Image Enhancement
"Enhancement" meaning tone-mapping? Are neural networks really required for that? Seems like a lot of heavy machinery for the resulting filter, but maybe tone-mapping standards have gone up.
dgreensp··on Proposal for a Binary Encoding of the JavaScript AST
I love the idea of binary ASTs as the things browsers compile instead of source, but I don't think making browsers even more complex is worth it. These new binary files would also be yet another type of asset to serve alongside your .js files, with implications for debugging and source maps. If the reward is bloated SPAs load 10% faster, as long as they ship both JS and binary JS, forever, I would wonder if browsers should parse the binary format or just keep optimizing their text parsers more.
dgreensp··on GraalVM – Polyglot: From the Very Old to the Very New [video]
Thanks!
dgreensp··on GraalVM – Polyglot: From the Very Old to the Very New [video]
I'm really excited about the Graal model and especially Graal.js.

Here's hoping for a world where Graal.js is released as open source and runs on an official JDK release! Then we can do all sorts of wizard magic with JS in the cloud, without running actual Node. I tell myself it could be any year now. I forget whether JDK 9 supports Graal and what the latest release date for 9 is; it's changed so many times. I know there was some indication that Graal.js would eventually be open-sourced, but that may have been taken back.

If anyone knows anything, I'd love an update.

dgreensp··on Introverts, Emotional Processing, Self-Esteem and Salary Negotiations
I'm confused about whether the "WTF your crap is crap" example is exaggerated or true-to-life. If true, I would leave that job, or at least report to management that I'm unwilling to work with that person and be treated like that. If the example is exaggerated, then it confuses the point a bit because it bakes the author's sensitivity into reality for the purpose of the article. Maybe I've just always worked with other sensitive, conflict-avoidant engineers, and not assholes, but the example is way outside of bounds for me.

The way to think about a situation like that is in terms of having boundaries, not about ego. Don't take abuse. You don't need a witty comeback. Or, it will come when you stop thinking you need to tolerate abuse.

The part about talking with your partner about what works for you in sex is lovely.

dgreensp··on Luna – Visual and textual functional programming language
Not entirely, but I think that would be hard to do in a comment box! Thank you!
dgreensp··on Luna – Visual and textual functional programming language
Thanks for the reply!

So do you have first-class support for video as well as images? It seems like to have fun with video editing in Luna, you'd need to have built-in support for videos an inputs and outputs, and have a way to play the video output on the screen, and maybe scrub through it, and at a minimum be able to run shaders on the "current frame" and export the resulting video out. The next level after that would be being able to load multiple frames into memory at the same time, and being able to do a combination of "offline" and "online" processing with some CPU involvement (e.g. calculating a motion track and storing it, or applying a filter that can't be expressed as a pure shader program).

I don't know enough about Luna yet to know what code to do these things would "look" like on the visual side, or come to think of it where the computation is being performed (in the browser?). Much more to learn, but the project looks great, a sort of "holy grail" in a way.

dgreensp··on Luna – Visual and textual functional programming language
Can I implement pixel-level video effects with Luna (e.g. warping, time map, segmentation, keying, etc.)?
dgreensp··on Machine-checked explicit state: An arrow in the heart of complex web apps
"Hidden" isn't the same as implicit. State might be hidden in the sense that it is encapsulated. For example, sometimes we want to treat a text field component as just an "editor for a string value," without worrying about the cursor and selection state, or the state of the autocomplete dropdown if there is one, etc. That said, in the fullness of time, you do eventually find yourself wanting access to this state for some purpose or another.

Every time you use an HTML input tag, you are using an abstraction over state, and the first time you need access to the input element's cursor and selection, you realize you've been pretending the element had less state than it had, which is a pretty useful thing to do.

If I can write a form component that needs an "editor for a string" component, specified as a type, and fill that need with a "fancy editor for a string" component that has a more elaborate model that I can abstract away, then I think we're in business, but I can't quite picture how that would work.

dgreensp··on Machine-checked explicit state: An arrow in the heart of complex web apps
I've looked into Elm a little bit, read the docs and watched the videos, and I tend to agree with the first paragraph. The architecture is mostly about how to handle updates to a single state machine and render it. There is no deep insight about how to compose stateful components into larger stateful components, and up and up, to build a sophisticated app without things getting out of hand, except: "A component is just a module with types and functions. Compose them however you want." As people build more and more sophisticated widgets with Elm, it pushes the state of the art in this respect, but the problem is still there as far as I can tell.
dgreensp··on Why Threads are a Bad Idea (for most purposes) (1995) [pdf]
That's part of it, for sure.
dgreensp··on Why Threads are a Bad Idea (for most purposes) (1995) [pdf]
I'd rather have real threads available in my language, and use shared state sparingly. Your N single-threaded processes have to talk to each other anyway, or at least to a master, and might even share memory through memory-mapping. Threads are just a tool, and they give you options. You can use them in a share-nothing way if you want.

As someone who grew up on the Java VM and started my start-up/web career on it, I've always felt like Java programmers have a different relationship with threads than C programmers. Java gives you cross-platform, usable, debuggable native threads; it basically makes them free if you want them. In C/C++, on the other hand, threads are a library, and using them is a grungy affair. If you grew up on Rails, meanwhile, threads don't exist ("when you say worker thread, do you mean worker process? I'm confused").

Node.js was created by C programmers and launched with a lot of anti-thread propaganda, much like the link. They equated threads with shared state, and also said threads were too memory inefficient to be practical for a high-performance server (they meant that holding a native thread for every open connection would require too much stack space, which is true, but that's not what they said).

dgreensp··on Show HN: Cell.js – A Self-constructing web app framework
Got it.

I immediately had a bunch more questions, some of which I tried to answer by playing around with the demo.

Is "this" the actual DOM element? (Yes.) Then how is "context inheritance" implemented? The section named "How Cell implements 'context inheritance' does not ever say how it's implemented ;) (Getters and setters are set up by the framework.) It feels like inheriting everything would be a little messy compared to specifying what goes in context.

Does changing something in "context" trigger updates in nested components that read that context? Apparently, no.

Does assigning to $components always give you brand-new components, or is there any sort of diff/patch as in React? Apparently, always new components and new DOM nodes, so don't recalculate your children; you should probably access them via the DOM API and call methods on them instead. So you don't get "props flowing down" as in React.

How are assignments to underscored props coalesced, e.g. using what notion of equality? What should you call props that you don't want to cause an $update?

Why is it ok to call methods on other cells from $update, causing further updates, when this is frowned on in React, partly because of timing issues? I sort of wonder if making state changes synchronous is a huge win and solves a lot of issues; a lot of people are wondering if React makes a big mistake there. At the same time, it seems like there would be situations where you update underscored properties on A and B, and A is actually an ancestor of B, so updating A would destroy B. Then you wonder if the framework is going to be smart about the update order, and smart about dealing with defunct components during the update cycle. Edit: That's not even a good example of a timing issue caused by cascading updates. Can't think of a good one off the top of my head.

Also edit: I haven't read the code, but it looks really short.

dgreensp··on Show HN: Cell.js – A Self-constructing web app framework
Sure thing. :) One thing I'm not completely clear on is the reactivity model. It seems like setting $components (for example) triggers a setter that updates the DOM? What about other DOM properties? What about underscore properties? Is there a dependency graph under the hood, and can you set up a property to depend on a calculation based on another property? Or is all data propagation explicit/imperative/"push"?
dgreensp··on Show HN: Cell.js – A Self-constructing web app framework
This is a thought-provoking new framework, thank you! It's novel and easy to understand.

Having worked on sophisticated React apps, I've come to understand the benefits and shortcomings of its architecture.

One insight is that properly encapsulating UI components and their behaviors leads directly and naturally to nested state machines. React is cleanest if you have one state machine, or N independent global state machines, that drive your app. Once you start trying to compose state machines to make a sophisticated UI, you end up in setState/callback hell, and then you try the Redux/Elm model, in which states are composed to make bigger states. I think it's fruitful to experiment with ways of composing state machines in which you don't just glue the states together, but you let the machines interact. Of course you still want to keep your program easy to reason about and avoid spaghetti, but I'm sure there are interesting patterns lurking there.

Another issue is components in React aren't supposed to address each other. You can easily call methods on your children using refs, though this is discouraged and interacts badly with the update cycle and higher-order components. Components not talking directly to each other is a great feature right up until it's not, such as when you have to deal with focus and selection changes. You're forced to contemplate taking what you thought of as pure UI state -- local to a component and tied to that component's lifecycle -- and moving it outside of React into a store whose structure parallels the component tree (which in turn parallels the DOM), just so that you can traverse it in a reasonable fashion and update it synchronously while DOM updates remain asynchronous. In Cell.js, these three trees become one.

dgreensp··on TypeScript support in Electron
Resources for getting started with Electron+TypeScript are still not great, contrary to the tone of this article. I'm working on getting electron-compile up and running, and I currently have compilation but no type-checking. I don't expect it will be too hard to figure out, but it's not a five-minute task where you just start with a repo or follow a tutorial. There are various quick-start repos but they appear old. Someone let me know if I'm looking in the wrong place. This article and the accompanying video talk exclusively about the experience of editing code, not compiling it.
dgreensp··on Principles of TLA+
Thanks for bearing with me, and responding, even if it might be more efficient for me to wait and read the next parts.

It seems like if the quicksort of a list L is defined as equal to the concatenation of 1) the quicksort of the subsequence of L consisting of items less than the pivot item, 2) (the list containing) the pivot item, and 3) the quicksort of the subsequence of L consisting of items greater than the pivot, then we can prove properties like "any two items of the resulting list are in sorted order" by case analysis on whether each item is part of (1), (2), or (3).

Maybe you would interpret "the quicksort of L is defined as..." to mean "if you're in state quicksort(L), you can proceed to state the-concatenation-of"? If we're working in the realm of mathematics, don't we get definitions, equations, and inductive proofs for free, without making a state machine do it?

Edit: Reading more, I guess I'm just doing the sorting inside the "next-state relation" of a state machine, so it's done in one state transition, and saying you could look at quicksort as one way to factor the relation, which by math is equivalent to other ways to factor the relation that resemble other sorting algorithms.

dgreensp··on Principles of TLA+
I mean "state" in the sense that we can distinguish time-dependent systems with internal state or memory from time-independent systems, whose outputs are a pure function of their inputs. Combining pure functions to create pure functions does not introduce any state, in this sense.

An entire program may have no observable state, like a command-line tool that reads stdin and writes stdout with no particular timing. It does have state inside it, of course, but only because it's running on a giant state machine. We can fully describe its behavior without making reference to any internal states, using functions or relations to talk about the relationship between its input and its output.

> I would say that the main difference between TLA+ and the functional approaches, is that in TLA+ you reason purely mathematically, while in the functional approaches you reason within a (complex) programming language.

This statement puzzles me, because we have great math for reasoning about pure functions (mappings). We have lambda calculus and category theory. You don't need a state machine to prove QuickSort works in a purely mathematical way, either, just statements about the equivalence of functions. The recursion can be handled using the fixed point operator and the algebraic laws it obeys.

Edit: In fairness, existing "functional approaches" to specification do seem complex and look like programming languages.

I came across an old comment of yours (https://news.ycombinator.com/item?id=11835178) that seemed to support the idea that FP and TLA+ have strengths for different kinds of programs, depending on whether they are more transformative or more reactive. I'm just as happy if learning more about TLA+ turns my idea of this on its head, though!

dgreensp··on Principles of TLA+
Great article, and I look forward to the next! I've been meaning to learn about TLA+ for a while.

One thought I didn't see expressed, in all the comparisons of tools and approaches, is that sometimes you don't care about time and state. In purely "transformational" programs, like compilers, for example, all state is incidental complexity, so we can analyze them as pure functions. Meanwhile, all the questions such as whether we can just execute the spec and whether we can prove properties of real programs remain. New web frameworks are trying to keep the parts that deal with time and state as small and self-contained as possible, leaving the rest to be described using functions.

Couldn't we say that the factor of "do you care about time" is behind observations such as that TLA+ is mostly popular with concurrent and distributed systems, or that approaches that only look at function contracts often apply to pieces of a program but not the whole? As a more specific statement than, for example, that distributed systems are particularly hard so they necessitate particularly powerful tools.

dgreensp··on The Purpose of Life Is to Be a Nobody
Matter to whom? Mattering to myself was an important step in my personal growth, and there are other people in my life who think I matter, and people I've never met who simply believe we all matter.

How sad to convince ourselves not to matter to ourselves by saying look, I don't matter to the universe, so how could I possibly matter? Does anything matter to the universe? If not, it's probably not the best entity to look to to figure out what matters. If the universe does care about something, who says it doesn't care about you, just because it's big and you're small in comparison?

dgreensp··on Prepack helps make JavaScript code more efficient
What you're talking about -- writing an interpreter that's optimized into a compiler -- is actually coming in the soon-to-be-released Java 9. Check out Graal and Truffle. I'm pretty excited to play with it at some point.

Prepack reminds me more of a "supercompiler," because it focuses on partial evaluation rather than optimization.

dgreensp··on Is Matter Conscious?
This is actually one of the better presentations of this idea, and it gave me a better handle on it.

Here's one way to look at it. If you accept the claim, "My conscious experiences exist, non-physically," which seems true, you can reason to some interesting places from there. For example, it would be pretty weird if you were the only "conscious" person in the world, surrounded by zombies who only appear to have an inner life, so we can say that all brains have consciousness. Then, you can keep delicately applying Occam's razor to say that what we call consciousness could be just one manifestation of a more basic phenomenon, which fills a metaphysical explanatory void.

Even if we don't accept the claim, and we say consciousness doesn't really exist and we are merely projecting its existence, we could still discover new phenomena that seem just as real to us as the illusion of consciousness, despite not being clearly connected to physical laws. Maybe pretending that it's possible to have a "direct experience" of something can reveal that everyday consciousness is just one kind of direct experiencing.

dgreensp··on The Mac Pro Lives
This. Can we remember that Apple is making a box with fans and a motherboard? It takes them five years because they have to be inspired with some original concept that marries form and function, and then deliver something novel and daring -- not just a new computer, but a new kind of computer. This is not in customers' interest, and they are right to be upset.
dgreensp··on Tears
As a parent, it seems like a glaring omission that most crying is done by babies. It's right there in the article that humans have the "most dependent babies," and signaling behaviors are often repurposed responses, so it's a good starting point to say that crying (with big inhales and audible sobs) evolved as a "baby in distress" alarm, in which a baby makes a lot of noise because it needs help. We go to that place when we feel small or want the kind of support a parent would give.

Babies often don't have tears for the first few months, but I'm not sure that's important. I do think they play a role on the playground, and a lot of the speculation about their effects in social situations sounds right. I don't have any ideas to contribute on why crying is accompanied by tears.

In any other species, wearing a signal that advertises, "I recently lost in a dominance challenge," is a strict liability — an invitation for others to pile on, opportunistically, and attack you while you're down (or else to mentally note that you're no longer a good, strong ally). There's no upside, therefore, to using anything other than a quick facial expression or flash of body language, to show your submission only to the aggressor.

That sounds like an overly harsh picture of non-humans to me! I'm pretty sure at least certain apes help their potentially-non-kin in distress. Humans aren't the only social mammals.

dgreensp··on Unless You’re Oprah, ‘Be Yourself’ Is Terrible Advice (2016)
Heh, I'm exasperated with the author too, but only because they published their absurdities. I don't judge people for having absurdities in their heads.

As a semi-anxious person, I've found it is useful to deconstruct this stuff.

dgreensp··on Unless You’re Oprah, ‘Be Yourself’ Is Terrible Advice (2016)
No one wants to see our true self? Maybe not. Or maybe you are missing the fact that friends who say, "be yourself" have probably seen bits of your true self and liked it, and are just trying to cut through your anxiety. You're coming to someone saying, "I want them to like me. Should I be like this? Should I be like that?" If you're lucky enough to be talking to someone who genuinely likes who you are, they are not going to tell you to be something else, just "yourself."

In the advice context of the article, the goal is (for an arbitrary person) to be successful and liked by an audience (whether the TED audience, or an audience of employees, or an audience of TV viewers, or in front of friends and acquaintances). In that context, I'd say being authentic doesn't make you likable, but if you can be authentic while simultaneously being likable, people love that.

Brutal honesty, which is a different thing, will not win you friends. No one likes the person who says, "What? I was just being honest!" Social interactions are transactional and layered with meaning. "I want to have sex with you right now" is not merely a random act of stating a fact, and neither is a personal criticism (e.g. "you're ugly"). An exec who asks her employees for emotional support is making an ask that may not be comfortable.

My advice is to learn to be more authentic (with fewer self-inhibiting inner dictates), for your own personal reasons, and simultaneously to learn how to better relate to other people.

← PreviousPage 14 of 30Next →