Recent posts

#91
PC Problems / Re: linux OS distributions and...
Last post by RemiD - May 01, 2024, 13:21:26
wow ! thanks for all these infos :o

i don't want to code / compile stuff on linux OS, i just want to run some linux apps.

so i will have to check if these apps are compatible with which linux distributions. ok...
#92
PC Problems / Re: linux OS distributions and...
Last post by Derron - May 01, 2024, 13:01:58
Quote from: RemiD on May 01, 2024, 08:37:00i am wondering if when an app has a linux 'version', does it mean that it is compatible with all different linux OSs 'distributions' ? i guess that yes, in theory, but in practice ?

No, absolutely a NO.


Each "app" can have dependencies. Eg a lot of graphical applications require an X-Server. It comes with stuff like "xinput" and also emits kind of "system events". For example BlitzMax' brl-modules rely on the existence of these x...tools and builds the "mouse/keyboard input handling" on it. It also uses it to create the "window" and all this stuff.

So "headless linux installs" won't be able to run these kind of applications (having this dependency). Next to x11 there is also "wayland" (in dev for some years) and of course tools to make "non wayland but x11 using" programs compatible with wayland (so a "layer" inbetween).

Next to the x-Server stuff applications can have dependencies like "qt" (of a specific version) or "gtk" or ...  you need to install libraries then which provide the required functionality for you.
On Windows the application would most probably be shipped with some DLL ... which is not what all Linux users "like". Not all are fancy to use "portable apps" (means they ship with everything they need).

Yet there exist users who do not care as long as things just "run". Which is why stuff like "snap" (Ubuntu only...) or "appimage" (the others) were "invented". They bunde specific library versions, your program, ... into one file and when "executing it" these things are used instead of potentially incompatible library versions on your system.


versions ... there is sometimes a version required which your system maintainers do not offer (yet, or "anymore" :D). So you might run into conflicts when trying to update libraries - because other libraries might not yet be ready to work with newers (especially when the "major version" changes - as these can break things).

Most important (imo) is "glibc". Each Linux distribution comes with a specific version of "glibc" (it is almost a core library ... albeit there exist "alternatives" - which is not used by all the major distributions for obvious reasons like "compatibility").

The issue with "glibc" is: it is "backwards compatible" but not "future compatible".
Means if you compile your programme on a distribution using "glibc 2.35" then it will NOT run on distributions having a glibc < 2.35.
But they run on systems using 2.36 and so on.

ronny@RonnyPC ~ $ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.6) 2.35

In a "Windows" world this would mean: You compile a program on Windows 10 and you can only run it on Windows 10 or newer (Windows 11 etc).


Some people want to use "bleeding edge" libraries and these sometimes require certain glibc versions (as minimum). So eg the "Cura" developers (3d printer software from ultimaker) wanted some new QT6 stuff (I think it was QT) and thus even their "appimage" (which tries to make things "portable") required newer glibc versions than the "oldest still supported/updates-providing ubuntu" had (same for Linux Mint, which is what I use).


This is why there are kind of "industry standard" library versions one needs to use to compile linux binaries so they run on "most" distributions
eg this one here:
https://vfxplatform.com/


As "simple users/developers" this means you will try to find the "oldest ubuntu" still compiling your stuff, and compile it there. For BlitzMax this will be Ubuntu 16.04 (which was released in 2016) but we also had it build (with adjustments) on an old CentOS 7 (for native 32bit builds using some very ancient GCC, released in 2014).
Chances are really high that the binaries will run on a majority of (graphical) linux installations (so Ubuntu, Mint, possibly Manjaro, Suse, ...).

But be aware that most distros are 64bit now - but some are still 32bit. I would say you can ignore the 32bit users as they most often just are "annoying" ("I do not update because i do not see any need, my computer of 2005 still plays 4k youtube videos!"). I bet > 95% of your potential linux users will run a 64bit distro.

Installing 32bit libraries on 64bit systems can come with a hassle - avoid this for your users.



bye
Ron
#93
BlitzMax / BlitzMax NG / Re: Case statement sequence?
Last post by Derron - May 01, 2024, 12:36:59
To emphasize that:
SuperStrict
Framework Brl.StandardIO


Local t:Int
Local runs:Int = 1000000


t = Millisecs()

