950 reputation
511
bio website
location
age
visits member for 3 years, 8 months
seen 15 hours ago

Sep
10
comment Correct terminology in type theory: types, type constructors, kinds/sorts and values
I should say, ghci's :kind command gives the kind of Num as * -> Constraint. That could be specific to GHC, I don't know.
Sep
10
comment Correct terminology in type theory: types, type constructors, kinds/sorts and values
Could you clarify/extend the section about 'Kinds'? In Haskell, a type has kind *, while a type constructor (with one argument) has kind * -> *. Constraints such as (Num a) => a (meaning "any type a that is an instance of the Num typeclass") are not themselves kinds. The typeclass Num is not a 'kind' itself, but has the kind * -> Constraint. I find it difficult to relate the Haskell idea of a 'kind' (which I assume is closely related to kinds in type theory?) to the examples you give.
Sep
7
comment Why does “charset” really mean “encoding” in common usage?
You talk about character sets as "a set of Unicode characters", as though someone started with Unicode and then picked subsets. It is more accurate to say many character sets existed prior to Unicode's invention (or at least prior to Unicode becoming ubiquitous), and Unicode is deliberately constructed to be a superset of them.
Sep
7
comment Why does “charset” really mean “encoding” in common usage?
It looks to me like the 'charset' parameter was already present in RFC 1341 (June 1992).
Aug
17
comment Commenting regular expressions
Rather than storing the pattern in a variable, you can use re.compile at the point where you define your pattern, and only store the resulting object. That way, the pattern compilation flags (including re.VERBOSE) don't need to be separated from the pattern itself.
Apr
21
comment long lines in git or svn
Subversion does not use a line-based diff in its storage, it uses xdelta (a binary diff algorithm). It is not necessarily true that longer lines will result in larger xdeltas.
Jan
17
comment Is there already a “Binder” data-structure?
Related: Gap buffer
Nov
2
comment Is it reasonable to null guard every single dereferenced pointer?
My guess is that @KristofProvost is talking about OSes that use overcommit, for which malloc always succeeds (but the OS may later kill your process if there isn't actually enough memory available). However, this is not a good reason to skip null checks on malloc: overcommit is not universal across platforms and even if it's enabled, there may be other reasons for malloc to fail (e.g., on Linux, a process address space limit set with ulimit).
Sep
17
comment Which is the better: a <= b or a < b+1
"the second parameter to range() isn't an upper bound, it's the number of values to generate". This is incorrect. The second parameter to range most definitely is an upper bound. Try range(5,10), for example.
Mar
21
comment Why is Java boolean primitive type name not 'bool'?
The Oak language specification (version 0.2, copyrighted 1994) also includes the boolean type. (Oak was later renamed to Java). That pushes the dates even closer, though I still see no definite evidence to show precedence, or influence, in either direction.
Mar
21
comment Why is Java boolean primitive type name not 'bool'?
According to Evolving a language in and for the real world: C++ 1991-2006, the bool type was introduced to C++ in 1993. Java included boolean in its first release in 1995, but the Java project itself was started in 1991. Without finding further sources of information, it's not clear to me which came first, or what (if any) influence they had on each other.
Mar
21
comment Why is Java boolean primitive type name not 'bool'?
"I think C++ had decided to use bool quite a bit earlier than Java decided to use boolean" Why do you think that?
Dec
29
comment Is a day really 24 hours long?
@ChrisF: The day does not end at 23:59:59, that's just a limitation of our quantised time representation. 23:59:59 is a point in time, not a period of time one second long. The point of time 00:00:00 is exactly at the boundary of two adjacent days.
Dec
20
comment How do we differentiate between a computer and a calculator?
@ManojR: Recursion is a form of looping construct.
Dec
16
comment What is the reason behind the if syntax of CoffeeScript?
@RossPatterson: CoffeeScript also has unless.
Nov
15
comment Do functional generics exist and what is the correct name for them if they do?
My understanding of the example code was that Person and Car are types. Probably best to wait for the OP to clarify or respond.
Nov
15
comment Do functional generics exist and what is the correct name for them if they do?
I don't believe this question is about dependent types. None of the examples in the question require dependent types.
Nov
12
comment Is O(1) random access into variable length encoding strings useful?
@JoachimSauer: Yes, that's why I included the caveat: "In either case it'll only work for a subset of Unicode -- combining marks, bi-di text, complex shaping rules et c. will break it".
Nov
11
comment Is O(1) random access into variable length encoding strings useful?
Ok, here is a specific example: if you're rendering with a monospace font, then being able to jump into the text by codepoint allows you to select a segment of the text to display a scrolling ticker/marquee, or place the cursor at the right codepoint boundary based on the position of a mouse click. (For the ticker, it's easier to store a byte-index directly, so it just turns into normal sequential iteration over the text which doesn't need random access. In either case it'll only work for a subset of Unicode -- combining marks, bi-di text, complex shaping rules et c. will break it)
Nov
11
comment Is O(1) random access into variable length encoding strings useful?
Sorry, did you forget to push the change? I don't see any specific example of an operation that benefits from random access, only mention of the general areas of word processing and text rendering.