galaaz 0.5.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -0
  3. data/LICENSE +0 -0
  4. data/README.md +1416 -667
  5. data/Rakefile +68 -41
  6. data/bin/galaaz-bootstrap +137 -0
  7. data/bin/galaaz-jruby +11 -0
  8. data/bin/galaaz-ruby +16 -0
  9. data/bin/galaaz_jruby_env.inc.sh +6 -0
  10. data/bin/galaaz_ruby_env.inc.sh +36 -0
  11. data/bin/gbookdown +63 -0
  12. data/bin/gknit +83 -13
  13. data/bin/gknit-draft.rb +0 -0
  14. data/bin/gstudio +5 -3
  15. data/bin/gstudio_irb.rb +0 -0
  16. data/bin/gstudio_pry.rb +0 -0
  17. data/bin/install-tinytex +6 -0
  18. data/bin/run_all_rspec +44 -0
  19. data/bin/run_example +17 -0
  20. data/bin/run_old_rspec +20 -0
  21. data/bin/run_rspec +24 -0
  22. data/bin/run_rspec_subset +38 -0
  23. data/bin/run_slow_rspec +20 -0
  24. data/blogs/R-on-Rails-Planning-Document.md +940 -0
  25. data/blogs/README.md +100 -0
  26. data/blogs/galaaz_ggplot/galaaz_ggplot.Rmd +38 -66
  27. data/blogs/galaaz_ggplot/galaaz_ggplot.log +754 -0
  28. data/blogs/galaaz_ggplot/galaaz_ggplot.md +115 -155
  29. data/blogs/galaaz_ggplot/galaaz_ggplot.tex +607 -0
  30. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-gfm/midwest_rb.png +0 -0
  31. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-gfm/scatter_plot_rb.png +0 -0
  32. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/midwest_rb.png +0 -0
  33. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/scatter_plot_rb.png +0 -0
  34. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/midwest_rb.png +0 -0
  35. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/scatter_plot_rb.png +0 -0
  36. data/blogs/galaaz_ggplot/midwest.Rmd +3 -3
  37. data/blogs/galaaz_ggplot/midwest_external_png +0 -0
  38. data/blogs/gknit/gknit.Rmd +47 -52
  39. data/blogs/gknit/gknit.md +1430 -0
  40. data/blogs/gknit/gknit_files/figure-gfm/bubble-1.png +0 -0
  41. data/blogs/gknit/gknit_files/figure-gfm/diverging_bar.png +0 -0
  42. data/blogs/gknit/gknit_files/figure-html/bubble-1.png +0 -0
  43. data/blogs/gknit/gknit_files/figure-html/diverging_bar.png +0 -0
  44. data/blogs/gknit/lst.rds +0 -0
  45. data/blogs/gknit/model.rb +1 -1
  46. data/blogs/gknit/stats.bib +0 -0
  47. data/blogs/manual/include_model_local_repro.Rmd +14 -0
  48. data/blogs/manual/include_model_local_repro.md +75 -0
  49. data/blogs/manual/lst.rds +0 -0
  50. data/blogs/manual/manual.Rmd +855 -239
  51. data/blogs/manual/manual.log +1786 -0
  52. data/blogs/manual/manual.md +1416 -667
  53. data/blogs/manual/manual.tex +1883 -1161
  54. data/blogs/manual/manual_files/figure-html/bubble-1.png +0 -0
  55. data/blogs/manual/manual_files/figure-html/diverging_bar.png +0 -0
  56. data/blogs/manual/manual_files/figure-latex/bubble-1.png +0 -0
  57. data/blogs/manual/model.rb +1 -1
  58. data/blogs/nse_dplyr/nse_dplyr.Rmd +84 -111
  59. data/blogs/nse_dplyr/nse_dplyr.log +928 -0
  60. data/blogs/nse_dplyr/nse_dplyr.md +198 -229
  61. data/blogs/oh_my/not_so.rb +0 -0
  62. data/blogs/oh_my/oh_my.Rmd +1234 -25
  63. data/blogs/oh_my/oh_my.log +804 -0
  64. data/blogs/oh_my/oh_my.md +1663 -86
  65. data/blogs/oh_my/oh_my.tex +821 -0
  66. data/blogs/oh_my/old.Rmd +15 -14
  67. data/blogs/ruby_plot/ruby_plot.Rmd +58 -82
  68. data/blogs/ruby_plot/ruby_plot.log +885 -0
  69. data/blogs/ruby_plot/ruby_plot.md +71 -102
  70. data/blogs/ruby_plot/ruby_plot.tex +940 -0
  71. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/dose_len.png +0 -0
  72. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facet_by_delivery.png +0 -0
  73. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facet_by_dose.png +0 -0
  74. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_by_delivery_color.png +0 -0
  75. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_by_delivery_color2.png +0 -0
  76. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_decorations.png +0 -0
  77. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_jitter.png +0 -0
  78. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_points.png +0 -0
  79. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/final_box_plot.png +0 -0
  80. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/final_violin_plot.png +0 -0
  81. data/blogs/ruby_plot/ruby_plot_files/figure-gfm/violin_with_jitter.png +0 -0
  82. data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.png +0 -0
  83. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.png +0 -0
  84. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.png +0 -0
  85. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.png +0 -0
  86. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.png +0 -0
  87. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png +0 -0
  88. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.png +0 -0
  89. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.png +0 -0
  90. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.png +0 -0
  91. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.png +0 -0
  92. data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.png +0 -0
  93. data/blogs/ruby_plot/ruby_plot_files/figure-latex/dose_len.png +0 -0
  94. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
  95. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
  96. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
  97. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
  98. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
  99. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
  100. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
  101. data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
  102. data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
  103. data/blogs/ruby_plot/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
  104. data/blogs/test/test.Rmd +14 -0
  105. data/blogs/test/test.md +10 -0
  106. data/examples/50Plots_MasterList/Images/midwest-scatterplot.PNG +0 -0
  107. data/examples/50Plots_MasterList/ScatterPlot.rb +2 -1
  108. data/examples/50Plots_MasterList/scatter_plot.rb +1 -0
  109. data/examples/Bibliography/master.bib +0 -0
  110. data/examples/Bibliography/stats.bib +0 -0
  111. data/examples/R/calc.R +0 -0
  112. data/examples/R/java_interop.R +0 -0
  113. data/examples/bioconductor_deseq2_airway/Documentation/DESeq2-airway-walkthrough.md +56 -0
  114. data/examples/bioconductor_deseq2_airway/bench_galaaz_three_same_process.rb +54 -0
  115. data/examples/bioconductor_deseq2_airway/bench_r_three_same_process.R +34 -0
  116. data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz.rb +34 -0
  117. data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz_optimized.rb +35 -0
  118. data/examples/bioconductor_deseq2_airway/deseq2_airway_minimal.R +30 -0
  119. data/examples/bioconductor_deseq2_airway/deseq2_airway_pipeline_for_bench.R +36 -0
  120. data/examples/islr/all.rb +14 -0
  121. data/examples/islr/ch2.spec.rb +38 -7
  122. data/examples/islr/ch3.spec.rb +12 -2
  123. data/examples/islr/ch3_boston.rb +28 -0
  124. data/examples/islr/ch3_multiple_regression.rb +1 -0
  125. data/examples/islr/ch6.spec.rb +25 -1
  126. data/examples/islr/x_y_rnorm.jpg +0 -0
  127. data/examples/latex_templates/Test-acm_article/acm_proc_article-sp.cls +0 -0
  128. data/examples/latex_templates/Test-acm_article/sigproc.bib +0 -0
  129. data/examples/latex_templates/Test-acs_article/acs-Test-acs_article.bib +0 -0
  130. data/examples/latex_templates/Test-acs_article/acs-my_output.bib +0 -0
  131. data/examples/latex_templates/Test-aea_article/BibFile.bib +0 -0
  132. data/examples/latex_templates/Test-aea_article/Test-aea_article.Rmd +0 -0
  133. data/examples/latex_templates/Test-aea_article/references.bib +0 -0
  134. data/examples/latex_templates/Test-amq_article/Test-amq_article.Rmd +0 -0
  135. data/examples/latex_templates/Test-amq_article/Test-amq_article.pdfsync +0 -0
  136. data/examples/latex_templates/Test-ieee_article/IEEEtran.bst +0 -0
  137. data/examples/latex_templates/Test-ieee_article/mybibfile.bib +0 -0
  138. data/examples/latex_templates/Test-rjournal_article/RJournal.sty +0 -0
  139. data/examples/latex_templates/Test-rjournal_article/RJreferences.bib +0 -0
  140. data/examples/latex_templates/Test-rjournal_article/Test-rjournal_article.Rmd +0 -0
  141. data/examples/misc/baseball.csv +0 -0
  142. data/examples/misc/ggplot.rb +5 -3
  143. data/examples/misc/moneyball.rb +1 -0
  144. data/examples/misc/subsetting.rb +1 -0
  145. data/examples/multithread_shards_to_r/shards_to_r.rb +68 -0
  146. data/examples/rmarkdown/svm-rmarkdown-anon-ms-example/svm-rmarkdown-anon-ms-example.Rmd +0 -0
  147. data/examples/rmarkdown/svm-rmarkdown-article-example/svm-rmarkdown-article-example.Rmd +0 -0
  148. data/examples/rmarkdown/svm-rmarkdown-beamer-example/svm-rmarkdown-beamer-example.Rmd +0 -0
  149. data/examples/rmarkdown/svm-rmarkdown-cv/svm-rmarkdown-cv.Rmd +0 -0
  150. data/examples/rmarkdown/svm-rmarkdown-syllabus-example/attend-grade-relationships.csv +0 -0
  151. data/examples/rmarkdown/svm-rmarkdown-syllabus-example/svm-rmarkdown-syllabus-example.Rmd +0 -0
  152. data/examples/rmarkdown/svm-xaringan-example/svm-xaringan-example.Rmd +0 -0
  153. data/examples/sthda_ggplot/README.md +0 -0
  154. data/examples/sthda_ggplot/RUN.md +41 -0
  155. data/examples/sthda_ggplot/all.rb +1 -0
  156. data/examples/sthda_ggplot/one_variable_continuous/density_gg.rb +1 -0
  157. data/examples/sthda_ggplot/one_variable_continuous/geom_area.rb +1 -0
  158. data/examples/sthda_ggplot/one_variable_continuous/geom_density.rb +3 -0
  159. data/examples/sthda_ggplot/one_variable_continuous/geom_dotplot.rb +1 -0
  160. data/examples/sthda_ggplot/one_variable_continuous/geom_freqpoly.rb +1 -0
  161. data/examples/sthda_ggplot/one_variable_continuous/geom_histogram.rb +1 -0
  162. data/examples/sthda_ggplot/one_variable_continuous/histogram_density.rb +1 -0
  163. data/examples/sthda_ggplot/one_variable_continuous/stat.rb +1 -0
  164. data/examples/sthda_ggplot/one_variable_discrete/bar.rb +1 -0
  165. data/examples/sthda_ggplot/qplots/box_violin_dot.rb +1 -0
  166. data/examples/sthda_ggplot/qplots/scatter_plots.rb +1 -0
  167. data/examples/sthda_ggplot/scatter_gg.rb +1 -0
  168. data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_bin2d.rb +1 -0
  169. data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_density2d.rb +1 -0
  170. data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_hex.rb +1 -0
  171. data/examples/sthda_ggplot/two_variables_cont_cont/geom_point.rb +1 -0
  172. data/examples/sthda_ggplot/two_variables_cont_cont/geom_smooth.rb +1 -0
  173. data/examples/sthda_ggplot/two_variables_cont_cont/misc.rb +1 -0
  174. data/examples/sthda_ggplot/two_variables_cont_function/geom_area.rb +5 -3
  175. data/examples/sthda_ggplot/two_variables_disc_cont/geom_bar.rb +1 -0
  176. data/examples/sthda_ggplot/two_variables_disc_cont/geom_boxplot.rb +1 -0
  177. data/examples/sthda_ggplot/two_variables_disc_cont/geom_dotplot.rb +1 -0
  178. data/examples/sthda_ggplot/two_variables_disc_cont/geom_jitter.rb +1 -0
  179. data/examples/sthda_ggplot/two_variables_disc_cont/geom_line.rb +1 -0
  180. data/examples/sthda_ggplot/two_variables_disc_cont/geom_violin.rb +1 -0
  181. data/examples/sthda_ggplot/two_variables_disc_disc/geom_jitter.rb +1 -0
  182. data/examples/sthda_ggplot/two_variables_error/geom_crossbar.rb +1 -0
  183. data/ext/new_bridge/Makefile +46 -0
  184. data/ext/new_bridge/galaaz_gatekeeper_phase0.cpp +12 -0
  185. data/ext/new_bridge/galaaz_gatekeeper_phase1.cpp +1639 -0
  186. data/lib/R_interface/galaaz_device.R +20 -0
  187. data/lib/R_interface/include_engine.R +109 -0
  188. data/lib/R_interface/new_bridge_adapter.rb +824 -0
  189. data/lib/R_interface/r.rb +177 -25
  190. data/lib/R_interface/r_arrow.rb +113 -0
  191. data/lib/R_interface/r_libs.R +3 -3
  192. data/lib/R_interface/r_methods.rb +13 -126
  193. data/lib/R_interface/r_module_s.rb +0 -0
  194. data/lib/R_interface/rbinary_operators.rb +20 -2
  195. data/lib/R_interface/rclosure.rb +5 -1
  196. data/lib/R_interface/rdata_frame.rb +34 -70
  197. data/lib/R_interface/rdevice.rb +125 -0
  198. data/lib/R_interface/rdevices.R +0 -0
  199. data/lib/R_interface/renvironment.rb +10 -4
  200. data/lib/R_interface/rexpression.rb +5 -1
  201. data/lib/R_interface/rindexed_object.rb +41 -13
  202. data/lib/R_interface/rlanguage.rb +20 -62
  203. data/lib/R_interface/rlist.rb +115 -25
  204. data/lib/R_interface/rlogical_operators.rb +0 -0
  205. data/lib/R_interface/rmatrix.rb +2 -11
  206. data/lib/R_interface/rmd_indexed_object.rb +5 -1
  207. data/lib/R_interface/robject.rb +348 -290
  208. data/lib/R_interface/rpkg.rb +0 -0
  209. data/lib/R_interface/rsupport.rb +609 -328
  210. data/lib/R_interface/rsupport_scope.rb +2 -1
  211. data/lib/R_interface/rsymbol.rb +50 -0
  212. data/lib/R_interface/ruby_callback.rb +2 -3
  213. data/lib/R_interface/ruby_extensions.rb +225 -175
  214. data/lib/R_interface/runary_operators.rb +0 -0
  215. data/lib/R_interface/rvector.rb +162 -31
  216. data/lib/galaaz.rb +0 -0
  217. data/lib/galaaz_jruby.rb +22 -0
  218. data/lib/galaaz_ruby.rb +34 -0
  219. data/lib/gknit/diagnostics.rb +50 -0
  220. data/lib/gknit/draft.rb +23 -17
  221. data/lib/gknit/include_engine.rb +15 -7
  222. data/lib/gknit/knitr_engine.rb +223 -74
  223. data/lib/gknit/rb_engine.rb +3 -3
  224. data/lib/gknit/ruby_engine.rb +0 -0
  225. data/lib/gknit.rb +1 -0
  226. data/lib/new_bridge/bootstrap/windows_bootstrap.rb +285 -0
  227. data/lib/new_bridge/envelope.rb +51 -0
  228. data/lib/new_bridge/eval_result.rb +26 -0
  229. data/lib/new_bridge/framing.rb +39 -0
  230. data/lib/new_bridge/instance_pool_client.rb +38 -0
  231. data/lib/new_bridge/r_instance_manager.rb +404 -0
  232. data/lib/new_bridge/session_client.rb +530 -0
  233. data/lib/new_bridge/tcp_framed.rb +44 -0
  234. data/lib/new_bridge.rb +9 -0
  235. data/lib/util/exec_ruby.rb +95 -20
  236. data/lib/util/inline_file.rb +35 -30
  237. data/new_bridge_specs/benchmark_phase5_5_unboxing_spec.rb +96 -0
  238. data/new_bridge_specs/eval_r_async_spec.rb +113 -0
  239. data/new_bridge_specs/integration_phase5_1_concurrent_spec.rb +50 -0
  240. data/new_bridge_specs/integration_phase5_1_eval_spec.rb +16 -0
  241. data/new_bridge_specs/integration_phase5_1_r_api_spec.rb +25 -0
  242. data/new_bridge_specs/integration_phase5_1_smoke_spec.rb +31 -0
  243. data/new_bridge_specs/integration_phase5_2_dataframe_unboxing_spec.rb +19 -0
  244. data/new_bridge_specs/integration_phase5_2_handle_eval_unboxing_spec.rb +25 -0
  245. data/new_bridge_specs/integration_phase5_3_callback_args_spec.rb +28 -0
  246. data/new_bridge_specs/integration_phase5_3_callback_error_spec.rb +22 -0
  247. data/new_bridge_specs/integration_phase5_3_callback_timeout_spec.rb +28 -0
  248. data/new_bridge_specs/integration_phase5_3_callbacks_smoke_spec.rb +22 -0
  249. data/new_bridge_specs/integration_phase5_3_edge_cases_spec.rb +52 -0
  250. data/new_bridge_specs/integration_phase5_3_nested_spec.rb +30 -0
  251. data/new_bridge_specs/integration_phase5_4_concurrent_sessions_spec.rb +53 -0
  252. data/new_bridge_specs/integration_phase5_4_nested_session_callbacks_spec.rb +49 -0
  253. data/new_bridge_specs/integration_phase5_4_session_routing_spec.rb +38 -0
  254. data/new_bridge_specs/integration_phase5_5_stress_concurrency_spec.rb +52 -0
  255. data/new_bridge_specs/integration_phase5_5_unbox_walk_spec.rb +46 -0
  256. data/new_bridge_specs/phase0_protocol_spec.rb +96 -0
  257. data/new_bridge_specs/phase1_req_ret_spec.rb +66 -0
  258. data/new_bridge_specs/phase2_multi_instance_spec.rb +67 -0
  259. data/new_bridge_specs/phase3_callbacks_spec.rb +71 -0
  260. data/new_bridge_specs/phase4_2_hardening_spec.rb +252 -0
  261. data/new_bridge_specs/phase4_3_r_instance_manager_spec.rb +85 -0
  262. data/new_bridge_specs/phase4_nested_callbacks_spec.rb +123 -0
  263. data/r_requires/ggplot.rb +0 -0
  264. data/r_requires/knitr.rb +0 -0
  265. data/specs/all.rb +15 -11
  266. data/specs/arrow_from_ruby_batches_spec.rb +50 -0
  267. data/specs/arrow_semantics_spec.rb +64 -0
  268. data/specs/bridge_concurrent_spec.rb +46 -0
  269. data/specs/bridge_nested_spec.rb +25 -0
  270. data/specs/dataframe_semantics_spec.rb +122 -0
  271. data/specs/dataframe_single_index_logical_filter_spec.rb +21 -0
  272. data/specs/dispatch_probe_cache_spec.rb +38 -0
  273. data/specs/dispatch_probe_error_class_fallback_spec.rb +20 -0
  274. data/specs/dispatch_probe_fallback_spec.rb +18 -0
  275. data/specs/environment_semantics_spec.rb +89 -0
  276. data/specs/field_access_spec.rb +31 -0
  277. data/specs/figures/bg.jpeg +0 -0
  278. data/specs/figures/bg.png +0 -0
  279. data/specs/figures/bg.svg +168 -57
  280. data/specs/figures/dose_len.png +0 -0
  281. data/specs/figures/no_args.jpeg +0 -0
  282. data/specs/figures/no_args.png +0 -0
  283. data/specs/figures/no_args.svg +168 -57
  284. data/specs/figures/width_height.jpeg +0 -0
  285. data/specs/figures/width_height.png +0 -0
  286. data/specs/figures/width_height_units1.jpeg +0 -0
  287. data/specs/figures/width_height_units1.png +0 -0
  288. data/specs/figures/width_height_units2.jpeg +0 -0
  289. data/specs/figures/width_height_units2.png +0 -0
  290. data/specs/formula_semantics_spec.rb +81 -0
  291. data/specs/galaaz_util_exec_ruby_spec.rb +85 -0
  292. data/specs/galaaz_util_inline_file_spec.rb +54 -0
  293. data/specs/gknit_cli_option_permutation_spec.rb +24 -0
  294. data/specs/gknit_include_engine_spec.rb +72 -0
  295. data/specs/gknit_install_timeout_report_spec.rb +69 -0
  296. data/specs/gknit_internal_error_report_spec.rb +57 -0
  297. data/specs/gknit_vector_map_output_spec.rb +59 -0
  298. data/specs/globalenv_guardrail_spec.rb +52 -0
  299. data/specs/language_expression_semantics_spec.rb +145 -0
  300. data/specs/list_semantics_spec.rb +111 -0
  301. data/specs/new_bridge_bulk_dataframe_transfer_spec.rb +44 -0
  302. data/specs/new_bridge_bulk_vector_transfer_spec.rb +73 -0
  303. data/specs/new_bridge_callback_timeout_spec.rb +69 -0
  304. data/specs/new_bridge_eval_r_fallback_spec.rb +55 -0
  305. data/specs/nil_null_spec.rb +42 -0
  306. data/specs/object_build_phase2_spec.rb +53 -0
  307. data/specs/phase1_callback_bridge_spec.rb +84 -0
  308. data/specs/phase2_gknit_generic_rendering_guardrail_spec.rb +46 -0
  309. data/specs/phase2_gknit_no_raw_code_leakage_spec.rb +43 -0
  310. data/specs/phase3_gknit_generic_graphics_capture_spec.rb +71 -0
  311. data/specs/plot_device_semantics_spec.rb +28 -0
  312. data/specs/plot_snapshot_semantics_spec.rb +58 -0
  313. data/specs/protocol_result_spec.rb +236 -0
  314. data/specs/r_batch_fail_fast_spec.rb +47 -0
  315. data/specs/r_bridge_bootstrap_spec.rb +11 -0
  316. data/specs/r_devices.spec.rb +1 -1
  317. data/specs/r_eval.spec.rb +16 -18
  318. data/specs/r_function.spec.rb +1 -1
  319. data/specs/r_instance_manager_spec.rb +285 -0
  320. data/specs/r_list_apply.spec.rb +15 -15
  321. data/specs/r_matrix.spec.rb +0 -0
  322. data/specs/r_nse.spec.rb +5 -5
  323. data/specs/r_object_send_dispatch_spec.rb +13 -0
  324. data/specs/r_vector_comparator_spec.rb +8 -0
  325. data/specs/r_vector_creation.spec.rb +0 -0
  326. data/specs/r_vector_functions.spec.rb +0 -0
  327. data/specs/r_vector_object.spec.rb +0 -0
  328. data/specs/r_vector_operators.spec.rb +0 -0
  329. data/specs/r_vector_structured_scalar_reads_spec.rb +35 -0
  330. data/specs/r_vector_subsetting.spec.rb +0 -0
  331. data/specs/range_helper_spec.rb +21 -0
  332. data/specs/rsupport_scope_spec.rb +28 -0
  333. data/specs/rsupport_var_name_thread_safety_spec.rb +24 -0
  334. data/specs/scalar_character_spec.rb +44 -0
  335. data/specs/scoped_symbol_dsl_refinement_spec.rb +40 -0
  336. data/specs/session_env_bridge_spec.rb +25 -0
  337. data/specs/simplecov_bootstrap_spec.rb +10 -0
  338. data/specs/spec_helper.rb +10 -0
  339. data/specs/tmp.rb +0 -0
  340. data/specs/unboxing_recursion_regression_spec.rb +30 -0
  341. data/specs/unboxing_spec.rb +49 -0
  342. data/specs/verify_callbacks.rb +42 -0
  343. data/sty/galaaz.sty +0 -0
  344. data/version.rb +1 -1
  345. metadata +219 -63
  346. data/blogs/galaaz_ggplot/galaaz_ggplot.html +0 -520
  347. data/blogs/galaaz_ggplot/galaaz_ggplot.pdf +0 -0
  348. data/blogs/galaaz_ggplot/midwest.html +0 -188
  349. data/blogs/gknit/gknit.html +0 -2266
  350. data/blogs/gknit/gknit.pdf +0 -0
  351. data/blogs/manual/manual.html +0 -4638
  352. data/blogs/manual/manual.pdf +0 -0
  353. data/blogs/manual/manual_files/figure-latex/diverging_bar.pdf +0 -0
  354. data/blogs/nse_dplyr/nse_dplyr.html +0 -878
  355. data/blogs/nse_dplyr/nse_dplyr.pdf +0 -0
  356. data/blogs/oh_my/oh_my.html +0 -568
  357. data/blogs/ruby_plot/ruby_plot.html +0 -544
  358. data/blogs/ruby_plot/ruby_plot.pdf +0 -0
  359. data/examples/latex_templates/Test-acs_article/Test-acs_article.pdf +0 -0
  360. data/examples/latex_templates/Test-aea_article/Test-aea_article.pdf +0 -0
  361. data/examples/latex_templates/Test-amq_article/Test-amq_article.pdf +0 -0
  362. data/examples/latex_templates/Test-amq_article/pics/Figure2.pdf +0 -0
  363. data/examples/latex_templates/Test-asa_article/Test-asa_article.pdf +0 -0
  364. data/examples/latex_templates/Test-ieee_article/Test-ieee_article.pdf +0 -0
  365. data/examples/latex_templates/Test-rjournal_article/RJwrapper.pdf +0 -0
  366. data/examples/latex_templates/Test-springer_article/Test-springer_article.pdf +0 -0
  367. data/examples/rmarkdown/svm-rmarkdown-anon-ms-example/svm-rmarkdown-anon-ms-example.pdf +0 -0
  368. data/examples/rmarkdown/svm-rmarkdown-article-example/svm-rmarkdown-article-example.pdf +0 -0
  369. data/examples/rmarkdown/svm-rmarkdown-beamer-example/svm-rmarkdown-beamer-example.pdf +0 -0
  370. data/examples/rmarkdown/svm-rmarkdown-cv/svm-rmarkdown-cv.pdf +0 -0
  371. data/examples/rmarkdown/svm-rmarkdown-syllabus-example/svm-rmarkdown-syllabus-example.pdf +0 -0
  372. data/specs/r_dataframe.spec.rb +0 -379
  373. data/specs/r_environment.spec.rb +0 -140
  374. data/specs/r_formula.spec.rb +0 -232
  375. data/specs/r_language.spec.rb +0 -112
  376. data/specs/r_list.spec.rb +0 -293
  377. data/specs/r_plots.spec.rb +0 -72
  378. data/specs/ruby_expression.spec.rb +0 -316
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.install_and_loads('ISLR', 'MASS')
@@ -23,40 +23,64 @@
23
23
 