Local s:Int = 0
For local j:Int = 0 until runs
Local i:Int = 30
Select i
case 0; s :+ i
case 1; s :+ i
case 2; s :+ i
case 3; s :+ i
case 4; s :+ i
case 5; s :+ i
case 6; s :+ i
case 7; s :+ i
case 8; s :+ i
case 9; s :+ i
case 10; s :+ i
case 11; s :+ i
case 12; s :+ i
case 13; s :+ i
case 14; s :+ i
case 15; s :+ i
case 16; s :+ i
case 17; s :+ i
case 18; s :+ i
case 19; s :+ i
case 20; s :+ i
case 21; s :+ i
case 22; s :+ i
case 23; s :+ i
case 24; s :+ i
case 25; s :+ i
case 26; s :+ i
case 27; s :+ i
case 28; s :+ i
case 29; s :+ i
case 30; s :+ i
End Select
Next
print s
print "took " + (Millisecs() - t) + "ms"

s = 0
t = Millisecs()
For local j:Int = 0 until runs
Local i:Int = 30
if i = 0
s :+ i
elseif i = 1
s :+ i
elseif i = 2
s :+ i
elseif i = 3
s :+ i
elseif i = 4
s :+ i
elseif i = 5
s :+ i
elseif i = 6
s :+ i
elseif i = 7
s :+ i
elseif i = 8
s :+ i
elseif i = 9
s :+ i
elseif i = 10
s :+ i
elseif i = 11
s :+ i
elseif i = 12
s :+ i
elseif i = 13
s :+ i
elseif i = 14
s :+ i
elseif i = 15
s :+ i
elseif i = 16
s :+ i
elseif i = 17
s :+ i
elseif i = 18
s :+ i
elseif i = 19
s :+ i
elseif i = 20
s :+ i
elseif i = 21
s :+ i
elseif i = 22
s :+ i
elseif i = 23
s :+ i
elseif i = 24
s :+ i
elseif i = 25
s :+ i
elseif i = 26
s :+ i
elseif i = 27
s :+ i
elseif i = 28
s :+ i
elseif i = 29
s :+ i
elseif i = 30
s :+ i
EndIf
Next
print s
print "took " + (Millisecs() - t) + "ms"


To see a time difference do a debug build (else you will for sure see "0ms" - maybe because it optimizes stuff automatically).

You will see there is only a marginal difference (in my case it is 1044ms vs 1029ms ... so the "elseif" should be faster than a nested if).

But now replace the "if i = 0" with "if i = 30" and check times then. For me it dropped to 99ms. So this means the other 900ms are just used because of all the other "ifs" it checks first.

The more "biased" the incoming data is (so not equally distributed) the more you benefit from a custom "ordering" or a kind of "pre-filtering/pre-branching".


Maybe think of your old TV channel ordering years ago - you ordered by your favorites so you do not need to go through all these nonsense shopping channels. You also order your clothes so the "most often used" ones are easier to reach ... etc etc.

bye
Ron
#94
BlitzMax / BlitzMax NG / Re: Case statement sequence?
Last post by Derron - May 01, 2024, 12:17:49
The generated code of:
Code (Blitzmax) Select
SuperStrict
Framework Brl.StandardIO

Local i:Int = 0
Select i
case 0; print "is 0"
case 1; print "is 1"
case 2; print "is 2"
default; print "is something else"
End Select


is:
Code (C) Select
#include "untitled1.bmx.console.release.linux.x64.h"
struct BBString_4{BBClass_String* clas;BBULONG hash;int length;BBChar buf[4];};
struct BBString_17{BBClass_String* clas;BBULONG hash;int length;BBChar buf[17];};
static struct BBString_4 _s0={
&bbStringClass,
0x26e6f62aab5c04d6,
4,
{105,115,32,48}
};
static struct BBString_4 _s1={
&bbStringClass,
0x19b78fc511e60752,
4,
{105,115,32,49}
};
static struct BBString_4 _s2={
&bbStringClass,
0xefff255b16b3c4e,
4,
{105,115,32,50}
};
static struct BBString_17 _s3={
&bbStringClass,
0x41437bbe2f24fb4b,
17,
{105,115,32,115,111,109,101,116,104,105,110,103,32,101,108,115,101
}
};
static int _bb_main_inited = 0;
int _bb_main(){
if (!_bb_main_inited) {
_bb_main_inited = 1;
__bb_brl_blitz_blitz();
__bb_brl_standardio_standardio();
BBINT bbt_i=0;
BBINT bbt_=bbt_i;
if(bbt_==0){
brl_standardio_Print((BBString*)&_s0);
}else{
if(bbt_==1){
brl_standardio_Print((BBString*)&_s1);
}else{
if(bbt_==2){
brl_standardio_Print((BBString*)&_s2);
}else{
brl_standardio_Print((BBString*)&_s3);
}
}
}
return 0;
}
return 0;
}


