I have added #ObjectIcon and #ATS --
https://rosettacode.org/wiki/Bernstein_basis_polynomials#ATS
#objecticon #ats #atslang #functionalprogramming
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.)
A new entry for #ObjectIcon --
Euler method - Rosetta Code https://rosettacode.org/wiki/Euler_method#ObjectIcon
#Icon #ObjectOriented #GoalDirected #EulerMethod #DifferentialEquations
#objecticon #icon #objectoriented #goaldirected #eulermethod #differentialequations
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.)
Come get your #ObjectIcon sources, people! A #programming #language you probably do not yet know: https://github.com/chemoelectric/objecticon
Easier to learn if you already know #Icon or #Unicon. Also if you know #Prolog or #Mercury, which are other languages that have goal-directed evaluation (which which are declarative, whereas the Icon family are procedural).
#objecticon #programming #language #icon #unicon #prolog #mercury
Come get your #ObjectIcon sources, people! A #programming #language you probably do not yet know: https://github.com/chemoelectric/objecticon
Easier to learn if you already know #Icon or #Unicon. Also if you know #Prolog or #Mercury, which are other languages that have goal-directed evaluation (which which are declarative, whereas the Icon family are procedural).
#objecticon #programming #language #icon #unicon #prolog #mercury
#ObjectIcon is one of those compilers that installs an executable as intermediate code with a shebang header that runs the intermediate code interpreter. So oipatch is something to rewrite the shebang header to point to a different location for the interpreter.
With that, you can do a staged install.
As it current comes (but perhaps not after I make changes, if I get to doing that), Object Icon is meant to be run where you built it. To me, that’s not acceptable.
Here is how I decided to work monotonic cubic splining (for color gradients) straight into the #ATS program:
chemoelectric / mandelbrot-viewer / [d4995d] /pchip2c.icn.m4 https://sourceforge.net/p/chemoelectric/mandelbrot-viewer/ci/default/tree/pchip2c.icn.m4
That is an #Icon/#Unicon program (or #ObjectIcon, depending on #m4 settings). What it does is take the output of passing the original PCHIP (not any of the derivatives) through f2c and make it buildable without f2c.h or libf2c.
Then I simply link the #ATS with that C code.
Mandelbrot set - Rosetta Code https://rosettacode.org/wiki/Mandelbrot_set#ObjectIcon
#Mandelbrot #MandelbrotSet #ObjectIcon #RosettaCode #ComputerProgramming
#mandelbrot #mandelbrotset #objecticon #rosettacode #computerprogramming
Okay, running the generated #ObjectIcon for the Mandelbrot program, and running the generated regular #Icon with the ‘Arizona’ compiler: the Object Icon is MUCH faster.
Because what I generate is a set of coroutines (passing along control in continuation passing style, except with only global variables) and regular Icon is probably using a separate pthread for each coroutine.
This has more portability and safety than in older versions (and in Unicon), but makes co-expressions SLOW.
I shall now add #Icon and #ObjectIcon to the languages vmc can output and I am going to do it with co-expressions. So we shall see a comparison of current Arizona Icon methods (probably pthreads) and those of Object Icon (linked stack frames).
Perhaps I could also install Unicon and get it into the mix. It would be using the AMD64 stack-switcher that (ahem) I wrote for it. (But I haven’t had Unicon installed for years. I’m bad.)
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 is 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, too. I have ideas for #ObjectIcon using co-expressions.
#ats #rosettacode #compiler #goto #objecticon
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.)
#objecticon #rosettacode #proceduralprogramming #logicprogramming
Oh, and any #ObjectIcon user (if there be any other than I) might find this useful: https://bitbucket.org/chemoelectric/chemoelectric-overlay/src/master/dev-lang/objecticon/files/oipatch.icn
It is needed by the Gentoo ebuild for staged installation. Icon-folk don’t think a lot about the needs of people doing installation.
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.)
BTW there a fourth method, beyond closures, inheritance, and unlimited polymorphism, is the co-expressions of #ObjectIcon and #Icon. Which I used, for those languages. (Also #Unicon)
A fifth option would be practically anything you can think up that uses call-with-current-continuation in Scheme. But I did the #Scheme with closures. :)
#objecticon #icon #unicon #scheme
My #ObjectIcon translated from #Dlang was a complete botch. It gave wrong answers! So I deleted it. But this #Icon code works:
https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n)#Icon
(To use it as ObjectIcon code would require a few tiny changes.)
In adding the #ObjectIcon I discovered there is a serious bug in the ObjectIcon runtime of the last revision:
Continued fraction/Arithmetic/G(matrix ng, continued fraction n) - Rosetta Code https://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_ng,_continued_fraction_n)#ObjectIcon
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.
#dlang #rosettacode #objecticon #scheme #commonlisp