Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-08-06 01:15:38

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 873/3,474

Cross Platform

Alright, I have a question for you guys. After I get a chance to release the latest version of the Christmas Hack (still have things to do, and haven't had time to finish it with the things i mentioned in the thread) I plan on taking a break from actually hacking to work on things like hack planning and making some tools. However, as it stands I only know how to write tools in VB6, which is not cross platform. Sure there is Gambas, which is the equivalent for Linux, but I was wondering what you all would suggest as a good language to learn for me to be able to easily release cross-platform GUI tools, similar to the ones I have released in the past?

As it stands, I have a program I have been messing with which is still in VB6, and I will probably try to translate it and my other tools to Gambas to release linux versions (I'm sorry, but OSX is not a priority for me.) but I would like to be able to code programs once and have them compilable for any OS. What language would you guys suggest I learn?

Offline

#2 2011-08-06 03:48:45

257/700

Re: Cross Platform

Mateo wrote:

Sure there is Gambas, which is the equivalent for Linux

I have never heard of Gambas, and thus doubt its usefulness.

Popular choices:

  • C with GTK

  • C++ with Qt

  • Python with GTK

I believe Pokanalysis (written in Python and C) has a GUI, if you need an example. I assume it’s compatible with Windows.

Please don’t use Java.

#3 2011-08-06 04:13:23

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 875/3,474

Re: Cross Platform

Here is the wikipedia article on Gambas

http://en.wikipedia.org/wiki/Gambas

I haven't played around with it yet, just saw it in Ubuntu Software Center and thought I'd look into it. It claims to be very similar to Visual Basic, but for making GTK applications if I remember.

I would assume pokeanalysis can run on windows, although I haven't tried. I'll check it out at some point while I'm still in linux though. Also, thanks for those suggestions. I'll look into them and see which one feels easier to use and pickup for me.

Offline

#4 2011-08-06 04:42:01

Harrison
Member
Registered: 2010-10-16
Post 58/64

Re: Cross Platform

Freepascal! With Lazarus as your IDE. It's how I wrote all of my tools.

Seriously, Freepascal. Just do it.

Offline

#5 2011-08-06 08:30:13

Tauwasser
Member
Registered: 2010-10-16
Post 154/448

Re: Cross Platform

The only GUI builder for GTK+ I used is glade. It creates xml ".ui" files which can then be loaded inside your application. However, I have to say GTK+ is a piece of shit in general and I would never ever use it again if I had the choice to use Qt instead.

cYa,

Tauwasser

Offline

#6 2011-08-06 16:38:45

Sawakita
Administrator
Registered: 2010-10-16
Post 176/364

Re: Cross Platform

IIMarckus wrote:
Mateo wrote:

Sure there is Gambas, which is the equivalent for Linux

I have never heard of Gambas, and thus doubt its usefulness.

Popular choices:

  • C with GTK

  • C++ with Qt

  • Python with GTK

I believe Pokanalysis (written in Python and C) has a GUI, if you need an example. I assume it’s compatible with Windows.

Pokanalysis should work on Windows, although compiling it is a nightmare. All I've managed to do is compiling a Cygwin version (obtaining a .dll, which I suppose is all is needed, except GUI, to run that program), but never got it running because I haven't found a Cygwin version of glade or whatever is needed to run the .glade file.

Anyway, in topic, would C# be a good solution? I've read somewhere that it's fully compatible with Wine or, well, it can run on UNIX-like systems. Could it be a good compromise between "hard-GUI multi-platform" languages (C/C++) and "easy-GUI non-multi-platform" languages (VB)?

IIMarckus wrote:

Please don’t use Java.

Java is probably the best compromise among all. I know, its optimization sucks, but apart from that, what don't you like about Java?

Harrison wrote:

Freepascal! With Lazarus as your IDE. It's how I wrote all of my tools.

Seriously, Freepascal. Just do it.

What is its "language" like? I mean, does it resemble C, Java, VB, or what? Is it OO or procedural? I'm curious, since you don't find many FreePascal users, I think.

Offline

#7 2011-08-09 05:05:47

Adrian Malacoda
New member
Registered: 2011-08-09
Post 1/2

Re: Cross Platform

I would recommend Python with wxWidgets. Cross platform with native widgets, so your app looks like a Windows app in Windows, a GTK+ app in Gnome, and uh... GTK+ app in KDE. IMHO wxWidgets provides a good mix of cross-platformity and native-look experience. As a language I find Python easier to write and to understand than most "C/Java type" languages. The syntax feels intuitive to me. Consider, for example, how you'd test for the existence of some object in a container:

aList = ["something","anything","another thing"]
if "something" in aList:
    ...

or a loop,

for element in aList:
    ...

and here's how you'd open a file!

with open("somefile.txt") as somefile:
    print somefile.read()

and it'll even close the file out for you when you're done with it.  No bloody semicolons and braces either. There's a neat wxWidgets designer called "wxGlade" (written in Python!) that I like to use; it'll be in the Ubuntu repository, of course.

C and C++ should do well too, but I can't say anything because I've never used C or C++.

Last time I looked Gambas was prerelease quality and not very robust, and not very cross-platform either.

I don't consider C# a cross-platform solution and here's why - it's controlled by a single platform company, which means that anyone else implementing C# will be playing catch-up.

Wine is never a solution, either. Do not develop for Wine. Wine is for when someone refuses to develop for GNU/Linux entirely. IOW Wine is a hack.

As for Java - Java apps take up an inappropriate amount of system resources and Swing is ugly. Java has found its way in server applications. IMHO Java should stay there, it seems more suited for that environment. The Java language itself feels verbose at times and low-level at others (not that being a low level language is bad in and of itself, just that Java feels low-level when it shouldn't).

Last edited by Adrian Malacoda (2011-08-09 05:20:48)

Offline

#8 2011-08-09 05:31:11

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 886/3,474

Re: Cross Platform

Fair enough, I'll take a look at the python and see how it treats me

Offline

#9 2011-08-09 05:35:13

260/700

Re: Cross Platform

Sawakita wrote:
IIMarckus wrote:

Please don’t use Java.

Java is probably the best compromise among all. I know, its optimization sucks, but apart from that, what don't you like about Java?

That statement was based on two things:

  • My experiences running Java apps: the JRE is a huge pain to install on less‐known platforms. Though ironically it’s gotten easier since Oracle took over.

  • The little Java code I’ve seen; the language encourages things like “Device device = Device.getDevice(deviceName);” (real code!), or FactoryFactories.

Adrian Malacoda wrote:

I would recommend Python with wxWidgets. Cross platform with native widgets, so your app looks like a Windows app in Windows, a GTK+ app in Gnome, and uh... GTK+ app in KDE. IMHO wxWidgets provides a good mix of cross-platformity and native-look experience.

I forgot about wxWidgets; I haven’t really heard anything bad about it (unlike “Qt is bloated” or “GTK sucks in general”). I will look into it.

Adrian Malacoda wrote:

I don't consider C# a cross-platform solution and here's why - it's controlled by a single platform company, which means that anyone else implementing C# will be playing catch-up.

Eh, I disagree that that’s a reason against it. Lots of languages, file formats, and/or programs are controlled by a single platform company. Mono is better than nothing, and at least C# is a standard and under a “we promise not to sue” patent license. (Compare with VP8, which is not a standard, is under a “we promise not to sue” patent license, and is encouraged by the FSF. Not that I care what the FSF thinks, but that’s another story entirely.)

#10 2011-08-09 07:36:19

amvz08
Member
From: Philippines
Registered: 2011-06-27
Post 111/600

Re: Cross Platform

yeah,python will be a go0d one, and also,it can be run on symbian ph0nes,when done in symbian format (.sis), java (.jar) can be run on java and symbian phones too.


Trust me, I'm an Engineer

>>>Pinoy ka ba? Pasok ka dito<<<

Offline

#11 2011-08-12 05:30:32

Harrison
Member
Registered: 2010-10-16
Post 59/64

Re: Cross Platform

Sawakita wrote:
Harrison wrote:

Freepascal! With Lazarus as your IDE. It's how I wrote all of my tools.

Seriously, Freepascal. Just do it.

What is its "language" like? I mean, does it resemble C, Java, VB, or what? Is it OO or procedural? I'm curious, since you don't find many FreePascal users, I think.

All of my programs are written in Freepascal, so just look at them :P Here's a sample:

procedure TPokeEdit.Open1Click(Sender: TObject);
var
  Version: Byte;
begin
  if OpenRomDialog1.Execute then
    begin
      if Rom = nil then
        Rom := TMemoryStream.Create;

      Rom.LoadFromFile(OpenRomDialog1.FileName);
      Rom.Position := $13C;
      Rom.Read(Version,SizeOf(Version));
      case Version of
        $42: Game := 'Blue';
        $52: Game := 'Red';
        $59: Game := 'Yellow';
        end;

      Modified := False;
      Save1.Enabled := True;

      //MapCombo1.ItemIndex := 0;
      // MapCombo1Change(Sender);
      MapCombo1.Enabled := True;
      Gload.Caption := Game;
    end;
end;

It's incredibly similar to Delphi, the language GoldMap was written in. Lazarus is pretty much the best IDE for it, again mimicing the Delphi 7 interface. Freepascal compiles on just about anything, and runs extremely well on all.

tl;dr I love Free Pascal and so should you :D If I ever get around to finishing Redmap, it'll be in Free Pascal.

Also, I did a little research and it does seem to have some OO capabilities. I'm not sure though, I've never needed to take advantage of them. Probably will for Redmap...


Sidenote: Don't use Java. These are lightweight tools, it doesn't make sense at all to use something as heavy as Java for them.

Last edited by Harrison (2011-08-12 05:34:51)

Offline

#12 2011-08-16 07:40:48

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 912/3,474

Re: Cross Platform

Harrison, if you wouldn't mind linking me to some tutorials and documentation of the language that would be helpful for learning the types of things I would need to make tools I would really appreciate it. I know I can google generic tutorials, but since you already use it to write tools I thought you might know some things or might be able to link me to things that helped you get started.

Offline

#13 2011-08-16 17:56:51

Harrison
Member
Registered: 2010-10-16
Post 60/64

Re: Cross Platform

In all honestly, I'm completely self-taught in Freepascal. I didn't really use any tutorials, I learned what I needed from looking mainly at Goldmap and just trying things out. Since you already have a background in programming, really all you have to do is learn the differences in Freepascal.

The Lazarus Forums are a pretty useful resource if you have a question to ask. The Lazarus website has a very nice list of documentation for the IDE and language, and there are some tutorials linked to.

One heads up, at first the executables made from Lazarus appear to be huge. This is only because the debug information is included in the exe when built. Lazarus includes "strip.exe" which will bring the exe down to size once you're ready to release. For more info, see here.

Last edited by Harrison (2011-08-16 17:57:09)

Offline

#14 2011-08-16 20:00:46

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 913/3,474

Re: Cross Platform

Alright, thanks mate. I'll check that out

Offline

#15 2011-08-17 00:17:52

Harrison
Member
Registered: 2010-10-16
Post 61/64

Re: Cross Platform

Feel free to message me on AIM/MSN if you need any help :D

Offline

#16 2011-08-22 20:36:43

Sawakita
Administrator
Registered: 2010-10-16
Post 193/364

Re: Cross Platform

Adrian Malacoda wrote:

I would recommend Python with wxWidgets.

I've made some research around the web and I was surprised how widely and largely Python is supported; Vim itself has tens of scripts that improve Vim-Python relationship.
By the way, what editor do you use? IDLE, Vim or what else? I'm having some trouble trying to re-create the "F5 (Run) command", in Vim, and make it recognize the "import wx". IDLE doesn't throw that error, while Vim says it can't find the module Nevermind, I got it working :P

About wxWidgets: after failing 4-5 times at compiling it (mainly because of coding errors and my inability to fix such errors) I found what looked like a convenient solution (since it was already compiled for Win32), called wxPython. Have you ever tried it (or is it the same thing as wxWidgets? It shouldn't, since wxPython is way smaller in size, than wxWidgets).

Adrian Malacoda wrote:

There's a neat wxWidgets designer called "wxGlade" (written in Python!) that I like to use; it'll be in the Ubuntu repository, of course.

I've read in various places that learning how to write GUI "by hand" is better than using GUI designers (mainly for flexibility reasons). Did you find any limitation in using wxGlade? (I've downloaded it anyway, who knows!)

Now, about the "FreePascal + Lazarus" solution: I gave a look at a Harrison's program, at wiki, and at the IDE, and I was disappointed by a couple of facts:
- the IDE is gargantuan (I so rarely have an opportunity to use it in a sentence), more than 500 MB. This applies to other IDEs like .NET Framework too but, unlike this one, the former's "largeness" is not so rightly motivated (in my opinion, of course);
- the executables themselves, if compiled in the standard way, are awfully large (more than 10 MB!). Even when compressed (using UPX) they're still like 1 MB (I've seen this in a relatively simple program as Harrison's "RBY Wild Pokemon Editor", so I wonder what will bigger projects come out like..).


Long story short, Python seems, to me, like a very convenient way of programming, and a really neat one too. The built-in tutorial is easy and nice to follow too.
Python has my vote too, I guess.

Last edited by Sawakita (2011-08-22 21:13:49)

Offline

#17 2011-08-29 06:33:44

Adrian Malacoda
New member
Registered: 2011-08-09
Post 2/2

Re: Cross Platform

Sawakita wrote:

I've made some research around the web and I was surprised how widely and largely Python is supported; Vim itself has tens of scripts that improve Vim-Python relationship.
By the way, what editor do you use? IDLE, Vim or what else? I'm having some trouble trying to re-create the "F5 (Run) command", in Vim, and make it recognize the "import wx". IDLE doesn't throw that error, while Vim says it can't find the module Nevermind, I got it working :P

I usually just use the Gnome text editor or Geany. I use Idle only very infrequently.

Sawakita wrote:

About wxWidgets: after failing 4-5 times at compiling it (mainly because of coding errors and my inability to fix such errors) I found what looked like a convenient solution (since it was already compiled for Win32), called wxPython. Have you ever tried it (or is it the same thing as wxWidgets? It shouldn't, since wxPython is way smaller in size, than wxWidgets).

wxPython is the Python binding for wxWidgets (which is a C++ library). You will need wxWidgets to use it. You shouldn't have to compile anything, wxWidgets has an installer on its download page. http://www.wxwidgets.org/downloads/#latest_dev

Sawakita wrote:

I've read in various places that learning how to write GUI "by hand" is better than using GUI designers (mainly for flexibility reasons).

In general you have more flexibility doing something by hand than using any sort of designer tool, but if you don't want to spend time laying out widgets by hand using a designer can speed it up. Since you can open up the generated code and tweak it however you need to, you're not really losing much.

Offline

#18 2011-08-29 18:00:36

tysonrss
Member
From: US, Ohio
Registered: 2011-08-27
Post 15/649

Re: Cross Platform

As many said before me, the C language is the way to go, its actually fun to learn.


Pokemon Blue DX is reborn!

Offline

#19 2011-08-30 14:42:57

Harrison
Member
Registered: 2010-10-16
Post 62/64

Re: Cross Platform

Sawakita wrote:

Now, about the "FreePascal + Lazarus" solution: I gave a look at a Harrison's program, at wiki, and at the IDE, and I was disappointed by a couple of facts:
- the IDE is gargantuan (I so rarely have an opportunity to use it in a sentence), more than 500 MB. This applies to other IDEs like .NET Framework too but, unlike this one, the former's "largeness" is not so rightly motivated (in my opinion, of course);
- the executables themselves, if compiled in the standard way, are awfully large (more than 10 MB!). Even when compressed (using UPX) they're still like 1 MB (I've seen this in a relatively simple program as Harrison's "RBY Wild Pokemon Editor", so I wonder what will bigger projects come out like..).

The IDE is large, I can't argue against that. However, the executable size I already mentioned and linked to this page which explains why they are so large. Lazarus projects start large and grow extremely slowly. For example, the current version of RedMap I have (opens and displays maps with limited editing capabilities, reading the tilesets from the ROM. Technically more complex than the Wild Pokemon editor) is smaller than the Wild Pokemon editor.

Of course, the real test of size will be if I ever actually finish RedMap.

Offline

#20 2011-08-30 22:09:17

Sawakita
Administrator
Registered: 2010-10-16
Post 200/364

Re: Cross Platform

@Harrison: Of course, you're right there. My speech about exe size was not too relevant, since the difference of size between an optimized "C like" program and a Freepascal one is not that big of a problem. Whatever works is good.

Adrian Malacoda wrote:

You will need wxWidgets to use it. You shouldn't have to compile anything, wxWidgets has an installer on its download page.

Actually the installer just unZips the files, you still need to compile them in order to get the needed DLLs. Anyway, wxPython worked since the first time, so, yeah, it's fine.

Offline

Board footer

Powered by FluxBB