10,589 reputation
23073
bio website evincarofautumn.blogspot.com
location United States
age 23
visits member for 3 years, 10 months
seen 3 hours ago

I like programming, language, and collecting hobbies.


3h
comment Why don't languages include implication as a logical operator?
Sure, I was saying it’s an interesting observation, but not something you should use in real programs because it isn’t short-circuiting and that could take somebody by surprise if they expected did_all_possible_stuff = x.do_required_stuff() and (x.supports_optional_stuff() <= x.do_optional_stuff()) to work.
4h
comment What would the register-machine bytecode for this code look like?
@Prog: Since there is a limit on the actual number of registers available in hardware, what a compiler typically does is try to keep everything in registers, and “spill” to memory when that’s not possible. That’s something you need to do for good performance in either a stack VM or a register VM. Which one is “harder to compile to” depends more on your style of thinking.
23h
answered What would the register-machine bytecode for this code look like?
2d
awarded  Announcer
2d
comment Why don't languages include implication as a logical operator?
This is awesome, but unfortunately has the wrong strictness properties: f() implies g() should not evaluate g() if f() is False, but <= does evaluate g() in this case.
Jul
27
comment Is too much whitespace a bad thing?
One thing to try: increase the line spacing in your editor’s display settings, so you aren’t tempted to insert so many extra line breaks.
Jul
25
awarded  Good Answer
Jul
22
comment Duck typing in statically-typed languages
@Doval: Haskell’s type classes are a bit different, since they require that the type in question be declared an instance of the class elsewhere, whereas Scala’s structural subtyping is fully ad hoc.
Jul
13
comment How to handle divide by zero in a language that doesn't support exceptions?
@MK01: In other words, the analysis is “conservative”.
Jul
13
awarded  Nice Answer
Jul
8
answered How bad is using underscore in names?
Jul
2
awarded  Curious
Jun
29
comment function naming: plural form of “if not exists”
“Nonexistent” is one word, so it wouldn’t be nonExistent but nonexistent.
Jun
20
answered Mental Models or Real-World-Metaphors for Functional Programming
Jun
14
comment Are types erased in Haskell?
“There is only one implementation”—only one that makes sense, sure, but there are infinitely many possible. A function of type a → b has |b|^|a| possible implementations (consider the number of functions of type Bool → Bool), and lists have no upper size limit.
Jun
9
comment C++ strongly typed typedef
@Kian: Presumably you would use the SI base units internally—m, kg, s, A, &c.—and just define an alias 1km = 1000m for convenience.
Jun
6
awarded  Enlightened
Jun
6
awarded  Nice Answer
Jun
5
answered C++ strongly typed typedef
Jun
5
comment Is there a Design Pattern for preventing dangling references?
Instead of making a functor for fclose, you can just pass fclose directly to the shared_ptr constructor. :)