3 ms·
Why is it difficult?
by _nalply 3y ago
Why is it difficult?
- samatman 3y agoSince code-is-data, you can put that exact if statement into several functions. Since code-is-data, you can swap the if and else clauses around. This applies to all the functions where you've inserted the if statement. This kind of thing makes it difficult to compile a function to a fast set of machine instructions with the same effect. Not impossible, but difficult.
- sparkie 3y agoIt's difficult to optimize because evaluation of expressions depends on the dynamic environment, which you don't have ahead-of-time. You can't even assume `+` means "add the arguments", because `+` may have been bound to something completely different prior to evaluating the expression containing `+`.
- alexisread 3y agoLate to the party here. What would be your take on dynamic-by-default, but the ability to fix the env a la Dreams (http://elilabs.com/~rj/dreams/dreams- http://elilabs.com/~rj/dreams/dreams- rep.html) or Zig (comptime)? You can obv. do this in Rye via a static context.