24
24
  require 'galaaz'
25
25
 
26
+ using Galaaz::SymbolDSL
26
27
  R.install_and_loads('ISLR', 'MASS')
27
28
 
28
29
  context "ISLR" do
29
30
 
30
31
  context "Chapter 6 - Subset Selection Methods - page 244" do
31
32
 
33
+ def galaaz_islr_debug(msg)
34
+ STDERR.puts "[DEBUG islr][ch6.spec][#{Time.now.strftime('%H:%M:%S')}] #{msg}"
35
+ STDERR.flush
36
+ end
37
+
32
38
  before(:each) do
33
39
  @hitters = ~:Hitters
34
40
  end
35
41
 
36
42
  it "Should access the names of the dataset" do
43
+ galaaz_islr_debug 'test1 start (names/dim)'
37
44
  expect(@hitters.names[1] == "AtBat").to eq true
38
45
  expect(@hitters.names[5] == "RBI").to eq true
39
46
  expect(@hitters.names[11] == "CRuns").to eq true
40
47
  expect(@hitters.dim == R.c(322, 20)).to eq true
48
+ galaaz_islr_debug 'test1 end'
41
49
  end
42
50
 
43
51
  it "Should count na's using 'R.sum'" do
52
+ galaaz_islr_debug 'test2 start (R.sum)'
44
53
  expect(R.sum(@hitters.Salary.is__na) == 59).to eq true
