Name: Anonymous 2015-02-01 10:13
Using eval is almost always a bad idea. It's a crutch for bad designs, it opens giant security holes in your code, and in practice it's almost never needed to get actual stuff done.
the more mental overhead is involved in writing complex programs
$ ls -lh *
-rw-r--r-- 1 nikita prague 5.2K Dec 08 17:23 how-to-compile.txtA critical element of puzzle languages is providing an escape, a way to admit that the pretty solution is elusive, and it's time to get working code regardless of aesthetics. It's interesting that these escapes tend to have a stigma; they induce a feeling of doing something wrong; they're guaranteed to result in pedantic lecturing if mentioned in a forum.
Imagine you've implemented a large program in a purely functional way. All the data is properly threaded in and out of functions, and there are no truly destructive updates to speak of. Now pick the two lowest-level and most isolated functions in the entire codebase. They're used all over the place, but are never called from the same modules. Now make these dependent on each other: function A behaves differently depending on the number of times function B has been called and vice-versa.
In C, this is easy! It can be done quickly and cleanly by adding some global variables. In purely functional code, this is somewhere between a major rearchitecting of the data flow and hopeless.
Debug.Trace
clutch ("shit, I thought this function would be pure, but turns out I need it to print debug output"). This is the same problem that arises in tons and tons of cases: a purely functional design is beautiful and minimalistic, with only the barest minimum of dependencies between functions, but changing that design is a pain in the ass. function A behaves differently depending on the number of times function B has been called and vice-versa.So the problem with FP is when it isn't functional in the slightest?
It can be done quickly and cleanly by adding some global variables.IHBT
State and IO are not unsolved in FP.Please. Monad transformers are not a satisfying solution. And all the others are even worse.
type state = { i_am_here: int; enable_frobnicator: bool; _ }
val do_the_thing : state -> state
val go_over_there : int -> state -> state
state -> state
ML and Haskell don't allow in-place modifications.You mean the implementations don't do in-place modifications yet as far as you know.
state
is only ever going to have one instance (unless you're including global undo, which will be about 4 loc with immutable data and almost impossible with your global variable business) then the first copy will no longer be referenced by the time you get to using the second copy. That makes it incredibly unlikely that state
will survive the minor heap (barring huge calculations between state modifications, but then the cost of state modification is proportionally minimal)."mutable globals are evil!!1"Faggot quotation mark goes to >>>/g/
The HP (SourceForge) implementation of Judy arrays appears to be the subject of US patent 6735595lol