2014-08-13 06:16:58

Speaking of cdb, I really need to get the debugging tools for windows again. I deleted them; maybe I'll get'em again?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-08-13 17:06:04

believe it or not, cdb is actually a really good debugger once you learn it.  Only super useful with the MS compilers and gdb is better, but once you learn it a bit it actually does an unbelievable amount of stuff.  It turns out that the problems I've had with it (C++ template and STL debugging) exist everywhere.
I believe it is now integrated with the Windows 8 SDK or Visual Studio 2013.  I do not recall which, but I'm almost certain that debugging tools for windows has basically been merged at this point.
Unfortunately, mdbg, the command line debugger for .net, was killed and removed; consequently, debugging the CLR requires Visual Studio.  The Visual Studio debuggers exist in this weird place between UIA and MSAA and are known by Microsoft to be broken in terms of accessibility, so only jaws sees them.  There are enough other problems with the accessibility of VS that it's not worth it imho.  Technically, the latest versions of cdb have a little support for the CLR, but I think it's not even to the point of setting breakpoints.  I don't use the .net languages because Libaudioverse is C++, and I can build a pretty good case for C++ over them in a professional environment these days (sharing between five platforms).
Finally, here's an interesting tidbit.  Windows is the only platform I know of that offers a full debugger API.  It's a set of COM objects that, apparently, both VS and cdb/WinDbg use.  I.e. you can, in theory, make your own debugger.  This is a bigger project than it sounds because of lack of documentation, and not something I've explored.

My Blog
Twitter: @ajhicks1992

2014-08-14 01:23:48

@camlorn, you are quite correct. Although, I prefer Objective-C, C, C++, Objective-C++, Ada, D, Go, and Java. I won't be using Fortran because I don't like its syntax. Add PB to the languages above. I'm curious if I can find the headers for the debugging API. I'm curious if I can cross it over to Mac OS X and Linux. It maybe possible. If you want to know how to truely make a debugger, get the GDB soucre code and look under the 'include' directory for the headers, and then look under the 'src' directory. I'm not sure what the master source file is, but hey! That's what exploration is for!

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-08-14 02:05:42

I would not start with gdb to learn this.  Debuggers are actually hugely complex, GCC is known to be a platform that's hard to develop for, and gdb has had close to or over 20 years of continuous hacking and development.  Clang spun off them and shares no common code in part because of this, and GDB involves just about everything you could ever want to know about anything to do with your computer all at the same time.  Think hundreds of man-years of development and so complex that they have actually admitted that they have trouble finding developers who can fully understand the GCC stack at this point.  This is outside the experience level of everyone I know everywhere, including every professor I've ever met.  What Microsoft has done is exposed the API as a set of COM objects, and then called into it from elsewhere.  I.e. there is a debugger, and you just need to write an interface on it.
In actuality, the debuggers are usually made with the compiler.  I.e. Gdb only debugs GCC executables, with very limited support for other stuff.  The API Microsoft provides, therefore, only works fully on MS executables with the MS symbol format.  You can't port it in any short amount of time: leaving aside the fact that it's COM and Windows and that you don't have actual source code, you'd probably have to either completely rearrange GDB into some new and interesting format or write your own debugger that supports the GCC or Clang symbol formats.
My advice to everyone here is stay far away.  There are enough options that work already, and it'll just chew through your time like you wouldn't believe.  The only reason I'd do this ever is for pure fun, not because I'm expecting anything at all to come of it.

My Blog
Twitter: @ajhicks1992

2014-08-14 05:50:57

Totally agreeable. I think that we should move away from this topic, though, and start our own topic for objective-C and lal of the GNU stuff. I don't want to create it (because I'm compiling gcj!), but camlorn, if you want to continue this discussion, I'd recommend we move away from this topic and start our own. Or maybe not?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-08-16 12:02:12

I imagine the Microsoft tools will remain free as long as they offer their DDK for free. That's also a very cheeky way to get MFC 4.2 without buying Visual Studio, if you don't mind breaking the rules.

I don't know the state of gdb on Win32, but it does appear some OSS projects are using it successfully for reporting crashes. I don't know whether this necessarily means gdb can read Microsoft check symbols output by MSVC though. Those, and remote debugging, are in my opinion the single best reasons to use Microsoft's debugger interface via cdb. Of course if you are using MinGW then gdb is probably going to be the correct choice to debug your own code.

Just myself, as usual.

2014-08-17 08:59:15