So it means it uses "nested if-else" to simulate the "Select".
One needs to measure if "nested if-else" are slower than "else-ifs" ... or if the C compiler optimizes that at the end anyways.


Edit: To answer what might "bog down" the speed is the order of your "ifs" (or here - the order of your "select cases"))
Assume you have to select by the "age" of people.
Now you know most people are 18 or older.
If your select looks like this:

select
case 1; ...
case 2; ...
case 3; ...
...
case 18; ...
...
end select

Then the code will do a lot of checks before it reaches the 18 ... "if age == 1; else if age == 2 ... else if age == 3 ..."

This means to optimize ifs/ifelses/selects you might consider "sorting" them by their probabilities. So if your "instructions" are mostly 3 digits and more, than start with them.
Another "speedup" can possibly be reached if you "nest" your selects

if instruction < 100
  Select
     case 1...
  End Select
else
  Select
     case 100
     case 101
  End Select
endif

This will "branch" earlier, and in our case of an instruction of "120" you will not check 1 till 100 before.

Yet this all sems to indicate that the wrong "logic" might be used here. Maybe having a lookup table containing "instruction -> function" is faster in such a case.

bye
Ron
#95
Brucey's Modules / Re: Structs with Methods
Last post by _PJ_ - May 01, 2024, 09:21:08
Quote from: Derron on April 29, 2024, 14:48:17Having the overloaded New() is the way to go - especially if you create immutable structs (create them once and do not alter their "field values" anymore, and making the fields "readonly").


bye
Ron

That's excellent to hear. In my use case the fields are completely static so that's not an issue!
Thanks, Ron!
#96
Blitz2D, BlitzPlus, Blitz3D / Re: Blitz3D has been updated
Last post by _PJ_ - May 01, 2024, 09:16:53
I recall there was some "issues" post-v1.08 due to the open sourcing of B3d not being permissable with the fmod licensing or something, so fmod had to be licensed separately if you had simply downloaded the 'free' B3D

_
I purchased an original disc back in v.47 or so, is there anything special required concerning the freeimage and fmod libraries with the latest 112 version?
#97
PC Problems / linux OS distributions and lin...
Last post by RemiD - May 01, 2024, 08:37:00
hi  :)

i am not very familiar with linux OS, i have only tested 'ubuntu', just by curiosity.

as i understand there are different 'distributions' (different OS based on linux).

i am wondering if when an app has a linux 'version', does it mean that it is compatible with all different linux OSs 'distributions' ? i guess that yes, in theory, but in practice ?

can you suggest the most functional / stable linux OS 'distribution' ? my guess would be 'ubuntu' ?

i just want to be able to run some linux apps, a text editor, a web browser, connect to wifi...

thanks,
#98
Others / Re: Julia
Last post by Pfaber11 - May 01, 2024, 08:01:36
I'm gonna spend an hour a day with Julia and we'll see what we see. My AGK coding is pretty good now and I suppose it should be after 6 years although I have tried a few languages in that time so I think with that plus breaks between projects and a whole year off , maybe 2 good years with AGK. I was taking  breaks between projects of a month or two to recover although I don't think I need to do that now as things have become a lot easier with little stress. 
#99
Others / Julia
Last post by Pfaber11 - May 01, 2024, 07:09:33
Hi I have been trying out Julia. I had wanted to try mojo but found it to be still under construction and there's no goto which there is in Julia . It's fast too with speeds comparable to 'C' . I'm still using AGK Studio and probably will be until the end as i see it, 1 year or 10 years , who knows. Julia has been in use for a few years so it is all up and running. I looked at QB64-PE
 as well but I don't think it's what I'm after. Julia is JIT and AOT as you wish. Anyhow I am gonna try this out over the next few weeks. If anybody has any experience of Julia please let me know your thoughts. Have a nice morning. I'm using VS Code as my IDE.  
#100
Quote from: _PJ_ on April 29, 2024, 14:25:10there is of course a huge risk that such software contains trojans and other malware because you don't know what else it may be doing and you are willingly executing it with possibly higher privileges too.
yes i know, 'malware bytes' does not like it :))


Quote from: _PJ_ on April 29, 2024, 14:25:10so whislt you may believe it is safe to allow through, you still don't really know what might be happening alongside the wanted cheats.
indeed... i have not used the 'trainer', yet, for this reason...