|
Post by aurel on Aug 10, 2019 3:18:13 GMT -6
It is slow of course ... that is why almost every python program require import directive to bind external lib created in C or C++
I read ..i think on stackexchange that one guy run for-loop with 9999 iterations using python + pynum
which take 31 seconds ....give me a break!
Basic interpreters...
ok they are slow But use directly in python for -loop
when he must just do one operstion of addition with one variable without any import directive like:
for n = 1 to 9999 r = r + n next n print r
I don't know how to do that in python --even if is possible without import crap?
then do sam thing in any basic interpreter and then see who is faster
he he he !
|
|
|
Post by tbird on Aug 10, 2019 6:48:35 GMT -6
Since tbird has already destroyed johno's perfect ending, here is another post from me. Tbird, I posted my opinion first and everything after that was my answer to people arguing with me. For some reason, my defence of Python did make you well... upset. I wasn't talking to myself, you know... See it how you like. Your defence of Python, made me laugh, it seems so unnecessary is the point I was alluding to, if you missed that well chalk it up to inability to express emotion over text 🙂 And yes I did ruin Johnno56 perfect ending.
|
|
|
Post by tbird on Aug 10, 2019 7:03:13 GMT -6
It is slow of course ... that is why almost every python program require import directive to bind external lib created in C or C++ I read ..i think on stackexchange that one guy run for-loop with 9999 iterations using python + pynum which take 31 seconds ....give me a break! Basic interpreters... ok they are slow But use directly in python for -loop when he must just do one operstion of addition with one variable without any import directive like: for n = 1 to 9999 r = r + n next n print r I don't know how to do that in python --even if is possible without import crap? then do sam thing in any basic interpreter and then see who is faster he he he ! aurel only thing is your guys argument is semantics, your arguing a very narrow scope but are still correct in a way, he is arguing a very broad scope and is correct in a way. Your talking about specific things Python that can be slow and he is saying a lot of it isn't using the extensible nature that makes Python what it is. Being open minded wins the day, looking at things from only your point of view makes it hard to get someone else to see your way
|
|
|
Post by eyfenna on Aug 10, 2019 7:07:23 GMT -6
It is slow of course ... that is why almost every python program require import directive to bind external lib created in C or C++
No insult intended just python, lua and other languages are used in games as script language above a c++ core engine therefore the need for a functionality to bind or import c++ code. It is a game programming pattern to include a script engine by the way.
The Python is slower or faster than Basic discussion is a discussion similar to c/c++ versus java that happened in the past.
What I wonder is if RCBasic-VM could in theory be modified to run as virtual machine as higher layer in a c++ coded game ... well only a glimps of a thought.
|
|
|
Post by Tomaaz on Aug 10, 2019 9:34:59 GMT -6
How was my defence unnecesary if you still think that: a) I was talking only about using external libraries/modules. No, I was talking about simple for loop, as well b) Aurel is right Instead of assuming and trying to reduce speed of languages to a matter of taste, I run a simple test. Aurel's code, but a bit longer loop: Python: r = 0 for x in range(1, 1000000): r = r + x print r
248 ms. on my laptop Perl: for (my $x = 1; $x < 999999; $x++) { $r = $r + $x; } print $r;
227 ms. on my laptop Yabasic: r = 0 for x = 1 to 999999 r = r + x next print r
299 ms. on my Laptop So, 1. Perl 2. Python 3. Yabasic So, your "you're guys both right" theory is well... not true. Of course, you can keep laughing, saying how unnecesary my defence was and you can even radicule the problem of programming languages speed (which is in fact quite importand matter), but at the end we still have me pointing to A FACT (proven above) vs your full of "ifs", "buts" and "maybes" theory that with every single post makes this simple matter more and more absurd. It's fascinating that after several examples of code you still tend to agree with Aurel and not with me. nOOb, I need to disagree with you, again. Python is not a great language. It's popular, gets the job done, has plenty of useful libraries, but it's not great. Of course, it's my opinion only, because, contrary to programming languages speed, this is, in fact, a matter of personal preferences.
|
|
|
Post by Tomaaz on Aug 10, 2019 9:38:03 GMT -6
The first part of above post is a reply to tbird.
|
|
|
Post by tbird on Aug 10, 2019 12:06:46 GMT -6
Yes I believe it was unnecessary, and that's about it. When someone gets triggered it's best to step away, I was just trying to play peacekeeper but that went awry, so I apologize.
Sidenote: I wonder how many people use GDScript in GODOT since it's so python like.
|
|
|
Post by n00b on Aug 10, 2019 14:31:58 GMT -6
I actually use to think poorly of python but since I started using it for my job it has grown on me. I do think that arguing that speed is why someone would use python is a poor argument. But the reason I think a lot of people like python is its extensions and how easy it is to install new packages thanks to pip. Its ideal for someone who doesn't want to deal with the linker from C/C++.
If I was trying to get the most speed out of a program I would use C/C++ so the speed argument is kinda pointless.
|
|
|
Post by aurel on Aug 11, 2019 3:06:39 GMT -6
thanks tomek on testing i was suspect that Perl would be the fastest In fact Perl is faster of 3 scripting langs Perl Python Ruby Also Perl is the only one which have native binding to windows api.It is oldest. Tomaaz you said on your laptop which is on Linux ..right? I think thst results are slightly different on Windows. YaBasic ...hmm what to say it is not very fast interpreter,i think because is written with yacc/bisson help " src="//storage.proboards.com/forum/images/smiley/angry.png"> sourcee code is a such a mess. For other better basic bytecode interpreters i really doubt that python can beat FBSL ThinBasic and even i think that is slower than JustBasic/LibertyBasic of course there is a EdDavis toy which i tested long time ago and he also which is 5 times faster than python to not forget Euphoria (which by the way is not basic but is really fast) nooB said ..speed is not kinda important and C/C++ is the way don't forget assembler i remember very well dialect called myBasic written in assembly ( not one created by Wang- on which allegro basic is build) it is ultra fast and can beat most of other bytecode interpreters.
|
|
|
Post by Tomaaz on Aug 11, 2019 6:27:52 GMT -6
Aurel, I haven't noticed Yabasic being significantly slower than other BASIC interpreters and I don't believe they are faster than Python. This time you can prove me wrong, if you want.
I'm using OpenEuphoria and I can't say it's faster than Python. Perl and Python are in the same league - sometimes one is faster, sometimes the other, but the difference is never massive. Pypy (Python JIT compiler) will beat Perl probably in any situstion. Again you're pulling some names from your head, without testing anything and without any knowledge. Unless you provide any numbers, there is no point to continue this topic.
|
|
|
Post by aurel on Aug 11, 2019 8:05:55 GMT -6
Tomek I need to know some facts
1.Do you test it on Windows or on Linux?
2.which Python version you use 2... or 3... ?
3.Is your lap 32 bit or 64 bit ?
I can try run your test in python but i must found it first i think that i have 2.7
but that is just a if you wish and if you have time ...so nothing special
|
|
|
Post by Tomaaz on Aug 11, 2019 8:43:45 GMT -6
1. Linux 2. 2.7 3. 64bit
The one thing I've noticed is that Python takes a bit longer to start than Perl or Yabasic, so running your original example Python was the slowest. But that's a different story. Julia, for example, takes ages to start, but then it should be quite fast (according to what people say).
|
|
|
Post by Tomaaz on Aug 11, 2019 9:48:56 GMT -6
Of course, in Python you can calculate this sum like that:
print sum(range(1, 1000000))
Then it takes 121 ms and is more than two times faster than Yabasic.
|
|