4 ms·
Selkie – Opinionated TUI Framework for Raku
- apogee 6mo ago[dead]
- librasteve 6mo agoI tried this on macOS … very smooth install and looks great. But why would I switch to Raku just to get a TUI framework?
- apogee 6mo agoThe tl;dr is: because you want native performance and don't want to focus on blitting pixels or terminal internals. Selkie has an event/effect model similar to Elm & re-frame, you just declare your widgets and renders/updates are handled by the lib. As for why Raku: - grammars allow for easy parsing of complex DSLs - supply/tap are a natural fit for the event/effect model, asynchronous thread-safe programming - roles make composing widgets simple - it's fun to write :D
- librasteve 6mo agoOk cool, thanks!
- apogee 6mo agonp, what kind of TUIs do you write?
- librasteve 6mo agoOh I found this https://raku.land/zef:antononcube/DSL::Examples https://raku.land/zef:antononcube/DSL::Examples So Raku has a module for “few shot” LLM training for DSLs … would be cool to see an example DSL interpreter in Selkie (eg a window for DSL code and a window for output…
- apogee 6mo agoYeah I have thought about doing this with Roaring::Tags (https://raku.land/zef:apogee/Roaring::Tags https://raku.land/zef:apogee/Roaring::Tags) so you type a Roaring::Tags query on one side and it shows the built Raku on the other. Wouldn't be too difficult: - FileBrowser widget to get the serialised bitmap. - MultiLineInput for the query text input. - ListView to show tags and fields. - RichText for the AST pretty printer.
- antononcube 6mo agoThere is a set of Raku modules that leverage LLMs for different tasks (mostly code generation) using different techniques: - https://raku.land/zef:antononcube/LLM::Resources https://raku.land/zef:antononcube/LLM::Resources : Uses agentic LLM-graphs with asynchronous execution - https://raku.land/zef:antononcube/ML::FindTextualAnswer https://raku.land/zef:antononcube/ML::FindTextualAnswer : Finds answers to questions over provided texts (e.g. natural language code generation commands) - https://raku.land/zef:antononcube/ML::NLPTemplateEngine https://raku.land/zef:antononcube/ML::NLPTemplateEngine : Fills-in predefined code templates based on natural language code descriptions/commands - https://raku.land/zef:antononcube/DSL::Examples https://raku.land/zef:antononcube/DSL::Examples : Example translations of natural language commands to executable code
- apogee 6mo agoI've got a few LLM modules too, mostly for handling context management: - https://raku.land/zef:apogee/LLM::Character https://raku.land/zef:apogee/LLM::Character implements CCv3 which is a standard for managing characters (system prompts) and lorebooks (injected snippets) - https://raku.land/zef:apogee/LLM::Chat https://raku.land/zef:apogee/LLM::Chat handles context shifting for long contexts, sampler settings, templating for text completion & inferencing with or without streaming using supply/tap - https://raku.land/zef:apogee/LLM::Data::Inference https://raku.land/zef:apogee/LLM::Data::Inference adds retries, JSON parsing & multi-model route handling to LLM::Chat - https://raku.land/zef:apogee/LLM::Data::Pipeline https://raku.land/zef:apogee/LLM::Data::Pipeline allows you to declaratively build multi-step pipelines (simple agentic LLM use) - https://raku.land/zef:apogee/HuggingFace::API https://raku.land/zef:apogee/HuggingFace::API is a partial wrapper around HF API for grabbing tokenizers.json & tokenizer_config.json - https://raku.land/zef:apogee/Template::Jinja2 https://raku.land/zef:apogee/Template::Jinja2 is a near-complete impl of Jinja2 for parsing LLM text completion templates (can be used for anything you'd use Jinja2 for) - https://raku.land/zef:apogee/Tokenizers https://raku.land/zef:apogee/Tokenizers is a thin wrapper around HF tokenizers, for token counting mostly
- davidschultz 6mo agoNice. To get your dependency Notcurses::Native built via zef on my OpenSUSE Tumbleweed, I had to run zypper in ffmpeg-7-libavdevice-devel ffmpeg-7-libavutil-devel ffmpeg-7-libavcodec-devel libunistring-devel libdeflate-devel which pulled in several dependencies, resulting in the overall package list: ffmpeg-7-libavcodec-devel ffmpeg-7-libavutil-devel ffmpeg-7-libswresample-devel ffmpeg-7-libavformat-devel ffmpeg-7-libavdevice-devel ffmpeg-7-libavfilter-devel ffmpeg-7-libpostproc-devel ffmpeg-7-libswscale-devel libdeflate-devel libunistring-devel Maybe just a subset of these is necessary. Conversely, I've already had ffmpeg-7 and libavcodec57 and a number of other devel packages installed from before, so some other packages might also be neccessary. Still, this might help you in adding instructions for installing your Notcurses::Native on OpenSUSE.
- apogee 6mo agoThanks, I will get this into the next version of the Readme, I think the minimum would be roughly: sudo zypper in \ ncurses-devel libunistring-devel libdeflate-devel \ ffmpeg-7-libavcodec-devel ffmpeg-7-libavformat-devel \ ffmpeg-7-libavutil-devel ffmpeg-7-libavdevice-devel \ ffmpeg-7-libswscale-devel \ cmake pkg-config gcc
- apogee 6mo agoI've set up GitHub actions to prebuild all the deps so on any modern Mac/Windows/Linux it should just be 'zef install selkie' now.