Пікірлер
@nicknobody135
@nicknobody135 2 күн бұрын
use asm if you paid hourly had me rolling on the floor
@AMith-lv2cv
@AMith-lv2cv 3 күн бұрын
cool asf
@user-qd8lg6xr2v
@user-qd8lg6xr2v 3 күн бұрын
Запустить это на 386 компьютере и посмотреть производительность.
@occamraiser
@occamraiser 3 күн бұрын
ASM - the language of people who understand computers. IF the Assembler version doesn't execute faster than the high level versions then it was written by a C programmer.
@nguyenngoctuanhung657
@nguyenngoctuanhung657 3 күн бұрын
HAI vs 1 kick you out put not các công you real kick give hai nữ
@mr.tallguy
@mr.tallguy 4 күн бұрын
So we have to write the code in Python and let ChatGPT rewrite it in C :D
@ZettaiKatsu2013
@ZettaiKatsu2013 6 күн бұрын
Yeah use whatever suits you. It shouldn't be a pain. Get comfortable
@raulguerreroflores1460
@raulguerreroflores1460 6 күн бұрын
all you need is C/C++ and sometimes some assembly is required
@elye3701
@elye3701 6 күн бұрын
python VS julia, please?
@negry_
@negry_ 7 күн бұрын
well, GCC writes assembly better than you.
@leonhrad
@leonhrad 7 күн бұрын
An excellent title slide meme
@pingu0b
@pingu0b 7 күн бұрын
Sup
@xmdi0
@xmdi0 7 күн бұрын
Sup 0b
@Soupie62
@Soupie62 11 күн бұрын
As an immediate calculator, this is fine. However, if you want to write a program, your only option (currently) is to save a string in Notepad, then copy that to the command line. HP (and Swiss Micro) programmable RPN calculators are your next step, right? I need to watch your video series from the start.
@xmdi0
@xmdi0 11 күн бұрын
Thanks for your comment! Yeah, as you pointed out, this particular implementation is only useful for quick arithmetic on x86, a platform for which much better calculating solutions exist. The actual underlying purpose for this postfix parser is to handle calculating expressions at runtime in more sophisticated programs. As an example, we might want to express the position/orientation of 3D models (see other videos in this series) as a function of time, or we may wish to express some geometric dimensions as a function of another dimension at runtime. I have big plans :)
@Soupie62
@Soupie62 10 күн бұрын
@@xmdi0 It's always fun when KZbin makes a new video suggestion. You have some impressive stuff in the series. Thank you for your efforts to date.
@neonblowfish
@neonblowfish 12 күн бұрын
The guys writing assembly are the only ones that know how the hardware really works. 😉
@cxx.enjoyer
@cxx.enjoyer 12 күн бұрын
Maybe show ASM output or something and enable -O2 or -O3
@AMith-lv2cv
@AMith-lv2cv 13 күн бұрын
It's so cool
@donnell760
@donnell760 16 күн бұрын
Awesome series. Nice to see Christian representation in programming too. Keep it up!
@MrTekniqs
@MrTekniqs 18 күн бұрын
Lmao. Python is slow as heck. Learned this trying to parse a freaking txt file. I’m like wtf? C++ would be done already. Meanwhile the youngens are like “ew c++.”
@cacz2200
@cacz2200 18 күн бұрын
this seem extremely fun and funny at the same time, thank you for such amazing series, looking forward on going through it as well as CAD series later on, that will keep me busy for quite while:D cheers!
@DerHerrLatz
@DerHerrLatz 18 күн бұрын
I wonder how the comparison would look like with C++ and a bit of constexpr. 🤣
@marshallscarpulla3032
@marshallscarpulla3032 18 күн бұрын
C compilers generate code as close to assembly language as you can get, but far easier to code and understand. For you C noobies out there, you will fully understand how pointers and memory allocation work, after you create a pile of bad pointers and over run your stack and memory a few dozen times. But as Arnie used to say, What doesn't kill you makes you stronger.
@felixgasroorka1696
@felixgasroorka1696 18 күн бұрын
Hmm, it's like comparing apples and pears or strawberries...
@MarshyMcOfficial
@MarshyMcOfficial 19 күн бұрын
python(took 8.73 seconds): def is_prime(n): return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1)) number = int(input("Enter a number: ")) print("Prime" if is_prime(number) else "Not Prime") C(took 10.73 seconds im not as good with c): #include <stdio.h> int is_prime(int n) { if (n <= 1) return 0; for (int i = 2; i * i <= n; i++) if (n % i == 0) return 0; return 1; } int main() { int number; printf("Enter a number: "); scanf("%d", &number); printf(is_prime(number) ? "Prime " : "Not Prime "); return 0; } now assembly which i hate: section .data prime db 'Prime', 0xa not_prime db 'Not Prime', 0xa section .text global _start _start: mov eax, 17 ; Hardcoded number mov ecx, 2 .loop: mov edx, 0 div ecx cmp edx, 0 je .not_prime inc ecx cmp ecx, eax jg .prime jmp .loop .prime: mov eax, 4 mov ebx, 1 mov ecx, prime mov edx, 6 int 0x80 jmp .exit .not_prime: mov eax, 4 mov ebx, 1 mov ecx, not_prime mov edx, 10 int 0x80 jmp .exit .exit: mov eax, 1 xor ebx, ebx int 0x80
@AuroraLake.
@AuroraLake. 14 күн бұрын
I've got 0.1 seconds with this script on python, it does the same thing but it is optimized: import time def is_prime(n): if n <= 1: return False if n <= 3: return True if n % 2 == 0 or n % 3 == 0: return False i = 5 while i * i <= n: if n % i == 0 or n % (i + 2) == 0: return False i += 6 return True def count_primes(limit): num_primes = 0 for i in range(2, limit+1): if is_prime(i): num_primes += 1 return num_primes # Setting the range for prime calculation limit = 250001 # Start the timer start_time = time.time() # Counting primes num_primes = count_primes(limit) # End the timer end_time = time.time() # Output the number of primes and the time taken print(f"Number of primes up to {limit}: {num_primes}") print(f"Time taken: {end_time - start_time:.2f} seconds")
@ananasdoporto
@ananasdoporto 19 күн бұрын
Code in the end is just like eaten food, it all gets crunched down and becomes 1's and 0's.
@ananasdoporto
@ananasdoporto 19 күн бұрын
There is better ways to implement that in Python though. But good call.
@waynehawkins654
@waynehawkins654 20 күн бұрын
Be intrusting how C# goes in speed. I take it would be as fast as c++. And here I was thinking and been told by Python coder that Python runs faster then c\c++\c#. Based on this video, it's not.
@aion425
@aion425 20 күн бұрын
And then we compare runtime.
@stefancomanescu6487
@stefancomanescu6487 22 күн бұрын
man this is not concise wtf learn assembly first . i am speaking in behalf of the whole university of computer science of bucharest when i say you are a complete bust man you shouldnt be allowed to use the internet u are a disgrace to the programming community . fratimio vinde droguri
@PrueferAuge
@PrueferAuge 22 күн бұрын
even with pythons long runtime, it was faster than assrmbly xd
@davidfernandezfernandez8368
@davidfernandezfernandez8368 23 күн бұрын
I didn't know I needed this. Amazing.
@navuhudonossor123
@navuhudonossor123 24 күн бұрын
Hey, i’d like to see time results rather than your comment
@angelcaru
@angelcaru 24 күн бұрын
In the `print_int_x` example, couldn't you just use a lookup table instead of doing extra checks?
@faisalinsider
@faisalinsider 24 күн бұрын
Programmers who use vim for editors are humans from another dimension, they don't use auto-correction and further keyword suggestions
@Daniel_Massicotte
@Daniel_Massicotte 25 күн бұрын
Python is for the new DUMB generation...
@freemasry-gr8hw
@freemasry-gr8hw 25 күн бұрын
you are a gem on youtube bro, I really mean keep doing these amazing vids even if you will be doing a paid course I will buy it !
@maddogfargo3153
@maddogfargo3153 26 күн бұрын
I don't like deception... The reason this is sped up 4x is because they don't want you to notice how slowly the C++ and ASM programmers are actually typing. One person clearly knows Python well, but there are times I think they are reading from a book what to type for the C++ / ASM programmers. The pauses due to lack of proficiency are clear and noticeable. Just watch at .25 speed and you'll see it too.
@user-yn6pu7eb6w
@user-yn6pu7eb6w 27 күн бұрын
how coding assembly language?
@mtkaplanoglu
@mtkaplanoglu 28 күн бұрын
Great!
@jayttcorrea6207
@jayttcorrea6207 Ай бұрын
It's possible to make ASM faster than C++, but it requires so much effort that I would say it's not worth it. C/C++ is already very optimised
@thombrown
@thombrown Ай бұрын
So many people getting triggered by Python. Don't use it if you don't like it, but stop telling other people what to use.
@AlexAegisOfficial
@AlexAegisOfficial Ай бұрын
python is for losers
@versionoriginal
@versionoriginal Ай бұрын
Change "i <= n/2" to "i <= sqrt(n)" 😉
@omchaudhari6938
@omchaudhari6938 Ай бұрын
Mojo laughing in corner😅😅😂
@henrikloiske8572
@henrikloiske8572 Ай бұрын
Python is absolutely the best programming language ever invented..period.....
@GnomeEU
@GnomeEU Ай бұрын
1.3 sec with C# a few years later with a better PC. Don't waste your time with C or Asm, just buy a new computer :D
@elad2054
@elad2054 Ай бұрын
too much yap, just show an example of printing bitmap next time.
@pineneedle555
@pineneedle555 Ай бұрын
흰수선화 한달간 핀다 하니 한번 심어 보겠습니다.
@sliwkaaa
@sliwkaaa Ай бұрын
python semicolons holy shit why
@Ciao_Bambino
@Ciao_Bambino Ай бұрын
pretty cool
@GabrielxC
@GabrielxC Ай бұрын
Very good!