Stream: beginners

Topic: tui-platform


view this post on Zulip Luke Boswell (Nov 09 2022 at 08:38):

G'day Roc'sters,

I've been playing around with a tui platform which basically just wraps tui-rs. Here is a link to the Draft PR #4493. My goal isn't to merge this into main, although I'm happy to if this is useful and others might want to extend. I have been using this to learn more about Roc platform dev, and explore ideas for the editor.

I would appreciate any reviews or recommendations for how to improve this, as I'm pretty new to rust and Roc platform dev. I am particularly interested in feedback on how to do async rust and the event loop properly. Eventually I would like to support Action-State more fully. At the moment the loop should be pretty much instant for any events, with the ui drawn every tick (50ms). The Paragraph and Layout widgets are pretty much 95% supported, although I've only really tested it manually.

Screen-Shot-2022-11-09-at-18.05.17.png

view this post on Zulip Anton (Nov 09 2022 at 10:42):

Very cool @Luke Boswell! Looking at some larger roc files makes me feel warm inside :)

view this post on Zulip Richard Feldman (Nov 09 2022 at 19:22):

this is awesome! :heart_eyes:

I'd be totally fine with our replacing the current tui example with something more fully-featured like this

view this post on Zulip Zoltan Temesvari (Nov 15 2022 at 15:45):

Hi, totally newby question. I unpacked the latest nightly build (linux). Is that it? The installation does not seem complete. "Command 'roc' not found...". What did I miss?

view this post on Zulip Anton (Nov 15 2022 at 16:16):

Hi @Zoltan Temesvari,
the described install procedure does not make the roc command accessible everywhere on your system, we do plan to add that in the future!
I recommend you use ./roc in the folder that you unpacked. If you'd like to start a new roc project, I also recommend that you do it in that folder.

view this post on Zulip Zoltan Temesvari (Nov 15 2022 at 16:23):

Thanks, Anton. I should have tried that first :grinning: in the 'examples' folder '../roc helloWorld.roc ' did the trick. Thank you!

view this post on Zulip Anton (Nov 15 2022 at 16:52):

happy to help :)

view this post on Zulip Luke Boswell (Nov 26 2022 at 06:52):

I've been experimenting with the API for creating views in tui, and would appreciate any feedback. This is my Hello World app so far. I'm using it to test features as I go and experiment with different ideas. I was wondering if the API for the views look reasonable? I've made helpers using the optional records which feel nice. Any ideas to improve or for me to try out? Please let me know. :smiley:

view this post on Zulip Anton (Nov 26 2022 at 11:09):

Looks very clean @Luke Boswell!


Last updated: Jul 06 2025 at 12:14 UTC