Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why is it difficult?


Since 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.


It'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 `+`.


Late 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- rep.html) or Zig (comptime)? You can obv. do this in Rye via a static context.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: