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 #Scala, #Python, #C, #Z80, and #Go.
And it was simple, actually π
Well, that's done, and I'm done for today. Some relax before going to bed!
Yep, it is possible. I can't see any downsides, other that the extra checks to decided if the optimization is possible.
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 #nvim! π€¦ββοΈ
https://github.com/reidrac/dotvim/commit/711e844fa9f02844ab005d5d0f09da7054ee71a1
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 π )
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 π€·
LOL!
I did a search and I found this: https://jhall.io/posts/go-json-tricks-slightly-custom-marshaler/
So looks like I may be right after all!
For now this is fine. The JSON is readable and it works fine when I want to check something in the AST. So WIN! π
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.
Not sure if there's a better way of doing this, but then I serialise the AST into a JSON, #go's JSON encoder will encode the struct of each node, but I miss the type.
I want to include the node type.
FOSS person. Gamedev for the ZX Spectrum, Amstrad CPC, Commodore 64, MSX and other shiny things.