45
54
  expect(R.sum(@hitters.Salary.is__na)).to eq 59
55
+ galaaz_islr_debug 'test2 end'
46
56
  end
47
57
 
48
58
  it "Should count na's using Ruby Enumerable 'sum'" do
59
+ galaaz_islr_debug "test3 start (Ruby Enumerable sum over Salary)"
60
+ yielded = 0
61
+ salary = @hitters.Salary
62
+ galaaz_islr_debug "test3 salary fetched; about to salary.size"
63
+ sz = salary.size
64
+ galaaz_islr_debug "test3 salary.size=#{sz}; about to Salary.sum"
49
65
  # method 'sum' is a Ruby Enumerable method. To count na's we can loop through
50
66
  # every element and check if they are na or not. Note that the return os
51
67
  # is__na is an R::Vector, so we need to 'pop' the value to a Ruby value in
52
68
  # ordet to apply the '?' method
53
- expect(@hitters.Salary.sum { |e| (e.is__na == true)? 1 : 0 }).to eq 59
69
+ got = @hitters.Salary.sum do |e|
70
+ yielded += 1
71
+ galaaz_islr_debug("test3 yield #{yielded}") if yielded % 100 == 0
72
+ (e.is__na == true) ? 1 : 0
73
+ end
74
+ galaaz_islr_debug "test3 end (yielded=#{yielded}, got=#{got})"
75
+ expect(got).to eq 59
54
76
  end
