use asm if you paid hourly had me rolling on the floor
@AMith-lv2cv3 күн бұрын
cool asf
@user-qd8lg6xr2v3 күн бұрын
Запустить это на 386 компьютере и посмотреть производительность.
@occamraiser3 күн бұрын
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.
@nguyenngoctuanhung6573 күн бұрын
HAI vs 1 kick you out put not các công you real kick give hai nữ
@mr.tallguy4 күн бұрын
So we have to write the code in Python and let ChatGPT rewrite it in C :D
@ZettaiKatsu20136 күн бұрын
Yeah use whatever suits you. It shouldn't be a pain. Get comfortable
@raulguerreroflores14606 күн бұрын
all you need is C/C++ and sometimes some assembly is required
@elye37016 күн бұрын
python VS julia, please?
@negry_7 күн бұрын
well, GCC writes assembly better than you.
@leonhrad7 күн бұрын
An excellent title slide meme
@pingu0b7 күн бұрын
Sup
@xmdi07 күн бұрын
Sup 0b
@Soupie6211 күн бұрын
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.
@xmdi011 күн бұрын
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 :)
@Soupie6210 күн бұрын
@@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.
@neonblowfish12 күн бұрын
The guys writing assembly are the only ones that know how the hardware really works. 😉
@cxx.enjoyer12 күн бұрын
Maybe show ASM output or something and enable -O2 or -O3
@AMith-lv2cv13 күн бұрын
It's so cool
@donnell76016 күн бұрын
Awesome series. Nice to see Christian representation in programming too. Keep it up!
@MrTekniqs18 күн бұрын
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++.”
@cacz220018 күн бұрын
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!
@DerHerrLatz18 күн бұрын
I wonder how the comparison would look like with C++ and a bit of constexpr. 🤣
@marshallscarpulla303218 күн бұрын
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.
@felixgasroorka169618 күн бұрын
Hmm, it's like comparing apples and pears or strawberries...
@MarshyMcOfficial19 күн бұрын
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.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")
@ananasdoporto19 күн бұрын
Code in the end is just like eaten food, it all gets crunched down and becomes 1's and 0's.
@ananasdoporto19 күн бұрын
There is better ways to implement that in Python though. But good call.
@waynehawkins65420 күн бұрын
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.
@aion42520 күн бұрын
And then we compare runtime.
@stefancomanescu648722 күн бұрын
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
@PrueferAuge22 күн бұрын
even with pythons long runtime, it was faster than assrmbly xd
@davidfernandezfernandez836823 күн бұрын
I didn't know I needed this. Amazing.
@navuhudonossor12324 күн бұрын
Hey, i’d like to see time results rather than your comment
@angelcaru24 күн бұрын
In the `print_int_x` example, couldn't you just use a lookup table instead of doing extra checks?
@faisalinsider24 күн бұрын
Programmers who use vim for editors are humans from another dimension, they don't use auto-correction and further keyword suggestions
@Daniel_Massicotte25 күн бұрын
Python is for the new DUMB generation...
@freemasry-gr8hw25 күн бұрын
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 !
@maddogfargo315326 күн бұрын
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-yn6pu7eb6w27 күн бұрын
how coding assembly language?
@mtkaplanoglu28 күн бұрын
Great!
@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Ай бұрын
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Ай бұрын
python is for losers
@versionoriginalАй бұрын
Change "i <= n/2" to "i <= sqrt(n)" 😉
@omchaudhari6938Ай бұрын
Mojo laughing in corner😅😅😂
@henrikloiske8572Ай бұрын
Python is absolutely the best programming language ever invented..period.....
@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Ай бұрын
too much yap, just show an example of printing bitmap next time.