#atslang — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #atslang, aggregated by home.social.
-
CW: Rosetta Code/ATS
Here you go, numerous #ATS fans, another #Mathematics #RosettaCode contribution in #ATSlang --
https://rosettacode.org/wiki/Determine_if_two_triangles_overlap#ATS
-
CW: Rosetta Code and ATS
A #RosettaCode contribution for #ATS -- the old insideness of a convex hull algorithm. I decided to do this because I am likely to stick the algorithm within my next Bézier intersection algorithm (which will be coded in Ada using homogeneous geometric algebra, not in ATS using euclidean, but whatever) --
Find if a point is within a triangle - Rosetta Code https://rosettacode.org/wiki/Find_if_a_point_is_within_a_triangle#ATS
-
CW: Rosetta Code Bézier intersections task
Have at it, #fonts nerds and #graphics weirdos! A #RosettaCode task for y’all:
Bézier curves/Intersections - Rosetta Code https://rosettacode.org/wiki/B%C3%A9zier_curves/Intersections
-
CW: Rosetta Code and ATS
-
CW: Rosetta Code/ATS
There is a new #ATS example at #RosettaCode, part of my nascent tendentious series of simulations that show quantum physicists are entirely wrong in some of their beliefs:
https://rosettacode.org/wiki/Simulated_optics_experiment/Simulator
This #ATSlang code is all or mostly free of the proofs and complicated call by reference you often see in my ATS code. You could translate it straight into OCaml or SML. It is a simulation, supposedly impossible, of experiments you sometimes see hyped in the news, but which are stupid.
-
CW: Rosetta Code: NEW TASK!!!!!!!!!
I have added #ObjectIcon and #ATS --
https://rosettacode.org/wiki/Bernstein_basis_polynomials#ATS#ATSlang #FunctionalProgramming
Addendum: Others have been adding examples, too, so far in languages with which I am unfamiliar.
-
Some #RealTime #ObjectOriented programming in #ATS for #RosettaCode. And I mean really #OO, not type hierarchy masquerading as OO. Communicating objects.
There is no type hierarchy, because none is needed. One can use a closure to connect two objects, as long as the connection is compatible at both ends.
And there is just one thread, because why in heck would you need two threads, just to read the time on the clock??????
-
CW: Rosetta Code and ATS
Some naïve quadrature implementations, in #ATS, for #RosettaCode --
-
Another #ATS example for #RosettaCode fans!
https://rosettacode.org/wiki/Long_multiplication#ATS
This is long multiplication, which I have used here to solve two distinct problems.
The designer of the task must never have realized you could do this in something other than BCD and end up not having a carry ever occur.
-
I added #ATS to the #RosettaCode for Adaptive Simpson Quadrature: https://rosettacode.org/wiki/Numerical_integration/Adaptive_Simpson's_method#ATS
I also made some revisions to the text of the draft task.
-
CW: Rosetta Code and ATS
Last for the day: some quadrature instead of array stuff:
https://rosettacode.org/wiki/Numerical_integration/Gauss-Legendre_Quadrature#ATS
-
CW: Rosetta Code and ATS
But back to Gaussian elimination, we have LU decomposition: https://rosettacode.org/wiki/LU_decomposition#ATS
-
CW: Rosetta Code and ATS
Now for something (in)completely different: Cholesky decomposition.
-
CW: Rosetta Code and ATS
And here is the same code again modified, this time to find the reduced row echelon form of a matrix:
-
CW: Rosetta Code and ATS
Now I have added Gaussian elimination with back substitution:
-
CW: Rosetta Code and ATS
And now I have added the #RosettaCode task for Gauss-Jordan matrix inversion:
https://rosettacode.org/wiki/Gauss-Jordan_matrix_inversion#ATS
-
CW: Rosetta Code and ATS
Here is some significant #ATS code, albeit not an optimized implementation: #QRDecomposition (#QRFactorization) for #RosettaCode --
-
(Yes, nested loops/tail recursions might be slightly faster, but in #ATSlang are likely to be wordier and not enough faster to matter. Though for this particular problem you could use the for-loop notation with relative ease.
Whether nested loops or one overall loop is simpler to write depends on the language and style.)
-
CW: Rosetta Code and ATS
A little #RosettaCode example of a Maybe #monad, in #ATS --
-
CW: Rosetta Code and ATS
A silly little #ATS program:
Brownian tree - Rosetta Code https://rosettacode.org/wiki/Brownian_tree#ATS
-
CW: Rosetta Code and ATS
Alright, you many, many #ATS fanatics. I have a treat for you: four #RosettaCode tasks at once!
https://rosettacode.org/wiki/Bresenham_tasks_in_ATS
#ATSlang #FunctionalProgramming #GraphicsProgramming #Fonts
Sure, one can use SDL2 or whatever to draw lines, and, sure, these figures have "aliasing", but the tasks call for aliased figures. (I already did antialiased lines in ATS for a different task.)
-
CW: Rosetta Code/ATS
Okay, here’s another #ATS #ATSlang program in the raster image category:
https://rosettacode.org/wiki/Bitmap/PPM_conversion_through_a_pipe#ATS
It does seem advantageous in some respects to use ImageMagick THIS way, instead of using libmagick.
-
CW: Rosetta Code/ATS
-
CW: Rosetta Code/ATS
-
CW: Rosetta Code/ATS
-
CW: Rosetta Code/ATS
-
CW: Rosetta Code/ATS
I got rid of the need for floating point and the math library:
-
CW: Rosetta Code/ATS
Now the #grayscale task, and you’ll need even newer versions of bitmap_task.{sats,dats}:
-
CW: Rosetta Code/ATS
Okay, you NUMEROUS fans of #ATS, I have done the next step in that set of #RosettaCode tasks dealing with #pixmaps (#bitmaps):
https://rosettacode.org/wiki/Bitmap/Write_a_PPM_file#ATS
You have to get new versions of the earlier files, if you looked at those before. There is a link to them at the top of this entry.
-
CW: Rosetta Code/ATS
I have started a set of #pixmap = #bitmap manipulation tasks (since when do we pretend a color image is a ‘bitmap’?) with an #ATS contribution to the very first of the tasks:
https://rosettacode.org/wiki/Bitmap#ATShttps://rosettacode.org/wiki/Bitmap#ATS
I went back to doing things at a low level, which my readers surely will appreciate. So the code is lengthy, given what is being done.
And safety is important, so notice that if a ‘load’ fails you still get valid image data (an image filled with one color).
-
CW: Rosetta Code/ATS
I have added another #ATS example to #RosettaCode, this time for a strangely named ‘Munching Squares’ task:
https://rosettacode.org/wiki/Munching_squares#ATS
(The reason I say the task is strangely named is that ‘Munching Squares’ is an animation. Perhaps the task is not adequately fleshed out. I did what I thought it wanted.)
-
CW: Rosetta Code and ATS
Okay, you #ATS fans, whom I know to be plentiful! Here is the #RosettaCode task for drawing antialiased straight lines, done in ATS:
https://rosettacode.org/wiki/Xiaolin_Wu's_line_algorithm#ATS
-
CW: Rosetta Code and ATS
My latest addition to the #ATS repertoire of #RosettaCode -- an implementation of the #Quaternion type task --
Quaternion type - Rosetta Code https://rosettacode.org/wiki/Quaternion_type#ATS
Also related to ATS, I posted the #m4 output of vmc (which I wrote in ATS) to the #Mandelbrot set task:
-
CW: Rosetta Code
This #compiler for the #RosettaCode Virtual Machine assembly language can now target any of #ATS, #C, #Mercury, or #Scheme --
https://sourceforge.net/p/chemoelectric/rosettacode-contributions/ci/default/tree/vmc.dats
The Scheme code runs very fast in #ChezScheme, so-so in all else I have tried. I wonder how they do it. Maybe a lot of C code (instead of Scheme) in the runtime is part of it?
The generated Mercury is not so fast, but such is life with Mercury. It’s fastish, considering.
-
CW: Rosetta Code
I have added #ATS to the languages for which there is a solution to the #RosettaCode #ModularArithmetic task:
Modular arithmetic - Rosetta Code https://rosettacode.org/wiki/Modular_arithmetic#ATS
This task was practically tailor-made for #Ada. :) But ATS lets us easily extend the language to handle modular numbers.
#ATSlang #FunctionalProgramming #Proofs
Update: After reading the task language again, I added some more commentary, to point out what I see as a flaw in the task.
-
CW: Rosetta Code
I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n1,_continued_fraction_n2)#Using_multiple_precision_numbers
I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...
-
CW: Rosetta Code
I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n1,_continued_fraction_n2)#Using_multiple_precision_numbers
I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...
-
CW: Rosetta Code
I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n1,_continued_fraction_n2)#Using_multiple_precision_numbers
I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...
-
CW: Rosetta Code
I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n1,_continued_fraction_n2)#Using_multiple_precision_numbers
I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...