Simulated optics experiment/Data analysis: Difference between revisions
Simulated optics experiment/Data analysis (view source)
Revision as of 13:34, 1 June 2023
, 1 year ago→{{header|ATS}}: Forget the Boehm GC
(Added ATS.) |
(→{{header|ATS}}: Forget the Boehm GC) |
||
Line 58:
I know ATS can be very difficult to comprehend if you do not know the language, but there is not much "ATSism" in this code. It likely is readable by many. The following peculiarities do occur: some of the loops are written as tail recursions (which Schemers, ML-users, etc., probably will have no difficulty with), and there is C code embedded in the program in more than one way. I embed C code in part to avoid using libraries other than the ATS prelude, which is minimal.
The program will have to be linked with the C math library and with an allocator, which can be malloc(3)
<pre>patscc -O2 -std=gnu2x -
(It is my habit to tell patscc to use C beyond -std=c99)
▲<pre>patscc -O2 -std=gnu2x -DATS_MEMALLOC_GCBDW optics_simulation_analysis_task.dats -lgc -lm</pre>
<syntaxhighlight lang="ats">
|