55
77
 
56
78
  it "should remove missing values with na__omit" do
79
+ galaaz_islr_debug 'test4 start (na__omit)'
57
80
  @hitters = @hitters.na__omit
58
81
  expect(@hitters.dim == R.c(263, 20)).to eq true
59
82
  expect(R.sum(@hitters.is__na)).to eq 0
83
+ galaaz_islr_debug 'test4 end'
60
84
  end
61
85
 
62
86
  end
Binary file
File without changes
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  module LightBlueTheme
@@ -125,7 +126,7 @@ module LightBlueTheme
125
126
 
126
127
  end
127
128
 
128
- R.awt
129
+ # R.awt
129
130
 
130
131
  plot = R.grid__arrange(
131
132
  LightBlueTheme.graph_title("Cars: wt x mpg"),
@@ -137,7 +138,8 @@ plot = R.grid__arrange(
137
138
  heights: R.c(0.050, 0.025, 0.85, 0.05)
138
139
  )
139
140
 
140
- plot.print
141
+ # plot.print
142
+ R.ggsave("cars_plot.png", plot)
141
143
 
142
144
  =begin
143
145
  sleep(5)
@@ -153,7 +155,7 @@ R.grid__newpage
153
155
  R.geom_point('')).print
154
156
  =end
155
157
 
