Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

antovsky

9
Posts
66
Followers
1
Following
A member registered Aug 03, 2020 · View creator page →

Creator of

Recent community posts

Great, glad to hear they're fixed! Man I wish I knew more people on IRC, that would be my preferred method as well haha. I can't post my email here but if you dm me on Twitter we can get in touch @antovsky.

I like the labeled printing approach, I was going to implement it as part of the fixes but unfortunately realized that by the time that part of the code gets to printing the results, they are already "stripped" of their variable binding (it's a stack machine evaluator, and all it's printing are the remaining contents of the stack after all the ops complete). So I will need to do some more plumbing to actually keep around the bindings for printing, which makes it more work than I have time for right this second. It's almost certainly the right approach though (at least as a first try).

Update: 

I've blind "fixed" the Linux GrabKey issue, please give it a try and let me know if you can open multiple instances now (only the first will listen for the hotkey).


I've also fixed the number printing truncation, the calculation you provided should print correctly now (rounded to 69.24 due to float precision). It was a bug in the printing code, so thanks for providing a nice repro. If you see any further errors or weird calculations, please post them and I'll have a look. It's important for the basic calculations to be robust and trustworthy (which is a surprisingly messy topic, unfortunately, and an area I'd like to work on more when I have time).

Thanks for the feedback, I'm glad you're finding it useful! Some replies, in order of easiest to hardest :P

Re: GrabKey - Yes this seems like a stupid bug. I'm using some magic incantation to bind hotkeys on Linux (to open the calculator), and while I tested it on Win/Mac I just blind-did it for Linux and had someone else test it, and obviously didn't expect multiple instances will break. Oops! If you know of the correct way to register an OS hotkey, or an article about it, that would be very helpful (alternatively I can disable the hotkey, but I don't know if others use it. I just know Mac/Win people do).

Re: Printing precision - Yes, this is a bug I have seen as well. It seems to be new, since I feel like I tested it better than this, but I clearly need to revisit it. Printing numbers well turns out to be less trivial than I thought, but again if you know of any great article references that would help.

Re: Printing labels - I agree, some kind of labeling is definitely necessary. Your usage findings mirror mine exactly. After two values, maybe three, it starts to get messy and error prone to read them, and definitely inconvenient that they're on one line.
I think it's probably a good idea to "labeled print" any variable. So for example naked expressions like "3 + 5" get printed naked, but if you assign it like "a: 3+5" it gets printed as "a = 8" or something similar. And if you have labeled values, they automatically print vertically (whereas unlabeled values, I think are fine to print horizontally, because you naturally will start making variables as things get more complex anyway). I have ideas for "string labels" as well, but probably this initial fix would go a long way (string labels would be more for "very large" reusable programs that could use custom labeling. i have a couple of excel replacement kinds of programs which might benefit there, but again just having a VeryDescriptiveName for the variable names, and having those print, would probably be sufficient utilitarian-speaking).

Re: Open source - To be honest, I've kept it off github because I didn't want to manage the project, since it's my own hobby so to speak. But I totally get the tension, and that as something like this becomes more useful to someone (like you, or me), the more "uneasy" it might feel if it's not open. So for what it's worth, I promise that if I ever "abandon" it then I will post the source somewhere (or at least give it individually to whoever asks for it). This has been my stance up until recently. With the recent advancements in LLMs though, I'm less keen on the whole to put it out, because I don't really want clones. Again, being honest, I don't have a super clear moral stance on it, but it just doesn't seem like a can of worms I want to open. I might be persuaded one way or another. If you wanna chat more about it, join the discord and ping me.

So in the meantime, let me see if I can address those bugs and improve the labeled printing, those seem like simple improvements.

I'm trying to avoid too much "styling control" in the code itself, since it's not really designed as a "picture maker" and I don't want to burden the language syntax, but I've considered stuff like @color(255,128,64) and things of that nature as optional "style comments". I think the primary colorizing would come from a global "settings" menu though, so I'd just allow setting the entire app's color scheme (including the colors for each plotted graph, up to 16 or something). It's not that I don't want it to be used for making pictures, it's just that it's a deep rabbit hole of scope, so I need some kind of self imposed guardrails :P So at the moment it's something like "customizing colors to your liking makes sense, but customizing colors and styles for a perfect diagram to use elsewhere" probably doesn't make sense.

(2 edits)

You can already plot multiple functions actually, by listing them with commas, like so :)

f(x): x^2

g(x): sin(x)

f,g


Naut will "print" whatever it sees on the last line. If you give it a function (or a list), it will plot it (or them), and if you give it multiple numbers, it will print them.

It's a good idea to hover and highlight though! Custom colors could also be a thing, just need to add the idea of saving them to a user file somewhere (right now Naut doesn't load/save any data, it's self contained, but it wouldn't be a problem for "user customization" to live in some other folder I think) 

Good to know, thanks!

That's an interesting idea! 
Another option others have suggested is "ghost" results written next to each line, which shows "what would be printed if this was the last line" (which is a little bit different from "what would this line in isolation print", since that doesn't take into account prior line's definitions etc)

Glad to hear it :)

This looks really interesting, can I try it please?