You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.qmd
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -251,6 +251,9 @@ Not using external libraries brings a number of advantages:
251
251
- Avoid dependency hell.
252
252
- Avoid wasting time, memory and computing resources for translating between language structures.
253
253
- Ensure consistent behaviour with the rest of 'R'.
254
+
- Access to CRAN's quality control (no comparable quality control organization exists for most other programming languages).
255
+
256
+
See the [Other Packages](https://tony-aw.github.io/broadcast/about/d_other_pkgs.html) page for more details on the above points regarding the advantages of minimizing dependencies.
<divclass="toc-actions"><div><iclass="bi bi-github"></i></div><divclass="action-links"><p><ahref="https://github.com/tony-aw/broadcast/issues/new" class="toc-action">Report an issue</a></p></div></div></nav>
184
184
</div>
@@ -187,7 +187,7 @@ <h2 id="toc-title">On this page</h2>
@@ -213,12 +213,13 @@ <h1>Alternatives to ‘broadcast’</h1>
213
213
<li><strong>Wasteful translations</strong>: Using libraries from other languages, such as ‘xtensor’ (‘C++’) or ‘Numpy’ (‘Python’) means that - at some point - one needs to convert between the structure of <svgaria-hidden="true" role="img" viewbox="0 0 581 512" style="height:1em;width:1.13em;vertical-align:-0.125em;margin-left:auto;margin-right:auto;font-size:inherit;fill:currentColor;overflow:visible;position:relative;"><pathd="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"></path></svg> to that of the other language, and vice-versa, which wastes precious time, memory, and power.</li>
214
214
<li><strong>Inconsistent behaviour</strong>: Using libraries from other languages also means one cannot always guarantee consistent behaviour for some operations.<br>
215
215
For example: both ‘Numpy’ and ‘xtensor’ have only limited support for missing values, whereas <svgaria-hidden="true" role="img" viewbox="0 0 581 512" style="height:1em;width:1.13em;vertical-align:-0.125em;margin-left:auto;margin-right:auto;font-size:inherit;fill:currentColor;overflow:visible;position:relative;"><pathd="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"></path></svg> supports missing values for both atomic and recursive array/vector types (except type of ‘Raw’).</li>
216
+
<li><strong>Access to CRAN’s quality control</strong>: ‘R’ is unique in that it has access to CRAN’s quality control; most other languages (including Python) don’t have a real comparable organization like CRAN.</li>
216
217
</ul>
217
218
<p>Since the ‘broadcast’ package does not rely on any external library, other than linking to ‘Rcpp’, ‘broadcast’ avoids all of the above issues.</p>
218
219
<p> </p>
219
220
</section>
220
221
<sectionid="the-tinyverse" class="level1">
221
-
<h1>The ’tinyverse</h1>
222
+
<h1>The ‘tinyverse’</h1>
222
223
<p>The ‘broadcast’ package adheres to the ‘tinyverse’ philosophy (not to be confused with the ‘tidyverse’), which is the programming philosophy to primarily minimize dependencies. ‘broadcast’ also belongs to the <ahref="https://github.com/fastverse/fastverse">fastverse</a>, which is a collection of packages aimed at keep code fast and efficient.</p>
223
224
<p>Packages that belong to the ‘fastverse’ can be found listed on the dedicated GitHub page:<br>
<p>It appears that ‘broadcast’ is slightly faster than ‘Numpy’, though the differences in the computation times between ‘broadcast’ and ‘Numpy’ are rather small. It seems reasonable to conclude that, in general, ‘broadcast’ and ‘Numpy’ have somewhat similar speeds. It can also be observed that ‘broadcast’ has a bit more spread/variation in its computation time than ‘Numpy’.</p>
429
429
<p> </p>
430
+
<p>The benchmarks shown here involved rather large arrays (90 to 100 million elements). These benchmarks thus focussed on the core computation time, and not so much on the overhead involved.</p>
431
+
<p> </p>
430
432
<p>As stated earlier, comparing benchmarks between <svgaria-hidden="true" role="img" viewbox="0 0 581 512" style="height:1em;width:1.13em;vertical-align:-0.125em;margin-left:auto;margin-right:auto;font-size:inherit;fill:currentColor;overflow:visible;position:relative;"><pathd="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"></path></svg> and ‘Python’ should be taken with a grain of salt. I am open for suggestions on how to improve the computation time comparisons between ‘broadcast’ and ‘Numpy’, and make them more fair (so feel free to post suggestions on the GitHub Discussions page).</p>
<li>Access to CRAN’s quality control (no comparable quality control organization exists for most other programming languages).</li>
376
377
</ul>
378
+
<p>See the <ahref="https://tony-aw.github.io/broadcast/about/d_other_pkgs.html">Other Packages</a> page for more details on the above points regarding the advantages of minimizing dependencies.</p>
377
379
<p> </p>
378
380
<p><strong>Tested</strong></p>
379
381
<p>The ‘broadcast’ package is frequently checked using a large suite of unit tests via the <ahref="https://github.com/markvanderloo/tinytest">tinytest</a> package. These tests have a <ahref="https://tony-aw.github.io/broadcast/about/g_unit_test_covr.html">coverage</a> of over 90%. So the chance of a function from this package breaking completely is relatively low.</p>
0 commit comments