Better HN
topnewbestaskshowjobs
Log inSign up

panic

29,749 karma · joined Sep 16, 2009 (17y ago) · 3,593 submissions

Submissions

comment 11y ago · link · parent

Yes, as DanWaterworth has pointed out, people have written large projects with entirely bug-free code (in the sense that it verifiably implements a formal specification). The way these projects are developed is very different from the process described by this article -- a lot of time is spent writing formally-verifiable proofs of correctness.

comment 11y ago · link · parent

Deploying 100% bug-free code is the Holy Grail of software development.

Is this really true? Judging by their decisions, most people's Holy Grail is more like something reasonably good and shipped on time. 100% bug-free code is already possible, but few are willing to pay for it.

comment 11y ago · link · parent

Neat! I love how the demos are inline with the exposition and code, and it's striking how little code is necessary to make things go.

That said, this paragraph struck me as a great illustration of why I tend to prefer procedural layout systems to declarative ones, at least in production code:

Also note that there's slip! If you drag from the middle of the box, you'll see that the part of the image you grabbed slips out from under your finger. That's because the manipulator is just operating on the box's y coordinate. If we wanted to avoid slip then we'd have to create a new variable when the finger goes down, relate it to y (that is, fingery = box.y - 123 times scale, based on the current scale and finger start position) and then manipulate fingery instead of box.y. This isn't very hard, but the current manipulator code doesn't support it.

There will always be some situation the layout system's designer didn't predict. With procedural layout, you can write the procedure yourself. With declarative or constraint-based layout, you're stuck, since there's no way to express your special case in the limited language provided. Declarative systems are great for demos or rough prototypes, but when you want full control, there's no substitute for the power of procedural code, IMO.

3304.

Forgot, and Never Brought to Mind(distractionware.com ↗)

2 points · by panic · 11y ago · discuss

comment 11y ago · link · parent

There are languages with strong standard libraries: Erlang (both its normal libraries and OTP), Objective-C (Cocoa) and Mathematica are three that come to mind.

3306.

Poems for bugs(youtube.com ↗)

3 points · by panic · 11y ago · discuss

3307.

Write libraries, not services(drmaciver.com ↗)

6 points · by panic · 11y ago · discuss

comment 11y ago · link · parent

You can work around that using a "Box" type that wraps a value in a reference:

    class Box<T> {
        var contents : T
        init(_ initialContents : T) {
            contents = initialContents
        }
    }

    enum BinaryTree {
        case Leaf
        case Branch(Box<BinaryTree>, Box<BinaryTree>)
    }

comment 11y ago · link · parent

Are you speaking from experience writing system components in these languages? Lots of very high-quality software is written in C. Go and especially Rust are still moving targets. Depending on a separate compiler or runtime can hinder adoption and introduce errors when versions are out of sync.

comment 11y ago · link · parent

To what extent is it possible to design hardware using a software simulation of its behavior? Do you actually need to manufacture the hardware in order to develop it?

3311.

You keep using that word(aworkinglibrary.com ↗)

3 points · by panic · 11y ago · discuss

comment 11y ago · link · parent

it occurred to me that (some) Forth systems are awfully close to being macro assemblers, and that really the only reason you’d use a higher-level language rather than a macro assembler is that error handling in macro assemblers, and in Forth, is terrible verging on nonexistent.

Another reason to use a high-level language is that macro assembly code and Forth programs aren't very portable across machines. I guess you could model a virtual machine in the same way the authors model x86, target the virtual machine instead, then have a verified translation from VM operations to x86 instructions, ARM instructions, etc. I wonder if you could get similar performance to a native compiler with this approach.

comment 11y ago · link · parent

over-analysis of language is needed when language becomes arbitrary

