12 ms·
Writing GUI Apps Using the Red Programming Language
- MR4D 9y agoI always wondered why there has been no real successor to VB. This looks promising!
- tomcam 9y agoThe syntax of Rebol, its predecessor, was an inspiration for the Mathematica language.
- jwmerrill 9y agoAccording to Wikipedia, Mathematica was initially released in 1988. Rebol was first released in 1997. Maybe Rebol inspired some part of Mathematica that came later, like the manipulate/dynamic system?
- vram22 9y agoRebol also influenced JSON, according to some people, per links in this post (on my blog): https://jugad2.blogspot.in/2012/12/rebol-language-that-influenced-json-is.html https://jugad2.blogspot.in/2012/12/rebol-language-that-influ...
- mtkd 9y agoI expect something equivalent or better to come out of what is happening with WASM in next year or so. So many people are talking about missing the power of VB, early Delphi, Turbo Pascal etc. and WASM is first tech for a while that looks like it could take that power to the browser.
- HelloNurse 9y agoSure, there's going to be a bloom of compilers of anything to WASM, but what's discussed here is the opposite technology: lean native applications.
- mtkd 9y agoThe reason these post-2005 cross-platform envs have gained no traction is because so many devs won't move away from browser - or even consider alts to a browser exist. Suggesting something not SAAS, PAAS etc. right now in most enterprises won't do much for your career. WASM kind of fixes that - it takes that 90s/00s native speed into the frontend of the moment and makes complex UIs more viable. Any dev with more than 20 years experience shakes their head that it takes WASM to make that happen - but I'm just grateful it is.
- KallDrexx 9y agoLast I looked I could not find a garbage collection solution for wasm, and that seems to be a barrier to entry. I know the mono-team has had some success by porting all of Mono to Wasm but that seems a bit heavy handed just to get VB.Net or C# language to compile down to wasm.
- mtkd 9y agoIt's not a now solution - but from the trajectory you can see where this likely ends. It may even be the case that the current WASM specification does not support everything needed for that to happen. But if you look at the DOM and what Anders Hejlsberg was working on 25+ years ago with early Delphi - you can see a potential real step change from WASM - especially for enterprise tech to bring back some of that VB magic.
- sigzero 9y agoI would use Xojo for a "successor".
- spapas82 9y agoAs I mention in my other comment, take a look at Delphi/Lazarus for the VB heir!
- Momquist 9y agoCheck Gambas if you're interested in a similar language/IDE concept. It's Linux only, but I thought it was pretty cool for quickly prototyping GUI applications, although I do prefer the more mature FreePascal/Lazarus combo. http://gambas.sourceforge.net/en/main.html http://gambas.sourceforge.net/en/main.html
- badsectoracula 9y agoThe thing is, a real successor to VB wont be a programming language because VB's strength wasn't the programming language part (if anything, it was one of the weaker parts) but the ridiculously simple GUI designer and COM/ActiveX that allowed people to compose applications out of reusable components (be it controls or just pieces of code). We don't have a real successor to VB (yet) because people always tend to overlook things and only focus on specific stuff, like the language or the form designer but those pieces weren't what made VB, it was the entire package - take a single element out and it falls apart. Things i've seen people do in attempt to recapture VB: * Start writing a compiler. The compiler part of VB was an afterthought (and wasn't even there in VB1-3), the important part is the IDE. Whenever i see someone trying to remake VB by even thinking about a compiler first, i'm certain that it'll fail (even if the project is made, it wont be VB, the developers' hearts are not in the right place). * Ignore the "live" aspect of working with VB, like the ability to pause a program, modify it and continue or to execute statements, pause on errors, modify the code, continue, move the execution pointer around, modify variable values. You are interacting with a live system, there is no edit-compile-run cycle, it is just edit-run. Most attempts try to separate the IDE from the runtime, as if you were writing a C program with a form designer bolted on. A better system would try to eradicate the difference between designtime and runtime (e.g. allowing modifying forms while the program is running), not introduce additional steps or separation. * Ignore the IDE. It was named "Visual" Basic for a reason. The documentation calls editing the forms as "painting the GUI" because it is a visual process. The IDE tries to make things as visually seamless (not always with success, TBH) - the form designer is the form itself, placed wherever you place the form (later this was diluted a bit in VB5 but you could switch to SDI to get the real deal), double clicking a button has you typing the code immediately for that button (or any other control's default event), you get a property panel with live editing of properties and in later versions (VB5, VB6) you even get those properties categorized, etc. You get a visual browser for every available class, method, function, etc available even with some brief documentation. * Ignore extensions and composition. The entire reason Visual Basic exists is that Windows 3.0 got DLLs and someone (Alan Cooper) came up with the idea of using those DLLs to create reusable visual components. While Visual Basic does have a handful of "internal" controls (labels, listboxes, scrollbars, edit fields and a couple of others), most people using VB use external components. * Try to make it possible to do everything in it with the apex of that being trying to write the language in the language itself. VB was the best example of a right tool for the right job - and an example that was very often ignored. VB's best use when was it was used to create front ends to machinery written in other languages that were better suited for the task. Sadly Microsoft dropped the ball here and made it too hard to expose components to VB since COM/ActiveX was a PITA and the only alternative was using DLLs (something they made way worse with VB.NET and C# by allowing only DLLs). This is something i never understood - they had their own C/C++ compiler, this was their own language, why couldn't they add an "add C++ header" (or just C header) command in the project window and have the IDE automatically parse and expose to VB whatever defined in the header? Even if it was only a subset of it (i wouldn't expect macros to work for example) it would be much easier. I believe that this is what led many people who otherwise should have known better to try and do too much in VB - because using another language had a lot of friction - and as a result, people who want to "revive" VB, try to solve the issue by improving the "do everything in VB" part instead of making interfacing with other languages easier. * Focus too much on the language. This is really related to the first part, but really, i just cannot stress how often people miss the forest for the tree when it comes to VB - many programmers are attracted to VB's language like moths to flame. Originally VB was supposed to have pluggable languages and i don't know why this idea was scrapped - i'd guess it would make learning the system harder - but it is a testament to how unimportant the language was to the entire package. * Try to bolt an existing language that simply doesn't fit. I'm not going to give examples for those because i don't want people to focus too much on defending their favorite language, but while the language isn't that important, it still needs to feel right at home with the rest of the package - especially the IDE. Every feature of the language needs to be able to be represented in the GUI itself and that without being overwhelming (to understand what i mean with overwhelming, imagine working on an XML document produced with LibreOffice with a plain text editor - the document is technically a text file and you can technically edit and even write new parts on it with the text editor, but it is clearly not a good fit. Similarly it isn't enough to be able to represent the language in a GUI, its features also need to be a good fit for visual representation through a GUI). Note BTW that taking an existing language and altering it to make it a better fit might work (after all that is what Microsoft did with BASIC). There are other things of course (and i certainly do not include the most common case of people starting with an idea and going nowhere - but i suspect an easy language like VB attracted a lot of people who simply didn't know what they couldn't do), but the above are some of the main stuff in my mind (and this post is already too long). Personally i find the desktop development process today a broken mess and most "modern" approaches to really be rooted in 70s mindset. GUI is by its nature graphical, making GUIs should be graphical itself - yet most systems regressed to text based descriptions. The best system in active development today is Lazarus with Free Pascal. It is far from a VB alternative (despite how much people compared Delphi - Lazarus is practically an open source cross platform Delphi - and Visual Basic back in the 90s, the only common those two systems have is that they use form designers that if you squint hard enough look kinda similar - everything else is different) and IMO doesn't even reach Delphi 1's level of integration, it is kind of a mess in several places (some due to Free Pascal having a kitchensink philosophy, but also some due to just plain old sloppiness) and its cross platform support while there, has issues on anything except Windows (and personally i dislike how the only backend that really works on Linux is Gtk+ 2 and that they do not focus on their own backend - but that issue i have has a lot to do with how broken and hostile to backward compatibility is desktop development on Linux). Still, i do all my complex GUI stuff on Lazarus. Now and then i also work on a GUI toolkit that i hope one day to use to build my dream GUI development environment on Linux (so i can finally get rid of any Windows dependencies) although the entire Wayland story with all of its limitations and other issues puts a major block there (and makes me lose my interest on Linux desktop altogether).
- partycoder 9y agoLazarus, Xojo, Gambas to name a few. A lot can also be done with an interface designer like Glade. Delphi is still around.
- KnstrOnline 9y agoI really miss an awesome cross-platform GUI. Electron is awesome, but bloated.
- girishso 9y agoAgreed. But Electrcn seems to be the only option these days.
- wellpast 9y agoReally? It seems like there are a plethora of options. See an endless list at: https://news.ycombinator.com/item?id=12376242 https://news.ycombinator.com/item?id=12376242
- zerr 9y agoUnless you want to move beyond HTML and JavaScript.
- spapas82 9y agoActually no. Electron is the hipster/trending one. Unfortunately it creates monstrous applications with hundred mb sized binaries and gb memory requirements. Thanks but no thanks. On the other hand Delphi and its open source brother Lazarus are creating real (not html ones) native apps with sub mb binaries with minor memory footprints using a great IDE that reminds me of VB6. This is definitely the way to go for desktop apps!
- holydude 9y agoElectron is chic because it looks nice and it feels nice ...everywhere. Until it does not and then the costs of doing it in smh else are too high
- spapas82 9y agoLooks nice: agreed. Feels nice? Try running an Electron app (for example atom or VS code) on a 4gb ram celeron (like the one I have at my 9-5 work) and I can guarantee that you won't like the feeling :/
- garyclarke27 9y agoIniatly I was excited by Red’s expressiveness, ease of use and cross platform capability, but was very disappointed to find it lacks a driver for PostgreSQL. This for me is critical and surprising omission, especially considering that the main developer of Red - Nenad Rakocevic - wrote a Postgres driver for Rebol??
- 9214 9y agoLack of drivers and such is due to the fact that full I/O support is not yet implemented, but planned. See: https://trello.com/c/Iz0cl1e8/61-070-full-i-o-support https://trello.com/c/Iz0cl1e8/61-070-full-i-o-support
- fergus44 9y agoRed is alpha! Like you said, the author has written SQL drivers, and has already promised them for red. Priorities!
- onetom 9y agoIn the past, when I was writing web scrapers and I wanted to put the results into a database, I was just using the command-line interface for the database via the Rebol `CALL` function. It was a couple of lines to create a `SELECT` and `INSERT` function to abstract this detail away... If you are really curious about Red, you should give this approach a try and in case it's not performant enough for you, then you can put this option on hold until Red has proper I/O support.
- 9214 9y agoIn case someone wants to ask specific questions about Red, you can drop in gitter chat and say "Hi": https://gitter.im/red/red/welcome https://gitter.im/red/red/welcome
- ffjnljkfndsf 9y agoReally wish there was something like this for Go
- jdonaldson 9y agoHaxeUI is another cross platform option: http://haxeui.org http://haxeui.org
- ivanceras 9y agoHow is the development experience with haxe-ui? Is it trully write once then deploy to all without any need for tweaking quirks on each of the target specifics?
- solarkraft 9y agoIt really looks like it by the website, but I haven't seen anyone use it in the wild. I'm interested as well.
- jdonaldson 9y agoThe author gave a good overview of the framework at last year's Haxe summit: https://youtu.be/xU142SldYsw https://youtu.be/xU142SldYsw
- kome 9y agoRed is awesome. Why it's not hip it's a mystery to me...
- holydude 9y agoIt is a chicken egg problem really it is the same like Nim, Crystal etc
- nickelbox 9y agoI feel like both of those get more attention than Red does. I've written a bit in both, but completely forgot Red existed (sample of 1, yada yada).
- roywiggins 9y agoI've heard of both of those, but not Red. So n++, I guess.
- Volt 9y agoIt doesn't even have GC yet.
- 35bge57dtjku 9y agoLike C or like Java with the GC turned off?
- throwaway7645 9y agoAlways glad to see Red get some more attention. I think these little lightweight apps are the way to go for sure. I like freePascal + Lazarus too, but I wish they made certain things easier. Red's syntax isn't a silver bullet, but I like how they have DSLs for so many things and native data types for things like email and web scraping that would require libraries in other languages.
- vram22 9y ago>I like freePascal + Lazarus too, but I wish they made certain things easier. Which things? Interested to know, because I too like both Red and FPC (I use FPC to make it easier to distinguish Free Pascal (Compiler) from FP for Functional Programming).
- throwaway7645 9y agoHard to describe the beginner experience with FPC (nice acronym) + Lazarus and Rebol. Rebol has a lot of sites showing you how to build simple GUIs fast although some things are getting old (had trouble getting the native email functionality to work). So more beginner friendly doc would help both projects a lot. Also, I think it would help pointing out that certain things like connecting to an Oracle db are easy in C#/Java, but aren't obvious to me with FPC.
- vram22 9y agoGot it, thanks. Yes, there can be such issues, with any project, but to some extent or in some cases, more with open source projects, particularly those without funding or good management - though of course closed source projects are not immune to such issues either.
- throwaway7645 9y agoAgreed!
- vram22 9y ago
- sigzero 9y agoI have never even heard of this one. <shrug>
- JoeDaDude 9y agoWhoa! For a second I thought the meant RedCode [1]. That said, the Red language looks capable and brief. I am intrigued. [1] https://en.wikipedia.org/wiki/Core_War#Redcode https://en.wikipedia.org/wiki/Core_War#Redcode
- Apocryphon 9y agoDigging the bullet point about Haiku support. Hoping someone in that community pays attention to this.
- mherrmann 9y ago> After trying (and failing) to wrap “executable” ducktape around a Python script using PyInstaller on Windows Funny. I just started working on an open source solution to that exact problem: https://github.com/mherrmann/fbs https://github.com/mherrmann/fbs
- ausjke 9y agowhat about tcl/tk for GUI? mature, fast, and ubiquitous
- coldtea 9y agoAlso atrocious looking and alien feeling on every system.
- bch 9y agoAre you recalling the 1990s, or contemporary Tcl/Tk [0][1]? [0] https://en.wikipedia.org/wiki/File:Tk-Demo_using_Tk_8.6.6_on_Windows_10,_November_2016.png https://en.wikipedia.org/wiki/File:Tk-Demo_using_Tk_8.6.6_on... [1] http://www.tkdocs.com/tutorial/idle.html http://www.tkdocs.com/tutorial/idle.html
- cturner 9y agoI am using python to wrap Windows-C this week. I tried Idle again for the first time in years. Its text navigation is nasty, and caused me to go to shift editor. For example, ctrl+shift+arrows highlighting is something I do all the time and Idle's behaviour is inconsistent with Windows convention. It is hard to know how to make it mainstream from where it is. If they changed keyboard behaviour to align with Windows-convention, it may annoy parts of its existing userbase who have become accustomed to it.
- jcelerier 9y agoquite frankly, the two screenshots you posted are atrocious and a good reason to show people why one wouldn't use TCL/Tk
- bch 9y agoGenuinely curious - I’d like to see a more in depth criticism and/or compare/contrast side-by-side.
- 9y ago
- IronBacon 9y agoAs we are citing alternative options, I've only tried the IDE once, but if I'm not wrong Eiffel is another cross platform development/environment...
- shalabhc 9y agoFor language enthusiasts, here are some interesting features of Red (and Rebol): - You can pass unevaluated expressions to functions, which can then choose to evaluate the expressions any way they want. This sounds similar to 'fexprs' in some lisps. - Scoping is very 'flexible' - you can take a function body and evaluate it in another 'context' which provides different values for all the words in the body. - Making mini dialects (DSLs) is supposed to be easy and seems very common. It uses the `parse` function, which is a dialect used to define dialects. The parsing model is PEG like. The `view/options` for instance is a dialect being used for defining the GUI in the linked post. - Red/System is a dialect for system programming (C-level semantics, and performance) Overall it's a very interesting language and very impressive that it's also compact - the binaries are ~1MB on each platform.
- 9214 9y agoTo clarify: - unevaluated expressions are called blocks, and with them the line between code and data blurs, since you can treat block as either one at any time (homoiconity); - there're no scopes, only namespaces (contexts); - yes, Parse is one of the Red's crown jewels, many people (and author of the article himself) treat it as some kind of "plain English regex", while in fact it's not limited only to string parsing, but can be applied to any other series-like value and code (i.e. blocks) itself, which allows for some cool metaprogramming tricks; - R/S (without any optimization layers whatsoever) is 2-3 times slower than C.
- shalabhc 9y agoThanks for the clarifications. > it's not limited only to string parsing, but can be applied to any other series-like value and code (i.e. blocks) itself Sounds somewhat similar to OMeta (http://www.tinlizzie.org/ometa/ http://www.tinlizzie.org/ometa/) which can pattern match streams of objects. With contexts it sounds like almost every word can be late bound? Also it seems blocks and contexts are decoupled which means you could evaluate multiple blocks from different parts of your program in the same context, or give each a unique context, etc?
- 9y ago
- FreakyT 9y agoI don't see any reason why this would avoid the issue with every cross platform GUI toolkit: missing nuances that make apps written with it seem strange and foreign to each platform, even if superficially the appearance is correct. Minor things, like common layouts, keyboard shortcuts, or just ways of doing things in general ("get info..." vs "properties" comes to mind) are a few of what cross platform toolkits never get right.
- cmiles74 9y agoWith the success of Electron apps (i.e. Slack), I am starting to think this level of OS/GUI Fidelity isn't all that important. As long as the application is attractive and does the job, people don't seem to care that much about it matching the OS look and feel.
- thezilch 9y agoI wouldn't pin the success of any app on Electron. Most would gain a lot from pivoting away.
- gkya 9y agoThis is a very common misconception these days, IMHO. "Because people just use best of what's available, I presume that they are actually content with what they have." Today another thread talking about web apps and the heaviness thereof, people suggest that given people use these apps/websites, they must really prefer these slow, messy and creepy things to plain, information-dense sources. This might be indeed true, but you can't conclude so just observing the status quo from outside.
- chii 9y agoinstead of "best", I'd say people use what's good enough. electron is good enough for most people, and some people do notice the high resource usage, but they are in the minority, as most users don't attribute sluggishness of the machine on the app that's not slow (and electron can be made to feel fast if you know what you're doing).
- enturn 9y agoI tried installing the Windows version of Red but Avira blocked it as a trojan (TR/Crypt.XPACK.Gen2). Any thoughts? Edit: I found this https://github.com/red/red/issues/2399 https://github.com/red/red/issues/2399
- 9214 9y agoYes, Avira, Avast (and recently Norton) give us a ton of headaches because of their bad heuristics. Just to show you how they don't really care, here's a tweet discussion with Avira (dated July): https://twitter.com/red_lang/status/887970289618829312 https://twitter.com/red_lang/status/887970289618829312
- ifoundthetao 9y agoI'm incredibly excited for Red's use for exploit development, as a security researcher having a tool like this can make things move along quite well.
- greggirwin 9y agoSarcasm?
- ifoundthetao 9y agoVery serious.
- greggirwin 9y ago@badsectoracula's comment resonated with me, and obviously many others. VB was transformative. Since then, people have tried to recreate that magic. Hasn't happened. Other transformative magic has appeared but, to build on what @badsectoracula said, people miss the point when trying to recreate VB (or other magical things). Technology doesn't exist in a timeless vacuum. VB was in the right place at the right time, and solved a big problem. Solving that same problem now isn't nearly as magical. We have new problems. Still, what people miss is that a person (often brilliant) has a vision and creates it. The result has conceptual integrity and resonates with some people. Not all, but some. The goal is not to be all things to all people. That never works. I loved VB. Still do. I used it from v1.0 thru v6, and was one of the first 4 VB MVPs when they created the MVP program. As badsectoracula said, it wasn't any one thing that made it special; it was the whole. But, just as the Director's Cut of a movie isn't always better, there is the possibility of taking something and making it better. Maybe not in the visionary's view, but for others. A tale as old as time. There is a time to hold tight to the past, and a time to move forward without forgetting it. There is a time to fiercely defend our position, and a time to give way and relinquish victory in small battles so that we may win the war. Red is still very young, but Rebol's design is old. The problems Rebol aimed to solve were like classics in literature (or algorithms in CS), long-lived. Red is not aimed at solving only today's problems, or tomorrow's. It's aimed at solving the future's problems. Not by being one amazing product or technology, but by being a language we can use to communicate about problems we don't even know we have yet. For most people, though, it can serve very well as a tool to solve problems we have today, without knowing any of that.