Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rntz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
331.
▲
by
rntz
12y ago
As a type system, purely formally speaking, Java is... well, it's just kind of OK. It has parametric polymorphism. It gets subtyping & co-/contra-variance right -- for generic types only, not arrays, and requires explicit anno
332.
▲
by
rntz
12y ago
Fair point.
333.
▲
by
rntz
12y ago
No, you don't. But the question at hand isn't using a dynamically vs. a statically typed language, it is, given that you are in a statically typed language, is a Java-style one sufficient? Indeed, this is one of the benefits of
334.
▲
by
rntz
12y ago
Parsing, at least, absolutely can benefit from a powerful type system: consider Haskell's Parsec library, which uses monads & monad transformers to express a powerful parser combinator system.
335.
▲
by
rntz
12y ago
This comment by Matthias Felleisen's is a very polite and well-considered position from an academic on the dynamically-typed side of the spectrum: http://existentialtype.wordpress.com/2014/04/21/bellman-c
336.
▲
by
rntz
12y ago
`#and_then` is the monadic bind operation `>>=`; applicatives don't have this operation in general.
337.
▲
by
rntz
12y ago
> Why don't you group humans into 'suffered lots of disadvantage', 'suffered a medium amount', 'suffered none'. First, how does one directly measure disadvantage suffered? It's not a trivial thing
338.
▲
by
rntz
12y ago
It's not relevant what it's intended to do, but what it does. If it makes long conversations hard, that's a con. (OTOH, if it avoids heated exchange, that's a pro. I don't really have a strong position one way or th
339.
▲
by
rntz
12y ago
The article is about a macro system that gives you hygiene by default but allows you to capture when you want it. I'm not using a mature blogging platform.
340.
▲
by
rntz
12y ago
Article author here. I don't actually remember why I found syntax-rules confusing, although I can make a couple of guesses: 1. Doing simple things with syntax-rules is simple, and that's most of what you use syntax-rules for, but
341.
▲
by
rntz
12y ago
I published it on 2009-03-03. Dates are listed at http://www.rntz.net/index.html but not in the articles themselves; I guess maybe I should fix that (not sure where a good place to put the date would be). I don't feel
342.
▲
by
rntz
12y ago
Yes, that is what I meant. And yeah, it is weird behavior. (I think of "d[k] = v" as "setting the key k to the value v", so that's why I said "setting a key". Perhaps "binding a key" would be cle
343.
▲
by
rntz
12y ago
I list Common Lisp & its behavior in Appendix C at the end of the article. Multiple-return-value is definitely better than just returning NIL, but I still dislike it; it doesn't actively prevent you from confusing NIL with absence,
344.
▲
by
rntz
12y ago
Author of the article here. The Python solution using lists-as-options is actually even simpler: def values_in(keys, d): return [x for key in keys for x in getOpt(d,key)] Using lists as options is a neat trick I hadn't
345.
▲
Option and Null in Dynamic Languages
(rntz.net)
37 points
by
rntz
12y ago
|
85 comments
346.
▲
by
rntz
12y ago
The article mentions that > Fink has assigned one team to develop the open-source Machine OS, which will assume the availability of a high-speed, constant memory store. I have to ask: if this is open-source, where is it? Perhaps my googl
347.
▲
by
rntz
12y ago
In Turing's original paper, the Test is intended to be a "new form" of the question "can machines think?". It is explicitly a test of the machine's intelligence, not of humans'.
348.
▲
by
rntz
12y ago
Could you explain what you mean here by initial/final encoding, and why you say OO favors final encodings but initial encodings generate type information? I'm familiar with the notions of initial algebra, and slightly less so with
349.
▲
by
rntz
13y ago
This proposal is very similar to Plan 9's "factotum" scheme (see http://qedragon.livejournal.com/99938.html for a nice explanation with reference to Heartbleed; factotum is similar to a generic ssh-agent or g
350.
▲
by
rntz
13y ago
The code I gave translates easily into Agda, a computerized proof checker, and as such more formal than most mathematics. However, here's the same thing in a modernized version of Peano arithmetic. We assume all the usual properties of
351.
▲
by
rntz
13y ago
Whitehead & Russell didn't have the proof machinery we have today; they were inventing the wheel, and they did it badly. (Which is not to insult their achievement. Note that I say inventing the wheel, not reinventing it.)
352.
▲
by
rntz
13y ago
I did not in fact mean that 2 is defined as 1+1; you (and several others) are correct in saying that 1+1=2 requires proof for all reasonable definitions of +. 0^0 = 1 follows much more directly from the definitions in which it is true. My o
353.
▲
by
rntz
13y ago
Here is a simple definition of the natural numbers and addition, in Haskell: data Nat = Zero | Suc Nat plus :: (Nat, Nat) -> Nat plus (Zero, y) = y -- axiom 1 plus (Suc x, y) = Suc (plus (x, y)) -- axi
354.
▲
by
rntz
13y ago
In a certain sense, "1+1 is 2" is also merely a definition, in the same sense that "0^0 is 1" is a definition. Addition can be formally defined in mathematics; we habitually omit this definition because it is tedio
355.
▲
by
rntz
13y ago
In fact, exponentiation f : C x N -> C has a natural generalization to any monoid C, where f(x,n) is x "multiplied" by itself using the monoid operator n times. In this setting, the only sensible choice is that x^0 = 1 for an
356.
▲
by
rntz
13y ago
As I see it, the OP is frustrated that people mistake mere graphics (and in particular, realtime raytracing) as the gold standard for "realism" in games, when there are open problems both more challenging and more important that a
357.
▲
by
rntz
13y ago
They wrap for me in Chrome, but not in Firefox. (What the hell?)
358.
▲
by
rntz
13y ago
Yes. You might be able to get something like it back with Rust's macro system, though. But it's probably better just to use the new syntax & iteration protocol, assuming the Rust folks come up with something reasonable.
359.
▲
by
rntz
13y ago
Internal iterators are just syntactic sugar for a higher-order function. As long as Rust has higher-order functions, internal iteration will be possible (just not "the standard way to do things"). Edit: In fact, this is true of a
360.
▲
by
rntz
13y ago
Rust is actually in the middle of changing how iteration (and eventually for-loops) works, from "internal iterators" as described in the article to even more flexible "external iterators". I'm not fully up-to-date,
More ›