I'm not sure I understand why over-analysis is needed. The "cloud" concept isn't entirely arbitrary. Most clouds (unless they're in a photograph or painting or being described abstractly using language) arise from the same physical processes and behave similarly (raining, darkening the sky and so on). This is how "cloud" gets its meaning in everyday language: there really is a shared phenomenon there.

The error happens when we try to understand the individual physical processes underlying a particular phenomenon as part of a single object. Even though the concept of separate objects is useful in everyday life, it no longer has meaning when you start trying to decide which cloud a given raindrop belongs to. Why not just abandon the now-useless concept of cloud and start talking about the raindrops as individual entities with their own behavior? Of course, we could look closely at the raindrops and see they are made of molecules: really the concept of "raindrop" is just another useful but ultimately imprecise bit of language. And so on...

comment 11y ago · link · parent

Processing (https://processing.org) is an excellent language and development environment for playing with graphics.

comment 11y ago · link · parent

As usual, this is a philosophical "problem" caused by overanalysis of language. A cloud exists when someone can say "that's a cloud" and a listener thinks "yes, that is a cloud", or that fact is somehow meaningful to them in their life.

If you're a pilot, a cloud is a way to talk about something that reduces your visibility and causes turbulence. If you aren't carrying an umbrella, a cloud may be a sign you're about to get wet. The fact that these phenomena share the name "cloud" is only meaningful to the extent that they arise from the same sort of physical processes. But trying to rigidly assign a particular arrangement of physical processes to a single entity "cloud" leads to the nonsense you see here.

Nobody using the word "cloud" cares about this assignment. They care about whether there'll be turbulence, or whether they're likely to get wet, or whether the cloud looks like a bunny rabbit or whatever. The solution to the paradox is to realize that not all concepts are analyzable to this degree, and that that's OK.

comment 11y ago · link · parent

Baseballs have still "flown out", since they fly through the air in the normal sense; it is their hitters who have "flied out".

comment 11y ago · link · parent

Tab (https://bitbucket.org/tkatchev/tab) is another interesting recent text processing language.

3318.

Designing and Evaluating Reusable Components(mollyrocket.com ↗)

2 points · by panic · 11y ago · discuss

comment 11y ago · link · parent

Is there a situation where 14-bit sRGB isn't enough? There are a lot of weird color matching issues on the web caused by inconsistent application of ICC profiles to PNG images by different browsers / platforms.

3320.

Still Here, Part 1: A Memoir(randi.io ↗)

206 points · by panic · 12y ago · 210 comments

comment 12y ago · link · parent

The incentives for police in this country are all wrong. It should be illegal for police to profit in any way off of the people they're tasked with protecting. They should be paid using tax money based on how well they're doing their actual job.

comment 12y ago · link · parent

That leads you to wonder: if a programmer desired to switch from C/C++ to another language but hasn't by now, why not?

Another reason to use C for your project is the ubiquity of C compilers and C bindings to other languages. Software like Lua and SQLite wouldn't be as widely-used if they were written in another language.

3323.

Computers Are People, Too (1982)(youtube.com ↗)

1 points · by panic · 12y ago · discuss

3324.

No more JavaScript(nomorejavascript.com ↗)

6 points · by panic · 12y ago · 2 comments

comment 12y ago · link · parent

UNIX itself started because Ken Thompson wanted to port his game Space Travel to the PDP-7: http://cm.bell-labs.com/who/dmr/spacetravel.html

comment 12y ago · link · parent

As long as the manager's prestige and power are tied to the size of his budget, he will be motivated to expand his organization. This is an inappropriate motive in the management of a system design activity. Once the organization exists, of course, it will be used. Probably the greatest single common factor behind many poorly designed systems now in existence has been the availability of a design organization in need of work.

This is a great point, and it's not widely understood. Organizations always try to grow, and once they've grown, they will continue to do work, regardless of whether that's what anyone actually wants or needs them to do.

For example, say a popular website has gone a long time without much design work, and people are complaining that the site is hard to use. In response, the people in charge of the website form a design team, which succeeds in redesigning the site. But now that there's a design team, they will continue to do design work, and the site will likely be redesigned periodically. This will happen regardless of whether anyone actually using the site wants a new design.

3327.

What can cause glDrawArrays to generate a GL_INVALID_OPERATION error?(stackoverflow.com ↗)

1 points · by panic · 12y ago · discuss

1
110111112
120