Hacker News new | past | comments | ask | show | jobs | submit login
Gambas: Visual Basic on Linux (sourceforge.net)
189 points by galfarragem on March 14, 2020 | hide | past | favorite | 82 comments



http://gambaswiki.org/wiki/doc/diffvb lists "Differences From Visual Basic" and says "Gambas is not intended to be a clone of Microsoft Visual Basic" and "you can't simply copy your VB projects over and expect them to compile under Gambas".


Of course, you can’t copy your Visual Basic projects into Microsoft’s own Visual Basic.NET and expect them to compile there either.


>Thankfully, in Gambas you cannot use GOTO to trap errors! Instead, use CATCH, FINALLY or TRY

For error handling goto is generally much clearer than using exceptions.


Cleaner? Prettier? That's a preference. Having the catch below allows you to see everything at once. Complexity can be encapsulation in readable functions/class method names, etc if your catch does too much.


The construction being referenced is On Error [ERR_NO] Goto LABEL, which is not usually local to the error, and, depending on the dialect may be a generic handler that first needs to figure out what error it's handling.


Or, worse, and common in classic VB, ON ERROR RESUME NEXT. Which just skips the line that errored.


It sets Err. Which is essentially how SH, C and Go work too.

(With the obvious exceptions of longjmp and panic/defer, global vs local var, and Go forcing to assign the error.)

On Error Resume Next isn't great, but calling it much worse than On Error Goto, or much worse than other languages, is a stretch.

My point is only that people complain about it in VB disproportionally often compared to other languages. (Does that mitigate the issue to some extent, if every VB dev is super aware of it?)


I don’t think I’ve ever seen any vb code which actually checks that, though,or dry little, certainly. In C and Go you get something returned, which is a hint that you should maybe do something with it. In VB a magic global variable is set, and then generally ignored.


That's how I've done it. Enable it before the line(s) in question, then check err.number, and add "On Error Goto 0" after that so you get the default handler again.

Usually much cleaner than jumping to somewhere else, but that had its uses too.


Ah. I was never actually a VB programmer, but I did have a few side-jobs porting VB apps (mostly CRUD webapps) to something more modern in the mid-noughties. My experience from that was that real world use of on error resume next was to turn it on and leave it on.


Dijkstra would hate you


In the same vein, we have Lazarus vs Delphi:

https://www.lazarus-ide.org/


A great piece of software which, very important, runs native on ARM. That is, no cross compiling required to write and compile software for small ARM boards.


I have Lazarus IDE running in Raspberry Pi just fine for one of my fun projects


Lazarus is a lot closer to Delphi though.


That's a solid choice is this arena.


I haven't heard of this, or Gambas either. I've mostly just been writing in Python+Qt5, with my last project being a video player frontend:

https://gitlab.com/djsumdog/mpvbuddy

It's alright, and way better than Electron Cancer.

For Gambas models, does it have built-in models that can update their own views or is it all retained mode like all the other GUIs. The one big advantage of web frameworks seems to be how they're immediate mode (using things like the Shadow DOM) so you don't have to emit state changes. It doesn't seem like they're very many non-web based GUI toolkits which can do that (which aren't minimalist and meant for games)


For open source, I don't think there's a better one.

(Multiplatform) GUI is one of those things you really have to throw money at if you value your time.


Yeah. I'm waiting on Red, but have been waiting a long time.

On another note, one commercial option that is very cheap (like $250 for a professional license that is perpetual for that version and collects $0 royalties), but can build GUIs for (Windows, Linux, OSx, Raspberry Pi, Android, and iOS) and has very good built-in database support, encryption, audio, assembly...etc is the forth based 8th language. You can get source with an NDA and $2500 if you really need it. I've only played with it so far, but it is crazy fun and has a lot of built-in goodies. The author fixes many bugs in like hours and will push a new version same day for zero cost.


Links for 8th:

* Home: https://8th-dev.com/

* About: https://8th-dev.com/about8th.html

* Previous discussion: https://news.ycombinator.com/item?id=15672361

First I've heard of 8th, but my immediate reaction is similar to the comments in the HN discussion :/


Understandable. Even if a tool is really nice, once you're used to free and open-source tools, commercial applications seem a bit yucky.


Just to add 2 cents: HaxeUI[1] does this job, is stable and it's being actively developed.

[1]: http://haxeui.org/


Does it allow you to release as a single executable binary?


Yes. It basically outputs the executable binary for the target you choose when compiling your Haxe code. It means you write Haxe source and the 'compiler' (transpiler, actually) generates code for the choosen target. It will then compile the generated code using the target compiler installed in your system, if necessary (when you target C++, for example).


So how we debug the code? I mean other than various form of logging/dump.


There is solid debugging support for most Haxe targets on VSCode[1].

[1]: https://github.com/vshaxe/vshaxe/wiki/Debugging


This is interesting. Will take a look.


Really? What’s wrong with TCL/TK?


There is nothing wrong in TCL/TK. TCL/TK has:

1) SafeTcl for running untrusted code

