Post B4xrQTYKSr2Sgd7lcO by andnull@social.nouveau.community
(DIR) More posts by andnull@social.nouveau.community
(DIR) Post #B4xlPtxoBTnuaHNwFU by neauoire@merveilles.town
0 likes, 0 repeats
For a while now I've been wanting a generic notation to explain various things on my wiki(tropical arithmetic, multisets, other programming languages, ternary logic, primes, etc..) and I found a PL design I really enjoy writing. It lands in a weird place, I feel like it might be the only concatenative language without a stack? As far as I know anyways.I took a day to implement it, and shoved it into a little interactive playground. I have yet to populate the examples.https://wiki.xxiivv.com/site/rejoicehttps://wiki.xxiivv.com/etc/rejoicerepl/
(DIR) Post #B4xm2xMfTPCmQSdTcG by angelwood@merveilles.town
0 likes, 0 repeats
@neauoire I wish there was a wiki. xxiivv.com book I could buy, the sheer amount of super unique ideas and rabbitholes you've written about have infected my mind to the point where I have had sleepless nights thinking about what I read
(DIR) Post #B4xmCDV0r2wP4YxFJY by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire This may be the first concatenative notation for a counter machine that isn't rule-based. There is at least one deque catlang that has been made.Also, based on our talks of how rejoice executes, would you have a ton of junk operation in your call queue?
(DIR) Post #B4xmKWIkpe8hhgBECu by neauoire@merveilles.town
0 likes, 0 repeats
@andnull yeah, but no junk, only the whole program basically. Kind of like Joy I suppose?ex:
(DIR) Post #B4xmev9y7RkiaknZdg by neauoire@merveilles.town
0 likes, 0 repeats
@angelwood it's too "lively" it changes all the time. I must do about 20ish changes daily, it holds the current state of my understanding of various topics, but it's constantly growing.
(DIR) Post #B4xmiauFMaeMw1CEmu by d6@merveilles.town
0 likes, 0 repeats
@neauoire @angelwood wiki -> pdf export program for e-readers
(DIR) Post #B4xrQTYKSr2Sgd7lcO by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire Poking around and reading the docs, it seems like things are a bit different from the last time I peak at Rejoice. I was thinking when it was still "replace symbol with definition".times^5@Loop Loop/times junkI believe before this would have left a bunch of unevaluated junk items in the pending queue. The end result would have been [junk^5] but now it's [junk]. Gonna make recursion tricky cause you essentially only have tail recursion. The non-determinism of multiple address compounding that :stacky_thinking:
(DIR) Post #B4xxvNwpx5K00Qi3ua by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire A simple demonstration of the "multiple label" behavior in your implementation of Rejoice. Could be worth adding as an example of what can/could happen.[JumpA JumpB JumpC]@JumpA a@JumpB b@JumpC c[] [JumpA JumpB JumpC] a b c [] c [c] b c [b c] a b c [a b c] b c [a b^2 c] c [a b^2 c^2]
(DIR) Post #B4xxvOGKmauwytpdIm by neauoire@merveilles.town
0 likes, 0 repeats
@andnull Yes! I have a ton of explaining to do still, this is kind of a early draft. Right now there's no subroutine calls, so it's quite limiting. I'm not sure how close to a full programming language I want to get yet.
(DIR) Post #B4xyLyceDhylHKwisi by ragekit@mastodon.gamedev.place
0 likes, 0 repeats
@neauoire that looks neat, but how do you use this for your goal of generication notation ?
(DIR) Post #B4xyLz4eXaNegC35X6 by neauoire@merveilles.town
0 likes, 0 repeats
@ragekit I often write about logic, fractions or natural numbers, so I might have a bit on prime factor that will use numbers:18 * 2/3, or 2 * 3^2 * 2/3In some pages, I'll name primes instead of playing with numbers to make things for explicit.[red blue^2] red/blueThis is the sort of representation that I have on various pages, but it wasn't really "specified" anywhere, and it wasn't evaluatable. Good examples of pages where I mean to use it are:https://wiki.xxiivv.com/site/binaryhttps://wiki.xxiivv.com/site/primeshttps://wiki.xxiivv.com/site/tropical_arithmetichttps://wiki.xxiivv.com/site/reversible_computinghttps://wiki.xxiivv.com/site/ternary_computingI can use this little playground to cover all that material, and instead of making up new notations for each page, it'll all come down to that one style:[bag] [put^2]/take-away
(DIR) Post #B4xyXqn3ALcOSjTQHI by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire Subroutines would irocinally be falling back into typical FRACTRAN. But with the power to specify many loops and decode prefix tree*. I have a multistack esolang specdraft called AGAIN built around that idea. Gonna be updating it Eventually (tm) with HERE/LEAVE operations.* I can show what I mean in a bit
(DIR) Post #B4xyiM4xgnl6OnrQ4u by neauoire@merveilles.town
0 likes, 0 repeats
@andnull the idea here was to have exactly that fractran but with GOTOs, to do away with the cost of scanning the entire program everytime, not that I need speed for this, but it comes with more readable programs as well, which I wanted. I tried a lispy UX at first(Bägel), but it was clumsy, it seemed like catlang was, once again, hitting all the marks.I think the main point I'm going for is to have multisets as datastructure, concatenation flow ended up being what was most natural.If I don't need subroutines to explain some of the stuff I'll use this for, I think.. I might just not add them X) We'll see, tail recursion might be enough.
(DIR) Post #B4y046DJSNQzWDhOvQ by andnull@social.nouveau.community
0 likes, 1 repeats
@neauoire Okay, messing about. I have an example of what subroutines with returns look like in Rejoice:done-a PutAs @DoneA done-b PutBs @DoneBdone-add A+B->C @DoneAdd .#c@PutBs b b b b b Return@A+B->C @A->C [c A->C]/a @B->C [c B->C]/b Return@PutAs a a a Return@Return [DoneA]/done-a [DoneB]/done-b [DoneAdd]/done-addBasically, push a symbol the mark your return point then jump to the subroutine. Once the subroutine ends jump to your return handler. The return handler then finds the "entry" point you program should return to. Surprisingly graceful construct compared to how I thought it'd look.
(DIR) Post #B4y0W60DpqSoyKvSXQ by neauoire@merveilles.town
0 likes, 0 repeats
@andnull WOA WAT
(DIR) Post #B4y0e8X4JUdn8Q7isK by neauoire@merveilles.town
0 likes, 0 repeats
@andnull You made a sort of return lobby where it sends you back wherever you need to go.This is so cool, I hadn't thought of that AT ALL, you're good..
(DIR) Post #B4y0g776YjxNJVvDyy by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire This kinda of "mapping return locations to symbols" is partially what inspired AGAIN. In this cause, it doesn't have gotos (aside from AGAIN which jumps to the top of the program), but you can emulate gotos by pushing a prefix to the code you want to run.In the case of Rejoice, you push a symbol that can be decoded into an address to return back to.
(DIR) Post #B4y0p7WaOttRC88SAa by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire I love a good puzzle on how to emulate typical behaviors in atypical systems
(DIR) Post #B4y0qjS6s5jN7CoI4m by fkinoshita@merveilles.town
0 likes, 0 repeats
@neauoire @angelwood make yearly releases like "xxiivv as of 2026" then new editions can start with a gigantic list of everything that changed since!
(DIR) Post #B4y0xxpJpIUPiv79Rw by neauoire@merveilles.town
0 likes, 0 repeats
@andnull Is it alright if I shape this example in a way I can document it on the page? I think it's quite cool, I don't think I've ever come across this way of emulating subroutines. Do you happen to have fizzbuzz or tictactoe in AGAIN?
(DIR) Post #B4y1918pqI7FBoVuTI by neauoire@merveilles.town
0 likes, 0 repeats
@andnull ok I see how AGAIN is similar, you can never jump forward in again right? Other than walking over a bunch of IF..END blocks.Oh this is so cool, I hadn't caught this the first time I read through your posts about AGAIN.
(DIR) Post #B4y1bAWaY8xsOo31GK by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire 1) feel free to lift whatever you want from AGAIN. It's a very conceptual page rn.2) Not, yet, I need to write an interpreter for AGAIN. It currently exist as a little thought experiment / unimplemented specthing. I could make that my little task for tomorrow.3) That is correct, AGAIN can only jump backwards via AGAIN or forwards with IF/END. Rejoice is more flexible since there is arbitrary jumps forwards and backwards. However, both are share the limitation that you have no return stack of addresses. Thus you need a mechanism for turning Symbols into Locations. In AGAIN, it's via "walk a prefix". For Rejoice it's "decode a symbol to an address using a LUT".
(DIR) Post #B4y6rwMUxX1zAT92KO by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire I have been kinda obsessed with like:Every program can be describe as prefix trees to specific instruction.Event-based programming is kinda like searching for an entry point into a function with multiple starting points.How do you do function calls when all you have is symbols, conditional control-flow, and loops.I kinda have a small notebook filled with scribbles that need writing at some point.
(DIR) Post #B4y6rwdruwvS2LGuP2 by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire Also, state machines, I have just been obsessed with state machine lately.
(DIR) Post #B4y6rwmNPJjOSjFhfE by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire I guess a short way to put this whole thing: you have to encode call/return as a set of state transition when you don't have return addresses.
(DIR) Post #B4y6rwvEsMouuDOmTg by neauoire@merveilles.town
0 likes, 0 repeats
@andnull just got back from dinner, I'll experiment with these return trampolines of yours! You have excellent intuition for these really bizarre systems, I love to see you do your magic like that. :moomin_eyes:
(DIR) Post #B4y7KQxQnZtsAQ0T4q by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire What's fun is this lends naturally to say...@OnScreen ( -- ) ... Done@OnTick ( frame -- ) ... Done@Done ( possible co-routines in the bag or something ) ...
(DIR) Post #B4y7WJB1YM5jVi1iRk by ragekit@mastodon.gamedev.place
0 likes, 0 repeats
@neauoire oh so it's showing step by step some combinatorial logic ?
(DIR) Post #B4y7WJVaJuXQXTe8Ui by neauoire@merveilles.town
0 likes, 0 repeats
@ragekit yes, exactly! But it's unordered, there's no difference between [a b] and [b a], so it has some limits to what it can express clearly :)
(DIR) Post #B4y7wNIKri8foLsNCS by neauoire@merveilles.town
0 likes, 0 repeats
@andnull Ah yes! So I haven't really thought about input yet, but something like:@OnButton ( arrow -- ) .YouPressedUp/up-pressed DoneThe input could be put in the bag before firering the event:up-pressed OnButton
(DIR) Post #B4yBudDH6s4MQ0vv2e by neauoire@merveilles.town
0 likes, 0 repeats
@andnull I've been porting some Fractran programs, and made this multiplication function, which shows a bit how it short-circuits matching.x^3 y^4@Mul ( x y -- res )[Mul z res]/y@Move ( z -- y)[Move y]/zMul/x@Clean ( y -- )Clean/[res y]
(DIR) Post #B4yCFJCugbWQS8cjSq by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire Yeah, I realized my A+B->C rule could decompose into A->C and B->C allowing for a tighter looping process.
(DIR) Post #B4yJ2hnmdEcue8o58C by neauoire@merveilles.town
0 likes, 0 repeats
Unlike linear types in traditional programming languages like Rust or Clean, where resource tracking is a constraint imposed on the programmer, here linearity is not enforced, it is the model. Tokens don't persist because they're protected, but because nothing consumed them.
(DIR) Post #B4yrTRtlGXq5aBWin2 by wim_v12e@merveilles.town
0 likes, 0 repeats
@neauoire Looks very cool. I have a question about the first example: you say the sets are unordered. So is the outcome "[this is a programming language]" an accident of the evaluator implementation? If it is unordered, elements could occur in any order in the set, isn't it?
(DIR) Post #B4zFN5Wbw077M5CLLc by neauoire@merveilles.town
0 likes, 0 repeats
@wim_v12e yeah, it's kind of an accident, it's just the order in which the primes are stored. I should probably pick a different thing to showcase in the repl.
(DIR) Post #B4zFW5sXzLDN3hkk0e by neauoire@merveilles.town
0 likes, 0 repeats
@azul @ragekit yup, although tuples are a bit different, since you can't know what will be where at compile time, you have to search for them at runtime. It's a bit different from multisets.
(DIR) Post #B4zQhXuZCf72gJMRDk by bouncepaw@merveilles.town
0 likes, 0 repeats
@neauoire the colour scheme of Rejoice REPL is very daring, I like it. Is it comfortable to use for longer periods of time? Is it meant to? Lowkey considering restyling my IDE in this Merveilles Seafoam gradient...
(DIR) Post #B4zQl4qvBXK3iQL7RY by neauoire@merveilles.town
0 likes, 0 repeats
@bouncepaw I've been staring at it for hours today, and if I look away, I see everything purple for a brief moment. X)
(DIR) Post #B55eO6jObBftBjWKrg by neauoire@merveilles.town
0 likes, 0 repeats
I've received a pretty interesting email this morning that made rethink the connection with linear logic. The way I had it phrased made it seem like resources cannot be duplicated, right after I had JUST demonstrated how to duplicate symbols..It's a bit more subtle than that.Traditional logic treats propositions as infinite, whereas linear logic accounts for resources. Rejoice is an attempt at making a linear logic playground in which every transformation equates to a transaction that consumes rules.In Rejoice, the linear logic ! modality applies to rules, not to values. A one-shot fraction can freely duplicate or discard symbols(x^2/x), but the fraction itself is consumed after firing. Anonymous functions and the @label mechanism are what promote rules to unlimited use. This is illustrated with file handles: once file is consumed, any fraction requiring it in its denominator simply won't fire, the resource is inaccessible through absence rather than enforcement. A fraction requiring a consumed symbol doesn't crash, it just becomes dead code.file^1closed/fileread/file ( unreachable )
(DIR) Post #B55g0q8qJPhQz6SL3I by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire Also makes me think about nonfungible symbols for Rejoice. Mercury has syntax sugar for this in the form of !Var f(!X) :- g(!X), h(!X). is expanded out into f(X0, X) :- f(X0, X1), g(X1, X).I could see it coming into play for something like!task ... [F !task]/!task@Next1 ... [G !task]/!task@Next2 ... [H !task]/!task[]/taskbecomes task0 ... [F task1]/task0@Next1 ... [G task2]/task1@Next2 ... [H task]/task2[]/task
(DIR) Post #B55gCLdJZGj5q5CF2O by andnull@social.nouveau.community
0 likes, 0 repeats
@neauoire I won't lie I kinda am getting a vision for the next step up from Rejoice would be.
(DIR) Post #B55gCLqQmVDaUlKiTw by neauoire@merveilles.town
0 likes, 0 repeats
@andnull I'm so happy, this is why I do this, and I'm super hyped to see where this might lead.
(DIR) Post #B55gM3wGD5ZxrAgs9A by neauoire@merveilles.town
0 likes, 0 repeats
@andnull oh! That's a little like lambdas in uxntal where the compiler has a scope stack for automatically assigning names to things.. That's comfy af, lemme take it for a spin
(DIR) Post #B5JxozCRKM6gzT4hRw by mia@cathode.church
0 likes, 0 repeats
@neauoire small question re: Rejoice. Are there any nice (idiomatic?) ways of handling integers above 216 - 1? One could introduce another symbol to e.g. represent a two-digit base-65536 number, but since the output is in decimal, the result would require some considerable interpretation outside of the Rejoice evaluation
(DIR) Post #B5JxozVECV8Tvjrhjc by neauoire@merveilles.town
0 likes, 0 repeats
@mia you could split them up yeah, it's not equipped right now to deal with really large number, it's implemented in uxn as a 16-bit rejoice where the top bit is used for indicating a symbol reference(x^y, 0x8000)y^y should only apply when there are y, lemme have a look, you might have found a bug :)
(DIR) Post #B5JxpQ7PFB7iTfvYqu by mia@cathode.church
0 likes, 0 repeats
@neauoire also: is x/y^y supposed to apply when there are no instances of y in the bag? The bestiary seems to imply this should not be the case, but the REPL does apply it (i.e. it treats x/y^y the same as []/y^y x)
(DIR) Post #B5Jy2uBCmutnTY8Oq8 by neauoire@merveilles.town
0 likes, 0 repeats
@mia Oh yeah, that's interesting..[] x/y^y [x] I guess that makes sense..? It's basically saying if there are zero instances of y, put a x. I.. I don't know what I think about this but I don't think it's wrong, it's just bizarre.It acts as a kind of "remove all instances y, and put a x, regardless if there are y or not".
(DIR) Post #B5Jz0yhZ6XWGsJupIe by mia@cathode.church
0 likes, 0 repeats
@neauoire one nice quirk of zero instances matching this fraction is being able to do things like [z^x z^y]/[x^x y^y] (empty x and y into z). Interestingly though this doesn't seem to work properly if one reuses symbol (e.g. [x^y y^x]/[x^x y^y] does not swap the number of xs and ys)
(DIR) Post #B5Jz0yyE6aqZhzi8Gm by neauoire@merveilles.town
0 likes, 0 repeats
@mia ah yes! that's a bug I noticed, the order of application I feel is not quite right.The issue is that I modify in place, so application modifies that numerator, and then the numerator does another read, and the value has changed already at the point. It's why I've been trying to circling around fractions that modify a value in the numerator, and using that value as an exponent in the denumerator. Something I have to try and figure out today. This is all very experimental X)
(DIR) Post #B5JzMtWZ2DDJBkDjKS by mia@cathode.church
0 likes, 0 repeats
@neauoire This is all very experimental X)that's exactly why Rejoice piqued my interest! it lights up my little mathematician brain
(DIR) Post #B5JzMtjgFRhnqQMCm0 by neauoire@merveilles.town
0 likes, 0 repeats
@mia I'm glad :) It seemed like a very much unexplored space in computation(and possibly math? although I have only high-school math so I can't really tell), I feel like there's something really interesting here, can't quite put my finger on it yet!
(DIR) Post #B5Mzkdh87hHcWBMfp2 by mia@cathode.church
0 likes, 1 repeats
@neauoire I notice you fixed this bug, nice! after a little play I found the following cute implementation for the nth Fibonacci number:y n^10'[y^x x^y]/[x^x n](In particular, it's cute because one gets to see the fraction mindset in practice: one could view this as a reduction of the more natural fraction '[y^x y^y x^x]/[y^y x^x n])looking forward to playing with this more!
(DIR) Post #B5MzkduxIILHD3piN6 by neauoire@merveilles.town
0 likes, 0 repeats
@mia WOa, this just blew my mind. This is super smart!! Keep me posted, would you be okay with me replacing my crappy fib example code in the dropdown with this?
(DIR) Post #B5N1qHCYres0P2sl84 by mia@cathode.church
0 likes, 0 repeats
@neauoire absolutely!
(DIR) Post #B5N1qHQ23Ze54pBW7s by neauoire@merveilles.town
0 likes, 0 repeats
@mia thank you so much! @andnull just caught a bug, similar to the one where numerator transformations were applied sequentially instead of in parallel, and it seems the same bug happens in the denumerator, I'm fixing it now :) So if you run into something bizarre in the next hour, I'm on it, should be fixed momentarily.
(DIR) Post #B5N3NntYQq0dJIXiK0 by andnull@social.nouveau.community
0 likes, 0 repeats
@mia @neauoire Devine shared this thread with us and it inspired the discovery of the "Harmony" combinator: eq/[x^y y^x]. Given the bag is matched using >=, the denominator implies bag[x] >= bag[y] && bag[y] >= bag[x]. This expression is only satisfied when bag[x] = bag[y].So, now you can precisely match on things. And if you have a token that never exist, you can enforce a bag[x] = 0 match: [none-x]/[x^none none^x].A very powerful expression. As the traditional Fractran model has no means of matching on empty. Before you'd need to do none-x [x]/[x none-x]. Basically "assume x does not exist until proven otherwise".
(DIR) Post #B5N3NoBzKIkqETAR3Q by neauoire@merveilles.town
0 likes, 0 repeats
@andnull @mia It's fixed :)
(DIR) Post #B5OQd5G2eUsVbiHBEO by mia@cathode.church
0 likes, 0 repeats
@andnull @neauoire just a note that you don't need x^none none^x: if none never exists, then [foo]/[none^x] is sufficient (since this requires that bag[none] >= bag[x], i.e. 0 >= bag[x])
(DIR) Post #B5OQd5YTXxciWsttxo by neauoire@merveilles.town
0 likes, 0 repeats
@mia @andnull I've removed the duplication assignment lock, since application is properly in parallel now, here's Collatz in pretty much two fractions:https://wiki.xxiivv.com/etc/rejoicerepl/#collatz