Exactly. I'm not sure how people actually manage to debug an OS, but its completely possible. Well, it is, if you want to use cables and other things like that. I don't think that GDB supports wireless, remote debugging though.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-08-19 05:35:20 (edited by frastlin 2014-08-19 05:40:35)

In looking at pb code, I'm kind of startled. In python the Hello world script is:

print "hello world"

and that's all...
I use EdSharp as my text editor and I've configured my screen reader (NVDA) to read \t or 4 spaces as a "tab", so python script reads:
def function(argument):
tab"""This is a basic function with if statements"""
tab if argument == "hello":
tab tab print "Good bye"
tab elif argument == "bye":
tab tab print "Hello!"

function("argument=bye")


To get a gui you need to do some installing of pygame which then requires that you write several lines of code at the top of your main script file, but:

#The number sign means comment
#Bring the pygame package and scripts into our project:
import pygame
#Imports all the local variables from pygame, I'm not sure what they #all are, I've never used them except in this little gui creation.
from pygame.locals import *
#initializes the pygame engine
pygame.init()
#creates a screen or gui that is black for us to use.
screen = pygame.display.set_mode((640, 480))
#Sets the title of the window (I took this script from my keyboard #test script because I have it up...
pygame.display.set_caption('pygame keyboard test')
#You don't need this, but it makes the mouse invisible I think...
pygame.mouse.set_visible(0)


Then that is all for the wrest of the game. Just those 6 lines of code. And with python you have so many packages that help with things, like accessible_output, a package that provides screen reader support for almost every screen reader on mac, windows and linux, you will have libaudioverse which is a sound library written by camlorn, you have pyinstaller or py2exe which makes .exe files for python projects, you have all kinds of web server stuff, you can even write a website in python rather than using javascript (You just need to have the right package!).
Learn Python The Hard Waywill take you through the process of printing "hello world" to the screen to creating a web version of a game that you make.
Best part, it is free! (Well but for videos on learn python the hard way and libaudioverse), but you could use pyAl instead of libaudioverse and you could not watch the videos, like me... So for the most part it is free.


If you have a question about python you just google:
"How do I print hello world to the screen in python"
and tons of examples and answers to your question pop up.
Where as when I type the same question into google with pure basic rather than python, I got 1 that said what I wanted...
So why go for the less supported, less popular and less functional language when the more supported, more used, more functional language is just as easy (if not easier to use)?
I've even seen a whole OS written in python (unix based) and when you feel too restricted by python, you can jump over to C++ or C and write dll files that you can then use in your python program.
So why go pure basic?

2014-08-19 06:59:40

Why go pure basic? Good question, and one which I will attempt to answer here. Because, it gets the job done. I'm not intrested in shiny object orionted programming, nore in a fansy new sound library, nore any of that stuff if it can't do the job, and weather it can is entirely baste on the programmers opinion. And yes, I have tried learning python but could never really get into it. Severe storm steve here was intraduced to pure basic by me, and from what I have seen he's quite cumffy with it. Of course, if he decides to go to c++, that's his choice. So long as it gets the job done, users don't cair what your using, even if its autoit.

Check out the new reality software site. http://realitysoftware.noip.us

2014-08-19 15:30:36 (edited by bryanbkm82 2014-08-19 15:32:48)

Hi.
I've been messing with pure basic off and on for a while.
It seems like a pretty good language so far.
I do have a question about python though.
Is it true that pygame and all the others work with a certain version of python? I'd be interested in trying it, but That's the only thing stopping me. So far pb is doing to job for me, but I'm interested in other languages as well.

Bryan Mckinnish
aka the blue-eyes white dragon, with an attack strength of 3000 and a defense strength  of 2500!

2014-08-19 19:06:54

For most things there is python 2.x and 3.x.
Most everything is running 2.x and there is most support for 2.x. 3.x is supported by most things now though, it is just a little more difficult to find tutorials for. The difference between the two is very small. Python 3.x has a few more advanced packages that have been created for it and it has some more concise syntax
input("prompt")
rather than
raw_input("prompt")
and there is better support for more advanced operations, but I've never hit the 2.7 limits and 3.x has not become worth the trouble to convert yet (although it is almost to that point).
If you are willing to work with an evolving language, use 3.x, but if not, just use 2.7.8.
Here is an FAQ on the differences
There is also full unicode support in 3.x, so people who's languages are not in ascii can write in their own language. That was the main reason for the change.
Most 2.7 stuff will run on 3.x, but 3.x will not run on 2.x.

2014-08-19 19:08:14

pygame supports all the way up to python 3.3 I believe.

2014-08-21 04:51:29

@frastlin, you are wrong about things not working on 3.x when they're ran in python 2.x. However, this only works on python 3.3 and earlier versions of 3.x. Python versions 3.4 ant later finalize the new language syntax, and 2.x applications no longer work. The toughest thing I have to do is convert things from 2.x to 3.x. Mosty it involves changing print "text" to print ("text"), and raw_input() to input(), but other times I forget the differences with if and for. Also, although it works, it... well, it throws many tracebacks, some of which make absolutely no sense at all.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-08-21 05:32:26

So if one is wishing to learn a language, it would probably be a good idea to install 3.3. I didn't know that you could run 2.7 programs in 3.3.
I knew that 3.3 had a special 2.x interpreter that you could by running python -2 or something like that, but I don't remember trying to run my 2.x programs in 3.3.

2014-08-21 13:53:46

I don't mind PureBasic all that much. In fact, Road TO Rage is entirely written in it and the only reason it dies so hardcore is because of my inability to code. So if we're talking about audio games, there is way than enough room for making those. We have wrappers for many kinds of different audio engines that support different things, it's easy to set-up, so if you're not looking for the most advanced language and want to get off the ground quickly, and, of course, don't mind the basic syntax, I think it's definitely worth a look.

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2014-08-21 17:18:51

Unless someone cites a source about this ability to run Python 2.x programs on Python 3.3, I'm going to have to say that this isn't true.  I am basically certain, but if there's something I don't know, etc.  The compatibility goes in the other direction; you can run some 3.x programs on 2.7.x via from __future__ import feature statements, i.e. from __future__ import division.  But not many, and it's only really a bridge to get from 2.7.x to 3.0 without having to do it all at once.
What you can do is use the "py" launcher and install both 2.x and 3.x, at least on windows; it defaults to 2.7, as I recall.  To get later, you use a special comment at the top of the file or a command line option.  The launcher comes with Python 3.x, but you still need to have 2.x installed somewhere.
Simple Python programs will in fact work on both, but critical methods on built-in data types were removed, i.e. iterkeys and itervalues.  The regular versions of these methods that used to return lists now return iterators.  There's a bunch of other changes involving unicode that are also not encountered by Python newcomers, and a bunch of other smaller stuff.  The problem is that it is not necessarily true that all the packages you want to use work on both, even if your programs do.  These features were changed in 3.0, not 3.4; moving the version later does, of course, introduce more changes from 2.x to cope with.
Most of the tutorials are 2.x, though the library situation is improving.  Pypy just added support for 3.3, and a lot of stuff is either already ported or unavailable but with alternatives (and some of them are now even built-in, like asyncio).
@GhorthalonTheDragon
You're saying that you are a bad programmer.  Have you tried other languages, especially those with garbage collection?  Constructors/destructors, exceptions, and a GC can get rid of at least half the most common programmer errors: forgetting to allocate, forgetting to free, and forgetting to check if said allocation/initialization succeeded (in the third case, you usually get an exception, catching it at the point of the problem and not 500 lines later in a different file).  I totally have to stand by my statement that Purebasic is C but prettier.  I don't necessarily feel that OO is the only paradyme or the best in all situations.  Classes, to me, are a handy way to get constructors and not have to remember to pass the first parameter to all the methods that touch the player.  Do I use OO? yes, but only when appropriate.

My Blog
Twitter: @ajhicks1992

2014-08-21 18:53:03

Of course I do believe in things that make the life of programmers easier and I have looked at other options, like C, and later C#. And since I work with Android a lot, Java. But since this thread asked about PureBasic and I do not believe that PureBasic is a definite no-no, I gave my opinion. There are many ways to achieve a goal and of course I'd choose the one that makes it

easier

and most reliable for me. RTR is already a couple of years old and the first of projects I attempted of it's kind. So of course I learn.

--
Talon
Wanna play my Games? Listen to my Music? Follow me on Twitter, and say hi~
Code is poetry.

2014-08-21 22:40:55

I'm trying to understand the mindset here.  Purebasic has every single characteristic of a language I'd consider nonproductive: lack of large community, lack of large numbers of libraries, lack of large quantities of external resources, and lack of features to encapsulate beyond the function and the struct.  The proceeding is barely an opinion, but the following is not.  In terms of a language, it provides not much more than C; before someone mentions built-in libraries, I can get all of the built-in stuff externally.  Yet, as soon as someone says C, everyone runs screaming.  I'm trying to figure out how two languages that are essentially the same can engender two polar opposite opinions-especially since the one everyone says positive things about is not free and the one everyone says negative things about has at least 1000 times as many users, tutorials, documentation sets, libraries, etc.  And then, as soon as I mention C++, in which you can program in exactly the same manner as Purebasic and still have built-in libraries for a lot of common algorithmic tasks, everyone reacts as though I've got two heads or something.
So shrug, I guess.

My Blog
Twitter: @ajhicks1992

2014-08-22 03:15:30

I think the fact that pb is built for games?
but don't you have to write a lot more code in C++ than you need to do in pb?
Hello world in pb is 3 lines, in c it is 6 or so. I don't know if you need to compile pb, but that is also a consideration.

2014-08-22 03:42:53 (edited by stewie 2014-08-22 03:46:27)

Hello world is not a great indicator of total code size. Excluding function calls, hello world in either would be 2 lines in c++ and more in pure basic.

If pure basic is lacking many features such as classes, I can imagine pure basic code getting rather larger than c++. Code size is dependent on the type of project though. If you are developing a small GUI application for pure basic, it will be shorter. For c++ a small console rpg may or may not be shorter, it depends on the libraries used and the style of coding. In the end it comes down to preference, however if you are aiming for a mainstream programming job for example pure basic may not meet industry standards. Recreationally pure basic could work, it comes down to personal preference.

Both C++ and pure basic are compiled languages, meaning they have to be compiled to run them (at least with the interpreters and software used.)

Deep in the human unconscious is a pervasive need for a logical universe that makes sense. But the real universe is always one step beyond logic.

2014-08-22 04:36:35 (edited by frastlin 2014-08-22 04:39:02)

I could not ever build a game in a language with no classes or modules LOL...
In python I have a set of modules that are a mixture of other people's code and my code that I use in everything.
With my setup, calling a screen is 2 lines, catching the keyboard output is 4 lines, plus what ever other checks you wish to do with those key presses.
import pygame_scripts as pg

def main():
    pg.screen("short amount of lines test") #is the screen
    #now for key catching and game loop:
    play = True
    while play:
        key = pg.key2() # catches the keydown event of all keys as well as modifier keys like shift
        if key[0] = "escape":
            play = False #exit of the script. key has 2 items, (keyName, modName) so [0] means keyName and [1] would mean modName.


#and to run the code:
main()


How is pb or C++ in relationship to this? I heard C++ was OO, but is it this OO? Can you make it this OO?
With maybe 90 lines I can create a small fight simulator with multithreading and everything...

2014-08-22 04:53:25 (edited by stewie 2014-08-22 04:56:04)

Regarding the pg_scripts, can't a key have more than one modifier? Also if it captures every key shouldn't that be a list? Or is keys2 a yield function?

Deep in the human unconscious is a pervasive need for a logical universe that makes sense. But the real universe is always one step beyond logic.

2014-08-22 05:04:19

Frastlin, yes, C++ is object oriented, and it is possible to create a set of headers and libraries to do something similar to what you did in Python above. that's precisely how my game engine works. My engine is essentially a collection of C++ classes and libraries written in C++ which allows me to use object orientation to quickly access audio, input, timers, and build various types of game objects simply by creating an object and initializing it. After that the functions inside my classes do all the heavy lifting behind the scenes as it were.

Sincerely,
Thomas Ward
USA Games Interactive
http://www.usagamesinteractive.com

2014-08-22 05:12:09

@camlorn people arn't screaming at you for c++, but as I pointed out here people will use whatever programming language gets the job done for them, not always the one with 1000 users. I myself have tried c++ coding, and personally found I wasn't ready. And remember. Everyone has diffrent needs. If I want to write something like death match or snow race, pure basic is my language of choice. If I was coding some really large bit of software, pure basic would still be my choice because it has the tools to get the job done for me. I could cair less if their's a large community and how menny users. If the language don't get the job done, and I need to constantly refer back to a manual for functions, I aint using it. And your assumptions about pb seem to be quite rong. Their is a large community, and their are menny libraries for it at purearea.net. To everyone else. Creating a hello world program is easy, like this. MessageRequester("hello", "Hello world!")

Check out the new reality software site. http://realitysoftware.noip.us

2014-08-22 09:50:29

No, in pygame, every key has a number. Every key with a mod has a number and every mod combo has a number.
Also, if you alt-tab into the application you may have a different number for your mod keys for some reason. So there is like 4 numbers for the 2 shift keys alone. That is why it is on my list of things to do to make a function to return names for them.