bbb651 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=50916 Picotron Suggestions and Ideas <p>Hello! This is my first post here :)</p> <p>I've played around with Picotron in the past week and have some suggestions and ideas that I'll throw here:</p> <ul> <li>Userdata Views - I can make a whole post about this alone, but basically I'd really like userdata to work like numpy, based around <a href="https://numpy.org/doc/stable/user/basics.copies.html">views</a>. This is a generalization of slices (also in 2d), casting to different data types, reversing of userdata, looking at every other value, and much more. This allows code to be a lot more generic and easier to understand, and by having it be builtin to the way userdata works it ensures the obvious and clean code is cheaper in terms of cpu time.</li> <li>Mixed Types Userdata Operations - For example, matrix multiplication currently only works on two f64 userdata, and I came up with a cool usecase for <code>f64 * u8 -&gt; u8</code> matrix multiplication to efficiently do base64 encoding: <img style="margin-bottom:16px" border=0 src="/media/50916/image (1).png" alt="" /> <p>I can't think of an intuitive default for a result type or good way to let the user choose it... </p></li> <li>Allow Fetching More Things - There's a discussion to be made about if <code>fetch</code> should be &quot;nerfed&quot;, but as it currently is it's pretty arbitrary that it only allows you to fetch certain things like json, pods and pngs, but not others. It's not that big of a deal if you also write the backend but that's not always possible or forces you to use a proxy. This also goes for other limitations like changing the http method, supplying headers, etc. they are added complexity but they could work in a way that is opt-in for the user, exactly like the web <a href="https://developer.mozilla.org/en-US/docs/Web/API/fetch">fetch</a>.</li> <li>Wayland Support - currently SDL2 seems to be statically linked into the executable, with only the X11 backend enabled on linux. This makes it very stuttery on certain environments, especially in windowed mode. There are additional backends that would be cool to have, like the framebuffer backend to run dedicated picotron machines on e.g. single board computers. Linking SDL2 as a shared library and providing SDL as a shared object with the installation will make it possible to override it with the system version of SDL2.</li> <li>Intuitive Open File Menu Item - Currently the &quot;open file&quot; menu item opens the current file in Filenav instead of the usual meaning of opening a file chooser to select a file to open. The current behavior is usually called &quot;Reveal/Open/Show in Filenav&quot;, and should probably have a different icon than the one for saving. As far as I can tell the only way to open files in a program that is tabbed is closing the program and reopening by clicking the file or giving it as a command line argument.</li> <li>More Desktop Shortcuts - It would be nice to have shortcuts to open the terminal, open the Filenav, switch workspaces (just discovered <code>ctrl + 1</code> hides the workspace bar while testing it, neat, also code editor doesn't fill up the extra height it's given when doing this), and things like that. Even something analogous to <code>Super + Click + Drag</code> on linux to move/resize windows.</li> <li>Context Menus - Currently there are very few places with context menus, apps like Filenav should really have them it's breaking my muscle memory, I right click and accidentally open things all the time :|</li> <li>Dark Interface and Colors - This one might be a bit controversial but I feel like there's a big lack of dark natural colors. The only colors that can work as a dark background in most cases is 0 (black) and 1 (dark blue), I think a dark natural color (somewhere around #1b1b1b) would go a long way, maybe in place of one of the blues/oranges (12 and 16, and 9 and 25 look really similar to me, although my display has awful color accuracy so I'm not sure). That will make a dark mode setting feasible (opt-in by the apps of course, terminal should always be white on black).</li> <li>Code Editor Themes - This also goes for <code>gui_ed.lua</code> in general, it only takes <code>bgcol</code> and <code>fgcol</code>, making the number display (and probably syntax highlighting, haven't tested it yet) pretty broken when you change theme. They could then be accessible from within the code editor.</li> <li>Follow XDG Basedir Spec - This is a very minor nitpick, but it would nice to follow the <a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">xdg basedir specification</a> for storing the Picotron files instead of <code>~/.lexaloffle/Picotron</code>. This can be done in a backwards compatible way, first check if <code>~/.lexaloffle</code> exists and use that if it does, before using the new logic to get the location.</li> <li>Increase Stack Limit from 100k - The only way to convert userdata to string I found is to unpack it into <code>chr</code>, and you hit with limit when working with userdata the size of the screen, In my case 518,400. Maybe it can be increased to a million?</li> </ul> https://www.lexaloffle.com/bbs/?tid=141678 https://www.lexaloffle.com/bbs/?tid=141678 Fri, 12 Apr 2024 19:33:21 UTC