Reputation
16,586
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 42 66
Newest
 Good Answer
Impact
~235k people reached

May
23
comment How to design for good abstractions using algebraic data type?
This theory here is too simplistic to be useful. There are disjoint cases (e.g., either the HTTP headers have been sent or not) that are useful to distinguish at the type level, as the hyper library mentioned in the question does.
May
23
revised Is is possible to write a “Brainfuck with variables” compiler?
added 34 characters in body
May
23
answered Is is possible to write a “Brainfuck with variables” compiler?
May
18
awarded  Nice Answer
May
17
revised How do purely functional programming languages deal with fast changing data?
missing word
May
15
comment What makes functional programming languages declarative as opposed to Imperative?
@ALXGTV Functional programming is a very different paradigm, even if you're adamant about reading it as imperative (it is a very broad classification, there is more to programming paradigms than that). And the other code that builds on this code may be read declaratively too: For example, map (sum_of_fac . read) (lines fileContent). Of course at some point I/O gets into play but as I said, it's a continuum. Parts of Haskell programs are more imperative, sure, just like C has a sorta-declarative expression syntax (x + y, not load x; load y; add;)
May
15
answered What makes functional programming languages declarative as opposed to Imperative?
May
12
comment What is the best type to represent a number in java and why?
@JörgWMittag You don't think distinguishing between integer (i.e. discrete) and "real" (continuous) values might be useful? In any case, I didn't say they absolutely have to have multiple types, just that the assumption in the question (that there should be exactly one) should be questioned.
May
12
answered What is the best type to represent a number in java and why?
May
11
comment Is there any point in preventing developers from having a local copy of the database in their machine?
You don't indicate what you think the advantages might be, so your question comes off like "Is there any point to tying your shoelaces together?" Where does this question come from?
May
9
comment How can I implement an 'if' statement in an interpreter?
Yes, most interpreters actually interpret bytecode, but some do take their parser's AST and interpret it rather than generating bytecode from it. None of that has anything to do with tokens, so your terminology is really confusing. Most bytecode formats (including what I gleaned from p-code) is more complicated than just turning each occurence of a keyword to a call to the corresponding subroutine, though.
May
9
comment How can I implement an 'if' statement in an interpreter?
@Snowman You seem to be confusing something. Hardly anything that goes by the term JIT compiler stores the generated code in files. The real distinction is that JIT compilers generate machine code to be executed by the CPU while the interpreters you seem to be talking about generate some sort of byte code that is then interpreted by a virtual machine/interpreter. Totally different target language and performance characteristics and technical difficulties and architecture.
May
9
comment How can I implement an 'if' statement in an interpreter?
P-code is bytecode. That's something entirely different from tokens.
May
9
comment How can I implement an 'if' statement in an interpreter?
Tokenized as in lexical analysis? I don't know a single interpreter that does that, they all use an AST at least.
May
9
comment How can I implement an 'if' statement in an interpreter?
It depends entirely on what the interpreter interprets. Bytecode? AST? God forbid, lines of source code?
May
9
comment How to implement rounding in an all-purpose stack language using different types?
@ThorstenS. So... offer arbitrary precision types, allow converting floats to those types and back, and implement those algorithms in terms of those. In other words, why do you need to associate the exact-ness to the operation?
May
9
comment How to implement rounding in an all-purpose stack language using different types?
@ThorstenS. About ADD_EXACT: Yes, there often is error, but it's unavoidable without leaving the format behind entirely. However, if the result can be represented exactly, it is. What's the problem again? I guess I don't see what you want ADD_EXACT to achieve. Promote to an arbitrary precision type? (If so, why does that have to be part of the addition operation?)
May
9
revised How to implement rounding in an all-purpose stack language using different types?
added 30 characters in body
May
9
revised How to implement rounding in an all-purpose stack language using different types?
edited body
May
9
answered How to implement rounding in an all-purpose stack language using different types?