2) AndroWish for making Android apps

3) Wapp for web apps

4) Embedded SQLite database

5) Expect for automation

6) TclKit for single binaries

7) Hecl for running Tcl code on Symbian devices

8) Fossil that is better than git, stores repo in much less space.

It's not like there is anything wrong in any programming language, when it's still getting features, fixes, security fixes etc.

Problem is, when there is existing large VBA/VB6/VB.Net/Excel etc apps and Microsoft stops developing Visual Basic language.


Unicode support, especially for RTL languages, is abysmal.


While Lazarus supports multiple OSes, Gambas is pretty much Linux only.


For Windows, MacOS, iOS and Android: check out AppStudio. It lets you code in VB like BASIC. A VB like Design Screen lets you drag and drop visual controls. Output is JavaScript/HTML so it runs everywhere. (Disclosure - I'm on the team) https://www.appstudio.dev/


This is fantastic. I've lamented the lack of a good GUI and environment for making desktop apps since VB 4, but it looks like they never went away.

Gambas looks fantastic, and exactly as easy to develop with as I remember VB 4 being. I can't say I can stomach the language it uses, but something like this for Python would be a godsend.


Check out Anvil: https://anvil.works/


This looks nice, thank you. It's only web apps though, right? Ie no native components.


Speaking of Visual Basic... this tool (Windows based) that let's you quickly/easily develop an simple Android app using a flavour of Basic:

https://www.b4x.com/b4a.html

The developer recently released the tool's source and made it free.

It's a mature tool with lots of community support. It also has a pretty slick GUI Android screen designer (Win only - but works in WINE).

It might even be feasible to get the Gambas tool to work with the B4A Android Bridge and Designer.


It's worth noting that the same developer has free tools for desktop (Java) and Raspberry Pi applications, and a paid tool for iOS.

All of these use the same dialect of BASIC, and I believe they can use (but don't have to) a cross-platform GUI.


About the same time that "Microsoft plots the end of Visual Basic" (https://news.ycombinator.com/item?id=22570684).


I can't believe I haven't heard of this, it looks awesome. Looks like it can compile web apps too?


https://gambaswiki.org/wiki/comp/gb.web

I remember reading about this some time ago, like almost 10 years ago. So you have to wonder if there are businesses out there using Gambas web apps without knowing it. :-) Some of the developers who use Gambas are very experienced.


The phenomenal quantity of bugs and inconsistencies that makes Visual Basic so delightful persuaded me to start this project

It seems that Microsoft was aware of the poor quality of its language, as VB .Net is not backward compatible with older versions of Visual Basic.

I dislike the bad level of common Visual Basic programmers, often due to bad pratices imposed by the bugs and strangeness of this language.

Pity he couldn't resist taknng a swipe at vb and vb programmers in his introduction. Also he's inaccurate wrt to his comments about why Microsoft didn't make a vb7.


Sourceforge? Is this an old post?


The source code is on gitlab https://gitlab.com/gambas/gambas


Not everyone is jumping into Github.


Considering the malware years of sourceforge, this is no opportunity to take a stab at github. The surprise is that sourceforge is still a thing. https://www.howtogeek.com/218764/warning-don%E2%80%99t-downl...


No but everyone should jump away from SourceForge after the shady crap they pulled. Gitlab is also a thing.


SourceForge has now long been under a different ownership then when the shaddy crap happened. Since ownership changed there has been no shaddy behavior.


I wasn’t aware of this - and it’s a testament to the fact that sometimes there are no second chances after image and trust is destroyed.


The new management has been much better, AFAIK.


The download link actually appears to open a gitlab URL.


The last release is January this year.


"Gambas" means prawns in Spanish


funny, cuz that's what I call VB programmers... lol jk

This is an interesting project, but in my experience with companies that still use VB6 or VB.net (they have no idea about linux nor a desire to learn anything new... hence why they are still on VB6)


Also slang for legs in Argentina.


And for AR$100


Curious, where are you?


He's at home. There's a quarantine you know!


This made me chuckle

Needed it with all the stress at work


Would be good to have a cross platform version of this. I wonder how difficult it would be?


Xojo does it, but they are a long time commercial effort (RealBasic).


A friend that runs a one man shop developing websites and native apps swears by it. He actually moved his new developments from Lazarus to Xojo and is always talking about the upcoming Xojo web 2.0.

I gave it a try a few times but it never clicked. I felt constrained by the language (Lisp, Smalltalk and Forth ruined me for life) and the runtime is nothing to write home about. For most people I guess it doesn't matter. My friend doesn't even know what reference counting is and wants something simple to get stuff done.


To me, these are what computing should be all about: blurring the distinction between user/programmer, but providing gradations of complexity, comprehensiveness, and control.

Lazarus aside, it seems FOSS isn't going to give us the kind of RAD tools that one might hope for -- thinks more like Hypercard and related. Such efforts require the kind of resources (long periods of time and good funding, to start) that loose networks of casual contributors are never going to be able to provide. And in today's world, where next-quarter reporting and shareholder primacy dominate enterprise decisions, it's even rare to get something truly immersive and new from commercial entities (Apple is the biggest corp in the world. Do they have something like their ATG group from the 90s? If so, what the hell are they working on?)

> Lisp, Smalltalk and Forth ruined me for life)

Same here, but there's a (partial) reason these aren't really viable in today's computing culture. The first is that they really are for whole computing systems that don't necessarily make a distinction between user and programmer. The culture we have today is the opposite of this: users are consumers, first and foremost. Computing systems are thus mechanisms that run isolated "applications" whose ability to be modified by regular people is severely limited compared to what we know (and have known for 4 decades) is possible.


Xojo is a solid paid solution. I use it all the time.


Could you please talk about what kind of projects you are using it for? Do you use it for serious projects or just toy ones? Web or mobile?

I looked at the site, this sounds interesting. Just interested in hearing it from someone who uses it


Well let's say you need an app to program IP addy info into a IOT device on the LAN. Multi-platform done in 1 hour. You can also write web apps, drag and drop, we're really excited for the web 2.0 coming this year.


I've followed them since they were "RealBasic". I think I might just start using it. I keep bouncing between Lazarus/Pascal and Xojo/Basic. lol


Their instructions for compiling it on Cygwin hints on its dependencies. Looks like a long list, but many of those probably have ports for other plaforms (e.g. Windows). The Wikipedia article says it has been ported to Mac and FreeBSD "based on using local versions of the X11 system". Perhaps these are leads...


Previously when I installed Gambas to Windows with Cygwin, I did not need to build from source.

With Cygwin:

setup-x86_64.exe --packages gambas3,xinit,xwin-xdg-menu

Install from Internet, click Next

Root Directory C:\cygwin64 , click Next

Select Local Package Directory C:\Users\USERNAME\Downloads - where setup files are downloaded before installing, click Next

Select Internet Connection / Direct Connection, click Next

Choose a Download Site - I did select http://ftp-stud.hs-esserlingen.de but some other could also work

Select Packages - All required is selected, click Next

Wait while downloading and installing

Checkmark: [X] Create icon on Desktop [X] Add icon to Start Menu

Click Finished

Start Gambas this way:

Start / All Programs / Cygwin-X / XWin-Server

From hidden taskbar right corner icons select icon that has black C and in middle of it light green X. From there click Programming / Gambas3.


Thanks. Though, I still think it would be cool if there's a more native port that runs out of the box.

Curious to know the experience on the Gambas apps produced in Windows. I guess they would also need Cygwin?


I tried to install Gambas with info above, and seems it did not start on Win10.

I also think that on Windows Cygwin is required.

Following is from bottom of page http://gambaswiki.org/wiki/doc/faq?nh&l=en#t12

"Will you port Gambas to Windows™ ?

I won't, but I will help any people trying to do that.

Gambas already runs under Cygwin. Note that there is a lot of things to port, if you want to do a native port: process management, gb.qt4 component, and so on... This is a huge job. The most promising compiler target would be Mingw-w64, which also allows cross compilation on a unix-like system."

If you use Gambas for making web apps, then you could use webbrowser to access those apps. Gambas IDE has wizard for web app, and some components that can be dragged to form. From some forum discussions I have read that debugging those web apps is easier then debugging php apps.


For more info about Gambas, you can watch Gambas interview at Floss Weekly:

https://twit.tv/shows/floss-weekly/episodes/353


The issue I've had with cross platform VB-like languages is they all ended up just compiling to C, which meant losing all the great IDE-integrated debugging.


It's not "Visual Basic". At best, it's a basic done in the same "spirit" as Visual Basic.


[flagged]


Don't you think that "ideological reasons" can be quite a good reason to do things?

Besides, following ideological reasons only means to value certain (other) aspects higher for evaluating the question how good something is.

Usually the term ideological implies (in my book) that a person is considering the greater good, and willing to take a step back in own convenience. That sounds like a nice person to me. Maybe you could spare some curiosity for their reasons?


Ideology is all fine and well until you start to deviate too much from reality. Then you hit a wall.

Example : there are cases of babies dying because their parents refused to give them animal milk.

Be pragmatic : you don't want to hurt animals, OK, but why not raising a couple chicken to get some eggs ?

Fwiw, my servers are Linux, but my desktop is Windows (it's not for lack of trying Linux as a desktop).


Sometimes it's because someone wants to leverage the colossal investment already made in VB code and being able to run and maintain it on Linux is better than being locked to Windows anyway.


On the other hand, I have seen companies locked to specific Linux distributions, so....


That's odd. They must have done something impossibly wrong.


Yeah, like using commercial software for Linux, depending on distribution specific tools, non upgradable drivers, strange things.


Bad example. Noodles ARE vegan.


Many are only ovo-vegtarian.


I think there's a little more to it than that, but just a little...

A most uncomfortable truth!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: