3 ms·
Show HN: FXYT – Tiny, esoteric, stack-based, postfix, canvas colouring language
- denton-scratch 3y agoI can't find any way for one cell to be affected by the value of a different cell. I haven't thought about it much, but if there were syntax to allow references to adjacent cells, you could do stuff like convolution. Also, it would be nice to have (a) layers, and (b) alpha values. Pretty neat to jam it all into a small HTML page.
- jstanley 3y agoYou could compute the value of adjacent cells and use it in your formula.
- denton-scratch 3y agoI don't see how. There's no notation for addressing cells, and every cell runs the same formula. It's a bit like a spreadsheet, but with every cell running the same function. But with notation for addressing cells, you could make Conway's Game Of Life with a program just a dozen characters in length. With a z dimension and cell-addressing, you could probably create something like a weather model. But to be useful, you'd need a bigger canvas than 256x256. You could probably do some interesting things if the language allowed an arbitrary number of dimensions.
- jstanley 3y ago> There's no notation for addressing cells, and every cell runs the same formula. The adjacent cells are (X,Y-1), (X,Y+1), (X-1,Y), and (X+1,Y), you can use those values in your formula.
- denton-scratch 3y agoThanks! I didn't see that in the docs. That immediately makes it more interesting.
- harperlee 3y agoIt could be cool that layers are z dimension in terms of adjacency. It would also bring some challenges but hey, esoteric languages exist for the bold ones!
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- nickcw 3y agoI tried to write a mandlebrot plotter in FXYT. There are a number of challenges! First FXYT only provides a bounded loop - this can be overcome with a bit of inefficiency. However the deepest stack manipulation allowed is 3 values - the R command (Rotate the three values at the top of the data stack) which makes things supremely awkward. It could do with an PICK instruction (duplicate the n-th on the stack). However as an old FORTH programmer you always knew were getting into trouble if you used PICK. Despite these limitations I did figure out how to write a mandlebrot plotter. Alas it runs into an iterations limit if the depth is > 7, so here is a very low-res mandlebrot made with FXYT! NNNN7[SDDN1024/RDDN1024/R+N4096<[RN1+RR]SDDN1024/RDDN1024/R+N4096<![PPN4000N4000]SDDN1024/RDDN1024/RS-XN128-N12N512-+RRN512/YN128-N12+]PPN30 You can cut and paste the string above into https://susam.net/fxyt.html https://susam.net/fxyt.html if you wish to see it! Edit - looks like HN formatting mashes the code... This link should work https://susam.net/fxyt.html#NNNN7bSDDpN1024qRDDpN1024qRsN4096lbRN1sRRcSDDpN1024qRDDpN1024qRsN4096libPPN4000N4000cSDDpN1024qRDDpN1024qRSdXN128dN12pN512dsRRpN512qYN128dN12pscPPN30p https://susam.net/fxyt.html#NNNN7bSDDpN1024qRDDpN1024qRsN409...
- susam 3y agoGreat demo! Thanks for sharing! Copying the un-mangled code here for future reference: NNNN7[SDD*N1024/RDD*N1024/R+N4096<[RN1+RR]SDD*N1024/RDD*N1024/R+N4096<![PPN4000N4000]SDD*N1024/RDD*N1024/RS-XN128-N12*N512-+RR*N512/YN128-N12*+]PPN30* If you start a line in HN comment with 2 spaces, the line is reproduced verbatim. See https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc for more details about this.
- duckman1 3y ago[dead]
- pyinstallwoes 3y agoSo every pixel/coordinate can hold 3 bits? Hmm, that is alluring and potentially quite advantageous for storage and computationally aware coordinate spaces.
- jasonjmcghee 3y agoReminds me of https://tixy.land https://tixy.land popular on HN a few years ago https://news.ycombinator.com/item?id=24974534 https://news.ycombinator.com/item?id=24974534 Edit: Ah > This project is inspired by Martin Kleppe's Tixy project