3 ms·
On a similar note: we rarely make use of abstractions that 'compile away', instead using abstractions that bring a runtime performance cost. An example of this
by MaxBarraclough 6y ago
On a similar note: we rarely make use of abstractions that 'compile away', instead using abstractions that bring a runtime performance cost.
An example of this is declarative GUI design. It's a good design idea to use a declarative language for this, as it helps with GUI design tooling (drag-and-drop editors), and eliminates the bugs that could arise from doing the work 'by hand' in a programming language. Most solutions end up parsing XML (or something similar) at runtime, rather than compiling down to an optimised binary. It's possible to 'have it all', in this instance.
- smichel17 6y agoAt least on the web, this is a feature, not a bug. It allows the user to modify the page as they see fit. For example, ad blockers or "dark mode" extensions would have a much more difficult job if websites were delivered as optimized binaries. I specify "on the web" because almost all browsers execute the content retrieved from the website with no user interaction besides navigating to a url. Contrast that with operating systems, which all require separate download + run steps (and often a bit flip in between, to mark the file as executable). That's a lot more friction / time for the user to notice if something is not as they expect or want.
- MaxBarraclough 6y agoI agree it makes sense on the web, which is ultimately a document system, but for a native desktop application I figure it makes good sense to compile away as much as possible.
- smichel17 6y agoAgreed on that front — especially since you can distribute the source in addition to the binary so that users can make changes & recompile if they want.