156
- a = gets.chomp
158
+ a = gets.chomp if $stdin.tty?
157
159
 
158
160
 
159
161
  =begin
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'galaaz'
4
4
 
5
+ using Galaaz::SymbolDSL
5
6
  local_dir = File.expand_path File.dirname(__FILE__)
6
7
 
7
8
  # This dataset comes from Baseball-Reference.com.
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'galaaz'
4
4
 
5
+ using Galaaz::SymbolDSL
5
6
  # This examples were extracted from "Advanced R", by Hadley Wickham, available on the
6
7
  # web at: http://adv-r.had.co.nz/Subsetting.html#applications
7
8
 
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Multithreaded Ruby → single R workflow
4
+ #
5
+ # Pattern: JRuby runs several threads (e.g. one connection per shard). Each thread
6
+ # performs I/O-bound work (here simulated; replace with Sequel/SQLite/pg per shard).
7
+ # Results are merged in Ruby, then passed to R in one or a few bridge calls for
8
+ # analytics (dplyr on an Arrow table, or a plain data.frame).
9
+ #
10
+ # Run from repo root (JRuby + R as for other examples):
11
+ # jruby examples/multithread_shards_to_r/shards_to_r.rb
12
+ #
13
+ # See also:
14
+ # specs/bridge_concurrent_spec.rb — many threads calling R; bridge serializes.
15
+ # specs/arrow_from_ruby_batches_spec.rb — same merge → R pattern with Arrow.
16
+
17
+ require 'galaaz'
18
+
19
+ using Galaaz::SymbolDSL
20
+ SHARD_COUNT = 3
21
+ ROWS_PER_SHARD = 200
22
+
23
+ # Replace this with a real query, e.g.:
24
+ # Sequel.connect(ENV.fetch("DATABASE_URL_SHARD_#{shard_id}"))
25
+ # .fetch("SELECT id, region, amount FROM events WHERE shard_id = ?", shard_id)
26
+ # .map { |r| r.symbolize_keys }
27
+ def fetch_rows_from_shard(shard_id)
28
+ base = shard_id * ROWS_PER_SHARD
29
+ (0...ROWS_PER_SHARD).map do |j|
30
+ n = base + j
31
+ {
32
+ shard: shard_id,
33
+ id: n,
34
+ region: "r#{n % 4}",
35
+ amount: (n % 17) + 1.0
36
+ }
37
+ end
38
+ end
39
+
40
+ batches = []
41
+ batch_mx = Mutex.new
42
+
43
+ threads = SHARD_COUNT.times.map do |sid|
44
+ Thread.new do
45
+ rows = fetch_rows_from_shard(sid)
46
+ batch_mx.synchronize { batches << rows }
47
+ end
48
+ end
49
+ threads.each(&:join)
50
+
51
+ merged = batches.flatten
52
+ puts "Collected #{merged.size} rows from #{SHARD_COUNT} threads in Ruby"
53
+
54
+ unless R::Support.eval("requireNamespace('arrow', quietly=TRUE) && requireNamespace('dplyr', quietly=TRUE)") == true
55
+ warn 'Skipping R aggregation: install R packages arrow and dplyr, or use R.data__frame from merged hashes.'
56
+ exit 0
57
+ end
58
+
59
+ tbl = R::Arrow.from_ruby_batches(merged)
60
+ grouped = R.dplyr___group_by(tbl, :region)
61
+ summarised = R.dplyr___summarise(
62
+ grouped,
63
+ n: E.n,
64
+ total: E.sum(:amount),
65
+ mean_amt: E.mean(:amount)
66
+ )
67
+ out = R.dplyr___collect(summarised)
68
+ puts R.as__data__frame(out)
File without changes
@@ -0,0 +1,41 @@
1
+ # Running sthda_ggplot examples
2
+
3
+ Use the same JRuby and JVM options as the specs (required for Apache Arrow).
4
+
5
+ ## Run all sthda_ggplot examples
6
+
7
+ From the project root:
8
+
9
+ ```bash
10
+ jruby -I lib -J--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED examples/sthda_ggplot/all.rb
11
+ ```
12
+
13
+ Or with the helper script (if present):
14
+
15
+ ```bash
16
+ bin/run_example examples/sthda_ggplot/all.rb
17
+ ```
18
+
19
+ ## Run a single example
20
+
21
+ ```bash
22
+ jruby -I lib -J--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED examples/sthda_ggplot/one_variable_continuous/geom_density.rb
23
+ ```
24
+
25
+ Examples that open a display (e.g. `R.awt` / X11) will show a window; some examples use `sleep(2)` between plots.
26
+
27
+ ## Via Rake (default Ruby)
28
+
29
+ The default task runs all sthda examples:
30
+
31
+ ```bash
32
+ rake sthda:all
33
+ ```
34
+
35
+ A single example (replace with the file path under `examples/sthda_ggplot/`):
36
+
37
+ ```bash
38
+ rake "sthda:one_variable_continuous/geom_density"
39
+ ```
40
+
41
+ Note: Rake uses `ruby --polyglot --jvm -Ilib/` (TruffleRuby-style). For JRuby + Shadow Bridge, use the `jruby` command above.
@@ -21,6 +21,7 @@
21
21
 
