The 2 operations at the end are to do min() and max()

Spent the night trying to figure out how to round a number in 1th with @strstr. We figured it out after a couple of hours.

clr 256 512 / dup dup 1 mod sub swp dup vid swp pop swp vid mod 2 mul swp div dup 1 mod sub add .

@neauoire Neat, could it have bitwise operations? Kind of thing which would make me create my own dc(1).

@neauoire
on a more serious note, are you aware of the RPN calculator @akkartik is building right now to demo the Mu project?

@milofultz @strstr never thought of it that way before, but it's a really good description 👌

@neauoire does it work? i think the algo should work straight out.

@strstr I just learn that when you invert a fraction, what you get is called a reciprocal.

A fraction * reciprocal = 1

@neauoire oh yeah! dividing by a fraction is multiplying but its reciprocal

@neauoire and thus, since any non-zero number divided by itself always gives 1, a fraction * reciprocal = 1

@akkartik @strstr I watched a little video but there was just a few primitives and it didn't seem to do much just yet. I figured it's very much a wip, do you have a link that is not a video?

@akkartik @strstr Oh! I didn't realize the context, so this is written within the mu ecosystem!

@neauoire Yeah. Partly testing the foundations, partly trying to show that it can be used for interesting research in spite of not having graphics. Plus it's an idea I've gotten interested in. mastodon.social/@akkartik/1048 describes the motivations and influences a bit. Basic idea is to see how far I can go without any stack-manipulation commands like `dup` and `swap`, since they feel like accidental complexity.

@strstr

@neauoire Definitely just a prototype.

I tried to show the instructions for running it at the start of the video, but yeah not super clear. Here they are (requiring Linux..):

```
$ git clone github.com/akkartik/mu
$ cd mu
$ ./translate_mu apps/tile/*.mu
$ ./a.elf screen
```

@strstr

@akkartik @strstr How big is the repo? I'm at 40mb and it's still climbing, my internet connection is very bad.

@akkartik @strstr where are the primitives defined if I wanted to add more for fun?

@akkartik @strstr that's alright, I know how it can be haha, this is cool. I'll poke around :>

@neauoire I see you ran into a known bug there with the negative number :) I'm still unsure what the best way is to represent and manage errors.

@neauoire

`git clone --depth 1` might be useful to you in general.

@akkartik btw, if you ever want to get off mastodon.social, let me know. I think you'd be a good fit for Merveilles.

@neauoire I'd be honored to join Merveilles! Been finding lots of interesting people to follow through you.

@neauoire

vid [den [num

should make rounding a ton easier to write

@strstr yeah! Variables are a single letter tho, didn't want to implement a true dictionary, it's just 256 values addressable by key.

@neauoire d and n still sound good.

i was wondering, do you say "vidided by" or "vidived by"?

@strstr I think of divided as "divi_ded", so I guess "vidi_ded"

@neauoire right. also the "by" made no sense in my example what am i thinking. aaah the semantics of vidision.

Sign in to participate in the conversation
Merveilles

Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.