Pinned post

Hi, I'm Juan πŸ‘‹

I was looking for a Masto instance I could trust and I thought SDF (in operation since 1987) is the type of commitment I like πŸ‘

(also have an account in SDF-EU, although I haven't used it much so far)

I've been hosting my own email and web since 2003, so what I'm looking for is more the community aspect of SDF/tildeverse.

I do retro-gamedev (ZX Spectrum, Amstrad CPC, MSX and Commodore 64), and other types of "dev" in , , , , and .

And it was simple, actually πŸ˜‚

Well, that's done, and I'm done for today. Some relax before going to bed!

Show thread

Yep, it is possible. I can't see any downsides, other that the extra checks to decided if the optimization is possible.

Show thread

I'm going to have a shower and will think about it before writing any code πŸ˜‚

Show thread

So the code is solid. Did a bit of a refactor (without tests, I hope nothing broke!).

Now I'm thinking... can I optimise recursive tail-calls automatically?

I know it is a return with a recursive function call; do I need the "tailc" tag at all? πŸ€”

so... what's the point of Masto accounts that are a bot just mirroring content from someone else (usually wit some sort of celebrity status) on twitter?

BITD the bots were one of the worst things of

I don't have time to review the code, but looks like it works!

non tail-call tagged: 0m13.265s
tail-call tagged: 0m0.052s

(the interpreter isn't fast anyway, but I wanted to implement this!)

So turns out tail call optimisation isn't that difficult after I implemented return. I have some WIP code, may finish it if I have time at lunch.

I'm not doing automatic optimisation (even if there's some semantic analysis). It requires tagging the function call in the return. So... syntactic tail call optimisation?

E.g. in fn we can have "return tailc fn(n);"

Ah, I know now why I had that delay opening telescope in ! πŸ€¦β€β™‚οΈ

By having <leader>f and <leader>fb, using f had to wait to see if I was adding a b. Now the delay is gone!

So we watched EP01 of Star Trek: Strange New Worlds, and I found it a bit dull.

It all starts too quick and felt a bit samey. Didn't feel like Pike was charismatic, not brilliantly written characters, all was kind of flat.

I mean, Pike starts watching The Day the Earth Stood Still; uh? ah, right... wait for it.

I can't say I agree with the 8.1 on IMDB. Hopefully it will get better!

(we gave up Picard on season 2 πŸ˜… )

That's the "hey guys!" pose, according to Vic πŸ˜‚

Show thread

So turns out implementing return was easier.

I still need to "fix" the implicit return, but after a lot if scratching I couldn't get the tail call optimisation to work 🀷

Show thread

For now this is fine. The JSON is readable and it works fine when I want to check something in the AST. So WIN! πŸŽ‰

Show thread

So what I came up with is a Marshaller for each top level node type, that wraps in a "node" struct (type string and object any), and local type to avoid an infinite loop.

This works fine, but not sure if there's a better way of doing it.

Providing the MarshalJSON for each node isn't terrible.

Show thread

Not sure if there's a better way of doing this, but then I serialise the AST into a JSON, 's JSON encoder will encode the struct of each node, but I miss the type.

I want to include the node type.

Me: wow, that was amazing!
Vic (5yo): you don't need to say that again, but you can if you want to...


Show older
Mastodon @ SDF

"I appreciate SDF but it's a general-purpose server and the name doesn't make it obvious that it's about art." - Eugen Rochko