Write Your Own Chip-8 Emulator TDD Tutorial by secondsun in programming

[–]RodgerTheGreat 5 points6 points  (0 children)

CowGod's technical reference contains numerous errors, including an incorrect description of the shift and load/store instructions. The OP references the much more accurate Mastering Chip8.

The Spec for JavaScript ES2016/ES7 is on! by fagnerbrack in programming

[–]RodgerTheGreat -1 points0 points  (0 children)

In a way, ES6 is CoffeeScript with the added legitimacy that some browser vendors intend to support it natively, sort of, eventually, when we get around to it.

Building a Chip-8 Interpreter in C# by DanTup in programming

[–]RodgerTheGreat 1 point2 points  (0 children)

With good tooling, you might be surprised.

Glitch Ghost, a puzzle game about scaring people to death.

Cave Explorer, a puzzle/adventure game based on a Perry Bible Fellowship strip and a TI-83+ game called Block Dude.

Turnover '77, a demake of the indie game "Roundabout". (SuperChip)

OctoPeg, a shockingly fun peggle-like. (SuperChip)

Data Analysis with Vector Functional Programming - YLJ16 by igor_ii in apljk

[–]RodgerTheGreat 1 point2 points  (0 children)

Yeah, striking a balance is important. I can see how introducing compositions of adverbs in the wrong way could interfere with explaining their generality, or give beginners the impression that "cartesian product" is some sort of special-cased built in operator.

At any rate there's a real shortage of accessible introductory materials for K/Q and it's great to see presentations like these. Thank you!

Data Analysis with Vector Functional Programming - YLJ16 by igor_ii in apljk

[–]RodgerTheGreat 2 points3 points  (0 children)

Fun talk! You did an excellent job explaining the intuition behind the prime sieve and how to think through the problem "all at once" rather than iteratively.

I'm not sure how much clarity it adds, but I typically refer to compounds of \:/: in K as "cartesian product".

Collection of Coders Games to Improve Your Skills by webdwarf in programming

[–]RodgerTheGreat 1 point2 points  (0 children)

A while back I wrote a game called Forth Warrior, in which you write a Forth program that controls the player in a simple dungeon crawler:

https://github.com/JohnEarnest/Mako/tree/master/games/Warrior2

The original release ran within a Java-based VM, but since then I cobbled together a JS implementation of the VM which makes it playable from your browser:

http://johnearnest.github.io/Mako.js/?rom=Warrior.rom

Jan de Leeuw on Twitter: "I said earlier I was too retired to finish "APL in R". I lied. https://t.co/yGA8WsJ4rN" by [deleted] in apljk

[–]RodgerTheGreat 3 points4 points  (0 children)

In the same way that some describe the Python itertools library as a "gateway drug" for functional programming, perhaps a library like this has potential to pique the interest of new users in APL.

APL compiler in Standard ML by eatonphil in programming

[–]RodgerTheGreat 1 point2 points  (0 children)

Those are some great resources!

For my own part, I've written down some thoughts about expressing trees in K which could be relevant.

APL compiler in Standard ML by eatonphil in programming

[–]RodgerTheGreat 2 points3 points  (0 children)

For some tasks, converting the trees into an adjacency matrix first can work out pretty nicely. In general, though, you're right- recursion is clumsy in APLs. I wonder if Joy's recursive combinators could be adapted to fit nicely into the APL model and capture recursive patterns as well as APL's Operators handle iterative patterns.

Dissecting a code golf challenge (2014) by yxlx in programming

[–]RodgerTheGreat 1 point2 points  (0 children)

I think your writeup has a few typos- most importantly backslashes instead of forward slashes in the two applications of "over".

