IssueRaiser

Several more that come to mind: * "unusual" control-flow: return several levels up from a function without requiring extensive elaborate...

Several more that come to mind: * "unusual" control-flow: return several levels up from a function without requiring extensive elaborate exception-handling mechanisms, coroutines, and techniques similar to continuation-passing-style. After all, functions and procedures are just an artificial construct imposed by HLLs. * Easily return multiple values from a function by using several registers, even normally inaccessible ones like EFLAGS (very useful for booleans.) * Generating self-modifying-code, like a simple JIT compiler, is straightforward to do. Works especially well for tight loops that have several variants of their bodies. Compilers are still bound by conventions and the features the HLL exposes. Asm is only limited by what the CPU can do (and what the programmer can come up with.) I admit that, while I do prefer using something like C for much of the "mundane" code I write, it's quite frustrating in those situations where I can think of a very elegant way to do something that either can't be expressed in C without some extreme compiler-fighting, or is completely impossible because of how it generates code and what the language allows.

Posted by userbinator on Jul 26, 2015, 1:25 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments

hackernews (Software)

Several more that come to mind: * "unusual" control-flow: return several levels up from a function without requiring extensive elaborate...

userbinatorJul 26, 2015, 1:25 PM

Several more that come to mind: * "unusual" control-flow: return several levels up from a function without requiring extensive elaborate exception-handling mechanisms, coroutines, and techniques similar to continuation-passing-style. After all, functions and procedures are just an artificial construct imposed by HLLs. * Easily return multiple values from a function by using several registers, even normally inaccessible ones like EFLAGS (very useful for booleans.) * Generating self-modifying-code, like a simple JIT compiler, is straightforward to do. Works especially well for tight loops that have several variants of their bodies. Compilers are still bound by conventions and the features the HLL exposes. Asm is only limited by what the CPU can do (and what the programmer can come up with.) I admit that, while I do prefer using something like C for much of the "mundane" code I write, it's quite frustrating in those situations where I can think of a very elegant way to do something that either can't be expressed in C without some extreme compiler-fighting, or is completely impossible because of how it generates code and what the language allows.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue