Search found 1352 matches

by caseih
Jul 06, 2019 1:57
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 9984

Re: python experiment

Correct. ctypes is, in Python 3 at least, a built-in module. Python 3 is definitely faster than Python 2. If you're trying to do a lot of intensive math calculations in Python, you will be disappointed compared to compiled FB performance. However in the scientific and math community Python is often ...
by caseih
Jul 05, 2019 14:55
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 9984

Re: python experiment

The final alternative is to create a Python function using the C API and have that function pass data between FB and Python. See https://stackoverflow.com/questions/13942128/how-to-pass-an-array-from-c-to-an-embedded-python-script. The SOF article speaks only about passing data to Python. You might...
by caseih
Jul 04, 2019 17:15
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 9984

Re: python experiment

@jj2007 I did a fair amount of web searching and pipes were among the hits, it's a pity that there's no simple and efficient way to exchange data. There are several methods. You can create a Python object from FB, such as a Python list, and then insert data into that list. You could also cast your ...
by caseih
Jul 04, 2019 4:53
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 9984

Re: python experiment

srvaldez wrote:I really don't understand why PyRun_AnyFileExFlags(fp, name_, 0, NULL) needs a filename when it already has a file pointer
It might have something to do with setting the __name__ variable for the python script.
by caseih
Jul 03, 2019 16:40
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 9984

Re: python experiment

I'm pretty sure the API uses C int regardless of 32 or 64-bit host. Py_Main is designed to be passed the same data structures that a C main program is passed, which is int and a t_wchar **. On Linux everything is UTF-8, so t_wchar is the equivalent of char. So the declaration is probably more along ...
by caseih
Jul 03, 2019 14:06
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 9984

Re: python experiment

dodicat the one hairy detail is: how to exchange data between the python script and FB, sure you could write it to a file and then read it, but that's not very efficient. If we had the complete Python API declared for FB then you would just create a Python object around your FB data and you'd have ...
by caseih
Jul 03, 2019 14:03
Forum: Libraries
Topic: python experiment
Replies: 33
Views: 9984

Re: python experiment

[quote="dodicat"] PyMain cdecl alias "Py_Main"(as integer=0,as zstring ptr=0) as integer I can't speak to Win32, but I'm pretty sure on Linux and Mac, that a C int is always 32-bit, even on 64-bit systems. So this declaration should probably be Long instead of Integer. I think th...
by caseih
Jun 29, 2019 13:34
Forum: Beginners
Topic: Console off
Replies: 17
Views: 6750

Re: Console off

Sorry, I think I didn't express it properly. Of course the code works with -gen gcc properly but what I want to know is if there is a command line switch argument for gcc to set the linker not to show the console window by default. GCC itself uses the flag "-mwindows" which it passes to t...
by caseih
Jun 29, 2019 0:09
Forum: Beginners
Topic: Console off
Replies: 17
Views: 6750

Re: Console off

Okay right. The console or gui flag is a linker flag too, not a compiler flag. I know most FB programmers don't use multiple modules and makefiles, but if you did, you wouldn't have to recompile anything to hide the gui; just re-link it with the subsystem flag you want.
by caseih
Jun 28, 2019 23:04
Forum: Beginners
Topic: Console off
Replies: 17
Views: 6750

Re: Console off

The same flag should work for the GCC backend as the ASM one. If not, I'd say that's a bug.
by caseih
Jun 28, 2019 17:51
Forum: Beginners
Topic: Console off
Replies: 17
Views: 6750

Re: Console off

Indeed he would be using Windows because in no other operating system would it make sense to be talking about hiding the console. Windows is the only operating system that makes distinctions between console and GUI applications and has special console windows. However Microsoft is finally changing a...
by caseih
Jun 26, 2019 3:58
Forum: General
Topic: mingw_stdio example
Replies: 13
Views: 2270

Re: mingw_stdio example

When you say it's not working, what are you seeing? Feel free to check the intermediate output (C or assembler) to see what the compiler is doing. All CDECL means is that the parameters are passed left to right on the stack, instead of right to left, which is the default for FB and the Windows API (...
by caseih
Jun 25, 2019 14:34
Forum: General
Topic: mingw_stdio example
Replies: 13
Views: 2270

Re: mingw_stdio example

Why not? They are just C functions after all. FB can call them directly, just like any other function in the C runtime. declare function mingw_sprintf CDECL alias "__mingw_sprintf" (byval as zstring ptr, byval as zstring ptr, ...) as long dim a as zstring*256 mingw_sprintf (a, "%d&quo...
by caseih
Jun 25, 2019 14:13
Forum: General
Topic: mingw_stdio example
Replies: 13
Views: 2270

Re: mingw_stdio example

Why do you need assembly wrappers? Can't you just call the mingw functions directly?
by caseih
Jun 01, 2019 3:35
Forum: Beginners
Topic: Speed of pointers ?
Replies: 9
Views: 4633

Re: Speed of pointers ?

Given that I can run a full spreadsheet in Javascript these days and it performs well enough, I should think that whatever you do would perform fairly well, even with inefficiencies of string transformation. I wouldn't worry too much about it being slow until you know exactly where your code is spen...

Go to advanced search