22
22
  require 'galaaz'
23
23
 
24
+ using Galaaz::SymbolDSL
24
25
  # Package Hmisc does not yet install on graalvm because of
25
26
  # problems with package data.table
26
27
  # install.packages('Hmisc')
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -38,6 +39,8 @@ a = wdata.ggplot(E.aes(x: :weight))
38
39
  # Aggregate the data by sex
39
40
  mu = R.aggregate(wdata.weight, by: R.list(wdata.sex), FUN: :mean)
40
41
  mu.names = R.c("sex", "grp_mean")
42
+ puts "MU CLASS: #{R.bridge.eval_r("paste(class(#{mu.r_interop}), collapse=' ')")}"
43
+ puts "MU NAMES: #{R.bridge.eval_r("names(#{mu.r_interop})")}"
41
44
  puts mu
42
45
 
43
46
  R.awt
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  # puts ~:mpg
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.set__seed(1234)
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  # Load the data
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.awt
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  diamonds = ~:diamonds
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  faithful = ~:faithful
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.install_and_loads('hexbin')
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  mtcars = ~:mtcars
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  mtcars = ~:mtcars
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.install_and_loads('quantreg')
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  economics = ~:economics
@@ -46,9 +47,10 @@ R.grid__newpage
46
47
  # a subset of economics data set is used
47
48
  R.set__seed(1234)
48
49
 
49
- # Remember that nrow is an R::Vector. To use it in a Ruby range we
50
- # need to 'pop' its value as Numeric
51
- ss = economics[R.sample((1..economics.nrow.pop), 20), :all]
50
+ # nrow returns a numeric (or R vector); use it in a Ruby range for sampling row indices
51
+ n = economics.nrow
52
+ n = n.respond_to?(:pop) ? n.pop : n
53
+ ss = economics[R.sample((1..n), 20), :all]
52
54
 
53
55
  print ss.ggplot(E.aes(x: :date, y: :unemploy)) +
54
56
  R.geom_step
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  df = R.data__frame(dose: R.c("D0.5", "D1", "D2"),
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  tooth_growth = ~:ToothGrowth
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.install_and_loads('Hmisc')
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
  R.install_and_loads('Hmisc')
27
28
 
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  df = R.data__frame(supp: R.rep(R.c("VC", "OJ"), each: 3),
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
  R.install_and_loads('Hmisc')
27
28
 
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  diamonds = ~:diamonds
@@ -22,6 +22,7 @@
22
22
  ##########################################################################################
23
23
 
24
24
  require 'galaaz'
25
+ using Galaaz::SymbolDSL
25
26
  require 'ggplot'
26
27
 
27
28
  R.install_and_loads('Hmisc')
@@ -0,0 +1,46 @@
1
+ # Makefile for Galaaz Gatekeeper shared library
2
+ # Usage: make clean all
3
+
4
+ # R configuration
5
+ R_HOME := $(shell R RHOME)
6
+ R_CPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags)
7
+ R_LIBS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
8
+
9
+ # Rcpp configuration
10
+ RCPP_INCLUDE := $(shell $(R_HOME)/bin/Rscript -e "cat(system.file('include', package='Rcpp'))")
11
+ RCPP_CPPFLAGS := -I$(RCPP_INCLUDE)
12
+
13
+ # Compiler settings
14
+ CXX := $(shell $(R_HOME)/bin/R CMD config CXX)
15
+ CXXFLAGS := $(shell $(R_HOME)/bin/R CMD config CXXFLAGS)
16
+ CPPFLAGS := $(R_CPPFLAGS) $(RCPP_CPPFLAGS) -I.
17
+ # Core R library only (avoid system libs that may not be present)
18
+ LDFLAGS := -L$(R_HOME)/lib -lR -Wl,-rpath,$(R_HOME)/lib
19
+
20
+ # Target library
21
+ TARGET := galaaz_gatekeeper.so
22
+ SRC := galaaz_gatekeeper_phase1.cpp
23
+ OBJ := $(SRC:.cpp=.o)
24
+
25
+ .PHONY: all clean check
26
+
27
+ all: $(TARGET)
28
+
29
+ $(TARGET): $(OBJ)
30
+ $(CXX) -shared -o $@ $^ $(LDFLAGS)
31
+
32
+ %.o: %.cpp
33
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -fPIC -c $< -o $@
34
+
35
+ check: $(TARGET)
36
+ @echo "Checking library..."
37
+ @$(R_HOME)/bin/Rscript -e "dyn.load('$(TARGET)'); cat('Library loads successfully\n')"
38
+
39
+ clean:
40
+ rm -f $(OBJ) $(TARGET)
41
+
42
+ # Development helpers
43
+ install: $(TARGET)
44
+ @echo "Copying to galaaz lib directory..."
45
+ mkdir -p ../../lib/new_bridge
46
+ cp $(TARGET) ../../lib/new_bridge/
@@ -0,0 +1,12 @@
1
+ #include <Rcpp.h>
2
+
3
+ // Phase 0 skeleton: compile via Rcpp::sourceCpp; no socket I/O yet.
4
+
5
+ // [[Rcpp::export]]
6
+ Rcpp::List galaaz_poll() {
7
+ return Rcpp::List::create();
8
+ }
9
+
10
+ // [[Rcpp::export]]
11
+ void galaaz_shutdown() {
12
+ }