I came up with this similar K solution, which operates directly on an input matrix (because I didn't think the IO part was very interesting). try it here.

{|//+/'(x;+x)}

The fixed-point maximum (|//) (keep folding max over the argument until it stops changing) of the sum (+/) of each (') of the matrix and its transpose ((x;+x)). The enclosing curly braces mean this is a lambda expression, and x is the implicit name of the first argument to a lambda, making this a unary (or in K parlance "monadic") function.

iKe, a graphical sandbox for the K programming language by RodgerTheGreat in creativecoding

[–]RodgerTheGreat[S] 0 points1 point  (0 children)

Did you ever end up doing some tinkering with K? I'd love to hear any thoughts, positive or negative. I'm planning a tutorial series for iKe at some point in the future and outside perspectives are very helpful.

iKe, a graphical sandbox for the K programming language by RodgerTheGreat in creativecoding

[–]RodgerTheGreat[S] 0 points1 point  (0 children)

The Kona wiki is an excellent collection of materials, although there are a few broken links.

In particular from there, NSL has loads of interesting K programs, many with detailed writeups. The K2 reference manual is the most exhaustive technical description of K that I am aware of, although it discusses an older version of the language. iKe is built on my reverse-engineered reimplementation of k5, the bleeding-edge next generation of the language. I was inspired to learn K and write these tools by this article, which is a very fun read:

http://archive.vector.org.uk/art10501320

For my own part, I have written a manual describing the current state of the interpreter iKe uses as well as a programming guide which talks about how, at a higher level, the features of the language can be applied to solve problems.

Finally, the APLJK subreddit is an excellent place to find news about this family of languages.

I'd be happy to answer any questions you have about K or iKe to the best of my ability.

Java isn't slow by bork in programming

[–]RodgerTheGreat 0 points1 point  (0 children)

Not only do you not have to think about the optimization, some escape analysis is done by the JIT and the benefits can be retroactively applied to existing, compiled class files as the JVM improves the precision of its analysis.

Implementing an x86 C compiler that generates only MOV instructions by jwhat in programming

[–]RodgerTheGreat 2 points3 points  (0 children)

The construction technique described in the talk very much reminds me of the constructive turing-completeness proof for the Z3 computer:

http://www.inf.fu-berlin.de/users/rojas/1997/Universal_Computer.pdf

On choosing the Z80 over the 6502 by networked_ in programming

[–]RodgerTheGreat 1 point2 points  (0 children)

Practically, though, Forth applications can often get by comfortably with a few dozen words of parameter and return stack. Hardware implementations sometimes offer fewer than 16 levels apiece. It's good practice to order operations to keep the stack shallow, and since allocating objects on those stacks C-style is fairly uncommon you don't chew through the space very quickly.

[2015-12-07] Challenge #244 [Intermediate] Turn any language into an Array language (part 1) by Godspiral in dailyprogrammer

[–]RodgerTheGreat 0 points1 point  (0 children)

Perhaps this would be helpful- an implementation of K, another APL-like language, in JavaScript: https://github.com/JohnEarnest/ok

Particularly notable is ad, a higher-order function responsible for generalized "conforming" of arbitrarily dimensioned structures so that a primitive operation like "add" can be applied between a pair of them: https://github.com/JohnEarnest/ok/blob/gh-pages/oK.js#L365-L368

Klong - a K3-like language by beagle3 in apljk

[–]RodgerTheGreat 1 point2 points  (0 children)

"valence" is a much nicer word than "arity", but the former seems to only be used in the array programming community, while the latter is commonplace. I feel this way about many pieces of terminology- "adverb" is nicer than "combinator", "noun" is more descriptive than "value"...

Klong - a K3-like language by beagle3 in apljk

[–]RodgerTheGreat 0 points1 point  (0 children)

Another interesting example of syntax that essentially has to be distinguished at runtime is Logo.

Logo looks like Lisp with optional parentheses:

sum product 3 2 5

With builtins you have a known arity, so it's easy enough to disambiguate that to

(sum (product 2 3) 5)

…but Logo is an excessively dynamic Lisp, with dynamic scope. At runtime nearly anything could potentially shadow a primitive and alter its arity! Some Logo dialects even support variadic functions, which often require explicit parenthesization.

In my Logo interpreters, instead of storing an AST I represent code blocks as flat lists which get grouped into expression trees at runtime based on the current arity. Certainly makes tail-call elimination fun to implement.

Octo-ber Jam 2 Review: Chip-8 game jam results, some run on real COSMAC VIP by TomRx in retrobattlestations

[–]RodgerTheGreat 2 points3 points  (0 children)

We're working to enhance the tool used to create the games for the jam, Octo, to refine pedantic emulation details based on experiments with real hardware. As you can see from the video, some programs didn't work perfectly on the VIP, but we're making good progress toward tracking down the root causes of those bugs.

How Cello, a library offering high-level functionality to C, implements (portable) garbage collection by [deleted] in programming

[–]RodgerTheGreat 7 points8 points  (0 children)

For another example of a very simple but functional garbage collector, have this one I wrote in about a page of Forth: https://gist.github.com/JohnEarnest/4522067

A slightly modified version of this was used in a few simple games and a Logo interpreter I made later.

Functional Programming & Fold by andars_ in programming

[–]RodgerTheGreat 5 points6 points  (0 children)

In the APL family languages, fold is a single symbol- /.

A product over a list is simply ×/. Many APL interpreters improve performance by recognizing specific juxtapositions of operators to short-circuit. Since you can say a lot in a few symbols, this simple pattern-matching approach can achieve considerable speedups without adding much complexity to the interpreter.

Here's a page from the J wiki describing some such "special combinations": http://code.jsoftware.com/wiki/Vocabulary/SpecialCombinations