#rosettacode — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #rosettacode, 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: New Rosetta Code task
I wrote a new #RosettaCode task of interest to both #ATS fans and #fonts fans:
Steffensen's method - Rosetta Code https://rosettacode.org/wiki/Steffensen%27s_method
Incidentally, before being smart and using #MetaPost for the graphic (the only SW I should have considered, aside from #Asymptote), I tried using the software formerly known as FF, but which did nothing but crash. I mean, really, it did nothing but crash. FontCrash, it will be called.
cc: @khaled
-
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 just added a task to #RosettaCode, so have at it!
Bernstein basis polynomials - Rosetta Code https://rosettacode.org/wiki/Bernstein_basis_polynomials
-
CW: Rosetta Code: NEW TASK!!!!!!!!!
I just added a task to #RosettaCode, so have at it!
Bernstein basis polynomials - Rosetta Code https://rosettacode.org/wiki/Bernstein_basis_polynomials
-
CW: Rosetta Code: NEW TASK!!!!!!!!!
I just added a task to #RosettaCode, so have at it!
Bernstein basis polynomials - Rosetta Code https://rosettacode.org/wiki/Bernstein_basis_polynomials
-
CW: Rosetta Code: NEW TASK!!!!!!!!!
I just added a task to #RosettaCode, so have at it!
Bernstein basis polynomials - Rosetta Code https://rosettacode.org/wiki/Bernstein_basis_polynomials
-
CW: Rosetta Code: NEW TASK!!!!!!!!!
I just added a task to #RosettaCode, so have at it!
Bernstein basis polynomials - Rosetta Code https://rosettacode.org/wiki/Bernstein_basis_polynomials
-
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 --
-
CW: Rosetta Code and ATS
A little #RosettaCode example of a Maybe #monad, in #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, 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 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
Anti-aliased straight line drawing, implemented in #ObjectIcon (using the drawing of individual pixels, rather than cheating):
Xiaolin Wu's line algorithm - Rosetta Code https://rosettacode.org/wiki/Xiaolin_Wu's_line_algorithm#ObjectIcon
(I discovered (a) that ‘variable’ does what Parlett documented, even though it is different from what ‘variable’ does in Icon; (b) there are major bugs in ipl.math(ExtMath). I have marked them ‘SEVERE BUG’ in my issues tracker. Easy to fix, but not today.)
-
CW: Computer programming
I hope that so far I have AT LEAST done enough to prevent #ObjectIcon disappearing into nowhere.
Now I have to go mention the new repo on #RosettaCode. I’ll just make a handwritten note, for now.
Of course, any RC contributor can make the changes. But one shouldn’t give the impression I plan to be a ‘maintainer’. I’m an older, disabled person simply providing the thing in the most forkable way.
(Were it my own project, it would surely be in a Mercurial archive, not Git.)
-
CW: Rosetta Code and Object Icon
Mandelbrot set - Rosetta Code https://rosettacode.org/wiki/Mandelbrot_set#ObjectIcon
#Mandelbrot #MandelbrotSet #ObjectIcon #RosettaCode #ComputerProgramming
-
CW: Rosetta Code
A #RosettaCode #quaternion task entry for both #OtusLisp and ‘regular’ #Scheme --
Quaternion type - Rosetta Code https://rosettacode.org/wiki/Quaternion_type#Ol
-
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 went ahead and wrote a Virtual Machine to #ATS translator for the #RosettaCode #compiler task series:
Compiler/virtual machine interpreter - Rosetta Code https://rosettacode.org/wiki/Compiler/virtual_machine_interpreter#Compiler
The thing’s designed to make it relatively easy to handle many other languages. Languages with #goto should be easy to do, for instance: convert the program to one procedure with a lot of goto in it. And #Scheme could be done easily. I have ideas for #ObjectIcon and co-expressions.
-
CW: Rosetta Code
Finally (at least for today), here is a second #Fortran program:
-
CW: Rosetta Code
Lo and behold, now #OwlLisp (a dialect of #Scheme without anything mutable in it):
https://rosettacode.org/wiki/Modular_arithmetic#Owl_Lisp
#RosettaCode #ModularArithmetic #FunctionalProgramming #Lisp
-
CW: Rosetta Code
I have added #ObjectIcon --
https://rosettacode.org/wiki/Modular_arithmetic#ObjectIcon#RosettaCode #ProceduralProgramming
(I will not call this an example of #LogicProgramming, given that I never use goal-direction or failure in any significant way. But #ObjectOriented does apply.)
-
CW: Rosetta Code
I just keep going. It is a pretty simple task. I did more than was called for, in the #ATS example I did first.
Here is #Fortran --
https://rosettacode.org/wiki/Modular_arithmetic#Fortran
As with the ATS, I use a macro, although the macro system is not as capable as that of ATS.
(I used the C preprocessor. There was once a standard Fortran preprocessor, but it was removed from the standard. Nobody used it. Everyone used the C preprocessor, m4, or some such.)
-
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 now added #Oberon2 --
https://rosettacode.org/wiki/Modular_inverse#Oberon-2
(UPDATE: Now with bugfix and regression test.)
-
CW: Rosetta Code
I have now added #Oberon2 --
https://rosettacode.org/wiki/Modular_inverse#Oberon-2
(UPDATE: Now with bugfix and regression test.)
-
CW: Rosetta Code
I have now added #Oberon2 --
https://rosettacode.org/wiki/Modular_inverse#Oberon-2
(UPDATE: Now with bugfix and regression test.)
-
CW: Rosetta Code
I have now added #Oberon2 --
https://rosettacode.org/wiki/Modular_inverse#Oberon-2
(UPDATE: Now with bugfix and regression test.)
-
CW: Rosetta Code
And now I did #zsh :
https://rosettacode.org/wiki/Modular_exponentiation#zsh
But really it is #GNU #expr doing the work. I had considered using GNU #bc instead. Basically anything that can do the calculation. Unix-users in the old days often liked hoc; maybe there is a hoc implementation you could use. :)
-
CW: Rosetta Code
Now I have done the #ObjectIcon --
https://rosettacode.org/wiki/Modular_exponentiation#ObjectIcon
I hope to one day host the Object Icon sources myself, but you can get the last version by the author at Sourceforge. And my ‘chemoelectric’ overlay has a live ebuild for Gentoo. (I should make a ‘dead’ ebuild with a date as version, since the sources are no longer changing unless I make the changes.)
-
CW: Computer programming on :gentoo:
I have hacked out a #Gentoo ebuild for the Oxford #Oberon2 Compiler:
chemoelectric / chemoelectric-overlay / dev-lang / obc — Bitbucket https://bitbucket.org/chemoelectric/chemoelectric-overlay/src/master/dev-lang/obc/
For the #RosettaCode buffs who program in all the languages except those they hate, and sometimes even in those they hate.
-
CW: Computer programming on :gentoo:
I have hacked out a #Gentoo ebuild for the Oxford #Oberon2 Compiler:
chemoelectric / chemoelectric-overlay / dev-lang / obc — Bitbucket https://bitbucket.org/chemoelectric/chemoelectric-overlay/src/master/dev-lang/obc/
For the #RosettaCode buffs who program in all the languages except those they hate, and sometimes even in those they hate.
-
CW: Computer programming on :gentoo:
I have hacked out a #Gentoo ebuild for the Oxford #Oberon2 Compiler:
chemoelectric / chemoelectric-overlay / dev-lang / obc — Bitbucket https://bitbucket.org/chemoelectric/chemoelectric-overlay/src/master/dev-lang/obc/
For the #RosettaCode buffs who program in all the languages except those they hate, and sometimes even in those they hate.
-
CW: Computer programming on :gentoo:
I have hacked out a #Gentoo ebuild for the Oxford #Oberon2 Compiler:
chemoelectric / chemoelectric-overlay / dev-lang / obc — Bitbucket https://bitbucket.org/chemoelectric/chemoelectric-overlay/src/master/dev-lang/obc/
For the #RosettaCode buffs who program in all the languages except those they hate, and sometimes even in those they hate.
-
CW: Rosetta Code
It is not too often that I add a #Dlang example to #RosettaCode :
Continued fraction/Arithmetic/G(matrix ng, continued fraction n) - Rosetta Code https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n)#D
In fact, I think this is just the second time. I do not like this style of programming (even though #ObjectIcon is much alike and I hope to be its advocate in the absence of its author).
Yesterday I added a second #Scheme implementation (I also did the first) and #CommonLisp for this task.