13 ms·
7GUIs
- ogoffart 4y agoImplementation in Slint: https://github.com/slint-ui/slint/tree/master/examples/7guis https://github.com/slint-ui/slint/tree/master/examples/7guis
- nu11ptr 4y agoIs a .slint file without an .rs file a complete example or just a work in progress? Curious how you do "cells" without a table widget (Not being a slint user it looks like they used loops to build a bunch of "Text" widgets, but it is the _logic_ of handling them as a cohesive table that I'm interested in, and that seems like a TON of work without a proper table widget)
- ogoffart 4y agoYes, the .slint file without a .rs file is a complete example. They can be viewed with the online editor. For example, the cells: https://slint-ui.com/releases/0.2.2/editor/?load_url=https://raw.githubusercontent.com/slint-ui/slint/master/examples/7guis/cells.slint https://slint-ui.com/releases/0.2.2/editor/?load_url=https:/... The cells example is actually not finished and admittedly missing a lot of features, it is far from being a spreadsheet.
- Diggsey 4y agoThis doesn't actually fully implement any of the tasks though.
- jollybean 4y agoVery pragmatic, there's more to this I think than we might recognize. Using these as template starting points is a great idea.
- RcouF1uZ4gsC 4y agoNice list. One change I would make for the CRUD example is to do a Todo list instead since it might be more useful/doesn’t teach bad assumptions about names.
- __ryan__ 4y agoI agree with the premise, but please, anything other than a todo list.
- adamnemecek 4y agoI’ve been writing SwiftUI lately and it’s the most productive GUI toolkit out there. Taylor Holliday of the Audulus fame is porting it to Rust https://github.com/audulus/rui https://github.com/audulus/rui
- tayistay 4y agoI'm the author of rui, in case anyone has questions :)
- sawaali 4y agoHow different is the state managementin SwiftUI compared to the state in rui?
- tayistay 4y agoI've built some of the same sort of primitives, albeit with different syntax. Rui's `state` function will give you a state handle allowing you to mutate state similarly to how @State works in SwiftUI. rui also has a notion of bindings, just like SwiftUI, and even environment. This is all great for defining state that's local to a widget, which I've seen some other reactive/declarative libraries struggle with actually. Rui doesn't have an equivalent of @ObservedObject, and it's not clear to me that it needs one because state values can be accessed by reference.
- anonymouse008 4y agoSo I’m still not sold on SwiftUI, and I’m beginning to think I’m learning the wrong paradigms to “get it.” What would you say are the core concepts that make it click for you? Do you have any resources to recommend?
- adamnemecek 4y agoDid you watch any WWDC videos? Also the objc.io book on the topic is decent.
- ttoinou 4y agoGreat idea, would be nice to use this to compare different GUIs framework. Interested in c++ immediate GUIs, shadertoy.com like GUI and Red language https://www.red-lang.org/ https://www.red-lang.org/
- michaelsbradley 4y agoImplementation in Racket: https://github.com/mfelleisen/7GUI https://github.com/mfelleisen/7GUI
- evandale 4y agoRacket is so neat. I started learning it through How to Design Programs (https://htdp.org/2022-2-9/Book/index.html https://htdp.org/2022-2-9/Book/index.html) and I was blown away you could paste pictures into the source and assign them to variables and draw them on the screen. I'm not sure why I'm surprised they have a while GUI framework too.
- giraffe_lady 4y agoI'm surprised how often I reach for racket just to check something out or explore an idea quickly. I've never taken anything too far with it but it's an incredible tool for that, and because it's so easy to implement languages in it most languages have an implementation in it. A couple weeks ago there was a burst of posts on HN about prolog, a language family I know nothing about. Took no time to spin up dr racket, find a prolog dialect in it, and play around. I probably do something like that with it every couple months. And yeah being able to easily visually output stuff from a new language without having to grapple with the tooling and output quirks of a new language takes so much of the initial friction out.
- deleted 4y ago[deleted]
- spdegabrielle 4y agoIt’s not the only version either See https://github.com/Bogdanp/racket-gui-easy/tree/master/examples https://github.com/Bogdanp/racket-gui-easy/tree/master/examp... }, { title: "Racket", technologies: ["Racket", "racket/gui"], link: "https://github.com/mfelleisen/7GUI/", src: "https://github.com/mfelleisen/7GUI", }, { title: "GUI-Easy declarative GUI", technologies: ["GUI-Easy", "Racket", "racket/gui"], author: "Bogdan Popa", authorLink: "https://github.com/Bogdanp/", link: "https://github.com/Bogdanp/racket-gui-easy/tree/master/examples", src: "https://github.com/Bogdanp/racket-gui-easy/tree/master/examples", } ]
- azeirah 4y agoI implemented these a while ago in Clojure because it was part of the job application process at roam research. Didn't even get a reply... it cost me quite some hours to do this in a language I have almost no experience in. At least there was the upside that I got to experience Clojure and Om which was great to learn about :D
- polalavik 4y agoI would love to know, collectively, how much labor/time is wasted per year on applications that test whether someone is good enough to do “real” labor. It’s bonkers.
- nerdponx 4y agoIt's one thing to have someone write a toy program. It's another to have someone write seven increasingly-complicated toy programs. That's really grotesque and overkill.
- debo_ 4y agoYou didn't get closure, but at least you got Clojure.
- strangattractor 4y agoI would not waste effort with these test if it is not a language or system you are familiar with (unless you want to for fun). The companies that do this are looking for code monkeys. They want to feed you tickets and get code in return. Many of the people critiquing the submitted code are often not qualified to do so.
- bowsamic 4y agoNice. I might try these out in AppKit
- armadsen 4y agoJust for fun, I timed myself doing the first one in both AppKit and SwiftUI. I started with Xcode running but no project created yet, and hit stop when the app was launched and I had clicked the count button. It took me 1m57s to do it in AppKit, and 3m16s in SwiftUI. (I'm far more experienced with AppKit than SwiftUI).
- bbatchelder 4y agoThis is pretty neat. The complexity jump from CRUD to Circles and Cells is pretty radical, though. I feel like a Master/Detail task would be a nice addition, and it could include a resizable divider so that the GUI framework's layout functionality is exercised.
- finiteseries 4y agoFrom a web POV I think, yes, but from a platform with something like AppKit it’s very, very straightforward honestly. Note they’re explicitly encouraging the use of something like JTable/NSTableView in the cells example, the focus is on appearance/behavior customization and change propagation. And in the circles example, undo/redo is ideally provided for “free” by the environment, and with the system’s drawing frameworks & dialogs it really does make for a simple task. If the environment lacks these basic capabilities though..
- armadsen 4y agoYeah, I'm primarily an AppKit developer, and honestly the circle drawing task seems a bit easier than the CRUD task to me.
- kbenson 4y ago> f the environment lacks these basic capabilities though.. And that's the point, right? You're evaluating the toolkit, and if it lacks the features to make these tasks fairly easy, then it's going to be harder to do a lot of straightforward things. I imagine a similar set of tasks could (and have) easily be contrived for other common libraries/toolkits that are used, such as HTTP client libraries, numerical libraries, etc.
- dang 4y agoRelated: Show HN: 7GUIs in Vanilla HTML, CSS, JavaScript - https://news.ycombinator.com/item?id=28600804 https://news.ycombinator.com/item?id=28600804 - Sept 2021 (56 comments) 7GUIs - https://news.ycombinator.com/item?id=24958725 https://news.ycombinator.com/item?id=24958725 - Nov 2020 (56 comments) 7GUIs: A GUI Programming Benchmark (2018) - https://news.ycombinator.com/item?id=21883306 https://news.ycombinator.com/item?id=21883306 - Dec 2019 (16 comments) 7GUIs – A Notational Usability Benchmark for GUI Programming - https://news.ycombinator.com/item?id=15703230 https://news.ycombinator.com/item?id=15703230 - Nov 2017 (6 comments) 7GUIs – A Notational Usability Benchmark for GUI Programming - https://news.ycombinator.com/item?id=9050480 https://news.ycombinator.com/item?id=9050480 - Feb 2015 (17 comments including "Very cool to see my master's project here on hn")
- satnome 4y agoDo similar tasks exist that would apply more generally to picking up any programming language? Working on non-trivial projects seems to be a great way of learning new languages and tools, and I wonder if there are a set of projects that would touch on a decent chunk of a what is offered by a typical language. Then again, every language has its strengths and weaknesses so perhaps such projects do not exist?
- shadowgovt 4y agoI like to implement a Conway Life engine for this purpose. Small self-contained problem that requires UI, timing loops / iteration, and graphics. It's also embarrassingly parallelizable if your language supports parallelization primitives you want to exercise.
- schwartzworld 4y agoGames are a fun way of trying out a new toolset. I've implemented a few sudokus now.
- noitpmeder 4y agoMinesweeper is always fun!
- bondant 4y agoNot in the list: an example in C and Lua with IUP (an underrated library) https://www.tecgraf.puc-rio.br/iup/en/7gui/7gui.html https://www.tecgraf.puc-rio.br/iup/en/7gui/7gui.html
- marcodiego 4y agoIUP is definitely underrated. On the other hand, there are very few developers indeed.
- jameshart 4y agoIt’s a useful list. I think some of the interaction design could do with updating though - things like disabling buttons without explanation and popping up modals for data entry are no longer universal UI toolkit tropes. Different interactions might be more idiomatic in different contexts and - while you’ll learn a lot by implementing these exactly as specified, in some cases it might be an uphill struggle - and the reason could be that the framework is trying to tell you to implement it another way. So a second version of this challenge might be to implement the same capability, through a more native interaction idiom. Suspect much can be learned by doing it both ways.
- elcritch 4y agoExcellent list of UI challenges. I’ve been working through a similar list of my own to see if I can make a widget library I’m building in Nim do this [1]. Building on an event-driven immediate mode GUI has been fun. Now I’m totally going to run off this list. I've only got circles and cells left before I can do all of these challenges. 1: https://github.com/elcritch/fidgets https://github.com/elcritch/fidgets
- rajnathani 4y agoThe author Eugene unfortunately passed away in 2019. Source: https://news.ycombinator.com/item?id=24961110 https://news.ycombinator.com/item?id=24961110
- Pr0ject217 4y ago:(
- 6510 4y agoI was wondering if one could write something actually worth taking home and showing to others. 1 - Make your resume into a slide show with background music. 2 - Create fancy transitions 3 - replace the numbers in your slideshow resume with fast running counters that count up to the desired value. 4 - add something original that you feel should be part of the task 5 - create a fully functional inquiry form as the final slide of your resume 6 - All tasks are optional, have the amount of work you put in reflect how desperately you need this job.
- TheAceOfHearts 4y agoThis is missing challenges which include async content and proper error handling, which are both essential in modern web development. For example: You're loading or submitting content asnychronously and must handle different loading states in order to give the user feedback. If an action fails due to spotty internet you must also include a retry or refresh button. You load a model form to modify some data, and when you submit your changes someone else has already made modifications to the model.
- 101008 4y agoIs the second case handled by the "frontend"? Shouldn't be handled by the backend and then return an error state/message?
- jjayjay 4y agoIt's not as simple as cases where both data and logic are local to the gui. In this identified case, the gui has to react/behave correctly according to the results/errors of asynchronous remote logic over a spotty network.
- deleted 4y ago[deleted]
- xg15 4y agoI like the temperature converter one because it immediately introduces some of the more fuzzy design questions and annoying details that pop up when you implement data binding. Such as: when exactly should the other side update? When the user switches focus (where to?) or on every keystroke? Does it make sense to a user that they temporarily see the Fahrenheit value for 2°C if they really want to type in 20°C? What happens if they type an invalid value (or clear the box, which they often have to do)? What happens if they type an incorrect value and then type something into the other field? Etc etc. I think there are a lot of interesting tensions between a "formally correct" system and one that feels usable and intuitive to use. Especially with bidirectional data flow, they show up quickly.
- mbreese 4y agoIt’s also good for data formatting. You don’t want to see 22.2222222C for 72F. Ideally when you adjust one, the values are internally consistent.
- xg15 4y agoGood point. This in turn shows the risk of endless event propagation loops: So you decide to solve the formatting problem by using floor() and only showing the integer parts. So now when the user enters 72°F, it shows 22°C. However, in a naive implementation, updating the celsius field would trigger a change in the other direction as 22°C converted back would round to 71°F. But 71°F rounds to 21°C, triggering another change, etc etc.
- spdegabrielle 4y agoIt has been taken over and moved to a new site The website hasn’t been rebuilt but you can see the list of implementations here: https://github.com/7guis/7guis/blob/master/site/src/containers/Implementations.js https://github.com/7guis/7guis/blob/master/site/src/containe...
- pketh 4y agoSome of these seem like they could be really cool challenges in the context of a designer/engineer job interview
- synergy20 4y agoFirst time heard about this, now I know why the vuejs examples I am learning is calle 7 examples: https://vuejs.org/examples/#hello-world https://vuejs.org/examples/#hello-world this is like the Todo applications for GUI
- marcodiego 4y ago> In addition, all cells which depend on C must be reevaluated. This process repeats until there are no more changes in the values of any cell (change propagation). What if there are circular dependencies?
- magicalhippo 4y agoNot stated, but I'd do what Excel does which is to have a maximum recursion level.
- whiddershins 4y agoSvelte won't let you. Knockout claims it isn't a problem. What happens in Excel, are you able to create circular dependencies there and crash Excel?
- s-lambert 4y agoHow would Svelte prevent a user from creating an infinite recursion at run-time? It doesn't know what the cell's expressions are at compile time.
- chii 4y ago> What if there are circular dependencies? You could model the dependencies as a directed graph, and ensure that there's no cycles in the graph, and if there is, don't evaluate and warn/error msg the user.
- triptych 4y agoI did this exercise with Godot Engine : https://triptych.neocities.org/sevenguis/index.html https://triptych.neocities.org/sevenguis/index.html
- andai 4y agoI was nostalgic/excited by the 20 second loading bar, brings me back to the dialup days. Unfortunately afterwards I was greeted by a black screen. Looks like it doesn't work on my phone :( Time to get out of bed, I guess!
- chii 4y agowould you recommend Godot for GUI applications that aren't games? Is it a good tool for it, and is it better than using electron?
- graderjs 4y agoI did an implementation using We components https://crisdosyago.github.io/der.Knall.Gerust/7guis/ https://crisdosyago.github.io/der.Knall.Gerust/7guis/
- Pr0ject217 4y agoThis is awesome. More! Thank you.
- Jigjig 4y agoOnly 8 days late, but I have an implementation of this in PyScript as well: https://jeff.glass/project/the-7-guis-pyscript/ https://jeff.glass/project/the-7-guis-pyscript/
- pkphilip 4y agoI tried this out using Lazarus and Free Pascal and it seems pretty trivial to do - except for the timer example which will take a little bit more time.